================================================================== BUG: KASAN: slab-use-after-free in __update_min_deadline kernel/sched/fair.c:805 [inline] BUG: KASAN: slab-use-after-free in min_deadline_update kernel/sched/fair.c:819 [inline] BUG: KASAN: slab-use-after-free in min_deadline_cb_propagate kernel/sched/fair.c:825 [inline] BUG: KASAN: slab-use-after-free in reweight_entity+0x8e3/0xa60 kernel/sched/fair.c:3660 Read of size 8 at addr ffff888024e2d9f0 by task syz-executor.3/5447 CPU: 0 PID: 5447 Comm: syz-executor.3 Not tainted 6.6.0-rc6-syzkaller-00217-gcd8892c07876 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __update_min_deadline kernel/sched/fair.c:805 [inline] min_deadline_update kernel/sched/fair.c:819 [inline] min_deadline_cb_propagate kernel/sched/fair.c:825 [inline] reweight_entity+0x8e3/0xa60 kernel/sched/fair.c:3660 entity_tick kernel/sched/fair.c:5317 [inline] task_tick_fair+0xee/0xcd0 kernel/sched/fair.c:12392 scheduler_tick+0x210/0x650 kernel/sched/core.c:5657 update_process_times+0x19f/0x220 kernel/time/timer.c:2076 tick_sched_handle+0x8e/0x170 kernel/time/tick-sched.c:254 tick_sched_timer+0xe9/0x110 kernel/time/tick-sched.c:1492 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x647/0xc10 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1063 [inline] __sysvec_apic_timer_interrupt+0x105/0x3f0 arch/x86/kernel/apic/apic.c:1080 sysvec_apic_timer_interrupt+0x42/0xc0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:check_kcov_mode kernel/kcov.c:173 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x31/0x70 kernel/kcov.c:207 Code: cd e2 7b 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b 14 25 c0 bc 03 00 a9 00 01 ff 00 74 0e 85 c9 74 35 8b 82 04 16 00 00 <85> c0 74 2b 8b 82 e0 15 00 00 83 f8 02 75 20 48 8b 8a e8 15 00 00 RSP: 0018:ffffc90000007688 EFLAGS: 00000206 RAX: 0000000000000000 RBX: ffffffff88295d0b RCX: 0000000000000100 RDX: ffff888019ba3b80 RSI: ffffffff813a504c RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000003f6b80aff6 R12: ffffc90000007700 R13: ffffffff81758040 R14: ffffc90000007778 R15: ffff888019ba3b80 unwind_get_return_address+0xac/0xe0 arch/x86/kernel/unwind_orc.c:369 arch_stack_walk+0xbe/0x170 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x3f0 mm/slub.c:3523 kmalloc_reserve+0x166/0x260 net/core/skbuff.c:559 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 __netdev_alloc_skb+0x72/0x3f0 net/core/skbuff.c:714 netdev_alloc_skb include/linux/skbuff.h:3225 [inline] dev_alloc_skb include/linux/skbuff.h:3238 [inline] __ieee80211_beacon_get+0xc28/0x16d0 net/mac80211/tx.c:5426 ieee80211_beacon_get_tim+0xa5/0x560 net/mac80211/tx.c:5548 ieee80211_beacon_get include/net/mac80211.h:5421 [inline] mac80211_hwsim_beacon_tx+0x3f6/0x730 drivers/net/wireless/virtual/mac80211_hwsim.c:2260 __iterate_interfaces+0x2d2/0x580 net/mac80211/util.c:766 ieee80211_iterate_active_interfaces_atomic+0x71/0x1b0 net/mac80211/util.c:802 mac80211_hwsim_beacon+0x101/0x200 drivers/net/wireless/virtual/mac80211_hwsim.c:2290 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x203/0xc10 kernel/time/hrtimer.c:1752 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1769 __do_softirq+0x218/0x965 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:arch_static_branch arch/x86/include/asm/jump_label.h:27 [inline] RIP: 0010:static_key_false include/linux/jump_label.h:207 [inline] RIP: 0010:trace_rss_stat+0xe/0x1d0 include/trace/events/kmem.h:346 Code: 48 89 34 24 e8 53 05 16 00 48 8b 34 24 e9 7c ff ff ff 66 2e 0f 1f 84 00 00 00 00 00 41 54 49 89 fc 55 89 f5 53 e8 32 2e c0 ff <66> 90 e8 2b 2e c0 ff 65 8b 1d 00 11 3c 7e bf 07 00 00 00 89 de e8 RSP: 0018:ffffc9000537f718 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffffc9000537f838 RCX: 0000000000000000 RDX: ffff888019ba3b80 RSI: ffffffff81c7abbe RDI: ffff88807c350000 RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 1ffffffff1976ca1 R12: ffff88807c350000 R13: ffffffff8ecc508c R14: dffffc0000000000 R15: ffff88807c350490 mm_trace_rss_stat mm/memory.c:181 [inline] add_mm_counter include/linux/mm.h:2554 [inline] add_mm_rss_vec mm/memory.c:478 [inline] zap_pte_range mm/memory.c:1517 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x15b6/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e2/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9ad/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23ba/0x2790 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4b4067cae9 Code: Unable to access opcode bytes at 0x7f4b4067cabf. RSP: 002b:00007f4b414bf0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: 0000000000000006 RBX: 00007f4b4079bf80 RCX: 00007f4b4067cae9 RDX: 0000000000007a05 RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007f4b406c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001700 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4b4079bf80 R15: 00007ffdf5f7adc8 Allocated by task 4708: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x3f0 mm/slub.c:3523 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1110 [inline] copy_process+0x41c/0x73f0 kernel/fork.c:2327 kernel_clone+0xfd/0x920 kernel/fork.c:2909 __do_sys_clone+0xba/0x100 kernel/fork.c:3052 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5407: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free+0xf0/0x480 mm/slub.c:3831 put_task_struct include/linux/sched/task.h:136 [inline] put_task_struct include/linux/sched/task.h:123 [inline] delayed_put_task_struct+0x21b/0x2b0 kernel/exit.c:226 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 context_switch kernel/sched/core.c:5385 [inline] __schedule+0xee9/0x5a10 kernel/sched/core.c:6695 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6864 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45 __raw_write_unlock_irq include/linux/rwlock_api_smp.h:274 [inline] _raw_write_unlock_irq+0x40/0x50 kernel/locking/spinlock.c:358 exit_notify kernel/exit.c:761 [inline] do_exit+0x134a/0x2a20 kernel/exit.c:894 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1033 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 put_task_struct_rcu_user kernel/exit.c:232 [inline] put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:229 context_switch kernel/sched/core.c:5385 [inline] __schedule+0xee9/0x5a10 kernel/sched/core.c:6695 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6864 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:45 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irq+0x40/0x50 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:401 [inline] do_group_exit+0x1c5/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1033 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888024e2d940 which belongs to the cache task_struct of size 7360 The buggy address is located 176 bytes inside of freed 7360-byte region [ffff888024e2d940, ffff888024e2f600) The buggy address belongs to the physical page: page:ffffea0000938a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24e28 head:ffffea0000938a00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888028535241 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014e43500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888028535241 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2, tgid 2 (kthreadd), ts 26098996719, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2297 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] kmem_cache_alloc_node+0x132/0x3f0 mm/slub.c:3523 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1110 [inline] copy_process+0x41c/0x73f0 kernel/fork.c:2327 kernel_clone+0xfd/0x920 kernel/fork.c:2909 kernel_thread+0xc0/0x100 kernel/fork.c:2971 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x4fb/0x7d0 kernel/kthread.c:746 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 page_owner free stack trace missing Memory state around the buggy address: ffff888024e2d880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888024e2d900: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff888024e2d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024e2da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024e2da80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: cd e2 int $0xe2 2: 7b 7e jnp 0x82 4: 89 c1 mov %eax,%ecx 6: 48 8b 34 24 mov (%rsp),%rsi a: 81 e1 00 01 00 00 and $0x100,%ecx 10: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx 17: 03 00 19: a9 00 01 ff 00 test $0xff0100,%eax 1e: 74 0e je 0x2e 20: 85 c9 test %ecx,%ecx 22: 74 35 je 0x59 24: 8b 82 04 16 00 00 mov 0x1604(%rdx),%eax * 2a: 85 c0 test %eax,%eax <-- trapping instruction 2c: 74 2b je 0x59 2e: 8b 82 e0 15 00 00 mov 0x15e0(%rdx),%eax 34: 83 f8 02 cmp $0x2,%eax 37: 75 20 jne 0x59 39: 48 8b 8a e8 15 00 00 mov 0x15e8(%rdx),%rcx