============================================ WARNING: possible recursive locking detected 4.19.211-syzkaller #0 Not tainted -------------------------------------------- kworker/u4:4/2889 is trying to acquire lock: 00000000e339a205 (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 but task is already holding lock: 00000000e339a205 (&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 6 locks held by kworker/u4:4/2889: #0: 000000007d02c8cc ((wq_completion)"%s""bat_events"){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124 #1: 00000000cba5c733 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 #2: 00000000ab03b448 (rcu_read_lock){....}, at: batadv_nc_process_nc_paths.part.0+0xb1/0x3d0 net/batman-adv/network-coding.c:695 #3: 000000009f1f9c40 (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #3: 000000009f1f9c40 (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115 #4: 00000000e339a205 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 #5: 00000000eb6b848a (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 stack backtrace: CPU: 1 PID: 2889 Comm: kworker/u4:4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Workqueue: bat_events batadv_nc_worker 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 9pnet_virtio: no channels available for device 127.0.0.1 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:bytes_is_nonzero mm/kasan/kasan.c:166 [inline] RIP: 0010:memory_is_nonzero mm/kasan/kasan.c:184 [inline] RIP: 0010:memory_is_poisoned_n mm/kasan/kasan.c:210 [inline] RIP: 0010:memory_is_poisoned mm/kasan/kasan.c:241 [inline] RIP: 0010:check_memory_region_inline mm/kasan/kasan.c:257 [inline] RIP: 0010:check_memory_region+0xba/0x170 mm/kasan/kasan.c:267 Code: 00 74 f1 48 8d 50 08 eb 09 48 83 c0 01 48 39 d0 74 0e 80 38 00 74 f2 48 85 c0 0f 85 9c 00 00 00 5b 5d 41 5c c3 48 85 d2 74 f6 <48> 01 ea eb 09 48 83 c0 01 48 39 d0 74 e8 80 38 00 74 f2 eb d8 41 RSP: 0018:ffff8880abc47c00 EFLAGS: 00000202 ORIG_RAX: ffffffffffffffd5 RAX: ffffed101742455a RBX: ffffed101742455b RCX: ffffffff81518c83 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8880ba122ad0 RBP: ffffed101742455a R08: 0000000000000000 R09: ffffed101742455a R10: ffff8880ba122ad3 R11: 0000000000000000 R12: dffffc0000000000 R13: 0000000000000014 R14: ffff8880b4226500 R15: 000000000000002b atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] rcu_dynticks_curr_cpu_in_eqs kernel/rcu/tree.c:350 [inline] rcu_is_watching+0x53/0xc0 kernel/rcu/tree.c:1025 rcu_read_lock include/linux/rcupdate.h:628 [inline] batadv_nc_process_nc_paths.part.0+0x2db/0x3d0 net/batman-adv/network-coding.c:698 batadv_nc_process_nc_paths net/batman-adv/network-coding.c:690 [inline] batadv_nc_worker+0xa59/0xd50 net/batman-adv/network-coding.c:746 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 ---------------- Code disassembly (best guess): 0: 00 74 f1 48 add %dh,0x48(%rcx,%rsi,8) 4: 8d 50 08 lea 0x8(%rax),%edx 7: eb 09 jmp 0x12 9: 48 83 c0 01 add $0x1,%rax d: 48 39 d0 cmp %rdx,%rax 10: 74 0e je 0x20 12: 80 38 00 cmpb $0x0,(%rax) 15: 74 f2 je 0x9 17: 48 85 c0 test %rax,%rax 1a: 0f 85 9c 00 00 00 jne 0xbc 20: 5b pop %rbx 21: 5d pop %rbp 22: 41 5c pop %r12 24: c3 retq 25: 48 85 d2 test %rdx,%rdx 28: 74 f6 je 0x20 * 2a: 48 01 ea add %rbp,%rdx <-- trapping instruction 2d: eb 09 jmp 0x38 2f: 48 83 c0 01 add $0x1,%rax 33: 48 39 d0 cmp %rdx,%rax 36: 74 e8 je 0x20 38: 80 38 00 cmpb $0x0,(%rax) 3b: 74 f2 je 0x2f 3d: eb d8 jmp 0x17 3f: 41 rex.B