============================================
WARNING: possible recursive locking detected
5.16.0-rc1-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.1/6572 is trying to acquire lock:
ffffffff90790430 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff90790430 (&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
6 locks held by syz-executor.1/6572:
#0: ffffffff8bc58190 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mmap kernel/fork.c:497 [inline]
#0: ffffffff8bc58190 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mm+0x108/0x13e0 kernel/fork.c:1450
#1: ffff8880192be328 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
#1: ffff8880192be328 (&mm->mmap_lock#2){++++}-{3:3}, at: dup_mmap kernel/fork.c:498 [inline]
#1: ffff8880192be328 (&mm->mmap_lock#2){++++}-{3:3}, at: dup_mm+0x12e/0x13e0 kernel/fork.c:1450
#2: ffff88801a68b228 (&mm->mmap_lock/1){+.+.}-{3:3}, at: mmap_write_lock_nested include/linux/mmap_lock.h:78 [inline]
#2: ffff88801a68b228 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mmap kernel/fork.c:507 [inline]
#2: ffff88801a68b228 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mm+0x18a/0x13e0 kernel/fork.c:1450
#3: ffff88806ed85d30 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#3: ffff88806ed85d30 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#4: ffffffff90790430 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#5: ffff88801ae6f098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 6572 Comm: syz-executor.1 Not tainted 5.16.0-rc1-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:unwind_next_frame+0x4f1/0x1ce0 arch/x86/kernel/unwind_orc.c:464
Code: 0f 95 c6 40 84 f7 0f 85 d7 11 00 00 48 89 ce 83 e6 07 40 38 f2 40 0f 9e c6 84 d2 0f 95 c2 40 84 d6 0f 85 bc 11 00 00 83 e0 0f <3c> 09 0f 87 3e 0b 00 00 0f b6 d0 ff 24 d5 80 2a a9 89 4c 89 ff e8
RSP: 0018:ffffc9000288f298 EFLAGS: 00000206
RAX: 0000000000000005 RBX: 1ffff92000511e5b RCX: ffffffff8e0c3e3b
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffff8e0c3e36 R09: ffffc9000288f3c0
R10: fffff52000511e83 R11: 000000000008808a R12: ffffc9000288f408
R13: ffffc9000288f3f5 R14: ffffc9000288f3c0 R15: ffffffff8e0c3e3a
__unwind_start+0x51b/0x800 arch/x86/kernel/unwind_orc.c:712
unwind_start arch/x86/include/asm/unwind.h:64 [inline]
arch_stack_walk+0x5c/0xe0 arch/x86/kernel/stacktrace.c:24
stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:3234 [inline]
slab_alloc mm/slub.c:3242 [inline]
kmem_cache_alloc+0x202/0x3a0 mm/slub.c:3247
vm_area_dup+0x88/0x2b0 kernel/fork.c:356
dup_mmap kernel/fork.c:551 [inline]
dup_mm+0x5fa/0x13e0 kernel/fork.c:1450
copy_mm kernel/fork.c:1502 [inline]
copy_process+0x6fed/0x75a0 kernel/fork.c:2191
kernel_clone+0xe7/0xab0 kernel/fork.c:2582
__do_compat_sys_ia32_clone+0xac/0xe0 arch/x86/kernel/sys_ia32.c:254
do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
__do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf6ebf549
Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f7550d40 EFLAGS: 00000206 ORIG_RAX: 0000000000000078
RAX: ffffffffffffffda RBX: 0000000001200011 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000565b43e8
RBP: 00000000f6ff5000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess):
0: 0f 95 c6 setne %dh
3: 40 84 f7 test %sil,%dil
6: 0f 85 d7 11 00 00 jne 0x11e3
c: 48 89 ce mov %rcx,%rsi
f: 83 e6 07 and $0x7,%esi
12: 40 38 f2 cmp %sil,%dl
15: 40 0f 9e c6 setle %sil
19: 84 d2 test %dl,%dl
1b: 0f 95 c2 setne %dl
1e: 40 84 d6 test %dl,%sil
21: 0f 85 bc 11 00 00 jne 0x11e3
27: 83 e0 0f and $0xf,%eax
* 2a: 3c 09 cmp $0x9,%al <-- trapping instruction
2c: 0f 87 3e 0b 00 00 ja 0xb70
32: 0f b6 d0 movzbl %al,%edx
35: ff 24 d5 80 2a a9 89 jmpq *-0x7656d580(,%rdx,8)
3c: 4c 89 ff mov %r15,%rdi
3f: e8 .byte 0xe8