BUG: MAX_LOCKDEP_CHAINS too low! turning off the locking correctness validator. CPU: 1 PID: 4095 Comm: kworker/u4:9 Not tainted 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 lookup_chain_cache_add kernel/locking/lockdep.c:3735 [inline] validate_chain kernel/locking/lockdep.c:3756 [inline] __lock_acquire+0x1b64/0x7638 kernel/locking/lockdep.c:5012 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0xb4/0x110 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested kernel/sched/core.c:475 [inline] raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] rq_lock kernel/sched/sched.h:1621 [inline] ttwu_queue kernel/sched/core.c:3821 [inline] try_to_wake_up+0x418/0xc2c kernel/sched/core.c:4146 wake_up_state+0x14/0x20 kernel/sched/core.c:4221 wake_page_function+0x128/0x3a4 mm/filemap.c:1163 __wake_up_common+0x23c/0x3bc kernel/sched/wait.c:108 __wake_up_locked_key_bookmark+0x20/0x2c kernel/sched/wait.c:179 wake_up_page_bit+0x194/0x434 mm/filemap.c:1196 unlock_page+0x158/0x204 mm/filemap.c:1513 btrfs_page_end_writer_lock+0xd4/0x114 __process_pages_contig+0x638/0x9c0 fs/btrfs/extent_io.c:1904 extent_clear_unlock_delalloc+0x9c/0xb8 fs/btrfs/extent_io.c:2073 compress_file_range+0xf08/0x1084 fs/btrfs/inode.c:724 async_cow_start+0x28/0x94 fs/btrfs/inode.c:1343 btrfs_work_helper+0x33c/0x1548 fs/btrfs/async-thread.c:325 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 ================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x244/0x35c kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff0000cbbb5ac4 by task kworker/u4:9/4095 CPU: 0 PID: 4095 Comm: kworker/u4:9 Not tainted 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: btrfs-delalloc btrfs_work_helper Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load4_noabort+0x44/0x50 mm/kasan/report_generic.c:308 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x244/0x35c kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline] _raw_spin_lock_irqsave+0xcc/0x14c kernel/locking/spinlock.c:162 try_to_wake_up+0xb0/0xc2c kernel/sched/core.c:4030 wake_up_process+0x18/0x24 kernel/sched/core.c:4215 btrfs_add_delayed_iput+0x280/0x2ec fs/btrfs/inode.c:3422 async_cow_start+0x6c/0x94 fs/btrfs/inode.c:1345 btrfs_work_helper+0x33c/0x1548 fs/btrfs/async-thread.c:325 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 2: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8c/0xcc mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] kmem_cache_alloc_node+0x208/0x49c mm/slub.c:3256 alloc_task_struct_node kernel/fork.c:171 [inline] dup_task_struct+0x74/0xcf0 kernel/fork.c:894 copy_process+0x52c/0x3750 kernel/fork.c:2038 kernel_clone+0x1d8/0xa58 kernel/fork.c:2604 kernel_thread+0x148/0x1bc kernel/fork.c:2656 create_kthread kernel/kthread.c:357 [inline] kthreadd+0x588/0x7d0 kernel/kthread.c:701 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Freed by task 7614: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0xdc/0x3c4 mm/slub.c:3515 free_task_struct kernel/fork.c:176 [inline] free_task+0xe8/0x14c kernel/fork.c:474 __put_task_struct+0x1a8/0x24c kernel/fork.c:763 put_task_struct include/linux/sched/task.h:141 [inline] delayed_put_task_struct+0x124/0x380 kernel/exit.c:220 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0x830/0x1b34 kernel/rcu/tree.c:2763 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2776 handle_softirqs+0x384/0xdbc kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] invoke_softirq kernel/softirq.c:439 [inline] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641 irq_exit+0x14/0x88 kernel/softirq.c:665 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 put_task_struct_rcu_user+0x70/0xe0 kernel/exit.c:226 finish_task_switch+0x3a0/0x6b4 kernel/sched/core.c:4944 context_switch kernel/sched/core.c:5033 [inline] __schedule+0xf14/0x1e48 kernel/sched/core.c:6376 schedule+0x11c/0x1c8 kernel/sched/core.c:6459 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1a4/0x668 kernel/time/hrtimer.c:2045 hrtimer_nanosleep+0x1f0/0x384 kernel/time/hrtimer.c:2098 common_nsleep+0xa8/0xc0 kernel/time/posix-timers.c:1272 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1313 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1290 [inline] __arm64_sys_clock_nanosleep+0x350/0x38c kernel/time/posix-timers.c:1290 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Second to last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 release_task+0x1648/0x1748 wait_task_zombie kernel/exit.c:1179 [inline] wait_consider_task+0x16d8/0x2978 kernel/exit.c:1406 do_wait_thread kernel/exit.c:1469 [inline] do_wait+0x2f4/0xac8 kernel/exit.c:1586 kernel_wait4+0x24c/0x400 kernel/exit.c:1749 __do_sys_wait4 kernel/exit.c:1777 [inline] __se_sys_wait4 kernel/exit.c:1773 [inline] __arm64_sys_wait4+0x120/0x2d0 kernel/exit.c:1773 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000cbbb51c0 which belongs to the cache task_struct of size 6720 The buggy address is located 2308 bytes inside of 6720-byte region [ffff0000cbbb51c0, ffff0000cbbb6c00) The buggy address belongs to the page: page:00000000e134131a refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10bbb0 head:00000000e134131a order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000c1323a01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0840d80 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000c1323a01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cbbb5980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbbb5a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000cbbb5a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cbbb5b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbbb5b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50