============================================
WARNING: possible recursive locking detected
5.16.0-rc4-syzkaller #0 Not tainted
--------------------------------------------
modprobe/7045 is trying to acquire lock:
ffffffff9078d3f0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff9078d3f0 (&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
5 locks held by modprobe/7045:
#0: ffff88807c85a428 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
#0: ffff88807c85a428 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x15c/0x290 mm/util.c:517
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1323 [inline]
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1467 [inline]
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1496 [inline]
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1517 [inline]
#1: ffff88807a7bccd8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x86b/0x29f0 mm/memory.c:1538
#2: ffff8880141acc30 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#2: ffff8880141acc30 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#3: ffffffff9078d3f0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#4: ffff888025189098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 0 PID: 7045 Comm: modprobe Not tainted 5.16.0-rc4-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:__kasan_check_read+0x4/0x10 mm/kasan/shadow.c:31
Code: 42 07 48 85 db 0f 85 1d 56 44 07 48 83 c4 60 5b 5d 41 5c 41 5d c3 c3 e9 1d 57 44 07 cc cc cc cc cc cc cc cc cc cc 48 8b 0c 24 <89> f6 31 d2 e9 f3 f9 ff ff 0f 1f 00 48 8b 0c 24 89 f6 ba 01 00 00
RSP: 0018:ffffc90005bef828 EFLAGS: 00000256
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81ac2c1c
RDX: ffff88801df99d00 RSI: 0000000000000008 RDI: ffffffff8d912cd0
RBP: ffff88807c85a300 R08: 0000000000000007 R09: ffff88807c85a6ff
R10: ffffffff81ac2bf3 R11: 0000000000000000 R12: 000000000000000b
R13: 0000000000000001 R14: dffffc0000000000 R15: 0000000000000002
instrument_atomic_read include/linux/instrumented.h:71 [inline]
test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
cpumask_test_cpu include/linux/cpumask.h:344 [inline]
cpu_online include/linux/cpumask.h:895 [inline]
trace_rss_stat+0x5c/0x290 include/trace/events/kmem.h:366
mm_trace_rss_stat mm/memory.c:172 [inline]
add_mm_counter include/linux/mm.h:2048 [inline]
sync_mm_rss+0x164/0x220 mm/memory.c:183
add_mm_rss_vec mm/memory.c:502 [inline]
zap_pte_range mm/memory.c:1402 [inline]
zap_pmd_range mm/memory.c:1467 [inline]
zap_pud_range mm/memory.c:1496 [inline]
zap_p4d_range mm/memory.c:1517 [inline]
unmap_page_range+0x1f23/0x29f0 mm/memory.c:1538
unmap_single_vma+0x198/0x310 mm/memory.c:1583
unmap_vmas+0x16b/0x2f0 mm/memory.c:1615
unmap_region+0x204/0x350 mm/mmap.c:2649
__do_munmap+0x631/0x11a0 mm/mmap.c:2883
do_munmap mm/mmap.c:2894 [inline]
munmap_vma_range mm/mmap.c:603 [inline]
mmap_region+0x2fd/0x1650 mm/mmap.c:1741
do_mmap+0x869/0xfb0 mm/mmap.c:1575
vm_mmap_pgoff+0x1b7/0x290 mm/util.c:519
ksys_mmap_pgoff+0x40d/0x5a0 mm/mmap.c:1623
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6fbba5e1f2
Code: 04 00 00 5b 5d 41 5c c3 41 f7 c1 ff 0f 00 00 75 27 55 48 89 fd 53 89 cb 48 85 ff 74 33 41 89 da 48 89 ef b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 56 5b 5d c3 0f 1f 00 c7 05 9e 1f 01 00 16 00
RSP: 002b:00007ffd5a98a498 EFLAGS: 00000206 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f6fbba5e1f2
RDX: 0000000000000005 RSI: 000000000013f000 RDI: 00007f6fbb7dc000
RBP: 00007f6fbb7dc000 R08: 0000000000000000 R09: 0000000000022000
R10: 0000000000000812 R11: 0000000000000206 R12: 00007ffd5a98a4b0
R13: 00007ffd5a98a4e0 R14: 0000000000000005 R15: 00007f6fbba3c500
----------------
Code disassembly (best guess):
0: 42 07 rex.X (bad)
2: 48 85 db test %rbx,%rbx
5: 0f 85 1d 56 44 07 jne 0x7445628
b: 48 83 c4 60 add $0x60,%rsp
f: 5b pop %rbx
10: 5d pop %rbp
11: 41 5c pop %r12
13: 41 5d pop %r13
15: c3 retq
16: c3 retq
17: e9 1d 57 44 07 jmpq 0x7445739
1c: cc int3
1d: cc int3
1e: cc int3
1f: cc int3
20: cc int3
21: cc int3
22: cc int3
23: cc int3
24: cc int3
25: cc int3
26: 48 8b 0c 24 mov (%rsp),%rcx
* 2a: 89 f6 mov %esi,%esi <-- trapping instruction
2c: 31 d2 xor %edx,%edx
2e: e9 f3 f9 ff ff jmpq 0xfffffa26
33: 0f 1f 00 nopl (%rax)
36: 48 8b 0c 24 mov (%rsp),%rcx
3a: 89 f6 mov %esi,%esi
3c: ba .byte 0xba
3d: 01 00 add %eax,(%rax)