should_failslab+0x5/0x10
kmem_cache_alloc+0x5b/0x480
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-20220401 #1 Not tainted
------------------------------------------------------
syz-executor.2/5787 is trying to acquire lock:
ffffffff85115160 (console_owner){..-.}-{0:0}, at: vprintk_emit+0x316/0x550
but task is already holding lock:
ffff888010006958 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
getname_flags.part.0+0x50/0x4f0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2
__x64_sys_mkdirat+0xff/0x170
(&port->lock
do_syscall_64+0x3b/0x90
){-.-.}-{2:2}:
entry_SYSCALL_64_after_hwframe+0x44/0xae
_raw_spin_lock_irqsave+0x39/0x50
RIP: 0033:0x7fa231396b19
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:00007fa22e90c188 EFLAGS: 00000246
tty_port_tty_get+0x1f/0x100
ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fa2314a9f60 RCX: 00007fa231396b19
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 00007fa22e90c1d0 R08: 0000000000000000 R09: 0000000000000000
tty_port_default_wakeup+0x11/0x40
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe5f24d04f R14: 00007fa22e90c300 R15: 0000000000022000
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
default_idle+0xb/0x10
default_idle_call+0x87/0xd0
do_idle+0x3b9/0x530
cpu_startup_entry+0x14/0x20
secondary_startup_64_no_verify+0xd5/0xdb
-> #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
vprintk_emit+0x353/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_put_char+0x129/0x150
__process_echoes+0x57c/0x9f0
n_tty_receive_buf_common+0x1660/0x4720
tty_ioctl+0x514/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.2/5787:
#0: ffff888041fe2098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80
#1: ffff8880100060b8 (&port->buf.lock/1){+.+.}-{3:3}, at: tty_ioctl+0x4a7/0x1700
#2: ffff888041fe22e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: isig+0x37d/0x430
#3: ffffc90002dcb378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_receive_buf_common+0x162b/0x4720
#4: ffff888010006958 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
stack backtrace:
CPU: 1 PID: 5787 Comm: syz-executor.2 Not tainted 5.17.0-next-20220401 #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
vprintk_emit+0x353/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_put_char+0x129/0x150
__process_echoes+0x57c/0x9f0
n_tty_receive_buf_common+0x1660/0x4720
tty_ioctl+0x514/0x1700
__x64_sys_ioctl+0x196/0x210
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fefda024b19
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:00007fefd759a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fefda137f60 RCX: 00007fefda024b19
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007fefd759a1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffbd81742f R14: 00007fefd759a300 R15: 0000000000022000
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 5787 Comm: syz-executor.2 Not tainted 5.17.0-next-20220401 #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_put_char+0x129/0x150
__process_echoes+0x57c/0x9f0
n_tty_receive_buf_common+0x1660/0x4720
tty_ioctl+0x514/0x1700
__x64_sys_ioctl+0x196/0x210
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fefda024b19
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:00007fefd759a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fefda137f60 RCX: 00007fefda024b19
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007fefd759a1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffbd81742f R14: 00007fefd759a300 R15: 0000000000022000
CPU: 0 PID: 5793 Comm: syz-executor.5 Not tainted 5.17.0-next-20220401 #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
kmem_cache_alloc+0x5b/0x480
getname_flags.part.0+0x50/0x4f0
__x64_sys_mkdirat+0xff/0x170
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f3acbf05b19
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:00007f3ac945a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f3acc019020 RCX: 00007f3acbf05b19
RDX: 0000000000000000 RSI: 0000000020000080 RDI: ffffffffffffffff
RBP: 00007f3ac945a1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffde54ea7ef R14: 00007f3ac945a300 R15: 0000000000022000
loop3: detected capacity change from 0 to 264192
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 5803 Comm: syz-executor.3 Not tainted 5.17.0-next-20220401 #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
kmem_cache_alloc+0x5b/0x480
create_object.isra.0+0x3a/0xa20
kmem_cache_alloc+0x239/0x480
getname_flags.part.0+0x50/0x4f0
__x64_sys_mkdirat+0xff/0x170
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fa231396b19
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:00007fa22e90c188 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fa2314a9f60 RCX: 00007fa231396b19
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 00007fa22e90c1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe5f24d04f R14: 00007fa22e90c300 R15: 0000000000022000
loop7: detected capacity change from 0 to 1294