================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. systemd-udevd/4894 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff88801b2186a8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff88801b2186a8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x75/0x480 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __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+0x343a/0x40d0 fs/io_uring.c:9755 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 12675428 hardirqs last enabled at (12675428): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (12675428): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (12675427): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (12675427): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (12673696): [] asm_call_irq_on_stack+0xf/0x20 softirqs last disabled at (12675245): [] 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 *** 2 locks held by systemd-udevd/4894: #0: ffffffff8b339140 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #0: ffffffff8b339140 (rcu_callback){....}-{0:0}, at: rcu_core+0x582/0xf00 kernel/rcu/tree.c:2723 #1: ffffffff8b339260 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x250 net/netfilter/xt_cgroup.c:62 stack backtrace: CPU: 0 PID: 4894 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+0x107/0x163 lib/dump_stack.c:120 print_usage_bug kernel/locking/lockdep.c:3740 [inline] valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.cold+0x31/0x73 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0x11a5/0x5500 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __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+0x75/0x480 fs/io_uring.c:7361 percpu_ref_put_many.constprop.0+0x217/0x250 include/linux/percpu-refcount.h:322 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x5eb/0xf00 kernel/rcu/tree.c:2723 __do_softirq+0x2a0/0x9f6 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+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x132/0x200 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:79 [inline] RIP: 0010:arch_local_irq_save arch/x86/include/asm/irqflags.h:120 [inline] RIP: 0010:lock_is_held_type+0x21/0x100 kernel/locking/lockdep.c:5472 Code: 2e 0f 1f 84 00 00 00 00 00 41 57 41 56 41 89 f6 41 55 41 54 55 48 89 fd 53 48 83 ec 08 e8 b7 08 6f f8 84 c0 0f 84 b8 00 00 00 <9c> 8f 04 24 fa 48 c7 c7 e0 67 4b 89 31 db e8 bc 0b 00 00 65 4c 8b RSP: 0018:ffffc90000f2f938 EFLAGS: 00000202 RAX: 0000000000000001 RBX: 1ffff920001e5f33 RCX: 1ffffffff19d9a8b RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffff888012132444 RBP: ffffffff8b3391a0 R08: 0000000000000000 R09: ffffffff8ceca28f R10: fffffbfff19d9451 R11: 0000000000000001 R12: 0000000000000001 R13: ffffffff8b339260 R14: 00000000ffffffff R15: 0000000000000000 lock_is_held include/linux/lockdep.h:271 [inline] rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:123 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x5c9/0x740 kernel/locking/lockdep.c:5408 rcu_lock_acquire include/linux/rcupdate.h:253 [inline] rcu_read_lock include/linux/rcupdate.h:642 [inline] dput+0x74/0xbc0 fs/dcache.c:864 handle_mounts fs/namei.c:1389 [inline] step_into+0xd7c/0x1bd0 fs/namei.c:1691 walk_component+0x171/0x6a0 fs/namei.c:1867 lookup_last fs/namei.c:2310 [inline] path_lookupat+0x1ba/0x830 fs/namei.c:2334 filename_lookup+0x19f/0x560 fs/namei.c:2367 user_path_at include/linux/namei.h:59 [inline] do_faccessat+0x129/0x820 fs/open.c:423 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f5c9ac1b9c7 Code: 83 c4 08 48 3d 01 f0 ff ff 73 01 c3 48 8b 0d c8 d4 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 15 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 d4 2b 00 f7 d8 64 89 01 48 RSP: 002b:00007fff83d8b918 EFLAGS: 00000246 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 000055971c57af90 RCX: 00007f5c9ac1b9c7 RDX: 00007fff83d8b948 RSI: 0000000000000000 RDI: 00007fff83d8b920 RBP: 00007fff83d8b990 R08: 0000000000004d00 R09: 7269762f73656369 R10: 0000000000000020 R11: 0000000000000246 R12: 000055971aa42856 R13: 000055971c564600 R14: 00007fff83d8b920 R15: 000055971c563930