================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. systemd-udevd/26456 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888140e4fca8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888140e4fca8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x6a/0x3a0 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x114/0x5e0 kernel/locking/lockdep.c:5437 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_sqe_files_register fs/io_uring.c:7496 [inline] __io_uring_register fs/io_uring.c:9665 [inline] __do_sys_io_uring_register fs/io_uring.c:9755 [inline] __se_sys_io_uring_register+0x2416/0x2850 fs/io_uring.c:9737 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 282 hardirqs last enabled at (282): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (282): [] _raw_spin_unlock_irqrestore+0x2e/0x60 kernel/locking/spinlock.c:191 hardirqs last disabled at (281): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (281): [] _raw_spin_lock_irqsave+0x4d/0xa0 kernel/locking/spinlock.c:159 softirqs last enabled at (0): [] copy_process+0x10dd/0x53c0 kernel/fork.c:2048 softirqs last disabled at (263): [] asm_call_irq_on_stack+0xf/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&file_data->lock); lock(&file_data->lock); *** DEADLOCK *** 4 locks held by systemd-udevd/26456: #0: ffff88806a2b3958 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88806a2b3958 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x2c2/0xb80 arch/x86/mm/fault.c:1334 #1: ffff888029a0fc78 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #1: ffff888029a0fc78 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: wp_page_copy+0x711/0x20a0 mm/memory.c:2880 #2: ffffffff8bce8680 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire+0x0/0x20 kernel/rcu/tree.c:1374 #3: ffffffff8bce85c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:252 stack backtrace: CPU: 1 PID: 26456 Comm: systemd-udevd Not tainted 5.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x137/0x1be lib/dump_stack.c:120 print_usage_bug+0xbfe/0x1080 kernel/locking/lockdep.c:3740 mark_lock_irq kernel/locking/lockdep.c:3751 [inline] mark_lock+0x182d/0x1ef0 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0xbe6/0x5e90 kernel/locking/lockdep.c:4786 lock_acquire+0x114/0x5e0 kernel/locking/lockdep.c:5437 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_file_data_ref_zero+0x6a/0x3a0 fs/io_uring.c:7361 percpu_ref_put_many include/linux/percpu-refcount.h:322 [inline] percpu_ref_put+0x1cb/0x1d0 include/linux/percpu-refcount.h:338 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x7db/0x10c0 kernel/rcu/tree.c:2723 __do_softirq+0x307/0x6be kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9a/0xe0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu+0x1d6/0x200 kernel/softirq.c:423 irq_exit_rcu+0x5/0x20 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0xe0/0xf0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:flush_tlb_mm_range+0x23b/0x390 arch/x86/mm/tlb.c:915 Code: 00 02 00 00 74 05 e8 c4 c3 47 00 48 89 ef be 01 00 00 00 ba 03 00 00 00 e8 a2 0b 00 00 e8 3d bf 47 00 fb 49 81 c5 60 06 00 00 <4c> 89 ef 8b 74 24 0c e8 f9 d9 ae 02 89 c3 48 c7 c0 28 cd 0e 8d 48 RSP: 0000:ffffc90008f3fb98 EFLAGS: 00000286 RAX: 6b086765df0e2b00 RBX: ffff8880b9d33f18 RCX: ffffffff8159f229 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffff8880b9d33f00 R08: dffffc0000000000 R09: fffffbfff1dd7293 R10: fffffbfff1dd7293 R11: 0000000000000000 R12: 0000000000000005 R13: ffff88806a2b3e60 R14: 000055c0f9b27000 R15: dffffc0000000000 flush_tlb_page arch/x86/include/asm/tlbflush.h:235 [inline] ptep_clear_flush+0x111/0x150 mm/pgtable-generic.c:97 wp_page_copy+0xd21/0x20a0 mm/memory.c:2901 handle_pte_fault mm/memory.c:4403 [inline] __handle_mm_fault mm/memory.c:4520 [inline] handle_mm_fault+0x1e8d/0x24b0 mm/memory.c:4618 do_user_addr_fault+0x5fd/0xb80 arch/x86/mm/fault.c:1393 handle_page_fault arch/x86/mm/fault.c:1450 [inline] exc_page_fault+0xa1/0x1e0 arch/x86/mm/fault.c:1506 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 RIP: 0033:0x55c0f86304c9 Code: 00 c7 43 34 ff ff ff ff c7 43 30 ff ff ff ff 5b eb e6 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 8b 7f 08 e8 77 ed fc ff <80> 63 2f fb eb b0 90 48 85 ff 0f 84 77 01 00 00 41 56 41 55 41 54 RSP: 002b:00007fff2b6e8ab0 EFLAGS: 00010206 RAX: 0000000000000001 RBX: 000055c0f9b276d8 RCX: 000055c0f9b0f140 RDX: 00007fdc7149eb58 RSI: 0000000000000000 RDI: 00007fdc7149eb00 RBP: 000055c0f9b276e0 R08: 0000000000000045 R09: 0000000000000018 R10: 00007fdc7236d8c0 R11: 000055c0f86659a0 R12: 000055c0f86659a0 R13: 000055c0f9b0f308 R14: 000055c0f9b276d8 R15: 000055c0f9afb028