R13: 0000000000000005 R14: 0000000020000200 R15: 0000000000000000
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-20220324 #1 Not tainted
------------------------------------------------------
syz-executor.3/8092 is trying to acquire lock:
ffffffff85114ee0 (console_owner){..-.}-{0:0}, at: console_unlock+0x34e/0xd40
but task is already holding lock:
ffff88801afb2158 (&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_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 ***
6 locks held by syz-executor.3/8092:
#0: ffff888041e9a098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80
#1: ffff88801afb38b8 (&port->buf.lock/1){+.+.}-{3:3}, at: tty_ioctl+0x4a7/0x1700
#2: ffff888041e9a2e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: isig+0x37d/0x430
#3: ffffc900020db378 (&ldata->output_lock){+.+.}-{3:3}, at: n_tty_receive_buf_common+0x162b/0x4720
#4: ffff88801afb2158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
#5: ffffffff851f5320 (console_lock){+.+.}-{0:0}, at: vprintk+0x80/0x90
stack backtrace:
CPU: 1 PID: 8092 Comm: syz-executor.3 Not tainted 5.17.0-next-20220324 #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_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:0x7f0fe9428b19
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:00007f0fe699e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0fe953bf60 RCX: 00007f0fe9428b19
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007f0fe699e1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd7d62cd0f R14: 00007f0fe699e300 R15: 0000000000022000
9pnet_fd: Insufficient options for proto=fd
CPU: 1 PID: 8092 Comm: syz-executor.3 Not tainted 5.17.0-next-20220324 #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:0x7f0fe9428b19
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:00007f0fe699e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0fe953bf60 RCX: 00007f0fe9428b19
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007f0fe699e1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd7d62cd0f R14: 00007f0fe699e300 R15: 0000000000022000
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 8310 Comm: syz-executor.2 Not tainted 5.17.0-next-20220324 #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
__kmalloc_node+0x26f/0x470
memcg_alloc_slab_cgroups+0x7a/0x120
memcg_slab_post_alloc_hook+0xb9/0x440
kmem_cache_alloc_lru+0x273/0x7c0
xas_alloc+0x35d/0x480
xas_create+0x35b/0x1030
xas_store+0x90/0x1c40
shmem_add_to_page_cache+0x112e/0x1630
shmem_getpage_gfp.constprop.0+0x796/0x2190
shmem_write_begin+0xfd/0x1d0
generic_perform_write+0x208/0x510
__generic_file_write_iter+0x306/0x4b0
generic_file_write_iter+0xd7/0x220
new_sync_write+0x437/0x660
vfs_write+0x7c2/0xad0
__x64_sys_pwrite64+0x1fd/0x250
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f704b81bab7
Code: 08 89 3c 24 48 89 4c 24 18 e8 e5 f8 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 48 8b 74 24 08 8b 3c 24 b8 12 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 04 24 e8 15 f9 ff ff 48 8b
RSP: 002b:00007f7048dddf20 EFLAGS: 00000293 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f704b8b2970 RCX: 00007f704b81bab7
RDX: 000000000000009f RSI: 0000000020000280 RDI: 0000000000000005
RBP: 0000000000000002 R08: 0000000000000000 R09: ffffffffffffffff
R10: 0000000000008800 R11: 0000000000000293 R12: 0000000000000005
R13: 0000000000000005 R14: 0000000020000200 R15: 0000000000000000
9pnet_fd: Insufficient options for proto=fd
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 8328 Comm: syz-executor.3 Not tainted 5.17.0-next-20220324 #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
__kmalloc+0x25b/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:0x7f0fe9428b19
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:00007f0fe699e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0fe953bf60 RCX: 00007f0fe9428b19
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007f0fe699e1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd7d62cd0f R14: 00007f0fe699e300 R15: 0000000000022000