================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x114/0x763c kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff0000cbc0e468 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.9.0-rc3-syzkaller-gb5d2afe8745b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __lock_acquire+0x114/0x763c kernel/locking/lockdep.c:5005 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __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:553 [inline] try_to_wake_up+0xb0/0xf2c kernel/sched/core.c:4262 wake_up_process+0x18/0x24 kernel/sched/core.c:4510 nilfs_construction_timeout+0x40/0x50 fs/nilfs2/segment.c:2409 call_timer_fn+0x1b4/0x93c kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers kernel/time/timer.c:2418 [inline] __run_timer_base+0x56c/0x7b4 kernel/time/timer.c:2429 run_timer_base kernel/time/timer.c:2438 [inline] run_timer_softirq+0xcc/0x194 kernel/time/timer.c:2448 __do_softirq+0x2e4/0xd2c kernel/softirq.c:554 ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:889 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:86 invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0x1d8/0x434 kernel/softirq.c:633 irq_exit_rcu+0x14/0x84 kernel/softirq.c:645 __el1_irq arch/arm64/kernel/entry-common.c:537 [inline] el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:551 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:556 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:594 __daif_local_irq_enable arch/arm64/include/asm/irqflags.h:26 [inline] arch_local_irq_enable+0x8/0xc arch/arm64/include/asm/irqflags.h:48 cpuidle_idle_call kernel/sched/idle.c:191 [inline] do_idle+0x1f0/0x4e4 kernel/sched/idle.c:332 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:430 rest_init+0x2dc/0x2f4 init/main.c:732 start_kernel+0x3f0/0x4f0 init/main.c:1074 __primary_switched+0x84/0x8c arch/arm64/kernel/head.S:243 Allocated by task 2: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc_node+0x224/0x418 mm/slub.c:3888 alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0x74/0x908 kernel/fork.c:1106 copy_process+0x490/0x3280 kernel/fork.c:2219 kernel_clone+0x1d8/0x838 kernel/fork.c:2796 kernel_thread+0x184/0x200 kernel/fork.c:2858 create_kthread kernel/kthread.c:411 [inline] kthreadd+0x464/0x670 kernel/kthread.c:764 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Freed by task 6747: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x124/0x18c mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x168/0x3f0 mm/slub.c:4344 free_task_struct kernel/fork.c:181 [inline] free_task+0xe8/0x14c kernel/fork.c:609 __put_task_struct+0x178/0x210 kernel/fork.c:981 put_task_struct+0x88/0x10c include/linux/sched/task.h:138 delayed_put_task_struct+0xf4/0x304 kernel/exit.c:229 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0x888/0x1b3c kernel/rcu/tree.c:2471 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2488 __do_softirq+0x2e4/0xd2c kernel/softirq.c:554 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xd0/0xec mm/kasan/generic.c:541 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:551 __call_rcu_common kernel/rcu/tree.c:2734 [inline] call_rcu+0x104/0xb08 kernel/rcu/tree.c:2838 put_task_struct_rcu_user+0x70/0xd8 kernel/exit.c:235 finish_task_switch+0x5b4/0x614 kernel/sched/core.c:5318 context_switch kernel/sched/core.c:5412 [inline] __schedule+0x14c0/0x24ec kernel/sched/core.c:6746 preempt_schedule_common+0xe8/0x1dc kernel/sched/core.c:6925 preempt_schedule+0x60/0x80 kernel/sched/core.c:6949 __raw_spin_unlock include/linux/spinlock_api_smp.h:143 [inline] _raw_spin_unlock+0x74/0x78 kernel/locking/spinlock.c:186 spin_unlock include/linux/spinlock.h:391 [inline] nilfs_segctor_kill_thread fs/nilfs2/segment.c:2644 [inline] nilfs_segctor_destroy fs/nilfs2/segment.c:2727 [inline] nilfs_detach_log_writer+0x214/0xa48 fs/nilfs2/segment.c:2816 nilfs_put_super+0x4c/0x130 fs/nilfs2/super.c:499 generic_shutdown_super+0x128/0x2b8 fs/super.c:641 kill_block_super+0x44/0x90 fs/super.c:1675 deactivate_locked_super+0xc4/0x12c fs/super.c:472 deactivate_super+0xe0/0x100 fs/super.c:505 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1267 __cleanup_mnt+0x20/0x30 fs/namespace.c:1274 task_work_run+0x230/0x2e0 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] do_notify_resume+0x178/0x1f4 arch/arm64/kernel/entry-common.c:151 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xac/0x168 arch/arm64/kernel/entry-common.c:713 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000cbc0dac0 which belongs to the cache task_struct of size 7488 The buggy address is located 2472 bytes inside of freed 7488-byte region [ffff0000cbc0dac0, ffff0000cbc0f800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000cbc08000 pfn:0x10bc08 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000d5014301 flags: 0x5ffe00000000a40(workingset|slab|head|node=0|zone=2|lastcpupid=0xfff) page_type: 0xffffffff() raw: 05ffe00000000a40 ffff0000c1883500 fffffdffc32e1210 fffffdffc36afa10 raw: ffff0000cbc08000 0000000000040003 00000001ffffffff ffff0000d5014301 head: 05ffe00000000a40 ffff0000c1883500 fffffdffc32e1210 fffffdffc36afa10 head: ffff0000cbc08000 0000000000040003 00000001ffffffff ffff0000d5014301 head: 05ffe00000000003 fffffdffc32f0201 fffffdffc32f0248 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cbc0e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbc0e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000cbc0e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cbc0e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbc0e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================