FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 ====================================================== WARNING: possible circular locking dependency detected 5.16.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/10603 is trying to acquire lock: ffffffff8ba93f00 (console_owner){-.-.}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:1850 [inline] ffffffff8ba93f00 (console_owner){-.-.}-{0:0}, at: vprintk_emit+0x29b/0x4f0 kernel/printk/printk.c:2243 but task is already holding lock: ffff888076903158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 drivers/tty/pty.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&port->lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 tty_port_tty_get+0x1f/0x100 drivers/tty/tty_port.c:305 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:48 serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1845 serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1932 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1905 [inline] serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1949 serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x22b/0x880 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xa7/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x25f/0xd00 kernel/irq/chip.c:820 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0x9d/0x210 arch/x86/kernel/irq.c:250 common_interrupt+0x4d/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629 ffs arch/x86/include/asm/bitops.h:297 [inline] __do_softirq+0x196/0x9c2 kernel/softirq.c:546 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:404 [inline] uart_write+0x30d/0x570 drivers/tty/serial/serial_core.c:598 process_output_block drivers/tty/n_tty.c:581 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2250 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 redirected_tty_write+0xa1/0xc0 drivers/tty/tty_io.c:1116 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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 -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 serial8250_console_write+0xb11/0xe90 drivers/tty/serial/8250/8250_port.c:3387 call_console_drivers kernel/printk/printk.c:1928 [inline] console_unlock+0x7a9/0xb70 kernel/printk/printk.c:2710 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2244 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2265 register_console kernel/printk/printk.c:3063 [inline] register_console+0x410/0x7c0 kernel/printk/printk.c:2944 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:679 console_init+0x3c1/0x58d kernel/printk/printk.c:3163 start_kernel+0x30b/0x49b init/main.c:1064 secondary_startup_64_no_verify+0xc3/0xcb -> #0 (console_owner){-.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3063 [inline] check_prevs_add kernel/locking/lockdep.c:3186 [inline] validate_chain kernel/locking/lockdep.c:3801 [inline] __lock_acquire+0x2a2c/0x5470 kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 console_trylock_spinning kernel/printk/printk.c:1871 [inline] vprintk_emit+0x2d8/0x4f0 kernel/printk/printk.c:2243 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2265 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1304 slab_pre_alloc_hook mm/slab.h:707 [inline] slab_alloc_node mm/slub.c:3144 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x72/0x340 mm/slub.c:4420 kmalloc include/linux/slab.h:587 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:178 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:274 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:41 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 process_output_block drivers/tty/n_tty.c:581 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2250 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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 other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &port->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port->lock); lock(&port_lock_key); lock(&port->lock); lock(console_owner); *** DEADLOCK *** 5 locks held by syz-executor.0/10603: #0: ffff888074310098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244 #1: ffff888074310130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_write_lock drivers/tty/tty_io.c:950 [inline] #1: ffff888074310130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: do_tty_write drivers/tty/tty_io.c:973 [inline] #1: ffff888074310130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: file_tty_write.constprop.0+0x29f/0x910 drivers/tty/tty_io.c:1095 #2: ffff8880743102e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: n_tty_write+0x1bf/0xfd0 drivers/tty/n_tty.c:2233 #3: ffffc900053c3378 (&ldata->output_lock){+.+.}-{3:3}, at: process_output_block drivers/tty/n_tty.c:536 [inline] #3: ffffc900053c3378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_write+0x53c/0xfd0 drivers/tty/n_tty.c:2250 #4: ffff888076903158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 drivers/tty/pty.c:120 stack backtrace: CPU: 0 PID: 10603 Comm: syz-executor.0 Not tainted 5.16.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:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2143 check_prev_add kernel/locking/lockdep.c:3063 [inline] check_prevs_add kernel/locking/lockdep.c:3186 [inline] validate_chain kernel/locking/lockdep.c:3801 [inline] __lock_acquire+0x2a2c/0x5470 kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 console_trylock_spinning kernel/printk/printk.c:1871 [inline] vprintk_emit+0x2d8/0x4f0 kernel/printk/printk.c:2243 vprintk+0x80/0x90 kernel/printk/printk_safe.c:50 _printk+0xba/0xed kernel/printk/printk.c:2265 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x472/0x5a0 lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1304 slab_pre_alloc_hook mm/slab.h:707 [inline] slab_alloc_node mm/slub.c:3144 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x72/0x340 mm/slub.c:4420 kmalloc include/linux/slab.h:587 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:178 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:274 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:41 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 process_output_block drivers/tty/n_tty.c:581 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2250 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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:0x7f9111ee5fe9 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:00007f911085b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9111ff8f60 RCX: 00007f9111ee5fe9 RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f911085b1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc0e0535df R14: 00007f911085b300 R15: 0000000000022000 CPU: 0 PID: 10603 Comm: syz-executor.0 Not tainted 5.16.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:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1304 slab_pre_alloc_hook mm/slab.h:707 [inline] slab_alloc_node mm/slub.c:3144 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x72/0x340 mm/slub.c:4420 kmalloc include/linux/slab.h:587 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:178 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:274 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:321 tty_insert_flip_string include/linux/tty_flip.h:41 [inline] pty_write+0x11c/0x1e0 drivers/tty/pty.c:122 process_output_block drivers/tty/n_tty.c:581 [inline] n_tty_write+0x410/0xfd0 drivers/tty/n_tty.c:2250 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write.constprop.0+0x526/0x910 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2086 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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:0x7f9111ee5fe9 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:00007f911085b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9111ff8f60 RCX: 00007f9111ee5fe9 RDX: 00000000fffffedf RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f911085b1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc0e0535df R14: 00007f911085b300 R15: 0000000000022000