============================================ WARNING: possible recursive locking detected 4.19.211-syzkaller #0 Not tainted -------------------------------------------- syz-executor.2/15261 is trying to acquire lock: 00000000c1630a09 (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591 but task is already holding lock: 00000000c1630a09 (&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 8 locks held by syz-executor.2/15261: #0: 00000000a3d35d35 (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1512 [inline] #0: 00000000a3d35d35 (sk_lock-AF_INET6){+.+.}, at: sctp_setsockopt+0x1ea/0x4b40 net/sctp/socket.c:4337 #1: 00000000282a8760 (rcu_read_lock){....}, at: sctp_v6_xmit+0x262/0x710 net/sctp/ipv6.c:226 #2: 00000000282a8760 (rcu_read_lock){....}, at: __write_once_size include/linux/compiler.h:290 [inline] #2: 00000000282a8760 (rcu_read_lock){....}, at: __skb_unlink include/linux/skbuff.h:1920 [inline] #2: 00000000282a8760 (rcu_read_lock){....}, at: __skb_dequeue include/linux/skbuff.h:1936 [inline] #2: 00000000282a8760 (rcu_read_lock){....}, at: process_backlog+0x1d0/0x700 net/core/dev.c:5847 #3: 00000000282a8760 (rcu_read_lock){....}, at: ip6_input_finish+0x0/0x17a0 include/linux/skbuff.h:898 #4: 00000000abd60623 (slock-AF_INET6){+.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #4: 00000000abd60623 (slock-AF_INET6){+.-.}, at: sctp_rcv+0x14b0/0x3300 net/sctp/input.c:243 #5: 00000000664db3b5 (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] #5: 00000000664db3b5 (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115 #6: 00000000c1630a09 (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876 #7: 00000000b57231b7 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293 stack backtrace: CPU: 1 PID: 15261 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/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:sk_fullsock include/net/sock.h:2462 [inline] RIP: 0010:inet6_sk include/linux/ipv6.h:330 [inline] RIP: 0010:sctp_v6_get_dst+0xde/0x1c90 net/sctp/ipv6.c:246 Code: e8 03 42 80 3c 28 00 0f 85 f0 19 00 00 48 8b 85 a8 fe ff ff 4d 8b b4 24 b0 00 00 00 48 8d 78 12 48 b8 00 00 00 00 00 fc ff df <48> 89 fa 48 c1 ea 03 0f b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 RSP: 0018:ffff8880ba106f70 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffd2 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffff8880408d2e00 RDX: 0000000000000100 RSI: ffffffff87789ac7 RDI: ffff8880408d2e12 RBP: ffff8880ba107148 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: ffff88801b91d200 R13: dffffc0000000000 R14: ffff88808c9e0680 R15: ffffffff8afe7060 sctp_transport_route+0x125/0x350 net/sctp/transport.c:312 sctp_assoc_add_peer+0x5bf/0x1050 net/sctp/associola.c:677 sctp_process_init+0xfd/0x2b60 net/sctp/sm_make_chunk.c:2354 sctp_sf_do_5_1B_init+0x85f/0xde0 net/sctp/sm_statefuns.c:426 sctp_do_sm+0x162/0x5110 net/sctp/sm_sideeffect.c:1167 sctp_endpoint_bh_rcv+0x405/0x880 net/sctp/endpointola.c:457 sctp_inq_push+0x1da/0x270 net/sctp/inqueue.c:95 sctp_rcv+0x1642/0x3300 net/sctp/input.c:268 sctp6_rcv+0x12/0x30 net/sctp/ipv6.c:1072 ip6_input_finish+0x46a/0x17a0 net/ipv6/ip6_input.c:385 NF_HOOK include/linux/netfilter.h:289 [inline] ip6_input+0xcf/0x3c0 net/ipv6/ip6_input.c:428 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish+0x1d9/0x2f0 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] ipv6_rcv+0xf2/0x3f0 net/ipv6/ip6_input.c:273 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:4954 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5066 process_backlog+0x241/0x700 net/core/dev.c:5849 napi_poll net/core/dev.c:6280 [inline] net_rx_action+0x4ac/0xfb0 net/core/dev.c:6346 __do_softirq+0x265/0x980 kernel/softirq.c:292 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1092 do_softirq.part.0+0x160/0x1c0 kernel/softirq.c:336 do_softirq kernel/softirq.c:328 [inline] __local_bh_enable_ip+0x20e/0x270 kernel/softirq.c:189 local_bh_enable include/linux/bottom_half.h:32 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:721 [inline] ip6_finish_output2+0x11a9/0x2290 net/ipv6/ip6_output.c:121 ip6_finish_output+0x89b/0x10f0 net/ipv6/ip6_output.c:192 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x205/0x770 net/ipv6/ip6_output.c:209 dst_output include/net/dst.h:455 [inline] NF_HOOK include/linux/netfilter.h:289 [inline] ip6_xmit+0xdbf/0x20a0 net/ipv6/ip6_output.c:313 sctp_v6_xmit+0x377/0x710 net/sctp/ipv6.c:229 sctp_packet_transmit+0x1e21/0x3660 net/sctp/output.c:641 sctp_packet_singleton net/sctp/outqueue.c:792 [inline] sctp_outq_flush_ctrl.constprop.0+0x6d3/0xc40 net/sctp/outqueue.c:923 sctp_outq_flush net/sctp/outqueue.c:1205 [inline] sctp_outq_uncork+0x10b/0x200 net/sctp/outqueue.c:777 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1815 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x72a/0x5110 net/sctp/sm_sideeffect.c:1170 sctp_primitive_ASSOCIATE+0x98/0xc0 net/sctp/primitive.c:88 __sctp_connect+0x968/0xd00 net/sctp/socket.c:1258 __sctp_setsockopt_connectx+0x132/0x1c0 net/sctp/socket.c:1381 sctp_setsockopt_connectx_old net/sctp/socket.c:1397 [inline] sctp_setsockopt+0x29d9/0x4b40 net/sctp/socket.c:4354 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fbb4f37a0a9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fbb4d8ec168 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fbb4f499f80 RCX: 00007fbb4f37a0a9 RDX: 000000000000006b RSI: 0000000000000084 RDI: 0000000000000004 RBP: 00007fbb4f3d5ae9 R08: 000000000000001c R09: 0000000000000000 R10: 000000002055bfe4 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc4867337f R14: 00007fbb4d8ec300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: e8 03 42 80 3c callq 0x3c804208 5: 28 00 sub %al,(%rax) 7: 0f 85 f0 19 00 00 jne 0x19fd d: 48 8b 85 a8 fe ff ff mov -0x158(%rbp),%rax 14: 4d 8b b4 24 b0 00 00 mov 0xb0(%r12),%r14 1b: 00 1c: 48 8d 78 12 lea 0x12(%rax),%rdi 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 48 89 fa mov %rdi,%rdx <-- trapping instruction 2d: 48 c1 ea 03 shr $0x3,%rdx 31: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 35: 48 89 fa mov %rdi,%rdx 38: 83 e2 07 and $0x7,%edx 3b: 38 d0 cmp %dl,%al 3d: 7f 08 jg 0x47 3f: 84 .byte 0x84