============================================ WARNING: possible recursive locking detected 5.16.0-rc3-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/6554 is trying to acquire lock: ffffffff90799c10 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577 but task is already holding lock: ffffffff90799c10 (&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 3 locks held by syz-executor.0/6554: #0: ffff8880790d6db0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #0: ffff8880790d6db0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #1: ffffffff90799c10 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 #2: ffff88807978a098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 stack backtrace: CPU: 1 PID: 6554 Comm: syz-executor.0 Not tainted 5.16.0-rc3-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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 ea ec 14 f8 48 89 ef e8 32 63 15 f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 f3 2b 08 f8 65 8b 05 fc 69 bb 76 85 c0 74 0a 5b 5d c3 e8 10 23 RSP: 0018:ffffc90001af7c78 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff1b21841 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff8880216ecaa0 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817d2958 R11: 0000000000000000 R12: 0000000000000000 R13: ffff888024a58280 R14: 0000000000000000 R15: ffff888024a58890 do_wait+0x79c/0xce0 kernel/exit.c:1546 kernel_wait4+0x14c/0x260 kernel/exit.c:1684 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1712 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:0x7f7925769f87 Code: 89 7c 24 10 48 89 4c 24 18 e8 35 50 02 00 4c 8b 54 24 18 8b 54 24 14 41 89 c0 48 8b 74 24 08 8b 7c 24 10 b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 89 44 24 10 e8 65 50 02 00 8b 44 RSP: 002b:00007ffdef5759e0 EFLAGS: 00000293 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 0000000000001336 RCX: 00007f7925769f87 RDX: 0000000040000001 RSI: 00007ffdef575a6c RDI: 00000000ffffffff RBP: 00007ffdef575a6c R08: 0000000000000000 R09: 00007ffdef5c0080 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032 R13: 000000000011e260 R14: 0000000000000009 R15: 00007ffdef575ad0 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 24 10 and $0x10,%al 2: e8 ea ec 14 f8 callq 0xf814ecf1 7: 48 89 ef mov %rbp,%rdi a: e8 32 63 15 f8 callq 0xf8156341 f: 81 e3 00 02 00 00 and $0x200,%ebx 15: 75 25 jne 0x3c 17: 9c pushfq 18: 58 pop %rax 19: f6 c4 02 test $0x2,%ah 1c: 75 2d jne 0x4b 1e: 48 85 db test %rbx,%rbx 21: 74 01 je 0x24 23: fb sti 24: bf 01 00 00 00 mov $0x1,%edi * 29: e8 f3 2b 08 f8 callq 0xf8082c21 <-- trapping instruction 2e: 65 8b 05 fc 69 bb 76 mov %gs:0x76bb69fc(%rip),%eax # 0x76bb6a31 35: 85 c0 test %eax,%eax 37: 74 0a je 0x43 39: 5b pop %rbx 3a: 5d pop %rbp 3b: c3 retq 3c: e8 .byte 0xe8 3d: 10 23 adc %ah,(%rbx)