============================================ WARNING: possible recursive locking detected 4.19.211-syzkaller #0 Not tainted -------------------------------------------- syz-executor.2/16122 is trying to acquire lock: 00000000e2d9d3e3 (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 but task is already holding lock: 00000000e2d9d3e3 (&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 4 locks held by syz-executor.2/16122: #0: 0000000061c2e53f (&xt[i].mutex){+.+.}, at: xt_find_table_lock+0x3d/0x430 net/netfilter/x_tables.c:1207 #1: 00000000c0577a3b (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #1: 00000000c0577a3b (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115 #2: 00000000e2d9d3e3 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 #3: 000000001d0a2a77 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 stack backtrace: CPU: 1 PID: 16122 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/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:stackdepot_memcmp lib/stackdepot.c:179 [inline] RIP: 0010:find_stack lib/stackdepot.c:195 [inline] RIP: 0010:depot_save_stack+0x12e/0x410 lib/stackdepot.c:242 Code: 47 8d 48 85 ed 75 12 e9 b6 00 00 00 48 8b 6d 00 48 85 ed 0f 84 a9 00 00 00 39 5d 08 75 ee 3b 7d 0c 75 e9 31 c0 48 8b 54 c5 18 <48> 39 14 c1 75 dc 48 83 c0 01 48 39 c6 75 ec 48 8b 3c 24 48 85 ff RSP: 0018:ffff8880489b7760 EFLAGS: 00000206 ORIG_RAX: ffffffffffffffd2 RAX: 0000000000000007 RBX: 00000000f11b43c7 RCX: ffff8880489b77c0 RDX: ffffffff86d81036 RSI: 000000000000000c RDI: 000000000000000c RBP: ffff88809cbfc170 R08: 00000000006000c0 R09: 0000000000000003 R10: 00000000528cb325 R11: 00000000ef140b1b R12: ffff8880489b77a8 R13: 00000000000b43c7 R14: ffff88813bff04c0 R15: 0000000000000060 save_stack mm/kasan/kasan.c:454 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0x139/0x160 mm/kasan/kasan.c:553 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc_node mm/slab.c:3340 [inline] kmem_cache_alloc_node_trace+0x13c/0x3b0 mm/slab.c:3666 kmalloc_node include/linux/slab.h:553 [inline] alloc_vmap_area+0x12e/0x980 mm/vmalloc.c:420 __get_vm_area_node+0x17b/0x3a0 mm/vmalloc.c:1401 __vmalloc_node_range mm/vmalloc.c:1748 [inline] __vmalloc_node mm/vmalloc.c:1804 [inline] __vmalloc_node_flags mm/vmalloc.c:1818 [inline] vzalloc+0xe6/0x1a0 mm/vmalloc.c:1857 do_ipt_get_ctl+0x4ed/0x8e0 net/ipv4/netfilter/ip_tables.c:803 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1574 [inline] ip_getsockopt+0x167/0x1c0 net/ipv4/ip_sockglue.c:1554 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:3629 __sys_getsockopt+0x135/0x210 net/socket.c:2050 __do_sys_getsockopt net/socket.c:2061 [inline] __se_sys_getsockopt net/socket.c:2058 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2058 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f3e97dbdbca Code: 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc01f546d8 EFLAGS: 00000216 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3e97dbdbca RDX: 0000000000000041 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007ffc01f54700 R08: 00007ffc01f546fc R09: ffffffffffff0000 R10: 00007ffc01f54760 R11: 0000000000000216 R12: 00007ffc01f54760 R13: 0000000000000003 R14: 00007ffc01f546fc R15: 00007f3e97eb3d20 ---------------- Code disassembly (best guess): 0: 47 8d 48 85 rex.RXB lea -0x7b(%r8),%r9d 4: ed in (%dx),%eax 5: 75 12 jne 0x19 7: e9 b6 00 00 00 jmpq 0xc2 c: 48 8b 6d 00 mov 0x0(%rbp),%rbp 10: 48 85 ed test %rbp,%rbp 13: 0f 84 a9 00 00 00 je 0xc2 19: 39 5d 08 cmp %ebx,0x8(%rbp) 1c: 75 ee jne 0xc 1e: 3b 7d 0c cmp 0xc(%rbp),%edi 21: 75 e9 jne 0xc 23: 31 c0 xor %eax,%eax 25: 48 8b 54 c5 18 mov 0x18(%rbp,%rax,8),%rdx * 2a: 48 39 14 c1 cmp %rdx,(%rcx,%rax,8) <-- trapping instruction 2e: 75 dc jne 0xc 30: 48 83 c0 01 add $0x1,%rax 34: 48 39 c6 cmp %rax,%rsi 37: 75 ec jne 0x25 39: 48 8b 3c 24 mov (%rsp),%rdi 3d: 48 85 ff test %rdi,%rdi