================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x114/0x75e8 kernel/locking/lockdep.c:5004 Read of size 8 at addr ffff0000c8a34118 by task swapper/1/0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.6.0-rc7-syzkaller-g8de1e7afcc1c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __lock_acquire+0x114/0x75e8 kernel/locking/lockdep.c:5004 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5753 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:518 [inline] try_to_wake_up+0xb0/0xe80 kernel/sched/core.c:4230 wake_up_process+0x18/0x24 kernel/sched/core.c:4478 nilfs_construction_timeout+0x40/0x50 fs/nilfs2/segment.c:2444 call_timer_fn+0x19c/0x8cc kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x55c/0x734 kernel/time/timer.c:2022 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:2035 __do_softirq+0x2d0/0xd54 kernel/softirq.c:553 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:886 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85 invoke_softirq kernel/softirq.c:434 [inline] __irq_exit_rcu+0x200/0x494 kernel/softirq.c:632 irq_exit_rcu+0x14/0x84 kernel/softirq.c:644 __el1_irq arch/arm64/kernel/entry-common.c:503 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:517 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:522 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:591 __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:27 [inline] arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:49 cpuidle_idle_call kernel/sched/idle.c:170 [inline] do_idle+0x1f0/0x4e8 kernel/sched/idle.c:282 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:380 secondary_start_kernel+0x198/0x1c0 arch/arm64/kernel/smp.c:272 __secondary_switched+0xb8/0xbc arch/arm64/kernel/head.S:681 Allocated by task 2: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x90/0x4a0 mm/slab.h:762 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x2c8/0x46c mm/slub.c:3523 alloc_task_struct_node kernel/fork.c:173 [inline] dup_task_struct+0x74/0x888 kernel/fork.c:1110 copy_process+0x488/0x34b8 kernel/fork.c:2327 kernel_clone+0x1d8/0x80c kernel/fork.c:2909 kernel_thread+0x184/0x200 kernel/fork.c:2971 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x464/0x670 kernel/kthread.c:746 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 Freed by task 0: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x2e4/0x56c mm/slub.c:3831 free_task_struct kernel/fork.c:178 [inline] free_task+0xe8/0x14c kernel/fork.c:627 __put_task_struct+0x178/0x210 kernel/fork.c:981 put_task_struct+0x88/0x10c include/linux/sched/task.h:136 delayed_put_task_struct+0xdc/0x2d8 kernel/exit.c:226 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x8a4/0x1b28 kernel/rcu/tree.c:2403 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2420 __do_softirq+0x2d0/0xd54 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:492 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:502 __call_rcu_common kernel/rcu/tree.c:2653 [inline] call_rcu+0x104/0xaf4 kernel/rcu/tree.c:2767 put_task_struct_rcu_user+0x70/0xd8 kernel/exit.c:232 finish_task_switch+0x5b4/0x614 kernel/sched/core.c:5289 context_switch kernel/sched/core.c:5385 [inline] __schedule+0x1368/0x23b4 kernel/sched/core.c:6695 schedule+0xc4/0x170 kernel/sched/core.c:6771 worker_thread+0xb64/0xef4 kernel/workqueue.c:2799 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:857 Second to last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:492 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:502 __call_rcu_common kernel/rcu/tree.c:2653 [inline] call_rcu+0x104/0xaf4 kernel/rcu/tree.c:2767 release_task+0x145c/0x1544 wait_task_zombie kernel/exit.c:1210 [inline] wait_consider_task+0x15d0/0x2660 kernel/exit.c:1437 do_wait_thread kernel/exit.c:1500 [inline] do_wait+0x2f4/0xac8 kernel/exit.c:1617 kernel_wait4+0x24c/0x3d8 kernel/exit.c:1780 __do_sys_wait4 kernel/exit.c:1808 [inline] __se_sys_wait4 kernel/exit.c:1804 [inline] __arm64_sys_wait4+0x11c/0x2a0 kernel/exit.c:1804 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 The buggy address belongs to the object at ffff0000c8a33780 which belongs to the cache task_struct of size 6848 The buggy address is located 2456 bytes inside of freed 6848-byte region [ffff0000c8a33780, ffff0000c8a35240) The buggy address belongs to the physical page: page:00000000e885fc14 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108a30 head:00000000e885fc14 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c185a500 0000000000000000 0000000000000001 raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c8a34000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c8a34080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000c8a34100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c8a34180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c8a34200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================