================================ WARNING: inconsistent lock state 6.9.0-rc5-syzkaller-00355-g2c8159388952 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.0/7323 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff8880b9538a80 (lock#11){+.?.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9538a80 (lock#11){+.?.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x7f/0x790 mm/mmap_lock.c:237 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:125 [inline] vm_mmap_pgoff+0x2f7/0x3c0 mm/util.c:571 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1431 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 74313 hardirqs last enabled at (74312): [] __do_softirq+0x1d6/0x922 kernel/softirq.c:538 hardirqs last disabled at (74313): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (74313): [] _raw_spin_lock_irq+0x45/0x50 kernel/locking/spinlock.c:170 softirqs last enabled at (74110): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (74110): [] __do_softirq+0x5da/0x922 kernel/softirq.c:583 softirqs last disabled at (74311): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (74311): [] __irq_exit_rcu kernel/softirq.c:633 [inline] softirqs last disabled at (74311): [] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#11); lock(lock#11); *** DEADLOCK *** 12 locks held by syz-executor.0/7323: #0: ffff88807a8560e0 (&type->s_umount_key#80/1){+.+.}-{3:3}, at: alloc_super+0x23d/0xbd0 fs/super.c:343 #1: ffff88807a856610 (sb_internal#3){.+.+}-{0:0}, at: btrfs_rebuild_free_space_tree+0xaa/0x480 fs/btrfs/free-space-tree.c:1323 #2: ffff888023ae6380 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x137/0xff0 fs/btrfs/transaction.c:314 #3: ffff888023ae63a8 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x137/0xff0 fs/btrfs/transaction.c:314 #4: ffff888023ae63d0 (btrfs_trans_commit_prep){.+.+}-{0:0}, at: btrfs_commit_transaction+0x152/0x3b30 fs/btrfs/transaction.c:2162 #5: ffff88807aded910 (&head_ref->mutex){+.+.}-{3:3}, at: btrfs_delayed_ref_lock+0x6d/0x2f0 fs/btrfs/delayed-ref.c:504 #6: ffff88807d32b2f0 (&cache->free_space_lock){+.+.}-{3:3}, at: remove_from_free_space_tree+0x21b/0xa80 fs/btrfs/free-space-tree.c:856 #7: ffffc90000a08cb0 (&(&bat_priv->nc.work)->timer){..-.}-{0:0}, at: call_timer_fn+0x11a/0x610 kernel/time/timer.c:1790 #8: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #8: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #8: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xf2/0x1020 kernel/workqueue.c:2324 #9: ffff8880150a0018 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x39e/0x1020 kernel/workqueue.c:2360 #10: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #10: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #10: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] #10: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0xf8/0x440 kernel/trace/bpf_trace.c:2421 #11: ffff888078109e20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #11: ffff888078109e20 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x1e8/0x7d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 7323 Comm: syz-executor.0 Not tainted 6.9.0-rc5-syzkaller-00355-g2c8159388952 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_usage_bug kernel/locking/lockdep.c:3971 [inline] valid_state kernel/locking/lockdep.c:4013 [inline] mark_lock_irq kernel/locking/lockdep.c:4216 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4567 [inline] __lock_acquire+0x13d4/0x3b30 kernel/locking/lockdep.c:5091 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:166 [inline] stack_map_get_build_id_offset+0x5df/0x7d0 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x6bf/0x700 kernel/bpf/stackmap.c:449 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1985 [inline] bpf_get_stack_raw_tp+0x124/0x160 kernel/trace/bpf_trace.c:1975 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:1997 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2236 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run3+0x167/0x440 kernel/trace/bpf_trace.c:2421 __bpf_trace_workqueue_queue_work+0x101/0x140 include/trace/events/workqueue.h:23 trace_workqueue_queue_work include/trace/events/workqueue.h:23 [inline] __queue_work+0x627/0x1020 kernel/workqueue.c:2382 call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1839 [inline] __run_timers+0x567/0xaf0 kernel/time/timer.c:2418 __run_timer_base kernel/time/timer.c:2429 [inline] __run_timer_base kernel/time/timer.c:2422 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2438 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2448 __do_softirq+0x218/0x922 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:633 [inline] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:write_comp_data+0x7d/0x90 kernel/kcov.c:262 Code: 00 00 4a 8d 34 dd 28 00 00 00 48 39 f2 72 1b 48 83 c7 01 48 89 38 4c 89 44 30 e0 4c 89 4c 30 e8 4c 89 54 30 f0 4a 89 4c d8 20 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 RSP: 0018:ffffc90004bb6fb8 EFLAGS: 00000297 RAX: 0000000000000002 RBX: 0000000000000000 RCX: ffffffff83857709 RDX: ffff888021da3c00 RSI: 0000000000000000 RDI: 0000000000000005 RBP: ffff88805f576370 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000007 R12: ffff88802f11e000 R13: ffffc90004bb71f8 R14: 00000000ffffffff R15: ffff88805f576370 btrfs_search_slot+0x219/0x3010 fs/btrfs/ctree.c:2028 btrfs_search_prev_slot.constprop.0+0x36/0x110 fs/btrfs/free-space-tree.c:140 remove_free_space_extent fs/btrfs/free-space-tree.c:733 [inline] __remove_from_free_space_tree fs/btrfs/free-space-tree.c:828 [inline] remove_from_free_space_tree+0x52a/0xa80 fs/btrfs/free-space-tree.c:857 alloc_reserved_extent+0x49/0x2e0 fs/btrfs/extent-tree.c:4798 alloc_reserved_tree_block fs/btrfs/extent-tree.c:4961 [inline] run_delayed_tree_ref fs/btrfs/extent-tree.c:1763 [inline] run_one_delayed_ref fs/btrfs/extent-tree.c:1797 [inline] btrfs_run_delayed_refs_for_head fs/btrfs/extent-tree.c:2062 [inline] __btrfs_run_delayed_refs+0x1491/0x3d10 fs/btrfs/extent-tree.c:2132 btrfs_run_delayed_refs+0x1a6/0x330 fs/btrfs/extent-tree.c:2244 btrfs_commit_transaction+0x783/0x3b30 fs/btrfs/transaction.c:2185 btrfs_rebuild_free_space_tree+0x2a3/0x480 fs/btrfs/free-space-tree.c:1356 btrfs_start_pre_rw_mount+0x218/0xf60 fs/btrfs/disk-io.c:2991 open_ctree+0x3c3a/0x52f0 fs/btrfs/disk-io.c:3546 btrfs_fill_super fs/btrfs/super.c:938 [inline] btrfs_get_tree_super fs/btrfs/super.c:1858 [inline] btrfs_get_tree+0x11e9/0x1b90 fs/btrfs/super.c:2084 vfs_get_tree+0x8f/0x380 fs/super.c:1779 fc_mount+0x16/0xc0 fs/namespace.c:1125 btrfs_get_tree_subvol fs/btrfs/super.c:2047 [inline] btrfs_get_tree+0xa53/0x1b90 fs/btrfs/super.c:2085 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb25a87f5aa Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb25b6b4ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fb25b6b4f80 RCX: 00007fb25a87f5aa RDX: 00000000200051c0 RSI: 0000000020005200 RDI: 00007fb25b6b4f40 RBP: 00000000200051c0 R08: 00007fb25b6b4f80 R09: 0000000001204408 R10: 0000000001204408 R11: 0000000000000202 R12: 0000000020005200 R13: 00007fb25b6b4f40 R14: 00000000000051ab R15: 0000000020000580 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 4a 8d 34 dd 28 00 00 lea 0x28(,%r11,8),%rsi 9: 00 a: 48 39 f2 cmp %rsi,%rdx d: 72 1b jb 0x2a f: 48 83 c7 01 add $0x1,%rdi 13: 48 89 38 mov %rdi,(%rax) 16: 4c 89 44 30 e0 mov %r8,-0x20(%rax,%rsi,1) 1b: 4c 89 4c 30 e8 mov %r9,-0x18(%rax,%rsi,1) 20: 4c 89 54 30 f0 mov %r10,-0x10(%rax,%rsi,1) 25: 4a 89 4c d8 20 mov %rcx,0x20(%rax,%r11,8) * 2a: c3 ret <-- trapping instruction 2b: cc int3 2c: cc int3 2d: cc int3 2e: cc int3 2f: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 36: 00 00 00 00 3a: 0f 1f 00 nopl (%rax) 3d: 90 nop 3e: 90 nop 3f: 90 nop