FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
5.18.0-rc5-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/17833 is trying to acquire lock:
ffffffff8bc8dd00 (console_owner){-.-.}-{0:0}, at: console_unlock+0x35e/0xdd0 kernel/printk/printk.c:2770
but task is already holding lock:
ffff888022caa158 (&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:306
tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:48
serial8250_tx_chars+0x4f3/0xa50 drivers/tty/serial/8250/8250_port.c:1866
serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1953
serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1926 [inline]
serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1970
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:817
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:636
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:645
native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
default_idle+0xb/0x10 arch/x86/kernel/process.c:733
default_idle_call+0x87/0xd0 kernel/sched/idle.c:109
cpuidle_idle_call kernel/sched/idle.c:191 [inline]
do_idle+0x401/0x590 kernel/sched/idle.c:303
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:400
start_secondary+0x224/0x2c0 arch/x86/kernel/smpboot.c:266
secondary_startup_64_no_verify+0xc3/0xcb
-> #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+0x9cb/0xc30 drivers/tty/serial/8250/8250_port.c:3358
call_console_drivers kernel/printk/printk.c:1952 [inline]
console_unlock+0x9bc/0xdd0 kernel/printk/printk.c:2774
vprintk_emit+0x1b4/0x5f0 kernel/printk/printk.c:2272
vprintk+0x80/0x90 kernel/printk/printk_safe.c:50
_printk+0xba/0xed kernel/printk/printk.c:2293
register_console kernel/printk/printk.c:3131 [inline]
register_console+0x410/0x7c0 kernel/printk/printk.c:3012
univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:679
console_init+0x3c1/0x58d kernel/printk/printk.c:3231
start_kernel+0x30b/0x4a0 init/main.c:1068
secondary_startup_64_no_verify+0xc3/0xcb
-> #0 (console_owner){-.-.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3065 [inline]
check_prevs_add kernel/locking/lockdep.c:3188 [inline]
validate_chain kernel/locking/lockdep.c:3803 [inline]
__lock_acquire+0x2ac6/0x56c0 kernel/locking/lockdep.c:5029
lock_acquire kernel/locking/lockdep.c:5641 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606
console_lock_spinning_enable kernel/printk/printk.c:1794 [inline]
console_unlock+0x3b1/0xdd0 kernel/printk/printk.c:2771
vprintk_emit+0x1b4/0x5f0 kernel/printk/printk.c:2272
vprintk+0x80/0x90 kernel/printk/printk_safe.c:50
_printk+0xba/0xed kernel/printk/printk.c:2293
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:1313
slab_pre_alloc_hook mm/slab.h:724 [inline]
slab_alloc mm/slab.c:3299 [inline]
__do_kmalloc mm/slab.c:3708 [inline]
__kmalloc+0x7b/0x4d0 mm/slab.c:3719
kmalloc include/linux/slab.h:586 [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+0x8c/0x240 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
tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3144
__process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:711
process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:794
n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1771
tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365
set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438
set_termios drivers/tty/tty_ioctl.c:392 [inline]
tty_mode_ioctl+0x87c/0xe50 drivers/tty/tty_ioctl.c:724
n_tty_ioctl_helper+0x48/0x2d0 drivers/tty/tty_ioctl.c:903
n_tty_ioctl+0x4b/0x360 drivers/tty/n_tty.c:2381
tty_ioctl+0xc57/0x15e0 drivers/tty/tty_io.c:2787
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
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 ***
6 locks held by syz-executor.1/17833:
#0: ffff888000775098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
#1: ffff8880007752e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: tty_set_termios+0xfe/0x910 drivers/tty/tty_ioctl.c:352
#2: ffff888000775098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:264
#3: ffffc900049bf378 (&ldata->output_lock){+.+.}-{3:3}, at: process_echoes+0xaf/0x1c0 drivers/tty/n_tty.c:792
#4: ffff888022caa158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0 drivers/tty/pty.c:120
#5: ffffffff8bd6e140 (console_lock){+.+.}-{0:0}, at: vprintk+0x80/0x90 kernel/printk/printk_safe.c:50
stack backtrace:
CPU: 0 PID: 17833 Comm: syz-executor.1 Not tainted 5.18.0-rc5-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
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:2145
check_prev_add kernel/locking/lockdep.c:3065 [inline]
check_prevs_add kernel/locking/lockdep.c:3188 [inline]
validate_chain kernel/locking/lockdep.c:3803 [inline]
__lock_acquire+0x2ac6/0x56c0 kernel/locking/lockdep.c:5029
lock_acquire kernel/locking/lockdep.c:5641 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606
console_lock_spinning_enable kernel/printk/printk.c:1794 [inline]
console_unlock+0x3b1/0xdd0 kernel/printk/printk.c:2771
vprintk_emit+0x1b4/0x5f0 kernel/printk/printk.c:2272
vprintk+0x80/0x90 kernel/printk/printk_safe.c:50
_printk+0xba/0xed kernel/printk/printk.c:2293
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:1313
slab_pre_alloc_hook mm/slab.h:724 [inline]
slab_alloc mm/slab.c:3299 [inline]
__do_kmalloc mm/slab.c:3708 [inline]
__kmalloc+0x7b/0x4d0 mm/slab.c:3719
kmalloc include/linux/slab.h:586 [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+0x8c/0x240 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
tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3144
__process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:711
process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:794
n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1771
tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365
set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438
set_termios drivers/tty/tty_ioctl.c:392 [inline]
tty_mode_ioctl+0x87c/0xe50 drivers/tty/tty_ioctl.c:724
n_tty_ioctl_helper+0x48/0x2d0 drivers/tty/tty_ioctl.c:903
n_tty_ioctl+0x4b/0x360 drivers/tty/n_tty.c:2381
tty_ioctl+0xc57/0x15e0 drivers/tty/tty_io.c:2787
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
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:0x7f269ac890e9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f269be1d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f269ad9c030 RCX: 00007f269ac890e9
RDX: 0000000020000000 RSI: 0000000000005402 RDI: 0000000000000004
RBP: 00007f269be1d1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffec203b9df R14: 00007f269be1d300 R15: 0000000000022000
CPU: 0 PID: 17833 Comm: syz-executor.1 Not tainted 5.18.0-rc5-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
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:1313
slab_pre_alloc_hook mm/slab.h:724 [inline]
slab_alloc mm/slab.c:3299 [inline]
__do_kmalloc mm/slab.c:3708 [inline]
__kmalloc+0x7b/0x4d0 mm/slab.c:3719
kmalloc include/linux/slab.h:586 [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+0x8c/0x240 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
tty_put_char+0x122/0x150 drivers/tty/tty_io.c:3144
__process_echoes+0x577/0x9f0 drivers/tty/n_tty.c:711
process_echoes+0xf9/0x1c0 drivers/tty/n_tty.c:794
n_tty_set_termios+0x71d/0x1010 drivers/tty/n_tty.c:1771
tty_set_termios+0x650/0x910 drivers/tty/tty_ioctl.c:365
set_termios.part.0+0x30e/0x530 drivers/tty/tty_ioctl.c:438
set_termios drivers/tty/tty_ioctl.c:392 [inline]
tty_mode_ioctl+0x87c/0xe50 drivers/tty/tty_ioctl.c:724
n_tty_ioctl_helper+0x48/0x2d0 drivers/tty/tty_ioctl.c:903
n_tty_ioctl+0x4b/0x360 drivers/tty/n_tty.c:2381
tty_ioctl+0xc57/0x15e0 drivers/tty/tty_io.c:2787
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
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:0x7f269ac890e9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f269be1d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f269ad9c030 RCX: 00007f269ac890e9
RDX: 0000000020000000 RSI: 0000000000005402 RDI: 0000000000000004
RBP: 00007f269be1d1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffec203b9df R14: 00007f269be1d300 R15: 0000000000022000