FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
5.17.0-next-20220325 #1 Not tainted
------------------------------------------------------
syz-executor.0/17018 is trying to acquire lock:
ffffffff85115140 (console_owner){..-.}-{0:0}, at: console_unlock+0x34e/0xd40
but task is already holding lock:
ffff8880451d7158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
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+0x39/0x50
tty_port_tty_get+0x1f/0x100
tty_port_default_wakeup+0x11/0x40
serial8250_tx_chars+0x50b/0xa70
serial8250_handle_irq.part.0+0x3f1/0x4c0
serial8250_default_handle_irq+0xb8/0x230
serial8250_interrupt+0xf4/0x1a0
__handle_irq_event_percpu+0x20f/0x820
handle_irq_event+0xa7/0x1e0
handle_edge_irq+0x262/0xd10
__common_interrupt+0x92/0x1d0
common_interrupt+0x9f/0xc0
asm_common_interrupt+0x1e/0x40
_raw_spin_unlock_irqrestore+0x2e/0x50
uart_write+0x304/0x580
do_output_char+0x5e4/0x860
n_tty_write+0x4c9/0xfe0
file_tty_write.constprop.0+0x529/0x910
redirected_tty_write+0xa1/0xc0
do_iter_readv_writev+0x481/0x760
do_iter_write+0x18d/0x700
vfs_writev+0x1aa/0x630
do_writev+0x139/0x300
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
-> #1 (&port_lock_key){-.-.}-{2:2}:
_raw_spin_lock_irqsave+0x39/0x50
serial8250_console_write+0x90e/0xb20
console_unlock+0x8c7/0xd40
register_console+0x378/0x7d0
univ8250_console_init+0x3a/0x46
console_init+0x3c1/0x58d
start_kernel+0x301/0x4aa
secondary_startup_64_no_verify+0xd5/0xdb
-> #0 (console_owner){..-.}-{0:0}:
__lock_acquire+0x2c2f/0x6120
lock_acquire+0x1a2/0x4d0
console_unlock+0x3a1/0xd40
vprintk_emit+0x1b4/0x550
vprintk+0x80/0x90
_printk+0xba/0xed
should_fail+0x472/0x5a0
should_failslab+0x5/0x10
__kmalloc+0x72/0x440
tty_buffer_alloc+0x23f/0x2a0
__tty_buffer_request_room+0x156/0x2a0
tty_insert_flip_string_fixed_flag+0x91/0x240
pty_write+0x11c/0x1e0
tty_send_xchar+0x2f0/0x370
n_tty_ioctl_helper+0x179/0x2d0
n_tty_ioctl+0x4b/0x360
tty_ioctl+0x860/0x1700
__x64_sys_ioctl+0x196/0x210
do_syscall_64+0x3b/0x90
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/17018:
#0: ffff8880098ff098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80
#1: ffff8880098ff130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_send_xchar+0x1a6/0x370
#2: ffff8880098ff2e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: tty_send_xchar+0x1ef/0x370
#3: ffff8880451d7158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
#4: ffffffff851f5580 (console_lock){+.+.}-{0:0}, at: vprintk+0x80/0x90
stack backtrace:
CPU: 0 PID: 17018 Comm: syz-executor.0 Not tainted 5.17.0-next-20220325 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Call Trace:
dump_stack_lvl+0x8b/0xb3
check_noncircular+0x25f/0x2e0
__lock_acquire+0x2c2f/0x6120
lock_acquire+0x1a2/0x4d0
console_unlock+0x3a1/0xd40
vprintk_emit+0x1b4/0x550
vprintk+0x80/0x90
_printk+0xba/0xed
should_fail+0x472/0x5a0
should_failslab+0x5/0x10
__kmalloc+0x72/0x440
tty_buffer_alloc+0x23f/0x2a0
__tty_buffer_request_room+0x156/0x2a0
tty_insert_flip_string_fixed_flag+0x91/0x240
pty_write+0x11c/0x1e0
tty_send_xchar+0x2f0/0x370
n_tty_ioctl_helper+0x179/0x2d0
n_tty_ioctl+0x4b/0x360
tty_ioctl+0x860/0x1700
__x64_sys_ioctl+0x196/0x210
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fb39c0a4b19
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:00007fb39961a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb39c1b7f60 RCX: 00007fb39c0a4b19
RDX: 0000000000000003 RSI: 000000000000540a RDI: 0000000000000004
RBP: 00007fb39961a1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffedfaa08af R14: 00007fb39961a300 R15: 0000000000022000
CPU: 0 PID: 17018 Comm: syz-executor.0 Not tainted 5.17.0-next-20220325 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
Call Trace:
dump_stack_lvl+0x8b/0xb3
should_fail.cold+0x5/0xa
should_failslab+0x5/0x10
__kmalloc+0x72/0x440
tty_buffer_alloc+0x23f/0x2a0
__tty_buffer_request_room+0x156/0x2a0
tty_insert_flip_string_fixed_flag+0x91/0x240
pty_write+0x11c/0x1e0
tty_send_xchar+0x2f0/0x370
n_tty_ioctl_helper+0x179/0x2d0
n_tty_ioctl+0x4b/0x360
tty_ioctl+0x860/0x1700
__x64_sys_ioctl+0x196/0x210
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fb39c0a4b19
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:00007fb39961a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb39c1b7f60 RCX: 00007fb39c0a4b19
RDX: 0000000000000003 RSI: 000000000000540a RDI: 0000000000000004
RBP: 00007fb39961a1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffedfaa08af R14: 00007fb39961a300 R15: 0000000000022000
FAT-fs (loop6): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1)