============================================ WARNING: possible recursive locking detected 4.19.211-syzkaller #0 Not tainted -------------------------------------------- syz-executor.1/21647 is trying to acquire lock: 0000000046c7c236 (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 but task is already holding lock: 0000000046c7c236 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 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 3 locks held by syz-executor.1/21647: #0: 00000000069d209f (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #0: 00000000069d209f (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115 #1: 0000000046c7c236 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 #2: 00000000507db499 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 stack backtrace: CPU: 1 PID: 21647 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_deadlock_bug kernel/locking/lockdep.c:1764 [inline] check_deadlock kernel/locking/lockdep.c:1808 [inline] validate_chain kernel/locking/lockdep.c:2404 [inline] __lock_acquire.cold+0x121/0x57e kernel/locking/lockdep.c:3416 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:152 uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 n_hdlc_send_frames+0x278/0x470 drivers/tty/n_hdlc.c:403 n_hdlc_tty_wakeup+0xa0/0xc0 drivers/tty/n_hdlc.c:479 tty_wakeup+0xd4/0x110 drivers/tty/tty_io.c:534 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:50 serial8250_tx_chars+0x490/0xaf0 drivers/tty/serial/8250/8250_port.c:1813 serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1900 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1873 [inline] serial8250_default_handle_irq+0xae/0x220 drivers/tty/serial/8250/8250_port.c:1916 serial8250_interrupt+0x101/0x240 drivers/tty/serial/8250/8250_core.c:125 __handle_irq_event_percpu+0x27e/0x8e0 kernel/irq/handle.c:149 handle_irq_event_percpu kernel/irq/handle.c:189 [inline] handle_irq_event+0x102/0x290 kernel/irq/handle.c:206 handle_edge_irq+0x260/0xcf0 kernel/irq/chip.c:800 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline] handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0x93/0x1c0 arch/x86/kernel/irq.c:246 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:670 RIP: 0010:write_comp_data+0x23/0x70 kernel/kcov.c:122 Code: 1f 84 00 00 00 00 00 49 89 f1 49 89 fa 65 48 8b 34 25 c0 df 01 00 65 8b 05 7a 59 9f 7e a9 00 01 1f 00 75 4f 8b 86 60 13 00 00 <83> f8 03 75 44 48 8b 86 68 13 00 00 8b b6 64 13 00 00 48 8b 38 48 RSP: 0018:ffff8880af16fe70 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffd2 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8155fbdb RDX: 0000000000000000 RSI: ffff8880b015a140 RDI: 0000000000000005 RBP: 1ffff11015e2dfd2 R08: 1ffff11015e2dff9 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: dffffc0000000000 R13: 00007ffdc86bfea0 R14: 0000000000000000 R15: 0000000000000000 clockid_to_kclock kernel/time/posix-timers.c:1358 [inline] __do_sys_clock_nanosleep kernel/time/posix-timers.c:1213 [inline] __se_sys_clock_nanosleep+0x7b/0x360 kernel/time/posix-timers.c:1209 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f93ad9ac0f1 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 aa e7 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 e3 e7 ff ff 48 8b 04 24 eb 97 66 2e 0f 1f RSP: 002b:00007ffdc86bfe60 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 00007f93ada99f80 RCX: 00007f93ad9ac0f1 RDX: 00007ffdc86bfea0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f93ada9b980 R08: 0000000000000000 R09: 0000004cf9855179 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000048b2d R13: 00007ffdc86bffb0 R14: 00007ffdc86bffd0 R15: 0000000000000032 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 84 00 test %al,(%rax) 2: 00 00 add %al,(%rax) 4: 00 00 add %al,(%rax) 6: 49 89 f1 mov %rsi,%r9 9: 49 89 fa mov %rdi,%r10 c: 65 48 8b 34 25 c0 df mov %gs:0x1dfc0,%rsi 13: 01 00 15: 65 8b 05 7a 59 9f 7e mov %gs:0x7e9f597a(%rip),%eax # 0x7e9f5996 1c: a9 00 01 1f 00 test $0x1f0100,%eax 21: 75 4f jne 0x72 23: 8b 86 60 13 00 00 mov 0x1360(%rsi),%eax * 29: 83 f8 03 cmp $0x3,%eax <-- trapping instruction 2c: 75 44 jne 0x72 2e: 48 8b 86 68 13 00 00 mov 0x1368(%rsi),%rax 35: 8b b6 64 13 00 00 mov 0x1364(%rsi),%esi 3b: 48 8b 38 mov (%rax),%rdi 3e: 48 rex.W