================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.1/12497 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff8880150e28a8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff8880150e28a8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x78/0x4d0 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x750 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+0x355e/0x41f0 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: 15946 hardirqs last enabled at (15946): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (15946): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (15945): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (15945): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (14848): [] memcpy include/linux/string.h:447 [inline] softirqs last enabled at (14848): [] fpu__copy+0x16c/0x690 arch/x86/kernel/fpu/core.c:240 softirqs last disabled at (15721): [] 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 *** 3 locks held by syz-executor.1/12497: #0: ffff88801edf18d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801edf18d8 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x25f/0xc60 arch/x86/mm/fault.c:1334 #1: ffffffff8b78df00 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #1: ffffffff8b78df00 (rcu_callback){....}-{0:0}, at: rcu_core+0x6f4/0xf80 kernel/rcu/tree.c:2723 #2: ffffffff8b78e020 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x290 include/linux/cgroup.h:576 stack backtrace: CPU: 0 PID: 12497 Comm: syz-executor.1 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:4413 [inline] valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.cold+0x56/0x73 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0x11b4/0x54b0 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x750 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+0x78/0x4d0 fs/io_uring.c:7361 percpu_ref_put_many.constprop.0+0x258/0x290 include/linux/percpu-refcount.h:322 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x75d/0xf80 kernel/rcu/tree.c:2723 __do_softirq+0x2bc/0xa77 kernel/softirq.c:343 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:226 [inline] __irq_exit_rcu+0x17f/0x200 kernel/softirq.c:420 irq_exit_rcu+0x5/0x20 kernel/softirq.c:432 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:maybe_unlock_mmap_for_io mm/internal.h:423 [inline] RIP: 0010:fault_dirty_shared_page+0x1ba/0x400 mm/memory.c:2770 Code: cd ff 48 8d 7b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 c0 74 08 3c 03 0f 8e c8 01 00 00 8b 6b 08 04 00 00 00 41 89 ed 41 83 e5 24 44 89 ee e8 c2 e2 cd ff 41 83 RSP: 0018:ffffc9000376fd20 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffffc9000376fde0 RCX: 0000000000000000 RDX: 1ffff920006edfbd RSI: ffffffff81a44692 RDI: ffffc9000376fde8 RBP: 0000000000000255 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff81a44676 R11: 0000000000000000 R12: ffff8880371938e0 R13: 0000000000000000 R14: ffff8880354b5988 R15: 0000000000000001 do_shared_fault mm/memory.c:4097 [inline] do_fault mm/memory.c:4149 [inline] handle_pte_fault mm/memory.c:4385 [inline] __handle_mm_fault mm/memory.c:4520 [inline] handle_mm_fault+0x321b/0x5760 mm/memory.c:4618 do_user_addr_fault+0x458/0xc60 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:0x4039d7 Code: 00 00 00 48 83 ec 08 48 8b 15 c5 19 2b 01 48 8b 05 b6 19 2b 01 48 39 d0 48 8d 8a 00 00 00 01 72 17 48 39 c8 73 12 48 8d 50 04 <89> 38 48 89 15 98 19 2b 01 48 83 c4 08 c3 48 89 c6 bf b0 2c 4d 00 RSP: 002b:00007ffeaf5b8590 EFLAGS: 00010287 RAX: 0000001b2ee23000 RBX: 0000000000000001 RCX: 0000001b2fe20000 RDX: 0000001b2ee23004 RSI: 0000000080000000 RDI: 000000005aa44241 RBP: 000000000119c008 R08: 0000000000000241 R09: 000000005aa44245 R10: 00007ffeaf5b8740 R11: 0000000000000246 R12: 00007fd4a64f5008 R13: 00000000000001d6 R14: 00007fd4a64f5000 R15: ffffffff87d9e485