============================================
WARNING: possible recursive locking detected
5.15.0-syzkaller #0 Not tainted
--------------------------------------------
systemd-udevd/2973 is trying to acquire lock:
ffffffff90f473f0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0xfe/0x920 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff90f473f0 (&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
4 locks held by systemd-udevd/2973:
#0: ffffffff8d0d5478 (tomoyo_ss){....}-{0:0}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:267
#1: ffff88807ae9e430 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#1: ffff88807ae9e430 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x39/0x1e0 drivers/tty/serial/8250/8250_core.c:116
#2: ffffffff90f473f0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x3f/0x3e0 drivers/tty/serial/8250/8250_port.c:1908
#3: ffff88806dc1e098 (
&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x18/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 2973 Comm: systemd-udevd Not tainted 5.15.0-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:__stack_depot_save+0x25/0x4a0 lib/stackdepot.c:322
Code: 00 eb bc 66 90 55 41 57 41 56 41 55 41 54 53 48 83 ec 38 65 48 8b 04 25 28 00 00 00 48 89 44 24 30 48 c7 44 24 28 00 00 00 00 <31> c0 85 f6 0f 84 27 04 00 00 80 3d 1a 08 b9 0c 00 0f 85 1a 04 00
RSP: 0018:ffffc90001a3f6c0 EFLAGS: 00000286
RAX: f60df7750d3c7e00 RBX: ffff8880838a8000 RCX: 0000000000000001
RDX: 0000000000000c40 RSI: 0000000000000008 RDI: ffffc90001a3f730
RBP: ffffc90001a3f958 R08: dffffc0000000000 R09: fffffbfff1bfcade
R10: fffffbfff1bfcade R11: 0000000000000000 R12: ffff8880838a9000
R13: ffff888011442140 R14: 0000000000000c40 R15: ffffc90001a3f730
kasan_save_stack mm/kasan/common.c:40 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xf8/0x110 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:269 [inline]
__kmalloc+0x253/0x380 mm/slub.c:4423
kmalloc include/linux/slab.h:595 [inline]
tomoyo_realpath_from_path+0xd8/0x610 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x238/0x660 security/tomoyo/file.c:822
security_inode_getattr+0xc0/0x140 security/security.c:1334
vfs_getattr fs/stat.c:157 [inline]
vfs_fstat fs/stat.c:182 [inline]
__do_sys_newfstat fs/stat.c:422 [inline]
__se_sys_newfstat+0xd1/0x820 fs/stat.c:419
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:0x7f589451f2e2
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:00007ffd44506178 EFLAGS: 00000246 ORIG_RAX: 0000000000000005
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f589451f2e2
RDX: 00007ffd44506190 RSI: 00007ffd44506190 RDI: 000000000000000e
RBP: 00007ffd44506330 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000080000 R11: 0000000000000246 R12: 0000561bd322c900
R13: 0000561bd321a010 R14: 0000561bd321e750 R15: 00007ffd445062f0
----------------
Code disassembly (best guess):
0: 00 eb add %ch,%bl
2: bc 66 90 55 41 mov $0x41559066,%esp
7: 57 push %rdi
8: 41 56 push %r14
a: 41 55 push %r13
c: 41 54 push %r12
e: 53 push %rbx
f: 48 83 ec 38 sub $0x38,%rsp
13: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax
1a: 00 00
1c: 48 89 44 24 30 mov %rax,0x30(%rsp)
21: 48 c7 44 24 28 00 00 movq $0x0,0x28(%rsp)
28: 00 00
* 2a: 31 c0 xor %eax,%eax <-- trapping instruction
2c: 85 f6 test %esi,%esi
2e: 0f 84 27 04 00 00 je 0x45b
34: 80 3d 1a 08 b9 0c 00 cmpb $0x0,0xcb9081a(%rip) # 0xcb90855
3b: 0f .byte 0xf
3c: 85 1a test %ebx,(%rdx)
3e: 04 00 add $0x0,%al