====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc3-syzkaller-00197-g87b93b678e95 #0 Not tainted ------------------------------------------------------ syz-executor.5/14217 is trying to acquire lock: ffff88807e735070 (slock-AF_INET6){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline] ffff88807e735070 (slock-AF_INET6){+.-.}-{2:2}, at: release_sock+0x1f/0x1b0 net/core/sock.c:3483 but task is already holding lock: ffff88807e735378 (clock-AF_INET6){++--}-{2:2}, at: l2tp_tunnel_register+0x2be/0x11e0 net/l2tp/l2tp_core.c:1484 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (clock-AF_INET6){++--}-{2:2}: __raw_read_lock_bh include/linux/rwlock_api_smp.h:176 [inline] _raw_read_lock_bh+0x3f/0x70 kernel/locking/spinlock.c:252 sock_i_uid+0x1f/0xb0 net/core/sock.c:2564 inet_bhash2_addr_any_conflict+0x2c/0x420 net/ipv4/inet_connection_sock.c:266 inet_csk_get_port+0x1c9f/0x2660 net/ipv4/inet_connection_sock.c:537 __inet6_bind+0x625/0x1b20 net/ipv6/af_inet6.c:413 inet6_bind+0x177/0x220 net/ipv6/af_inet6.c:472 __sys_bind+0x1ed/0x260 net/socket.c:1776 __do_sys_bind net/socket.c:1787 [inline] __se_sys_bind net/socket.c:1785 [inline] __x64_sys_bind+0x73/0xb0 net/socket.c:1785 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&dccp_hashinfo.bhash[i].lock){+.-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] __inet_inherit_port+0x2b5/0x1840 net/ipv4/inet_hashtables.c:230 dccp_v6_request_recv_sock+0x9e4/0x1910 net/dccp/ipv6.c:546 dccp_check_req+0x2fa/0xa40 net/dccp/minisocks.c:195 dccp_v6_rcv+0x73e/0x11f0 net/dccp/ipv6.c:759 ip6_protocol_deliver_rcu+0x2dd/0x1280 net/ipv6/ip6_input.c:439 ip6_input_finish+0x150/0x2c0 net/ipv6/ip6_input.c:484 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip6_input+0xa0/0xd0 net/ipv6/ip6_input.c:493 dst_input include/net/dst.h:454 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:79 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ipv6_rcv+0x250/0x380 net/ipv6/ip6_input.c:309 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5482 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5596 process_backlog+0x3e4/0x810 net/core/dev.c:5924 __napi_poll+0xb8/0x770 net/core/dev.c:6485 napi_poll net/core/dev.c:6552 [inline] net_rx_action+0xa00/0xde0 net/core/dev.c:6663 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 do_softirq.part.0+0xde/0x130 kernel/softirq.c:472 do_softirq kernel/softirq.c:464 [inline] __local_bh_enable_ip+0x106/0x130 kernel/softirq.c:396 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:834 [inline] ip6_finish_output2+0x5be/0x1530 net/ipv6/ip6_output.c:135 __ip6_finish_output net/ipv6/ip6_output.c:195 [inline] ip6_finish_output+0x694/0x1170 net/ipv6/ip6_output.c:206 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1f1/0x540 net/ipv6/ip6_output.c:227 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip6_xmit+0x11f7/0x1c60 net/ipv6/ip6_output.c:343 inet6_csk_xmit+0x3b5/0x6d0 net/ipv6/inet6_connection_sock.c:135 dccp_transmit_skb+0xcfe/0x1450 net/dccp/output.c:138 dccp_send_ack.part.0+0x16b/0x2f0 net/dccp/output.c:600 dccp_send_ack+0x57/0x70 net/dccp/output.c:584 dccp_rcv_request_sent_state_process net/dccp/input.c:497 [inline] dccp_rcv_state_process+0x1081/0x1380 net/dccp/input.c:676 dccp_v6_do_rcv+0x2ad/0xc60 net/dccp/ipv6.c:653 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x133/0x3b0 net/core/sock.c:2928 release_sock+0x58/0x1b0 net/core/sock.c:3485 inet_wait_for_connect net/ipv4/af_inet.c:598 [inline] __inet_stream_connect+0x757/0xed0 net/ipv4/af_inet.c:690 inet_stream_connect+0x57/0xa0 net/ipv4/af_inet.c:729 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (slock-AF_INET6){+.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x33/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] release_sock+0x1f/0x1b0 net/core/sock.c:3483 l2tp_tunnel_register+0x3db/0x11e0 net/l2tp/l2tp_core.c:1487 pppol2tp_connect+0xcdc/0x1a10 net/l2tp/l2tp_ppp.c:723 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: slock-AF_INET6 --> &dccp_hashinfo.bhash[i].lock --> clock-AF_INET6 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(clock-AF_INET6); lock(&dccp_hashinfo.bhash[i].lock); lock(clock-AF_INET6); lock(slock-AF_INET6); *** DEADLOCK *** 3 locks held by syz-executor.5/14217: #0: ffff888051147130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] #0: ffff888051147130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0xadc/0x1a10 net/l2tp/l2tp_ppp.c:675 #1: ffff88807e7350f0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] #1: ffff88807e7350f0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: l2tp_tunnel_register+0x2aa/0x11e0 net/l2tp/l2tp_core.c:1483 #2: ffff88807e735378 (clock-AF_INET6){++--}-{2:2}, at: l2tp_tunnel_register+0x2be/0x11e0 net/l2tp/l2tp_core.c:1484 stack backtrace: CPU: 0 PID: 14217 Comm: syz-executor.5 Not tainted 6.2.0-rc3-syzkaller-00197-g87b93b678e95 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x33/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] release_sock+0x1f/0x1b0 net/core/sock.c:3483 l2tp_tunnel_register+0x3db/0x11e0 net/l2tp/l2tp_core.c:1487 pppol2tp_connect+0xcdc/0x1a10 net/l2tp/l2tp_ppp.c:723 __sys_connect_file+0x153/0x1a0 net/socket.c:1976 __sys_connect+0x165/0x1a0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4be408c0c9 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:00007f4be4d6e168 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f4be41abf80 RCX: 00007f4be408c0c9 RDX: 0000000000000032 RSI: 0000000020000040 RDI: 0000000000000005 RBP: 00007f4be40e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffee5d4861f R14: 00007f4be4d6e300 R15: 0000000000022000