================================================================== BUG: KASAN: slab-use-after-free in min_deadline_update kernel/sched/fair.c:818 [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+0x8c7/0xa60 kernel/sched/fair.c:3660 Read of size 8 at addr ffff88801da9d9e8 by task syz-executor.0/6766 CPU: 1 PID: 6766 Comm: syz-executor.0 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 min_deadline_update kernel/sched/fair.c:818 [inline] min_deadline_cb_propagate kernel/sched/fair.c:825 [inline] reweight_entity+0x8c7/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:write_comp_data+0x85/0x90 kernel/kcov.c:262 Code: 00 00 4a 8d 34 dd 28 00 00 00 48 39 f2 72 1b 48 83 c7 01 48 89 38 4c 89 44 30 e0 4c 89 4c 30 e8 4c 89 54 30 f0 4a 89 4c d8 20 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 8b 0c 24 40 0f b6 RSP: 0018:ffffc900001f0730 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffffc900001f07b8 RCX: ffffffff813a57cd RDX: ffff888021a21dc0 RSI: 0000000000000100 RDI: 0000000000000001 RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: ffffc900001f0ff8 R12: ffffffff859a838e R13: 0000000000000000 R14: ffffc900001f0878 R15: ffffc900001f07ed unwind_next_frame+0x19d/0x2390 arch/x86/kernel/unwind_orc.c:494 arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 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 __alloc_skb+0x287/0x330 net/core/skbuff.c:640 alloc_skb include/linux/skbuff.h:1286 [inline] wg_packet_send_keepalive+0x72/0x300 drivers/net/wireguard/send.c:226 wg_expired_send_persistent_keepalive+0x5e/0x70 drivers/net/wireguard/timers.c:141 call_timer_fn+0x19e/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x764/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __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:preempt_schedule_irq+0x4d/0x90 kernel/sched/core.c:7007 Code: 55 65 48 8b 2c 25 c0 bc 03 00 53 48 89 eb 48 c1 eb 03 48 01 c3 bf 01 00 00 00 e8 7e 92 1a f7 e8 69 6e 4e f7 fb bf 01 00 00 00 2e 99 ff ff 9c 58 fa f6 c4 02 75 1a bf 01 00 00 00 e8 bc 58 1a RSP: 0018:ffffc90004cf7308 EFLAGS: 00000202 RAX: 000000000005316b RBX: ffffed10043443b8 RCX: 1ffffffff2338aae RDX: 0000000000000000 RSI: ffffffff8a8caca0 RDI: 0000000000000001 RBP: ffff888021a21dc0 R08: 0000000000000001 R09: fffffbfff23389d0 R10: ffffffff919c4e87 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 irqentry_exit+0x35/0x80 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline] RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline] RIP: 0010:arch_local_irq_save arch/x86/include/asm/irqflags.h:104 [inline] RIP: 0010:lock_release+0x14e/0x680 kernel/locking/lockdep.c:5769 Code: 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 d9 04 00 00 41 8b b6 c4 0a 00 00 85 f6 0f 85 64 02 00 00 9c 8f 04 24 48 c7 c7 60 af 8c 8a e8 e5 47 d5 08 48 89 da 83 e3 07 48 b8 00 RSP: 0018:ffffc90004cf73d8 EFLAGS: 00000246 RAX: 0000000000000007 RBX: ffffffff8ecc5058 RCX: ffffffff816896a5 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888021a22884 RBP: 1ffff9200099ee7d R08: 0000000000000000 R09: fffffbfff1d9835a R10: ffffffff8ecc1ad7 R11: dffffc0000000000 R12: ffffffff8cbab2e0 R13: ffff88813fffa700 R14: ffff888021a21dc0 R15: 0000000000112cc0 rcu_lock_release include/linux/rcupdate.h:308 [inline] rcu_read_unlock include/linux/rcupdate.h:782 [inline] page_ext_put+0x48/0xd0 mm/page_ext.c:533 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] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x38c/0x3b0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] __kernfs_new_node+0xd3/0x890 fs/kernfs/dir.c:615 kernfs_new_node+0x94/0x110 fs/kernfs/dir.c:679 __kernfs_create_file+0x53/0x340 fs/kernfs/file.c:1047 cgroup_add_file kernel/cgroup/cgroup.c:4193 [inline] cgroup_addrm_files+0x3d7/0xa50 kernel/cgroup/cgroup.c:4253 css_populate_dir+0x169/0x530 kernel/cgroup/cgroup.c:1739 cgroup_apply_control_enable+0x3fc/0xc70 kernel/cgroup/cgroup.c:3194 cgroup_mkdir+0x5ab/0x11c0 kernel/cgroup/cgroup.c:5760 kernfs_iop_mkdir+0x14a/0x1d0 fs/kernfs/dir.c:1225 vfs_mkdir+0x532/0x7e0 fs/namei.c:4121 do_mkdirat+0x2a9/0x330 fs/namei.c:4144 __do_sys_mkdirat fs/namei.c:4159 [inline] __se_sys_mkdirat fs/namei.c:4157 [inline] __x64_sys_mkdirat+0x115/0x170 fs/namei.c:4157 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 RIP: 0033:0x7f6e8787cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6e886c60c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f6e8799bf80 RCX: 00007f6e8787cae9 RDX: 00000000000001ff RSI: 0000000020000000 RDI: ffffffffffffff9c RBP: 00007f6e878c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6e8799bf80 R15: 00007ffd48ce28d8 Allocated by task 11: 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 user_mode_thread+0xb4/0xf0 kernel/fork.c:2987 call_usermodehelper_exec_sync kernel/umh.c:133 [inline] call_usermodehelper_exec_work+0x6b/0x170 kernel/umh.c:164 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Freed by task 16: 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 schedule+0xe7/0x1b0 kernel/sched/core.c:6771 do_nanosleep+0x218/0x500 kernel/time/hrtimer.c:2047 hrtimer_nanosleep+0x1ae/0x440 kernel/time/hrtimer.c:2100 common_nsleep+0xa1/0xc0 kernel/time/posix-timers.c:1350 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1396 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1373 [inline] __x64_sys_clock_nanosleep+0x344/0x490 kernel/time/posix-timers.c:1373 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 task_work_add+0x88/0x2a0 kernel/task_work.c:48 scheduler_tick+0x228/0x650 kernel/sched/core.c:5662 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+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 The buggy address belongs to the object at ffff88801da9d940 which belongs to the cache task_struct of size 7360 The buggy address is located 168 bytes inside of freed 7360-byte region [ffff88801da9d940, ffff88801da9f600) The buggy address belongs to the physical page: page:ffffea000076a600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1da98 head:ffffea000076a600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888020c79f41 ksm flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014e43500 ffffea0000c66200 dead000000000003 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888020c79f41 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 9162578013, 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: ffff88801da9d880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801da9d900: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff88801da9d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801da9da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801da9da80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 4a 8d 34 dd 28 00 00 lea 0x28(,%r11,8),%rsi 9: 00 a: 48 39 f2 cmp %rsi,%rdx d: 72 1b jb 0x2a f: 48 83 c7 01 add $0x1,%rdi 13: 48 89 38 mov %rdi,(%rax) 16: 4c 89 44 30 e0 mov %r8,-0x20(%rax,%rsi,1) 1b: 4c 89 4c 30 e8 mov %r9,-0x18(%rax,%rsi,1) 20: 4c 89 54 30 f0 mov %r10,-0x10(%rax,%rsi,1) 25: 4a 89 4c d8 20 mov %rcx,0x20(%rax,%r11,8) * 2a: c3 ret <-- trapping instruction 2b: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 32: 00 00 00 35: f3 0f 1e fa endbr64 39: 48 8b 0c 24 mov (%rsp),%rcx 3d: 40 rex 3e: 0f .byte 0xf 3f: b6 .byte 0xb6