============================================
WARNING: possible recursive locking detected
5.16.0-rc1-syzkaller #0 Not tainted
--------------------------------------------
systemd-udevd/11123 is trying to acquire lock:
ffffffff91161430
(&port_lock_key){-.-.}-{2:2}
, at: uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff91161430 (&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
5 locks held by systemd-udevd/11123:
#0: ffff888032290d38 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#0: ffff888032290d38 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range+0x28d/0x1ba0 mm/memory.c:1323
#1: ffffffff8cd1da80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
#2: ffff88807ee8beb0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#2: ffff88807ee8beb0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x39/0x1e0 drivers/tty/serial/8250/8250_core.c:116
#3: ffffffff91161430 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x3f/0x3e0 drivers/tty/serial/8250/8250_port.c:1908
#4: ffff888082d13098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 11123 Comm: systemd-udevd 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+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+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40
RIP: 0010:folio_memcg_lock+0x2b7/0x4e0 mm/memcontrol.c:2043
Code: 48 8d bc 24 80 00 00 00 e8 f6 21 fb ff f6 84 24 81 00 00 00 02 0f 85 18 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 4c 8b 7c 24 20 <49> 8d 9f c0 10 00 00 48 89 df be 04 00 00 00 e8 65 23 fb ff 48 89
RSP: 0018:ffffc90002def5c0 EFLAGS: 00000206
RAX: 1ffff920005bdec8 RBX: ffff88814077c688 RCX: ffffffff81665dc1
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90002def6d8 R08: dffffc0000000000 R09: fffffbfff2034ddf
R10: fffffbfff2034ddf R11: 0000000000000000 R12: ffffea00003d8cf8
R13: dffffc0000000000 R14: 1ffff920005bdecc R15: ffff88814077c000
page_remove_rmap+0x2b/0x10f0 mm/rmap.c:1348
zap_pte_range+0xa25/0x1ba0 mm/memory.c:1357
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+0x745/0xa20 mm/memory.c:1538
unmap_vmas+0x202/0x390 mm/memory.c:1615
exit_mmap+0x3c6/0x6f0 mm/mmap.c:3170
__mmput+0x111/0x3a0 kernel/fork.c:1113
exit_mm+0x211/0x2f0 kernel/exit.c:507
do_exit+0x688/0x24f0 kernel/exit.c:819
do_group_exit+0x168/0x2d0 kernel/exit.c:929
__do_sys_exit_group+0x13/0x20 kernel/exit.c:940
__se_sys_exit_group+0x10/0x10 kernel/exit.c:938
__x64_sys_exit_group+0x37/0x40 kernel/exit.c:938
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fdf7f65e618
Code: Unable to access opcode bytes at RIP 0x7fdf7f65e5ee.
RSP: 002b:00007ffed5942618 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007ffed59426e0 RCX: 00007fdf7f65e618
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007ffed5942790 R08: 00000000000000e7 R09: fffffffffffffe50
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000003 R15: 000000000000000e
----------------
Code disassembly (best guess):
0: 48 8d bc 24 80 00 00 lea 0x80(%rsp),%rdi
7: 00
8: e8 f6 21 fb ff callq 0xfffb2203
d: f6 84 24 81 00 00 00 testb $0x2,0x81(%rsp)
14: 02
15: 0f 85 18 01 00 00 jne 0x133
1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d
22: 74 01 je 0x25
24: fb sti
25: 4c 8b 7c 24 20 mov 0x20(%rsp),%r15
* 2a: 49 8d 9f c0 10 00 00 lea 0x10c0(%r15),%rbx <-- trapping instruction
31: 48 89 df mov %rbx,%rdi
34: be 04 00 00 00 mov $0x4,%esi
39: e8 65 23 fb ff callq 0xfffb23a3
3e: 48 rex.W
3f: 89 .byte 0x89