============================================ WARNING: possible recursive locking detected 4.19.211-syzkaller #0 Not tainted -------------------------------------------- syz-executor.5/12049 is trying to acquire lock: 000000008b33efb2 (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 but task is already holding lock: 000000008b33efb2 (&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.5/12049: #0: 0000000030e050ac (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #0: 0000000030e050ac (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115 #1: 000000008b33efb2 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 #2: 0000000061bf125c (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 stack backtrace: CPU: 1 PID: 12049 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/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:__read_once_size include/linux/compiler.h:263 [inline] RIP: 0010:compound_head include/linux/page-flags.h:142 [inline] RIP: 0010:PageSwapCache include/linux/page-flags.h:338 [inline] RIP: 0010:free_swap_cache mm/swap_state.c:291 [inline] RIP: 0010:free_pages_and_swap_cache+0x247/0x3a0 mm/swap_state.c:319 Code: 89 f6 e8 1c 96 d0 ff 45 39 f7 0f 84 ca 00 00 00 e8 1e 95 d0 ff 4c 89 e8 48 c1 e8 03 80 3c 18 00 0f 85 04 01 00 00 4d 8b 65 00 <49> 8d 44 24 08 48 89 44 24 08 48 c1 e8 03 80 3c 18 00 0f 85 ff 00 RSP: 0018:ffff88804fbff718 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffd2 RAX: 1ffff110160fee88 RBX: dffffc0000000000 RCX: ffffffff8191f044 RDX: 0000000000000000 RSI: ffffffff8191f052 RDI: 0000000000000004 RBP: ffffea00028ff280 R08: 0000000000000001 R09: 00000000000001fe R10: 0000000000000004 R11: 0000000000000000 R12: ffffea000279e180 R13: ffff8880b07f7440 R14: 0000000000000086 R15: 00000000000001fe tlb_flush_mmu_free mm/memory.c:261 [inline] zap_pte_range mm/memory.c:1417 [inline] zap_pmd_range mm/memory.c:1463 [inline] zap_pud_range mm/memory.c:1492 [inline] zap_p4d_range mm/memory.c:1513 [inline] unmap_page_range+0x221f/0x2c50 mm/memory.c:1534 unmap_single_vma+0x198/0x300 mm/memory.c:1579 unmap_vmas+0xa9/0x180 mm/memory.c:1609 exit_mmap+0x2b9/0x530 mm/mmap.c:3093 __mmput kernel/fork.c:1016 [inline] mmput+0x14e/0x4a0 kernel/fork.c:1037 exit_mm kernel/exit.c:549 [inline] do_exit+0xaec/0x2be0 kernel/exit.c:857 do_group_exit+0x125/0x310 kernel/exit.c:967 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7febe7da65a9 Code: Bad RIP value. RSP: 002b:00007febe671a218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007febe7ec7f88 RCX: 00007febe7da65a9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007febe7ec7f88 RBP: 00007febe7ec7f80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007febe7ec7f8c R13: 00007fff472cc9cf R14: 00007febe671a300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 89 f6 mov %esi,%esi 2: e8 1c 96 d0 ff callq 0xffd09623 7: 45 39 f7 cmp %r14d,%r15d a: 0f 84 ca 00 00 00 je 0xda 10: e8 1e 95 d0 ff callq 0xffd09533 15: 4c 89 e8 mov %r13,%rax 18: 48 c1 e8 03 shr $0x3,%rax 1c: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) 20: 0f 85 04 01 00 00 jne 0x12a 26: 4d 8b 65 00 mov 0x0(%r13),%r12 * 2a: 49 8d 44 24 08 lea 0x8(%r12),%rax <-- trapping instruction 2f: 48 89 44 24 08 mov %rax,0x8(%rsp) 34: 48 c1 e8 03 shr $0x3,%rax 38: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) 3c: 0f .byte 0xf 3d: 85 ff test %edi,%edi