================================ WARNING: inconsistent lock state 6.9.0-rc6-syzkaller-00022-g98369dccd2f8 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.4/8475 [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_read_trylock include/linux/mmap_lock.h:166 [inline] get_mmap_lock_carefully mm/memory.c:5633 [inline] lock_mm_and_find_vma+0xeb/0x580 mm/memory.c:5693 do_user_addr_fault+0x29c/0x1080 arch/x86/mm/fault.c:1385 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 irq event stamp: 77813 hardirqs last enabled at (77812): [] __do_softirq+0x1d6/0x922 kernel/softirq.c:538 hardirqs last disabled at (77813): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (77813): [] _raw_spin_lock_irq+0x45/0x50 kernel/locking/spinlock.c:170 softirqs last enabled at (77716): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (77716): [] __do_softirq+0x5da/0x922 kernel/softirq.c:583 softirqs last disabled at (77811): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (77811): [] __irq_exit_rcu kernel/softirq.c:633 [inline] softirqs last disabled at (77811): [] 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 *** 11 locks held by syz-executor.4/8475: #0: ffff888079568420 (sb_writers#16){.+.+}-{0:0}, at: ioctl_preallocate+0x1a8/0x220 fs/ioctl.c:291 #1: ffff888078367008 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #1: ffff888078367008 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: btrfs_inode_lock+0xc8/0x110 fs/btrfs/inode.c:385 #2: ffff888078366e90 (&ei->i_mmap_lock){+.+.}-{3:3}, at: btrfs_inode_lock+0xee/0x110 fs/btrfs/inode.c:388 #3: ffff888079568610 (sb_internal#2){.+.+}-{0:0}, at: btrfs_replace_file_extents+0x394/0x1b80 fs/btrfs/file.c:2383 #4: ffff88807a722380 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x430/0xff0 fs/btrfs/transaction.c:290 #5: ffff88807a7223a8 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x430/0xff0 fs/btrfs/transaction.c:290 #6: ffffc90000a08cb0 (&(&bat_priv->nc.work)->timer){..-.}-{0:0}, at: call_timer_fn+0x11a/0x610 kernel/time/timer.c:1790 #7: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #7: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #7: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: __queue_work+0xf2/0x1020 kernel/workqueue.c:2337 #8: ffff8880150a0018 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x39e/0x1020 kernel/workqueue.c:2373 #9: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #9: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #9: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] #9: ffffffff8d7b0e20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0xf8/0x440 kernel/trace/bpf_trace.c:2421 #10: ffff88807e829e20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #10: ffff88807e829e20 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x1e8/0x7d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 1 PID: 8475 Comm: syz-executor.4 Not tainted 6.9.0-rc6-syzkaller-00022-g98369dccd2f8 #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:2395 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:check_kcov_mode kernel/kcov.c:173 [inline] RIP: 0010:write_comp_data+0x18/0x90 kernel/kcov.c:236 Code: 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 49 89 d2 49 89 f8 49 89 f1 65 48 8b 15 1f 18 76 7e 65 8b 05 20 18 76 7e 00 01 ff 00 74 0f f6 c4 01 74 59 8b 82 14 16 00 00 85 c0 74 4f RSP: 0018:ffffc90003de7198 EFLAGS: 00000246 RAX: 0000000080000001 RBX: ffffffff8fb7fa2c RCX: ffffffff813d0bf4 RDX: ffff8880557b8000 RSI: ffffffff81e909da RDI: 0000000000000006 RBP: ffffffff8fb7fa2c R08: 0000000000000006 R09: ffffffff81e909da R10: ffffffff81e909c7 R11: 0000000000000006 R12: ffffffff81e909da R13: ffffffff81e909c7 R14: dffffc0000000000 R15: ffffffff8fb7fa2c __orc_find+0xc4/0x130 arch/x86/kernel/unwind_orc.c:102 orc_find arch/x86/kernel/unwind_orc.c:227 [inline] unwind_next_frame+0x335/0x23a0 arch/x86/kernel/unwind_orc.c:494 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 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+0x12e/0x380 mm/slub.c:4344 free_extent_map fs/btrfs/extent_map.c:67 [inline] free_extent_map+0xeb/0x140 fs/btrfs/extent_map.c:60 btrfs_drop_extent_map_range+0xe8a/0x13f0 fs/btrfs/extent_map.c:892 btrfs_replace_extent_map_range+0x102/0x1b0 fs/btrfs/extent_map.c:928 __btrfs_prealloc_file_range+0x3d0/0x930 fs/btrfs/inode.c:9755 btrfs_prealloc_file_range+0x40/0x60 fs/btrfs/inode.c:9800 btrfs_zero_range fs/btrfs/file.c:3015 [inline] btrfs_fallocate+0x134f/0x24a0 fs/btrfs/file.c:3125 vfs_fallocate+0x4b8/0xf70 fs/open.c:330 ioctl_preallocate+0x1a8/0x220 fs/ioctl.c:291 file_ioctl fs/ioctl.c:336 [inline] do_vfs_ioctl+0x153d/0x1ad0 fs/ioctl.c:883 __do_sys_ioctl fs/ioctl.c:902 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __x64_sys_ioctl+0x116/0x220 fs/ioctl.c:890 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:0x7faea107dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007faea1d790c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007faea11abf80 RCX: 00007faea107dea9 RDX: 0000000020000000 RSI: 0000000040305839 RDI: 0000000000000004 RBP: 00007faea10ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007faea11abf80 R15: 00007ffecc123938 vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 90 nop 3: 90 nop 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 49 89 d2 mov %rdx,%r10 15: 49 89 f8 mov %rdi,%r8 18: 49 89 f1 mov %rsi,%r9 1b: 65 48 8b 15 1f 18 76 mov %gs:0x7e76181f(%rip),%rdx # 0x7e761842 22: 7e 23: 65 8b 05 20 18 76 7e mov %gs:0x7e761820(%rip),%eax # 0x7e76184a * 2a: a9 00 01 ff 00 test $0xff0100,%eax <-- trapping instruction 2f: 74 0f je 0x40 31: f6 c4 01 test $0x1,%ah 34: 74 59 je 0x8f 36: 8b 82 14 16 00 00 mov 0x1614(%rdx),%eax 3c: 85 c0 test %eax,%eax 3e: 74 4f je 0x8f