================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x10c/0x77c8 kernel/locking/lockdep.c:5065 Read of size 8 at addr ffff0000c77127f8 by task kworker/u8:6/1996 CPU: 0 UID: 0 PID: 1996 Comm: kworker/u8:6 Not tainted 6.12.0-rc6-syzkaller-g563047e691f2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 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+0x10c/0x77c8 kernel/locking/lockdep.c:5065 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __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:551 [inline] try_to_wake_up+0xd8/0x1274 kernel/sched/core.c:4165 wake_up_process+0x18/0x24 kernel/sched/core.c:4414 btrfs_add_delayed_iput+0x268/0x2d8 fs/btrfs/inode.c:3403 submit_compressed_extents+0xd0/0x12f4 fs/btrfs/inode.c:1646 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x96c/0xd28 fs/btrfs/async-thread.c:324 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 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:319 [inline] __kasan_slab_alloc+0x74/0x8c 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+0x204/0x3a8 mm/slub.c:4186 alloc_task_struct_node kernel/fork.c:181 [inline] dup_task_struct+0x74/0x908 kernel/fork.c:1108 copy_process+0x490/0x3250 kernel/fork.c:2204 kernel_clone+0x1d8/0x82c kernel/fork.c:2786 kernel_thread+0x184/0x200 kernel/fork.c:2848 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x464/0x670 kernel/kthread.c:767 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Freed by task 8207: 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 mm/kasan/common.c:247 [inline] __kasan_slab_free+0x64/0x8c 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+0x19c/0x560 mm/slub.c:4681 free_task_struct kernel/fork.c:186 [inline] free_task+0xe8/0x14c kernel/fork.c:615 __put_task_struct+0x178/0x210 kernel/fork.c:983 put_task_struct+0x88/0x10c include/linux/sched/task.h:144 delayed_put_task_struct+0xec/0x2f0 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x898/0x1b5c kernel/rcu/tree.c:2823 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2840 handle_softirqs+0x2e0/0xbf8 kernel/softirq.c:554 __do_softirq+0x14/0x20 kernel/softirq.c:588 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:3086 [inline] call_rcu+0x104/0xb00 kernel/rcu/tree.c:3190 put_task_struct_rcu_user+0x70/0xd8 kernel/exit.c:234 finish_task_switch+0x5a8/0x608 kernel/sched/core.c:5237 context_switch kernel/sched/core.c:5331 [inline] __schedule+0x16e4/0x27d0 kernel/sched/core.c:6690 __schedule_loop kernel/sched/core.c:6767 [inline] schedule+0xbc/0x238 kernel/sched/core.c:6782 schedule_timeout+0xb8/0x33c kernel/time/timer.c:2591 do_wait_for_common+0x30c/0x468 kernel/sched/completion.c:95 __wait_for_common kernel/sched/completion.c:116 [inline] wait_for_common kernel/sched/completion.c:127 [inline] wait_for_completion+0x48/0x60 kernel/sched/completion.c:148 kthread_stop+0x1b4/0x734 kernel/kthread.c:712 close_ctree+0x454/0xb3c fs/btrfs/disk-io.c:4330 btrfs_put_super+0x70/0x80 fs/btrfs/super.c:75 generic_shutdown_super+0x12c/0x2bc fs/super.c:642 kill_anon_super+0x4c/0x7c fs/super.c:1237 btrfs_kill_super+0x40/0x58 fs/btrfs/super.c:2129 deactivate_locked_super+0xc4/0x12c fs/super.c:473 deactivate_super+0xe0/0x100 fs/super.c:506 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1373 __cleanup_mnt+0x20/0x30 fs/namespace.c:1380 task_work_run+0x230/0x2e0 kernel/task_work.c:239 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:745 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000c7711e40 which belongs to the cache task_struct of size 7488 The buggy address is located 2488 bytes inside of freed 7488-byte region [ffff0000c7711e40, ffff0000c7713b80) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107710 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000c7e4bd81 ksm flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c182f500 fffffdffc3645800 dead000000000003 raw: 0000000000000000 0000000000040004 00000001f5000000 ffff0000c7e4bd81 head: 05ffc00000000040 ffff0000c182f500 fffffdffc3645800 dead000000000003 head: 0000000000000000 0000000000040004 00000001f5000000 ffff0000c7e4bd81 head: 05ffc00000000003 fffffdffc31dc401 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c7712680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c7712700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000c7712780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c7712800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000c7712880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================