================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. systemd-udevd/4905 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888012e0d2a8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888012e0d2a8 (&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+0x338f/0x4080 fs/io_uring.c:9755 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x56/0x80 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c irq event stamp: 17853472 hardirqs last enabled at (17853472): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (17853472): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (17853471): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (17853471): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (17853120): [] memcpy include/linux/string.h:399 [inline] softirqs last enabled at (17853120): [] fpu__copy+0x16c/0x660 arch/x86/kernel/fpu/core.c:240 softirqs last disabled at (17853439): [] 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/4905: #0: ffff88801a97a458 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801a97a458 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x25f/0xc50 arch/x86/mm/fault.c:1334 #1: ffffffff8b33a060 (rcu_read_lock){....}-{1:2}, at: maybe_unlock_mmap_for_io mm/internal.h:425 [inline] #1: ffffffff8b33a060 (rcu_read_lock){....}-{1:2}, at: count_memcg_event_mm.part.0+0x0/0x280 mm/memory.c:2770 #2: ffffffff8b339f40 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #2: ffffffff8b339f40 (rcu_callback){....}-{0:0}, at: rcu_core+0x582/0xf00 kernel/rcu/tree.c:2723 #3: ffffffff8b33a060 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x250 net/netfilter/xt_cgroup.c:62 stack backtrace: CPU: 1 PID: 4905 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:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline] RIP: 0010:lock_acquire kernel/locking/lockdep.c:5440 [inline] RIP: 0010:lock_acquire+0x2c7/0x740 kernel/locking/lockdep.c:5402 Code: 48 c7 c7 80 69 4b 89 48 83 c4 20 e8 b3 14 95 07 b8 ff ff ff ff 65 0f c1 05 16 4e ab 7e 83 f8 01 0f 85 36 03 00 00 ff 34 24 9d 3a fe ff ff 65 ff 05 7d 3c ab 7e 48 8b 05 d6 cd 82 0b e8 d1 09 RSP: 0000:ffffc9000164fc50 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 1ffff920002c9f8c RCX: 0000000000000001 RDX: 1ffff11003651b38 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ebc27a7 R10: fffffbfff1d784f4 R11: 0000000000000000 R12: 0000000000000002 R13: ffffffff8b33a060 R14: 0000000000000000 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:253 [inline] rcu_read_lock include/linux/rcupdate.h:642 [inline] count_memcg_event_mm.part.0+0x3b/0x280 include/linux/memcontrol.h:1019 count_memcg_event_mm include/linux/memcontrol.h:523 [inline] handle_mm_fault+0x11d/0x5640 mm/memory.c:4598 do_user_addr_fault+0x570/0xc50 arch/x86/mm/fault.c:1393 handle_page_fault arch/x86/mm/fault.c:1450 [inline] exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1506 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 RIP: 0033:0x7f54ecfe70fd Code: 3b 74 24 18 0f 86 2b fe ff ff 48 89 f1 4b 8d 04 26 48 89 f2 4c 29 e1 48 81 f9 ff 03 00 00 49 89 47 68 49 89 47 70 49 89 47 60 <4c> 89 68 10 4c 89 68 18 76 10 48 c7 40 20 00 00 00 00 48 c7 40 28 RSP: 002b:00007ffc15227070 EFLAGS: 00010293 RAX: 000056087106d090 RBX: 00007f54ed307b58 RCX: 00000000000000a0 RDX: 00000000000000e0 RSI: 00000000000000e0 RDI: 0000000000000077 RBP: 0000000000002710 R08: 00007f54ee1d68c0 R09: 0000000000000040 R10: 00007f54ee1d6b90 R11: 0000000000000246 R12: 0000000000000040 R13: 00007f54ed307b58 R14: 000056087106d050 R15: 00007f54ed307b00