================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942 Read of size 8 at addr ffff8880282a4580 by task ksoftirqd/1/21 CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 6.4.0-rc2-syzkaller-00163-g2d1bcbc6cd70 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 __lock_acquire+0x3ffd/0x5df0 kernel/locking/lockdep.c:4942 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 try_to_wake_up+0xab/0x1c40 kernel/sched/core.c:4191 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers+0x29b/0x4b0 kernel/time/timer.c:1751 __run_timers kernel/time/timer.c:2022 [inline] __run_timers kernel/time/timer.c:1995 [inline] run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:939 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:931 smpboot_thread_fn+0x659/0x9e0 kernel/smpboot.c:164 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 2: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] kmem_cache_alloc_node+0x185/0x3e0 mm/slub.c:3496 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x3c0/0x7600 kernel/fork.c:2333 kernel_clone+0xeb/0x890 kernel/fork.c:2918 kernel_thread+0xc0/0x100 kernel/fork.c:2980 create_kthread kernel/kthread.c:402 [inline] kthreadd+0x50c/0x790 kernel/kthread.c:737 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 21: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] kmem_cache_free+0xe9/0x480 mm/slub.c:3808 put_task_struct include/linux/sched/task.h:126 [inline] delayed_put_task_struct+0x1f5/0x280 kernel/exit.c:226 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x806/0x1ad0 kernel/rcu/tree.c:2377 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:232 context_switch kernel/sched/core.c:5346 [inline] __schedule+0xca2/0x5880 kernel/sched/core.c:6669 preempt_schedule_irq+0x52/0x90 kernel/sched/core.c:6981 irqentry_exit+0x35/0x80 kernel/entry/common.c:433 asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:650 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 put_task_struct_rcu_user+0x87/0xc0 kernel/exit.c:232 context_switch kernel/sched/core.c:5346 [inline] __schedule+0xca2/0x5880 kernel/sched/core.c:6669 schedule+0xde/0x1a0 kernel/sched/core.c:6745 worker_thread+0x160/0x10c0 kernel/workqueue.c:2573 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff8880282a3b80 which belongs to the cache task_struct of size 7360 The buggy address is located 2560 bytes inside of freed 7360-byte region [ffff8880282a3b80, ffff8880282a5840) The buggy address belongs to the physical page: page:ffffea0000a0a800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x282a0 head:ffffea0000a0a800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888140007500 ffffea0000497600 dead000000000002 raw: 0000000000000000 0000000000040004 00000001ffffffff 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 38, tgid 38 (kworker/u4:2), ts 8246742959, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] kmem_cache_alloc_node+0x138/0x3e0 mm/slub.c:3496 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct kernel/fork.c:1108 [inline] copy_process+0x3c0/0x7600 kernel/fork.c:2333 kernel_clone+0xeb/0x890 kernel/fork.c:2918 user_mode_thread+0xb1/0xf0 kernel/fork.c:2996 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xd0/0x180 kernel/umh.c:158 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffff8880282a4480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880282a4500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880282a4580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880282a4600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880282a4680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================