============================================ WARNING: possible recursive locking detected 5.16.0-rc2-next-20211125-syzkaller #0 Not tainted -------------------------------------------- syz-executor.2/18896 is trying to acquire lock: ffffffff9079b770 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577 but task is already holding lock: ffffffff9079b770 (&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.2/18896: #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1323 [inline] #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1467 [inline] #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1496 [inline] #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1517 [inline] #0: ffff888084e146d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x86a/0x32e0 mm/memory.c:1538 #1: ffff888019aad8b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #1: ffff888019aad8b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #2: ffffffff9079b770 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 #3: ffff88806db5b098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 stack backtrace: CPU: 1 PID: 18896 Comm: syz-executor.2 Not tainted 5.16.0-rc2-next-20211125-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:rcu_read_lock_sched_held+0x45/0x70 kernel/rcu/update.c:125 Code: 00 84 c0 74 41 e8 cb 9b 00 00 84 c0 74 38 be ff ff ff ff 48 c7 c7 60 31 b8 8b e8 96 a8 eb 07 85 c0 75 d3 65 8b 05 4b ae 9f 7e ff ff ff 7f 75 c5 9c 41 5c 49 c1 ec 09 49 83 f4 01 41 83 e4 01 RSP: 0018:ffffc90005b175c0 EFLAGS: 00000246 RAX: 0000000080000002 RBX: 1ffff92000b62ebc RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8d914ad7 R10: fffffbfff1b2295a R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000000 R14: ffffffff8bb83220 R15: 0000000000000000 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x442/0x510 kernel/locking/lockdep.c:5608 rcu_lock_acquire include/linux/rcupdate.h:268 [inline] rcu_read_lock include/linux/rcupdate.h:694 [inline] folio_memcg_lock+0x3a/0x6c0 mm/memcontrol.c:2034 page_remove_rmap+0x25/0x1d10 mm/rmap.c:1348 zap_pte_range mm/memory.c:1357 [inline] zap_pmd_range mm/memory.c:1467 [inline] zap_pud_range mm/memory.c:1496 [inline] zap_p4d_range mm/memory.c:1517 [inline] unmap_page_range+0xe51/0x32e0 mm/memory.c:1538 unmap_single_vma+0x198/0x310 mm/memory.c:1583 unmap_vmas+0x16b/0x2f0 mm/memory.c:1615 exit_mmap+0x1d0/0x630 mm/mmap.c:3176 __mmput+0x122/0x4b0 kernel/fork.c:1115 mmput+0x56/0x60 kernel/fork.c:1136 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2c20 kernel/exit.c:819 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x34c/0x28b0 kernel/signal.c:2859 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f156e404ae9 Code: Unable to access opcode bytes at RIP 0x7f156e404abf. RSP: 002b:00007f156b97a218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 00007f156e517f68 RCX: 00007f156e404ae9 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f156e517f6c RBP: 00007f156e517f60 R08: 0000000000000001 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 00007f156e517f6c R13: 00007ffc1a46ec5f R14: 00007f156b97a300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 00 84 c0 74 41 e8 cb add %al,-0x3417be8c(%rax,%rax,8) 7: 9b fwait 8: 00 00 add %al,(%rax) a: 84 c0 test %al,%al c: 74 38 je 0x46 e: be ff ff ff ff mov $0xffffffff,%esi 13: 48 c7 c7 60 31 b8 8b mov $0xffffffff8bb83160,%rdi 1a: e8 96 a8 eb 07 callq 0x7eba8b5 1f: 85 c0 test %eax,%eax 21: 75 d3 jne 0xfffffff6 23: 65 8b 05 4b ae 9f 7e mov %gs:0x7e9fae4b(%rip),%eax # 0x7e9fae75 * 2a: a9 ff ff ff 7f test $0x7fffffff,%eax <-- trapping instruction 2f: 75 c5 jne 0xfffffff6 31: 9c pushfq 32: 41 5c pop %r12 34: 49 c1 ec 09 shr $0x9,%r12 38: 49 83 f4 01 xor $0x1,%r12 3c: 41 83 e4 01 and $0x1,%r12d