====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc4-next-20230117-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/24679 is trying to acquire lock: ffff8880493657b0 (slock-AF_INET){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline] ffff8880493657b0 (slock-AF_INET){+.-.}-{2:2}, at: release_sock+0x1f/0x1b0 net/core/sock.c:3483 but task is already holding lock: ffff888049365ab8 (clock-AF_INET){++..}-{2:2}, at: l2tp_tunnel_register+0x1c3/0xd80 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_INET){++..}-{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 sk_reuseport_match net/ipv4/inet_connection_sock.c:401 [inline] inet_csk_get_port+0x85f/0x26d0 net/ipv4/inet_connection_sock.c:532 inet_csk_listen_start+0x1ad/0x440 net/ipv4/inet_connection_sock.c:1237 inet_listen+0x235/0x640 net/ipv4/af_inet.c:228 __sys_listen+0x181/0x250 net/socket.c:1835 __do_sys_listen net/socket.c:1844 [inline] __se_sys_listen net/socket.c:1842 [inline] __x64_sys_listen+0x54/0x80 net/socket.c:1842 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 (&tcp_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/0x18c0 net/ipv4/inet_hashtables.c:230 tcp_v4_syn_recv_sock+0xb5a/0x14b0 net/ipv4/tcp_ipv4.c:1628 tcp_check_req+0x632/0x1aa0 net/ipv4/tcp_minisocks.c:803 tcp_v4_rcv+0x2120/0x3280 net/ipv4/tcp_ipv4.c:2070 ip_protocol_deliver_rcu+0x9f/0x480 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2ec/0x4f0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_local_deliver+0x1ae/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_sublist_rcv_finish+0x9a/0x2c0 net/ipv4/ip_input.c:580 ip_list_rcv_finish.constprop.0+0x4f9/0x6c0 net/ipv4/ip_input.c:630 ip_sublist_rcv net/ipv4/ip_input.c:638 [inline] ip_list_rcv+0x347/0x4a0 net/ipv4/ip_input.c:673 __netif_receive_skb_list_ptype net/core/dev.c:5525 [inline] __netif_receive_skb_list_core+0x548/0x8f0 net/core/dev.c:5573 __netif_receive_skb_list net/core/dev.c:5625 [inline] netif_receive_skb_list_internal+0x75f/0xdc0 net/core/dev.c:5716 gro_normal_list include/net/gro.h:433 [inline] gro_normal_list include/net/gro.h:429 [inline] napi_complete_done+0x243/0x960 net/core/dev.c:6056 virtqueue_napi_complete drivers/net/virtio_net.c:405 [inline] virtnet_poll+0xd08/0x1300 drivers/net/virtio_net.c:1809 __napi_poll+0xaf/0x430 net/core/dev.c:6485 napi_poll net/core/dev.c:6552 [inline] net_rx_action+0x8da/0xc70 net/core/dev.c:6663 __do_softirq+0x2e3/0xae3 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 common_interrupt+0xad/0xd0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:640 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline] acpi_safe_halt+0x40/0x50 drivers/acpi/processor_idle.c:112 acpi_idle_do_entry+0x53/0x70 drivers/acpi/processor_idle.c:573 acpi_idle_enter+0x173/0x290 drivers/acpi/processor_idle.c:711 cpuidle_enter_state+0xd3/0x6f0 drivers/cpuidle/cpuidle.c:267 cpuidle_enter+0x4e/0xa0 drivers/cpuidle/cpuidle.c:388 cpuidle_idle_call kernel/sched/idle.c:215 [inline] do_idle+0x348/0x440 kernel/sched/idle.c:282 cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:379 rest_init+0x16d/0x2b0 init/main.c:732 arch_call_rest_init+0x13/0x1c init/main.c:894 start_kernel+0x44f/0x470 init/main.c:1148 secondary_startup_64_no_verify+0xce/0xdb -> #0 (slock-AF_INET){+.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3107 [inline] check_prevs_add kernel/locking/lockdep.c:3226 [inline] validate_chain kernel/locking/lockdep.c:3841 [inline] __lock_acquire+0x2a9d/0x5780 kernel/locking/lockdep.c:5073 lock_acquire.part.0+0x11c/0x350 kernel/locking/lockdep.c:5690 __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+0x2e0/0xd80 net/l2tp/l2tp_core.c:1487 l2tp_nl_cmd_tunnel_create+0x3d6/0x8b0 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x925/0xe20 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg+0xde/0x190 net/socket.c:745 ____sys_sendmsg+0x71c/0x900 net/socket.c:2501 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2555 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2584 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_INET --> &tcp_hashinfo.bhash[i].lock --> clock-AF_INET Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(clock-AF_INET); lock(&tcp_hashinfo.bhash[i].lock); lock(clock-AF_INET); lock(slock-AF_INET); *** DEADLOCK *** 4 locks held by syz-executor.0/24679: #0: ffffffff8e15df10 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1075 #1: ffffffff8e15dfc8 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8e15dfc8 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x51a/0x7e0 net/netlink/genetlink.c:1063 #2: ffff888049365830 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] #2: ffff888049365830 (sk_lock-AF_INET){+.+.}-{0:0}, at: l2tp_tunnel_register+0x1af/0xd80 net/l2tp/l2tp_core.c:1483 #3: ffff888049365ab8 (clock-AF_INET){++..}-{2:2}, at: l2tp_tunnel_register+0x1c3/0xd80 net/l2tp/l2tp_core.c:1484 stack backtrace: CPU: 0 PID: 24679 Comm: syz-executor.0 Not tainted 6.2.0-rc4-next-20230117-syzkaller #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:2187 check_prev_add kernel/locking/lockdep.c:3107 [inline] check_prevs_add kernel/locking/lockdep.c:3226 [inline] validate_chain kernel/locking/lockdep.c:3841 [inline] __lock_acquire+0x2a9d/0x5780 kernel/locking/lockdep.c:5073 lock_acquire.part.0+0x11c/0x350 kernel/locking/lockdep.c:5690 __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+0x2e0/0xd80 net/l2tp/l2tp_core.c:1487 l2tp_nl_cmd_tunnel_create+0x3d6/0x8b0 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x925/0xe20 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg+0xde/0x190 net/socket.c:745 ____sys_sendmsg+0x71c/0x900 net/socket.c:2501 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2555 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2584 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:0x7f2159a8c0c9 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:00007f215a7e1168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f2159babf80 RCX: 00007f2159a8c0c9 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00007f2159ae7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcccbef72f R14: 00007f215a7e1300 R15: 0000000000022000