============================================
WARNING: possible recursive locking detected
5.15.0-next-20211102-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.2/20516 is trying to acquire lock:
ffffffff9075ddf0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff9075ddf0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 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
4 locks held by syz-executor.2/20516:
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1327 [inline]
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1471 [inline]
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1500 [inline]
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1521 [inline]
#0: ffff88807821b4f8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x86b/0x29f0 mm/memory.c:1542
#1: ffff8880195002b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
#1: ffff8880195002b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#2: ffffffff9075ddf0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#3: ffff888080700098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 20516 Comm: syz-executor.2 Not tainted 5.15.0-next-20211102-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+0xcd/0x134 lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
check_deadlock kernel/locking/lockdep.c:2999 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027
lock_acquire kernel/locking/lockdep.c:5637 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
n_hdlc_send_frames+0x24b/0x490 drivers/tty/n_hdlc.c:290
tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1845
serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1932
serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1905 [inline]
serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1949
serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x303/0x8f0 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:198 [inline]
handle_irq_event+0x102/0x280 kernel/irq/handle.c:215
handle_edge_irq+0x25f/0xd00 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+0x9d/0x210 arch/x86/kernel/irq.c:250
common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629
RIP: 0010:zap_pte_range mm/memory.c:1332 [inline]
RIP: 0010:zap_pmd_range mm/memory.c:1471 [inline]
RIP: 0010:zap_pud_range mm/memory.c:1500 [inline]
RIP: 0010:zap_p4d_range mm/memory.c:1521 [inline]
RIP: 0010:unmap_page_range+0xa61/0x29f0 mm/memory.c:1542
Code: 49 83 c5 08 48 89 df e8 2d 27 cb ff 49 8d 87 00 10 00 00 4c 39 fb 0f 84 dd 0f 00 00 49 89 c7 49 8d 87 00 f0 ff ff 48 89 04 24 9a 23 cb ff 4c 89 e8 48 c1 e8 03 42 80 3c 30 00 0f 85 19 1a 00
RSP: 0018:ffffc900028cf7a8 EFLAGS: 00000206
RAX: 00007f0a1748d000 RBX: 00007f0a174ff000 RCX: 00007f0a1748d000
RDX: 0000000000000000 RSI: ffff88803d500000 RDI: 0000000000000003
RBP: 000ffffffffff000 R08: 00007f0a174ff000 R09: 0000000000000000
R10: ffffffff81aca703 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888079856468 R14: dffffc0000000000 R15: 00007f0a1748e000
unmap_single_vma+0x198/0x310 mm/memory.c:1587
unmap_vmas+0x16b/0x2f0 mm/memory.c:1619
exit_mmap+0x1d0/0x630 mm/mmap.c:3171
__mmput+0x122/0x4b0 kernel/fork.c:1164
mmput+0x56/0x60 kernel/fork.c:1185
exit_mm kernel/exit.c:507 [inline]
do_exit+0xb27/0x2b40 kernel/exit.c:819
do_group_exit+0x125/0x310 kernel/exit.c:929
get_signal+0x47d/0x2220 kernel/signal.c:2830
arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0a17d87ae9
Code: Unable to access opcode bytes at RIP 0x7f0a17d87abf.
RSP: 002b:00007f0a152fd218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f0a17e9af68 RCX: 00007f0a17d87ae9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f0a17e9af6c
RBP: 00007f0a17e9af60 R08: 000000000000000e R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 00007f0a17e9af6c
R13: 00007ffc1fefca9f R14: 00007f0a152fd300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: 49 83 c5 08 add $0x8,%r13
4: 48 89 df mov %rbx,%rdi
7: e8 2d 27 cb ff callq 0xffcb2739
c: 49 8d 87 00 10 00 00 lea 0x1000(%r15),%rax
13: 4c 39 fb cmp %r15,%rbx
16: 0f 84 dd 0f 00 00 je 0xff9
1c: 49 89 c7 mov %rax,%r15
1f: 49 8d 87 00 f0 ff ff lea -0x1000(%r15),%rax
26: 48 89 04 24 mov %rax,(%rsp)
* 2a: e8 9a 23 cb ff callq 0xffcb23c9 <-- trapping instruction
2f: 4c 89 e8 mov %r13,%rax
32: 48 c1 e8 03 shr $0x3,%rax
36: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
3b: 0f .byte 0xf
3c: 85 19 test %ebx,(%rcx)
3e: 1a 00 sbb (%rax),%al