================================
WARNING: inconsistent lock state
5.16.0-rc2-syzkaller #0 Not tainted
--------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
syz-executor.2/11477 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffff888086a34418 (&ctx->timeout_lock){?.+.}-{2:2}, at: io_timeout_fn+0x6a/0x220 fs/io_uring.c:5943
{HARDIRQ-ON-W} state was registered at:
  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
irq event stamp: 842
hardirqs last  enabled at (841): [<ffffffff8a14945f>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (841): [<ffffffff8a14945f>] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202
hardirqs last disabled at (842): [<ffffffff8a11e17a>] sysvec_apic_timer_interrupt+0xa/0xb0 arch/x86/kernel/apic/apic.c:1097
softirqs last  enabled at (788): [<ffffffff8820bbc5>] local_bh_enable+0x5/0x20 include/linux/bottom_half.h:32
softirqs last disabled at (782): [<ffffffff8820bba5>] local_bh_disable+0x5/0x20 include/linux/bottom_half.h:19

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&ctx->timeout_lock);
  <Interrupt>
    lock(&ctx->timeout_lock);

 *** DEADLOCK ***

1 lock held by syz-executor.2/11477:
 #0: ffff888086a340a8 (&ctx->uring_lock){+.+.}-{3:3}, at: tctx_task_work+0x2e5/0x560 fs/io_uring.c:2203

stack backtrace:
CPU: 1 PID: 11477 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:
 <IRQ>
 __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_usage kernel/locking/lockdep.c:4497 [inline]
 __lock_acquire+0xbf5/0x2b00 kernel/locking/lockdep.c:4981
 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
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x12/0x20
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: 71 54 fd ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 5e 75 51 f7 48 89 df e8 66 26 53 f7 e8 21 7f 76 f7 fb bf 01 00 00 00 <e8> 46 81 45 f7 65 8b 05 57 db ed 75 85 c0 74 02 5b c3 e8 dc c2 eb
RSP: 0018:ffffc9001d1074f0 EFLAGS: 00000286
RAX: 892a7ffd13715e00 RBX: ffff888086a34400 RCX: ffffffff81665fb1
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffc9001d107d40 R08: dffffc0000000000 R09: fffffbfff1ff33fd
R10: fffffbfff1ff33fd R11: 0000000000000000 R12: 0000000000000000
R13: 1ffff92003a20ebc R14: ffff8880713e9a88 R15: 0000000000000000
 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
 tctx_task_work+0x355/0x560 fs/io_uring.c:2206
 task_work_run+0x146/0x1c0 kernel/task_work.c:164
 tracehook_notify_signal include/linux/tracehook.h:214 [inline]
 handle_signal_work kernel/entry/common.c:146 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x180/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:0x7f59d06feae9
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:00007f59cdc74188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: 0000000000000002 RBX: 00007f59d0811f60 RCX: 00007f59d06feae9
RDX: 0000000000000000 RSI: 0000000000004510 RDI: 0000000000000003
RBP: 00007f59d0758f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffced096b2f R14: 00007f59cdc74300 R15: 0000000000022000
 </TASK>
----------------
Code disassembly (best guess):
   0:	71 54                	jno    0x56
   2:	fd                   	std
   3:	ff 90 53 48 89 fb    	callq  *-0x476b7ad(%rax)
   9:	48 83 c7 18          	add    $0x18,%rdi
   d:	48 8b 74 24 08       	mov    0x8(%rsp),%rsi
  12:	e8 5e 75 51 f7       	callq  0xf7517575
  17:	48 89 df             	mov    %rbx,%rdi
  1a:	e8 66 26 53 f7       	callq  0xf7532685
  1f:	e8 21 7f 76 f7       	callq  0xf7767f45
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 46 81 45 f7       	callq  0xf7458175 <-- trapping instruction
  2f:	65 8b 05 57 db ed 75 	mov    %gs:0x75eddb57(%rip),%eax        # 0x75eddb8d
  36:	85 c0                	test   %eax,%eax
  38:	74 02                	je     0x3c
  3a:	5b                   	pop    %rbx
  3b:	c3                   	retq
  3c:	e8                   	.byte 0xe8
  3d:	dc c2                	fadd   %st,%st(2)
  3f:	eb                   	.byte 0xeb