dump_stack_lvl+0x8b/0xb3
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
5.18.0-rc2-next-20220414 #1 Not tainted
------------------------------------------------------
syz-executor.4/14534 is trying to acquire lock:
ffffffff851167a0 (console_owner){-.-.}-{0:0}, at: vprintk_emit+0x316/0x550
but task is already holding lock:
ffff888018785158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
 should_fail.cold+0x5/0xa
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
 should_failslab+0x5/0x10
       tty_port_tty_get+0x1f/0x100
 kmem_cache_alloc+0x5b/0x480
       tty_port_default_wakeup+0x11/0x40
 getname_flags.part.0+0x50/0x4f0
       serial8250_tx_chars+0x50b/0xa70
 getname+0x8e/0xd0
       serial8250_handle_irq.part.0+0x3f1/0x4c0
 do_sys_openat2+0xf5/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
 __x64_sys_openat+0x13f/0x1f0
       asm_common_interrupt+0x1e/0x40
       default_idle+0xb/0x10
       default_idle_call+0x80/0xc0
 do_syscall_64+0x3b/0x90
       do_idle+0x3b9/0x530
       cpu_startup_entry+0x14/0x20
 entry_SYSCALL_64_after_hwframe+0x44/0xae
       secondary_startup_64_no_verify+0xe0/0xeb
RIP: 0033:0x7f6980540a04
-> #1 (&port_lock_key){-.-.}-{2:2}
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
:
RSP: 002b:00007f697db03060 EFLAGS: 00000293
       _raw_spin_lock_irqsave+0x39/0x50
 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f69806a0f60 RCX: 00007f6980540a04
       serial8250_console_write+0x90e/0xb20
RDX: 0000000000000000 RSI: 00007f697db030f0 RDI: 00000000ffffff9c
RBP: 00007f697db030f0 R08: 0000000000000000 R09: 00007f697db02f70
       console_unlock+0x8c7/0xd40
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 00007ffe6765391f R14: 00007f697db03300 R15: 0000000000022000
       register_console+0x378/0x7d0
 
       univ8250_console_init+0x3a/0x46
       console_init+0x3c1/0x58d
       start_kernel+0x301/0x4ee
       secondary_startup_64_no_verify+0xe0/0xeb
-> #0 (console_owner){-.-.}-{0:0}:
       __lock_acquire+0x2c2f/0x6120
       lock_acquire+0x1a2/0x530
       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_send_xchar+0x25b/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 ***
4 locks held by syz-executor.4/14534:
 #0: ffff888010130098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80
 #1: ffff888010130130 (&tty->atomic_write_lock){+.+.}-{3:3}, at: tty_send_xchar+0x1a6/0x370
 #2: ffff8880101302e8 (&tty->termios_rwsem){++++}-{3:3}, at: tty_send_xchar+0x1ef/0x370
 #3: ffff888018785158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xea/0x1e0
stack backtrace:
CPU: 0 PID: 14534 Comm: syz-executor.4 Not tainted 5.18.0-rc2-next-20220414 #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/0x530
 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_send_xchar+0x25b/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:0x7f5b0410bb19
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:00007f5b01681188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5b0421ef60 RCX: 00007f5b0410bb19
RDX: 0000000000000002 RSI: 000000000000540a RDI: 0000000000000003
RBP: 00007f5b016811d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc3fe0d6ff R14: 00007f5b01681300 R15: 0000000000022000
 
CPU: 0 PID: 14534 Comm: syz-executor.4 Not tainted 5.18.0-rc2-next-20220414 #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+0x25b/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:0x7f5b0410bb19
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:00007f5b01681188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5b0421ef60 RCX: 00007f5b0410bb19
RDX: 0000000000000002 RSI: 000000000000540a RDI: 0000000000000003
RBP: 00007f5b016811d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc3fe0d6ff R14: 00007f5b01681300 R15: 0000000000022000
 
FAT-fs (loop0): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1)
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 0 PID: 14636 Comm: syz-executor.5 Not tainted 5.18.0-rc2-next-20220414 #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
 getname+0x8e/0xd0
 do_sys_openat2+0xf5/0x4c0
 __x64_sys_openat+0x13f/0x1f0
 do_syscall_64+0x3b/0x90
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6980540a04
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007f697db03060 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f69806a0f60 RCX: 00007f6980540a04
RDX: 0000000000000000 RSI: 00007f697db030f0 RDI: 00000000ffffff9c
RBP: 00007f697db030f0 R08: 0000000000000000 R09: 00007f697db02f70
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 00007ffe6765391f R14: 00007f697db03300 R15: 0000000000022000
 
9pnet_fd: Insufficient options for proto=fd
loop0: detected capacity change from 0 to 256
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 14650 Comm: syz-executor.4 Not tainted 5.18.0-rc2-next-20220414 #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_send_xchar+0x25b/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:0x7f5b0410bb19
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:00007f5b01681188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5b0421ef60 RCX: 00007f5b0410bb19
RDX: 0000000000000002 RSI: 000000000000540a RDI: 0000000000000003
RBP: 00007f5b016811d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc3fe0d6ff R14: 00007f5b01681300 R15: 0000000000022000
 
FAT-fs (loop0): Invalid FSINFO signature: 0x00000000, 0x00000000 (sector = 1)
9pnet_fd: Insufficient options for proto=fd
9pnet_fd: Insufficient options for proto=fd
FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
CPU: 1 PID: 14770 Comm: syz-executor.5 Not tainted 5.18.0-rc2-next-20220414 #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
 strncpy_from_user+0x34/0x3d0
 getname_flags.part.0+0x95/0x4f0
 getname+0x8e/0xd0
 do_sys_openat2+0xf5/0x4c0
 __x64_sys_openat+0x13f/0x1f0
 do_syscall_64+0x3b/0x90
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6980540a04
Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44
RSP: 002b:00007f697db03060 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f69806a0f60 RCX: 00007f6980540a04
RDX: 0000000000000000 RSI: 00007f697db030f0 RDI: 00000000ffffff9c
RBP: 00007f697db030f0 R08: 0000000000000000 R09: 00007f697db02f70
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 00007ffe6765391f R14: 00007f697db03300 R15: 0000000000022000
 
----------------
Code disassembly (best guess):
   0:	84 00                	test   %al,(%rax)
   2:	00 00                	add    %al,(%rax)
   4:	00 00                	add    %al,(%rax)
   6:	44 89 54 24 0c       	mov    %r10d,0xc(%rsp)
   b:	e8 96 f9 ff ff       	callq  0xfffff9a6
  10:	44 8b 54 24 0c       	mov    0xc(%rsp),%r10d
  15:	44 89 e2             	mov    %r12d,%edx
  18:	48 89 ee             	mov    %rbp,%rsi
  1b:	41 89 c0             	mov    %eax,%r8d
  1e:	bf 9c ff ff ff       	mov    $0xffffff9c,%edi
  23:	b8 01 01 00 00       	mov    $0x101,%eax
  28:	0f 05                	syscall
* 2a:	48 3d 00 f0 ff ff    	cmp    $0xfffffffffffff000,%rax <-- trapping instruction
  30:	77 34                	ja     0x66
  32:	44 89 c7             	mov    %r8d,%edi
  35:	89 44 24 0c          	mov    %eax,0xc(%rsp)
  39:	e8 c8 f9 ff ff       	callq  0xfffffa06
  3e:	8b                   	.byte 0x8b
  3f:	44                   	rex.R