================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x114/0x763c kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff0000c7768990 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #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:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __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:377 [inline] print_report+0x178/0x518 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+0x23c/0x71c 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:4253 wake_up_process+0x18/0x24 kernel/sched/core.c:4501 nilfs_construction_timeout+0x40/0x50 fs/nilfs2/segment.c:2446 call_timer_fn+0x19c/0x8d4 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x524/0x6fc kernel/time/timer.c:2038 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:2051 __do_softirq+0x2d8/0xce4 kernel/softirq.c:553 ____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:434 [inline] __irq_exit_rcu+0x1d8/0x434 kernel/softirq.c:632 irq_exit_rcu+0x14/0x84 kernel/softirq.c:644 __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: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:312 cpu_startup_entry+0x5c/0x74 kernel/sched/idle.c:410 rest_init+0x2dc/0x2f4 init/main.c:730 start_kernel+0x0/0x4ec init/main.c:827 start_kernel+0x3ec/0x4ec init/main.c:1072 __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:575 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:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc_node+0x204/0x4c0 mm/slub.c:3903 alloc_task_struct_node kernel/fork.c:174 [inline] dup_task_struct+0x74/0x88c kernel/fork.c:1104 copy_process+0x488/0x3478 kernel/fork.c:2327 kernel_clone+0x1d8/0x80c kernel/fork.c:2902 kernel_thread+0x184/0x200 kernel/fork.c:2964 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 16: 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:589 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:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x15c/0x3d4 mm/slub.c:4363 free_task_struct kernel/fork.c:179 [inline] free_task+0xe8/0x14c kernel/fork.c:607 __put_task_struct+0x178/0x210 kernel/fork.c:979 put_task_struct+0x88/0x10c include/linux/sched/task.h:138 delayed_put_task_struct+0xdc/0x2d8 kernel/exit.c:229 rcu_do_batch kernel/rcu/tree.c:2190 [inline] rcu_core+0x890/0x1b34 kernel/rcu/tree.c:2465 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2482 __do_softirq+0x2d8/0xce4 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:551 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:561 __call_rcu_common kernel/rcu/tree.c:2715 [inline] call_rcu+0x104/0xaf4 kernel/rcu/tree.c:2829 put_task_struct_rcu_user+0x70/0xd8 kernel/exit.c:235 finish_task_switch+0x5b4/0x614 kernel/sched/core.c:5309 context_switch kernel/sched/core.c:5403 [inline] __schedule+0x149c/0x24b4 kernel/sched/core.c:6727 preempt_schedule_common+0xe8/0x1dc kernel/sched/core.c:6904 preempt_schedule+0x60/0x80 kernel/sched/core.c:6928 __local_bh_enable_ip+0x244/0x44c kernel/softirq.c:388 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x3c/0x4c kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:396 [inline] batadv_nc_purge_paths+0x2f4/0x378 net/batman-adv/network-coding.c:471 batadv_nc_worker+0x2e4/0x580 net/batman-adv/network-coding.c:720 process_one_work+0x694/0x1204 kernel/workqueue.c:2633 process_scheduled_works kernel/workqueue.c:2706 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:2787 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 The buggy address belongs to the object at ffff0000c7768000 which belongs to the cache task_struct of size 7424 The buggy address is located 2448 bytes inside of freed 7424-byte region [ffff0000c7768000, ffff0000c7769d00) The buggy address belongs to the physical page: page:00000000ed46c37e refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107768 head:00000000ed46c37e order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000c6c2c141 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c180d500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000c6c2c141 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c7768880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c7768900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000c7768980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c7768a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c7768a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================