================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.2/5240 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff888090108418 (&ctx->timeout_lock){?.+.}-{2:2}, at: io_timeout_fn+0x6f/0x360 fs/io_uring.c:5943 {HARDIRQ-ON-W} state was registered at: __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_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+0x256/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 irq event stamp: 11032 hardirqs last enabled at (11031): [] asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 hardirqs last disabled at (11032): [] sysvec_apic_timer_interrupt+0xb/0xc0 arch/x86/kernel/apic/apic.c:1097 softirqs last enabled at (10500): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (10500): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636 softirqs last disabled at (10329): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (10329): [] __irq_exit_rcu+0x123/0x180 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 *** 3 locks held by syz-executor.2/5240: #0: ffff88814741a360 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x7a/0x1070 drivers/block/loop.c:1106 #1: ffffffff8c4a8b68 (uevent_sock_mutex){+.+.}-{3:3}, at: kobject_uevent_env+0x873/0x1650 lib/kobject_uevent.c:586 #2: ffffffff8bcc76f8 (remove_cache_srcu){....}-{0:0}, at: kasan_quarantine_reduce+0x41/0x200 mm/kasan/quarantine.c:274 stack backtrace: CPU: 0 PID: 5240 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+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_usage kernel/locking/lockdep.c:4497 [inline] __lock_acquire+0x149d/0x54a0 kernel/locking/lockdep.c:4981 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 RIP: 0010:check_kcov_mode kernel/kcov.c:166 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x7/0x60 kernel/kcov.c:200 Code: 45 00 5d be 03 00 00 00 e9 36 c0 63 02 66 0f 1f 44 00 00 48 8b be b0 01 00 00 e8 b4 ff ff ff 31 c0 c3 90 65 8b 05 19 9d 8b 7e <89> c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b 14 25 40 70 02 00 a9 RSP: 0018:ffffc9000ab7f748 EFLAGS: 00000286 RAX: 0000000080000000 RBX: ffff88807e3cd140 RCX: 000000007e3cd140 RDX: 0000000000000000 RSI: ffff88801f6e2240 RDI: 0000000000000003 RBP: ffff8880fe3cd140 R08: ffff8880fe3cd140 R09: ffffffff8ff75a27 R10: ffffffff8134de0e R11: 000000000000003f R12: 000000007e3cd140 R13: dffffc0000000000 R14: ffffc9000ab7f7c0 R15: ffffea0000000000 phys_addr_valid arch/x86/mm/physaddr.h:7 [inline] __phys_addr+0x58/0x140 arch/x86/mm/physaddr.c:28 virt_to_head_page include/linux/mm.h:861 [inline] qlink_to_cache mm/kasan/quarantine.c:120 [inline] qlist_free_all+0xb8/0x110 mm/kasan/quarantine.c:162 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slab.c:3261 [inline] kmem_cache_alloc_node_trace+0x2ff/0x5b0 mm/slab.c:3617 __do_kmalloc_node mm/slab.c:3639 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3654 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1126 [inline] alloc_uevent_skb+0x7b/0x210 lib/kobject_uevent.c:290 uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:409 [inline] kobject_uevent_env+0xb09/0x1650 lib/kobject_uevent.c:593 disk_event_uevent+0x17b/0x1e0 block/disk-events.c:181 disk_force_media_change+0x1e/0xc0 block/disk-events.c:305 __loop_clr_fd+0x82d/0x1070 drivers/block/loop.c:1158 loop_clr_fd drivers/block/loop.c:1237 [inline] lo_ioctl+0x398/0x17c0 drivers/block/loop.c:1562 blkdev_ioctl+0x37a/0x800 block/ioctl.c:609 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 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 RIP: 0033:0x7fbc43c248a7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 04 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 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:00007fbc41178fa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000020003a80 RCX: 00007fbc43c248a7 RDX: 0000000000000000 RSI: 0000000000004c01 RDI: 0000000000000007 RBP: 00007fbc411796bc R08: 00007fbc41179040 R09: 0000000020003840 R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff R13: 000000000000000e R14: 00007fbc41179000 R15: 0000000020003ac0 ---------------- Code disassembly (best guess): 0: 45 00 5d be add %r11b,-0x42(%r13) 4: 03 00 add (%rax),%eax 6: 00 00 add %al,(%rax) 8: e9 36 c0 63 02 jmpq 0x263c043 d: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 13: 48 8b be b0 01 00 00 mov 0x1b0(%rsi),%rdi 1a: e8 b4 ff ff ff callq 0xffffffd3 1f: 31 c0 xor %eax,%eax 21: c3 retq 22: 90 nop 23: 65 8b 05 19 9d 8b 7e mov %gs:0x7e8b9d19(%rip),%eax # 0x7e8b9d43 * 2a: 89 c1 mov %eax,%ecx <-- trapping instruction 2c: 48 8b 34 24 mov (%rsp),%rsi 30: 81 e1 00 01 00 00 and $0x100,%ecx 36: 65 48 8b 14 25 40 70 mov %gs:0x27040,%rdx 3d: 02 00 3f: a9 .byte 0xa9