================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor.2/19756 [HC0[0]:SC0[0]:HE0:SE1] takes: ffff888014dea418 (&ctx->timeout_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] ffff888014dea418 (&ctx->timeout_lock){?...}-{2:2}, at: io_poll_remove_all+0x49/0x319 fs/io_uring.c:5702 {IN-HARDIRQ-W} state was registered at: lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5637 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 io_timeout_fn+0x6a/0x220 fs/io_uring.c:5943 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x3b3/0x1040 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline] __sysvec_apic_timer_interrupt+0xf9/0x270 arch/x86/kernel/apic/apic.c:1103 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:399 [inline] io_timeout fs/io_uring.c:6223 [inline] io_issue_sqe+0x581d/0x9830 fs/io_uring.c:6662 __io_queue_sqe+0x2d/0x780 fs/io_uring.c:6976 io_queue_sqe fs/io_uring.c:7018 [inline] io_submit_sqe fs/io_uring.c:7221 [inline] io_submit_sqes+0xffc/0xa7c0 fs/io_uring.c:7327 __do_sys_io_uring_enter fs/io_uring.c:10043 [inline] __se_sys_io_uring_enter+0x21f/0x1cb0 fs/io_uring.c:9985 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae irq event stamp: 3664 hardirqs last enabled at (3663): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (3663): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (3664): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (3664): [] _raw_spin_lock_irq+0xa9/0x110 kernel/locking/spinlock.c:170 softirqs last enabled at (2790): [] __irq_exit_rcu+0xec/0x170 kernel/softirq.c:636 softirqs last disabled at (2753): [] __irq_exit_rcu+0xec/0x170 kernel/softirq.c:636 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ctx->timeout_lock); lock(&ctx->timeout_lock); *** DEADLOCK *** 2 locks held by syz-executor.2/19756: #0: ffff888014dea3d8 (&ctx->completion_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #0: ffff888014dea3d8 (&ctx->completion_lock){+.+.}-{2:2}, at: io_poll_remove_all+0x38/0x319 fs/io_uring.c:5701 #1: ffff888014dea418 (&ctx->timeout_lock){?...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #1: ffff888014dea418 (&ctx->timeout_lock){?...}-{2:2}, at: io_poll_remove_all+0x49/0x319 fs/io_uring.c:5702 stack backtrace: CPU: 1 PID: 19756 Comm: syz-executor.2 Not tainted 5.16.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_usage_bug+0xa6d/0xea0 kernel/locking/lockdep.c:3933 mark_lock+0x168c/0x1e00 kernel/locking/lockdep.c:4605 mark_held_locks kernel/locking/lockdep.c:4206 [inline] __trace_hardirqs_on_caller kernel/locking/lockdep.c:4224 [inline] lockdep_hardirqs_on_prepare+0x26e/0x780 kernel/locking/lockdep.c:4292 trace_hardirqs_on+0x6f/0x80 kernel/trace/trace_preemptirq.c:49 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:399 [inline] __io_poll_remove_one fs/io_uring.c:5669 [inline] io_poll_remove_one+0x248/0x610 fs/io_uring.c:5680 io_poll_remove_all+0x24c/0x319 fs/io_uring.c:5709 io_uring_try_cancel_requests+0x320/0x42a fs/io_uring.c:9668 io_uring_cancel_generic+0x44f/0x661 fs/io_uring.c:9833 io_uring_files_cancel include/linux/io_uring.h:16 [inline] do_exit+0x281/0x24f0 kernel/exit.c:787 do_group_exit+0x168/0x2d0 kernel/exit.c:929 get_signal+0x1740/0x2120 kernel/signal.c:2852 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f637bb52ae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f63790c8218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f637bc65f68 RCX: 00007f637bb52ae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f637bc65f68 RBP: 00007f637bc65f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f637bc65f6c R13: 00007ffc4af40b0f R14: 00007f63790c8300 R15: 0000000000022000