================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor.4/9046 [HC0[0]:SC0[0]:HE0:SE1] takes: ffff888027553418 (&ctx->timeout_lock){?.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] ffff888027553418 (&ctx->timeout_lock){?.-.}-{2:2}, at: io_poll_remove_all+0x50/0x235 fs/io_uring.c:5702 {IN-HARDIRQ-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5637 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 io_timeout_fn+0x6f/0x360 fs/io_uring.c:5943 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x609/0xe50 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline] __sysvec_apic_timer_interrupt+0x146/0x530 arch/x86/kernel/apic/apic.c:1103 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 lock_acquire+0x1ef/0x510 kernel/locking/lockdep.c:5605 rcu_lock_acquire include/linux/rcupdate.h:268 [inline] rcu_read_lock include/linux/rcupdate.h:688 [inline] __d_lookup+0xa8/0x720 fs/dcache.c:2421 lookup_fast+0x2c7/0x6d0 fs/namei.c:1615 walk_component+0xcf/0x6a0 fs/namei.c:1966 link_path_walk.part.0+0x757/0xd00 fs/namei.c:2297 link_path_walk fs/namei.c:2221 [inline] path_lookupat+0xc8/0x860 fs/namei.c:2448 filename_lookup+0x1c6/0x590 fs/namei.c:2478 user_path_at_empty+0x42/0x60 fs/namei.c:2801 do_readlinkat+0xcd/0x2f0 fs/stat.c:443 __do_sys_readlinkat fs/stat.c:470 [inline] __se_sys_readlinkat fs/stat.c:467 [inline] __x64_sys_readlinkat+0x93/0xf0 fs/stat.c:467 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae irq event stamp: 5882 hardirqs last enabled at (5881): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (5881): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (5882): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (5882): [] _raw_spin_lock_irq+0x41/0x50 kernel/locking/spinlock.c:170 softirqs last enabled at (5822): [] read_pnet include/net/net_namespace.h:327 [inline] softirqs last enabled at (5822): [] sock_net include/net/sock.h:2658 [inline] softirqs last enabled at (5822): [] unix_create1+0x47c/0x5c0 net/unix/af_unix.c:893 softirqs last disabled at (5820): [] unix_sockets_unbound net/unix/af_unix.c:134 [inline] softirqs last disabled at (5820): [] unix_create1+0x3f9/0x5c0 net/unix/af_unix.c:890 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.4/9046: #0: ffff8880275533d8 (&ctx->completion_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #0: ffff8880275533d8 (&ctx->completion_lock){+.+.}-{2:2}, at: io_poll_remove_all+0x48/0x235 fs/io_uring.c:5701 #1: ffff888027553418 (&ctx->timeout_lock){?.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #1: ffff888027553418 (&ctx->timeout_lock){?.-.}-{2:2}, at: io_poll_remove_all+0x50/0x235 fs/io_uring.c:5702 stack backtrace: CPU: 1 PID: 9046 Comm: syz-executor.4 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+0xcd/0x134 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:203 [inline] valid_state kernel/locking/lockdep.c:3945 [inline] mark_lock_irq kernel/locking/lockdep.c:4148 [inline] mark_lock.cold+0x61/0x8e kernel/locking/lockdep.c:4605 mark_held_locks+0x9f/0xe0 kernel/locking/lockdep.c:4206 __trace_hardirqs_on_caller kernel/locking/lockdep.c:4224 [inline] lockdep_hardirqs_on_prepare kernel/locking/lockdep.c:4292 [inline] lockdep_hardirqs_on_prepare+0x135/0x400 kernel/locking/lockdep.c:4244 trace_hardirqs_on+0x5b/0x1c0 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 fs/io_uring.c:5654 [inline] io_poll_remove_one+0x236/0x870 fs/io_uring.c:5680 io_poll_remove_all+0x1af/0x235 fs/io_uring.c:5709 io_ring_ctx_wait_and_kill+0x1cc/0x322 fs/io_uring.c:9534 io_uring_release+0x42/0x46 fs/io_uring.c:9554 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f5a33badb32 Code: 00 00 00 00 00 0f 1f 00 41 f7 c1 ff 0f 00 00 75 27 55 48 89 fd 53 89 cb 48 85 ff 74 3b 41 89 da 48 89 ef b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 66 5b 5d c3 0f 1f 00 48 c7 c0 bc ff ff ff 64 RSP: 002b:00007f5a311230f8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 RAX: 0000000020ffd000 RBX: 0000000000008011 RCX: 00007f5a33badb32 RDX: 0000000000000003 RSI: 0000000000080000 RDI: 0000000020ffd000 RBP: 0000000020ffd000 R08: 0000000000000003 R09: 0000000010000000 R10: 0000000000008011 R11: 0000000000000206 R12: 0000000020000140 R13: 0000000020ffd000 R14: 0000000020000100 R15: 0000000020002000