============================================
WARNING: possible recursive locking detected
5.16.0-rc1-syzkaller #0 Not tainted
--------------------------------------------
systemd-udevd/18622 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
4 locks held by systemd-udevd/18622:
#0: ffffffff8c3599b8 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_perm+0x1c1/0x400 security/tomoyo/file.c:847
#1: ffff888037bd3db0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#1: ffff888037bd3db0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#2: ffffffff90790430 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#3: ffff888081956098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 0 PID: 18622 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+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:tomoyo_check_acl+0x24b/0x450 security/tomoyo/domain.c:171
Code: 01 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f e9 8b 1c d6 fd e8 86 1c d6 fd 48 89 d8 48 89 de 48 c1 e8 03 83 e6 07 0f b6 0c 28 <48> 8d 43 07 48 89 c2 48 c1 ea 03 0f b6 14 2a 40 38 f1 40 0f 9e c6
RSP: 0018:ffffc90005f57ab8 EFLAGS: 00000246
RAX: 1ffff1100fcd3360 RBX: ffff88807e699b00 RCX: 0000000000000000
RDX: ffff888077b40000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff83a1ca68 R11: 0000000000000000 R12: ffffc90005f57be8
R13: ffff88801c39c710 R14: 0000000000000000 R15: 0000000000000000
tomoyo_path_permission security/tomoyo/file.c:586 [inline]
tomoyo_path_permission+0x1ff/0x3a0 security/tomoyo/file.c:573
tomoyo_path_perm+0x2f0/0x400 security/tomoyo/file.c:838
security_inode_getattr+0xcf/0x140 security/security.c:1334
vfs_getattr fs/stat.c:157 [inline]
vfs_fstat+0x43/0xb0 fs/stat.c:182
__do_sys_newfstat+0x81/0x100 fs/stat.c:422
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:0x7f01d70fc2e2
Code: 48 8b 05 b9 db 2b 00 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 83 ff 01 77 33 48 63 fe b8 05 00 00 00 48 89 d6 0f 05 <48> 3d 00 f0 ff ff 77 06 f3 c3 0f 1f 40 00 48 8b 15 81 db 2b 00 f7
RSP: 002b:00007ffcac470528 EFLAGS: 00000246 ORIG_RAX: 0000000000000005
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f01d70fc2e2
RDX: 00007ffcac470540 RSI: 00007ffcac470540 RDI: 0000000000000010
RBP: 00007ffcac4706e0 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000080000 R11: 0000000000000246 R12: 00005633d122f520
R13: 00005633d122de10 R14: 00005633d1230e10 R15: 00007ffcac4706a0
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 48 83 c4 30 add $0x30,%rsp
4: 5b pop %rbx
5: 5d pop %rbp
6: 41 5c pop %r12
8: 41 5d pop %r13
a: 41 5e pop %r14
c: 41 5f pop %r15
e: e9 8b 1c d6 fd jmpq 0xfdd61c9e
13: e8 86 1c d6 fd callq 0xfdd61c9e
18: 48 89 d8 mov %rbx,%rax
1b: 48 89 de mov %rbx,%rsi
1e: 48 c1 e8 03 shr $0x3,%rax
22: 83 e6 07 and $0x7,%esi
25: 0f b6 0c 28 movzbl (%rax,%rbp,1),%ecx
* 29: 48 8d 43 07 lea 0x7(%rbx),%rax <-- trapping instruction
2d: 48 89 c2 mov %rax,%rdx
30: 48 c1 ea 03 shr $0x3,%rdx
34: 0f b6 14 2a movzbl (%rdx,%rbp,1),%edx
38: 40 38 f1 cmp %sil,%cl
3b: 40 0f 9e c6 setle %sil