BUG: MAX_LOCKDEP_CHAINS too low! turning off the locking correctness validator. CPU: 0 PID: 10 Comm: kworker/u8:0 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: btrfs-delalloc btrfs_work_helper 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 dump_stack+0x1c/0x28 lib/dump_stack.c:123 lookup_chain_cache_add kernel/locking/lockdep.c:3816 [inline] validate_chain kernel/locking/lockdep.c:3837 [inline] __lock_acquire+0x1c58/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 local_lock_acquire+0x44/0x1ac include/linux/local_lock_internal.h:29 lru_add_drain+0x84/0x168 mm/swap.c:766 __folio_batch_release+0x68/0xc0 mm/swap.c:1091 folio_batch_release include/linux/pagevec.h:101 [inline] __process_pages_contig+0x3fc/0x4e0 fs/btrfs/extent_io.c:228 extent_clear_unlock_delalloc+0x88/0xa0 fs/btrfs/extent_io.c:420 compress_file_range+0xe14/0xeb4 fs/btrfs/inode.c:1000 btrfs_work_helper+0x37c/0xda4 fs/btrfs/async-thread.c:314 process_one_work+0x7b8/0x15d4 kernel/workqueue.c:3267 process_scheduled_works kernel/workqueue.c:3348 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:3429 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x234/0x348 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff0000e41ce454 by task kworker/u8:0/10 CPU: 0 PID: 10 Comm: kworker/u8:0 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: btrfs-delalloc btrfs_work_helper 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_load4_noabort+0x20/0x2c mm/kasan/report_generic.c:380 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x234/0x348 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x64/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 btrfs_add_delayed_iput+0x268/0x2d8 fs/btrfs/inode.c:3393 submit_compressed_extents+0xbc/0x13c4 fs/btrfs/inode.c:1596 run_ordered_work fs/btrfs/async-thread.c:288 [inline] btrfs_work_helper+0x9dc/0xda4 fs/btrfs/async-thread.c:324 process_one_work+0x7b8/0x15d4 kernel/workqueue.c:3267 process_scheduled_works kernel/workqueue.c:3348 [inline] worker_thread+0x938/0xef4 kernel/workqueue.c:3429 kthread+0x288/0x310 kernel/kthread.c:388 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 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:1107 copy_process+0x490/0x3280 kernel/fork.c:2220 kernel_clone+0x1d8/0x838 kernel/fork.c:2797 kernel_thread+0x184/0x200 kernel/fork.c:2859 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 7460: 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:982 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 handle_softirqs+0x2ec/0xc34 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: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+0x14bc/0x24e8 kernel/sched/core.c:6746 __schedule_loop kernel/sched/core.c:6823 [inline] schedule+0xbc/0x238 kernel/sched/core.c:6838 schedule_timeout+0xb8/0x348 kernel/time/timer.c:2558 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+0x1cc/0x75c kernel/kthread.c:709 close_ctree+0x454/0xb44 fs/btrfs/disk-io.c:4339 btrfs_put_super+0x70/0x80 fs/btrfs/super.c:73 generic_shutdown_super+0x128/0x2b8 fs/super.c:641 kill_anon_super+0x4c/0x7c fs/super.c:1225 btrfs_kill_super+0x40/0x58 fs/btrfs/super.c:2091 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 ffff0000e41cdac0 which belongs to the cache task_struct of size 7488 The buggy address is located 2452 bytes inside of freed 7488-byte region [ffff0000e41cdac0, ffff0000e41cf800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1241c8 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000cd33cb81 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c1883500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000cd33cb81 head: 05ffc00000000840 ffff0000c1883500 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000001ffffffff ffff0000cd33cb81 head: 05ffc00000000003 fffffdffc3907201 dead000000000122 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e41ce300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e41ce380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000e41ce400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000e41ce480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e41ce500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================