============================================ WARNING: possible recursive locking detected 5.16.0-rc3-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/2591 is trying to acquire lock: ffffffff9078d3f0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577 but task is already holding lock: ffffffff9078d3f0 (&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 syz-executor.0/2591: #0: ffff88807d3d8f28 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline] #0: ffff88807d3d8f28 (&mm->mmap_lock#2){++++}-{3:3}, at: __mm_populate+0x264/0x3e0 mm/gup.c:1581 #1: ffff8880707e1fb0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #1: ffff8880707e1fb0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #2: ffffffff9078d3f0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 #3: ffff88801dfee098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 stack backtrace: CPU: 0 PID: 2591 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_irq include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 7e b1 15 f8 48 89 ef e8 c6 27 16 f8 e8 41 e2 36 f8 fb bf 01 00 00 00 16 f0 08 f8 65 8b 05 ef 62 bb 76 85 c0 74 02 5d c3 e8 0b 38 b9 RSP: 0018:ffffc9000dc1f668 EFLAGS: 00000206 RAX: 0000000000010547 RBX: 0000000000000001 RCX: 1ffffffff1ff0d7e RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff88807e213b50 R08: 0000000000000001 R09: ffffffff8ff73a37 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000001 R14: ffffea0002acebc0 R15: ffffc9000dc1f708 spin_unlock_irq include/linux/spinlock.h:399 [inline] shmem_add_to_page_cache+0xeff/0x15d0 mm/shmem.c:746 shmem_getpage_gfp+0x838/0x22d0 mm/shmem.c:1936 shmem_fault+0x1b4/0x750 mm/shmem.c:2114 __do_fault+0x10d/0x4d0 mm/memory.c:3849 do_read_fault mm/memory.c:4164 [inline] do_fault mm/memory.c:4293 [inline] handle_pte_fault mm/memory.c:4551 [inline] __handle_mm_fault+0x28e8/0x5120 mm/memory.c:4686 handle_mm_fault+0x1c8/0x790 mm/memory.c:4784 faultin_page mm/gup.c:939 [inline] __get_user_pages+0x522/0xfb0 mm/gup.c:1160 populate_vma_page_range+0x24d/0x330 mm/gup.c:1492 __mm_populate+0x1ea/0x3e0 mm/gup.c:1601 mm_populate include/linux/mm.h:2734 [inline] vm_mmap_pgoff+0x20e/0x290 mm/util.c:524 ksys_mmap_pgoff+0x79/0x5a0 mm/mmap.c:1623 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:0x7f3f42853ae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3f417a8188 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f3f42967028 RCX: 00007f3f42853ae9 RDX: 0000000000000003 RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 00007f3f428adff7 R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffc52fdeef R14: 00007f3f417a8300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 5: 55 push %rbp 6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi b: 48 89 fd mov %rdi,%rbp e: 48 83 c7 18 add $0x18,%rdi 12: e8 7e b1 15 f8 callq 0xf815b195 17: 48 89 ef mov %rbp,%rdi 1a: e8 c6 27 16 f8 callq 0xf81627e5 1f: e8 41 e2 36 f8 callq 0xf836e265 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 16 f0 08 f8 callq 0xf808f045 <-- trapping instruction 2f: 65 8b 05 ef 62 bb 76 mov %gs:0x76bb62ef(%rip),%eax # 0x76bb6325 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5d pop %rbp 3b: c3 retq 3c: e8 .byte 0xe8 3d: 0b 38 or (%rax),%edi 3f: b9 .byte 0xb9