============================================
WARNING: possible recursive locking detected
5.16.0-rc2-syzkaller #0 Not tainted
--------------------------------------------
syz-fuzzer/6519 is trying to acquire lock:
ffffffff90f54430 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff90f54430 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x3f/0x3e0 drivers/tty/serial/8250/8250_port.c:1908
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&port_lock_key);
lock(&port_lock_key);
*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by syz-fuzzer/6519:
#0: ffff888023a010b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#0: ffff888023a010b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x39/0x1e0 drivers/tty/serial/8250/8250_core.c:116
#1: ffffffff90f54430 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x3f/0x3e0 drivers/tty/serial/8250/8250_port.c:1908
#2: ffff88809a5a1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 6519 Comm: syz-fuzzer Not tainted 5.16.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
check_deadlock kernel/locking/lockdep.c:2999 [inline]
validate_chain+0x5984/0x8240 kernel/locking/lockdep.c:3788
__lock_acquire+0x1382/0x2b00 kernel/locking/lockdep.c:5027
lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5637
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
n_hdlc_send_frames+0x34e/0xb20 drivers/tty/n_hdlc.c:290
tty_wakeup+0xb3/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x68e/0x8a0 drivers/tty/serial/8250/8250_port.c:1845
serial8250_handle_irq+0x2fd/0x3e0 drivers/tty/serial/8250/8250_port.c:1932
serial8250_default_handle_irq+0xaf/0x190 drivers/tty/serial/8250/8250_port.c:1949
serial8250_interrupt+0xa3/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x20d/0x730 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:198 [inline]
handle_irq_event+0x10a/0x300 kernel/irq/handle.c:215
handle_edge_irq+0x245/0xbe0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xce/0x1e0 arch/x86/kernel/irq.c:250
common_interrupt+0x4a/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40
RIP: 0033:0x40d6ec
Code: 89 54 24 40 48 89 44 24 38 e8 b0 e9 05 00 83 3d 21 7c 48 01 00 0f 85 bc 01 00 00 48 8b 44 24 60 c7 80 f0 00 00 00 00 00 00 00 <90> 64 48 8b 0c 25 f8 ff ff ff 8b 90 08 01 00 00 8d 5a ff 89 98 08
RSP: 002b:000000c01a3beca8 EFLAGS: 00000246
RAX: 000000c0002da000 RBX: 0000000000000008 RCX: 00007f6d42bca108
RDX: 0000000000000028 RSI: 0000000000000028 RDI: 0000000000000000
RBP: 000000c01a3bed38 R08: 00007f6d1b166668 R09: 0000000000203003
R10: 0000000000000008 R11: 0000000000000074 R12: 00000000000000f4
R13: 0000000000000000 R14: 00000000008db717 R15: 0000000000000000
NMI backtrace for cpu 1
CPU: 1 PID: 6519 Comm: syz-fuzzer Not tainted 5.16.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:native_halt arch/x86/include/asm/irqflags.h:57 [inline]
RIP: 0010:halt arch/x86/include/asm/irqflags.h:98 [inline]
RIP: 0010:kvm_wait+0x138/0x1f0 arch/x86/kernel/kvm.c:991
Code: 89 e0 48 c1 e8 03 42 8a 04 28 84 c0 0f 85 9b 00 00 00 41 8a 04 24 3a 44 24 1c 0f 85 53 ff ff ff eb 07 0f 00 2d 19 46 31 09 f4 44 ff ff ff 4c 8d 7c 24 40 4d 89 fe 49 c1 ee 03 43 80 3c 2e 00
RSP: 0000:ffffc90001a9f620 EFLAGS: 00000046
RAX: 1ffffffff21ea803 RBX: 1ffff92000353ec8 RCX: ffffffff8167a3ef
RDX: dffffc0000000000 RSI: 0000000000000003 RDI: ffffffff90f54418
RBP: ffffc90001a9f6f0 R08: dffffc0000000000 R09: fffffbfff21ea884
R10: fffffbfff21ea884 R11: 0000000000000000 R12: ffffffff90f54418
R13: dffffc0000000000 R14: ffffc90001a9f680 R15: 1ffff92000353ed0
FS: 000000c0002da090(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc957cfd560 CR3: 0000000072f8b000 CR4: 00000000003526e0
Call Trace:
pv_wait arch/x86/include/asm/paravirt.h:603 [inline]
pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:470 [inline]
__pv_queued_spin_lock_slowpath+0x76c/0xcb0 kernel/locking/qspinlock.c:508
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
do_raw_spin_lock+0x4c9/0x8e0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
n_hdlc_send_frames+0x34e/0xb20 drivers/tty/n_hdlc.c:290
tty_wakeup+0xb3/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x68e/0x8a0 drivers/tty/serial/8250/8250_port.c:1845
serial8250_handle_irq+0x2fd/0x3e0 drivers/tty/serial/8250/8250_port.c:1932
serial8250_default_handle_irq+0xaf/0x190 drivers/tty/serial/8250/8250_port.c:1949
serial8250_interrupt+0xa3/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x20d/0x730 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:198 [inline]
handle_irq_event+0x10a/0x300 kernel/irq/handle.c:215
handle_edge_irq+0x245/0xbe0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xce/0x1e0 arch/x86/kernel/irq.c:250
common_interrupt+0x4a/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40
RIP: 0033:0x40d6ec
Code: 89 54 24 40 48 89 44 24 38 e8 b0 e9 05 00 83 3d 21 7c 48 01 00 0f 85 bc 01 00 00 48 8b 44 24 60 c7 80 f0 00 00 00 00 00 00 00 <90> 64 48 8b 0c 25 f8 ff ff ff 8b 90 08 01 00 00 8d 5a ff 89 98 08
RSP: 002b:000000c01a3beca8 EFLAGS: 00000246
RAX: 000000c0002da000 RBX: 0000000000000008 RCX: 00007f6d42bca108
RDX: 0000000000000028 RSI: 0000000000000028 RDI: 0000000000000000
RBP: 000000c01a3bed38 R08: 00007f6d1b166668 R09: 0000000000203003
R10: 0000000000000008 R11: 0000000000000074 R12: 00000000000000f4
R13: 0000000000000000 R14: 00000000008db717 R15: 0000000000000000
NMI backtrace for cpu 1
CPU: 1 PID: 6519 Comm: syz-fuzzer Not tainted 5.16.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:native_halt arch/x86/include/asm/irqflags.h:57 [inline]
RIP: 0010:halt arch/x86/include/asm/irqflags.h:98 [inline]
RIP: 0010:kvm_wait+0x138/0x1f0 arch/x86/kernel/kvm.c:991
Code: 89 e0 48 c1 e8 03 42 8a 04 28 84 c0 0f 85 9b 00 00 00 41 8a 04 24 3a 44 24 1c 0f 85 53 ff ff ff eb 07 0f 00 2d 19 46 31 09 f4 44 ff ff ff 4c 8d 7c 24 40 4d 89 fe 49 c1 ee 03 43 80 3c 2e 00
RSP: 0000:ffffc90001a9f620 EFLAGS: 00000046
RAX: 1ffffffff21ea803 RBX: 1ffff92000353ec8 RCX: ffffffff8167a3ef
RDX: dffffc0000000000 RSI: 0000000000000003 RDI: ffffffff90f54418
RBP: ffffc90001a9f6f0 R08: dffffc0000000000 R09: fffffbfff21ea884
R10: fffffbfff21ea884 R11: 0000000000000000 R12: ffffffff90f54418
R13: dffffc0000000000 R14: ffffc90001a9f680 R15: 1ffff92000353ed0
FS: 000000c0002da090(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc957cfd560 CR3: 0000000072f8b000 CR4: 00000000003526e0
Call Trace:
pv_wait arch/x86/include/asm/paravirt.h:603 [inline]
pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:470 [inline]
__pv_queued_spin_lock_slowpath+0x76c/0xcb0 kernel/locking/qspinlock.c:508
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
do_raw_spin_lock+0x4c9/0x8e0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
n_hdlc_send_frames+0x34e/0xb20 drivers/tty/n_hdlc.c:290
tty_wakeup+0xb3/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x68e/0x8a0 drivers/tty/serial/8250/8250_port.c:1845
serial8250_handle_irq+0x2fd/0x3e0 drivers/tty/serial/8250/8250_port.c:1932
serial8250_default_handle_irq+0xaf/0x190 drivers/tty/serial/8250/8250_port.c:1949
serial8250_interrupt+0xa3/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x20d/0x730 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:198 [inline]
handle_irq_event+0x10a/0x300 kernel/irq/handle.c:215
handle_edge_irq+0x245/0xbe0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xce/0x1e0 arch/x86/kernel/irq.c:250
common_interrupt+0x4a/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40
RIP: 0033:0x40d6ec
Code: 89 54 24 40 48 89 44 24 38 e8 b0 e9 05 00 83 3d 21 7c 48 01 00 0f 85 bc 01 00 00 48 8b 44 24 60 c7 80 f0 00 00 00 00 00 00 00 <90> 64 48 8b 0c 25 f8 ff ff ff 8b 90 08 01 00 00 8d 5a ff 89 98 08
RSP: 002b:000000c01a3beca8 EFLAGS: 00000246
RAX: 000000c0002da000 RBX: 0000000000000008 RCX: 00007f6d42bca108
RDX: 0000000000000028 RSI: 0000000000000028 RDI: 0000000000000000
RBP: 000000c01a3bed38 R08: 00007f6d1b166668 R09: 0000000000203003
R10: 0000000000000008 R11: 0000000000000074 R12: 00000000000000f4
R13: 0000000000000000 R14: 00000000008db717 R15: 0000000000000000
NMI backtrace for cpu 1
CPU: 1 PID: 6519 Comm: syz-fuzzer Not tainted 5.16.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:native_halt arch/x86/include/asm/irqflags.h:57 [inline]
RIP: 0010:halt arch/x86/include/asm/irqflags.h:98 [inline]
RIP: 0010:kvm_wait+0x138/0x1f0 arch/x86/kernel/kvm.c:991
Code: 89 e0 48 c1 e8 03 42 8a 04 28 84 c0 0f 85 9b 00 00 00 41 8a 04 24 3a 44 24 1c 0f 85 53 ff ff ff eb 07 0f 00 2d 19 46 31 09 f4 44 ff ff ff 4c 8d 7c 24 40 4d 89 fe 49 c1 ee 03 43 80 3c 2e 00
RSP: 0000:ffffc90001a9f620 EFLAGS: 00000046
RAX: 1ffffffff21ea803 RBX: 1ffff92000353ec8 RCX: ffffffff8167a3ef
RDX: dffffc0000000000 RSI: 0000000000000003 RDI: ffffffff90f54418
RBP: ffffc90001a9f6f0 R08: dffffc0000000000 R09: fffffbfff21ea884
R10: fffffbfff21ea884 R11: 0000000000000000 R12: ffffffff90f54418
R13: dffffc0000000000 R14: ffffc90001a9f680 R15: 1ffff92000353ed0
FS: 000000c0002da090(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc957cfd560 CR3: 0000000072f8b000 CR4: 00000000003526e0
Call Trace:
pv_wait arch/x86/include/asm/paravirt.h:603 [inline]
pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:470 [inline]
__pv_queued_spin_lock_slowpath+0x76c/0xcb0 kernel/locking/qspinlock.c:508
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
do_raw_spin_lock+0x4c9/0x8e0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
n_hdlc_send_frames+0x34e/0xb20 drivers/tty/n_hdlc.c:290
tty_wakeup+0xb3/0xf0 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x68e/0x8a0 drivers/tty/serial/8250/8250_port.c:1845
serial8250_handle_irq+0x2fd/0x3e0 drivers/tty/serial/8250/8250_port.c:1932
serial8250_default_handle_irq+0xaf/0x190 drivers/tty/serial/8250/8250_port.c:1949
serial8250_interrupt+0xa3/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x20d/0x730 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:198 [inline]
handle_irq_event+0x10a/0x300 kernel/irq/handle.c:215
handle_edge_irq+0x245/0xbe0 kernel/irq/chip.c:822
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xce/0x1e0 arch/x86/kernel/irq.c:250
common_interrupt+0x4a/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40
RIP: 0033:0x40d6ec
Code: 89 54 24 40 48 89 44 24 38 e8 b0 e9 05 00 83 3d 21 7c 48 01 00 0f 85 bc 01 00 00 48 8b 44 24 60 c7 80 f0 00 00 00 00 00 00 00 <90> 64 48 8b 0c 25 f8 ff ff ff 8b 90 08 01 00 00 8d 5a ff 89 98 08
RSP: 002b:000000c01a3beca8 EFLAGS: 00000246
RAX: 000000c0002da000 RBX: 0000000000000008 RCX: 00007f6d42bca108
RDX: 0000000000000028 RSI: 0000000000000028 RDI: 0000000000000000
RBP: 000000c01a3bed38 R08: 00007f6d1b166668 R09: 0000000000203003
R10: 0000000000000008 R11: 0000000000000074 R12: 00000000000000f4
R13: 0000000000000000 R14: 00000000008db717 R15: 0000000000000000
----------------
Code disassembly (best guess):
0: 89 e0 mov %esp,%eax
2: 48 c1 e8 03 shr $0x3,%rax
6: 42 8a 04 28 mov (%rax,%r13,1),%al
a: 84 c0 test %al,%al
c: 0f 85 9b 00 00 00 jne 0xad
12: 41 8a 04 24 mov (%r12),%al
16: 3a 44 24 1c cmp 0x1c(%rsp),%al
1a: 0f 85 53 ff ff ff jne 0xffffff73
20: eb 07 jmp 0x29
22: 0f 00 2d 19 46 31 09 verw 0x9314619(%rip) # 0x9314642
29: f4 hlt
* 2a: e9 44 ff ff ff jmpq 0xffffff73 <-- trapping instruction
2f: 4c 8d 7c 24 40 lea 0x40(%rsp),%r15
34: 4d 89 fe mov %r15,%r14
37: 49 c1 ee 03 shr $0x3,%r14
3b: 43 80 3c 2e 00 cmpb $0x0,(%r14,%r13,1)