================================================================== BUG: KASAN: slab-use-after-free in __put_prev_set_next_dl_server kernel/sched/sched.h:2470 [inline] BUG: KASAN: slab-use-after-free in put_prev_set_next_task kernel/sched/sched.h:2480 [inline] BUG: KASAN: slab-use-after-free in pick_next_task kernel/sched/core.c:6266 [inline] BUG: KASAN: slab-use-after-free in __schedule+0x4b87/0x5740 kernel/sched/core.c:6647 Write of size 8 at addr ffff88802a72a6e8 by task syz-executor.0/8933 CPU: 3 UID: 0 PID: 8933 Comm: syz-executor.0 Not tainted 6.12.0-rc7-syzkaller-g0a9b9d17f3a7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __put_prev_set_next_dl_server kernel/sched/sched.h:2470 [inline] put_prev_set_next_task kernel/sched/sched.h:2480 [inline] pick_next_task kernel/sched/core.c:6266 [inline] __schedule+0x4b87/0x5740 kernel/sched/core.c:6647 preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6872 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12 unwind_next_frame+0x1776/0x20c0 arch/x86/kernel/unwind_orc.c:672 arch_stack_walk+0x95/0x100 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 save_stack+0x162/0x1f0 mm/page_owner.c:156 __reset_page_owner+0x8d/0x400 mm/page_owner.c:297 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xa87/0x14f0 mm/page_alloc.c:2704 folios_put_refs+0x587/0x7b0 mm/swap.c:993 free_pages_and_swap_cache+0x36d/0x510 mm/swap_state.c:332 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0xe9/0x590 mm/mmu_gather.c:373 zap_pte_range mm/memory.c:1700 [inline] zap_pmd_range mm/memory.c:1739 [inline] zap_pud_range mm/memory.c:1768 [inline] zap_p4d_range mm/memory.c:1789 [inline] unmap_page_range+0x1c08/0x3cf0 mm/memory.c:1810 unmap_single_vma+0x194/0x2b0 mm/memory.c:1856 unmap_vmas+0x22f/0x490 mm/memory.c:1900 exit_mmap+0x1c6/0xb30 mm/mmap.c:1923 __mmput+0x12a/0x480 kernel/fork.c:1348 mmput+0x62/0x70 kernel/fork.c:1370 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2d70 kernel/exit.c:926 do_group_exit+0xd3/0x2a0 kernel/exit.c:1088 get_signal+0x25fb/0x2770 kernel/signal.c:2918 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe524a7cae9 Code: Unable to access opcode bytes at 0x7fe524a7cabf. RSP: 002b:00007fe5257f1178 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fe524b9c058 RCX: 00007fe524a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe524b9c058 RBP: 00007fe524b9c050 R08: 00007fe5257f16c0 R09: 00007fe5257f16c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe524b9c05c R13: 000000000000006e R14: 00007ffc851b52d0 R15: 00007ffc851b53b8 Allocated by task 8924: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 __do_sys_clone3+0x1f9/0x270 kernel/fork.c:3090 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5360: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 put_task_struct include/linux/sched/task.h:144 [inline] put_task_struct include/linux/sched/task.h:131 [inline] delayed_put_task_struct+0x11a/0x2f0 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x79d/0x14d0 kernel/rcu/tree.c:2823 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x99/0x7a0 kernel/rcu/tree.c:3086 put_task_struct_rcu_user kernel/exit.c:234 [inline] put_task_struct_rcu_user+0x75/0xc0 kernel/exit.c:231 context_switch kernel/sched/core.c:5331 [inline] __schedule+0xe5d/0x5740 kernel/sched/core.c:6693 __schedule_loop kernel/sched/core.c:6770 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6785 futex_wait_queue+0xfc/0x1f0 kernel/futex/waitwake.c:370 __futex_wait+0x291/0x3c0 kernel/futex/waitwake.c:669 futex_wait+0xe9/0x380 kernel/futex/waitwake.c:697 do_futex+0x22b/0x350 kernel/futex/syscalls.c:102 __do_sys_futex kernel/futex/syscalls.c:179 [inline] __se_sys_futex kernel/futex/syscalls.c:160 [inline] __x64_sys_futex+0x1e1/0x4c0 kernel/futex/syscalls.c:160 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Second to last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 task_work_add+0x212/0x3b0 kernel/task_work.c:75 sched_tick+0x1f3/0x4a0 kernel/sched/core.c:5611 update_process_times+0x19c/0x220 kernel/time/timer.c:2524 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x376/0x530 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1691 [inline] __hrtimer_run_queues+0x5fb/0xae0 kernel/time/hrtimer.c:1755 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1817 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline] __sysvec_apic_timer_interrupt+0x10f/0x400 arch/x86/kernel/apic/apic.c:1055 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff88802a72a440 which belongs to the cache task_struct of size 9024 The buggy address is located 680 bytes inside of freed 9024-byte region [ffff88802a72a440, ffff88802a72c780) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a728 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888025a86ac1 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801c2d6140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000030003 00000001f5000000 ffff888025a86ac1 head: 00fff00000000040 ffff88801c2d6140 0000000000000000 dead000000000001 head: 0000000000000000 0000000000030003 00000001f5000000 ffff888025a86ac1 head: 00fff00000000003 ffffea0000a9ca01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 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 45, tgid 45 (kworker/u32:2), ts 10223056919, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4750 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_node_noprof+0xed/0x310 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x4c1/0x8cb0 kernel/fork.c:2204 kernel_clone+0xfd/0x960 kernel/fork.c:2786 user_mode_thread+0xb4/0xf0 kernel/fork.c:2864 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:158 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 page_owner free stack trace missing Memory state around the buggy address: ffff88802a72a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a72a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802a72a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a72a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a72a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================