================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.4/27053 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff88802a2132a8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff88802a2132a8 (&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+0x3552/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: 3292 hardirqs last enabled at (3292): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (3292): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (3291): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3291): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (3148): [] asm_call_irq_on_stack+0xf/0x20 softirqs last disabled at (3155): [] 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 *** 7 locks held by syz-executor.4/27053: #0: ffff88801aea5098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:266 #1: ffff88801aea5130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:887 [inline] #1: ffff88801aea5130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:910 [inline] #1: ffff88801aea5130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write+0x27f/0x8b0 drivers/tty/tty_io.c:1045 #2: ffff88801aea52e8 (&tty->termios_rwsem){++++}-{3:3}, at: n_tty_write+0x1bf/0xfd0 drivers/tty/n_tty.c:2318 #3: ffffc90000f48378 (&ldata->output_lock){+.+.}-{3:3}, at: process_output_block drivers/tty/n_tty.c:551 [inline] #3: ffffc90000f48378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x53c/0xfd0 drivers/tty/n_tty.c:2335 #4: ffffffff8b77a9e0 (console_lock){+.+.}-{0:0}, at: do_con_write+0x10f/0x1e90 drivers/tty/vt/vt.c:2868 #5: ffffffff8b78e000 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #5: ffffffff8b78e000 (rcu_callback){....}-{0:0}, at: rcu_core+0x6f4/0xf80 kernel/rcu/tree.c:2723 #6: ffffffff8b78e120 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x290 include/linux/cgroup.h:576 stack backtrace: CPU: 1 PID: 27053 Comm: syz-executor.4 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:slow_down_io arch/x86/include/asm/paravirt.h:42 [inline] RIP: 0010:inb_p arch/x86/include/asm/io.h:334 [inline] RIP: 0010:vga_io_r include/video/vga.h:204 [inline] RIP: 0010:vga_io_rgfx include/video/vga.h:389 [inline] RIP: 0010:setcolor drivers/video/fbdev/vga16fb.c:170 [inline] RIP: 0010:vga_imageblit_expand drivers/video/fbdev/vga16fb.c:1164 [inline] RIP: 0010:vga16fb_imageblit+0x93b/0x2210 drivers/video/fbdev/vga16fb.c:1260 Code: c7 c2 98 b8 5e 8b 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 b2 15 00 00 ff 15 d3 ae 6c 07 ba cf 03 00 00 ec <48> c7 c2 98 b8 5e 8b 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 RSP: 0018:ffffc9000fae73f0 EFLAGS: 00000246 RAX: dffffc00000000ff RBX: 0000000000000007 RCX: ffffc90011a76000 RDX: 00000000000003cf RSI: ffffffff83f207f2 RDI: ffffc9000fae7588 RBP: ffffc9000fae757c R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff83f207e5 R11: 0000000000000001 R12: ffffffff81301bd0 R13: ffff888017c58440 R14: ffffc9000fae7598 R15: ffffc9000fae7578 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:139 [inline] bit_putcs+0x6e1/0xd20 drivers/video/fbdev/core/bitblit.c:188 fbcon_putcs+0x35a/0x450 drivers/video/fbdev/core/fbcon.c:1304 fbcon_redraw.constprop.0+0x41a/0x4a0 drivers/video/fbdev/core/fbcon.c:1677 fbcon_scroll+0x1d4c/0x3540 drivers/video/fbdev/core/fbcon.c:1787 con_scroll+0x5b9/0x6d0 drivers/tty/vt/vt.c:630 lf+0x26b/0x2c0 drivers/tty/vt/vt.c:1490 vc_con_write_normal drivers/tty/vt/vt.c:2811 [inline] do_con_write+0xf5b/0x1e90 drivers/tty/vt/vt.c:2915 con_write+0x21/0x40 drivers/tty/vt/vt.c:3255 process_output_block drivers/tty/n_tty.c:596 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2335 do_tty_write drivers/tty/tty_io.c:961 [inline] tty_write+0x512/0x8b0 drivers/tty/tty_io.c:1045 do_loop_readv_writev fs/read_write.c:764 [inline] do_loop_readv_writev fs/read_write.c:748 [inline] do_iter_write+0x489/0x670 fs/read_write.c:868 vfs_writev+0x1aa/0x660 fs/read_write.c:939 do_writev+0x139/0x300 fs/read_write.c:982 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e149 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fab26e7cc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e149 RDX: 0000000000000001 RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 000000000119bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00000000016afb7f R14: 00007fab26e7d9c0 R15: 000000000119bf8c