====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Not tainted ------------------------------------------------------ syz-executor.5/17744 is trying to acquire lock: ffff0001134d8eb0 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x34/0x1d4 net/core/sock.c:3648 but task is already holding lock: ffff0001134d9138 (k-clock-AF_INET){+++.}-{2:2}, at: l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (k-clock-AF_INET){+++.}-{2:2}: __raw_write_lock_bh include/linux/rwlock_api_smp.h:202 [inline] _raw_write_lock_bh+0x54/0x6c kernel/locking/spinlock.c:334 sock_orphan include/net/sock.h:2090 [inline] dccp_close+0x39c/0x688 net/dccp/proto.c:1039 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x34/0xac net/socket.c:678 inet_ctl_sock_destroy include/net/inet_common.h:71 [inline] dccp_v4_exit_net+0x3c/0x54 net/dccp/ipv4.c:1050 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x348/0x648 net/core/net_namespace.c:601 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863 -> #0 (k-sk_lock-AF_INET){+.+.}-{0:0}: 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+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 lock_sock_fast include/net/sock.h:1753 [inline] udp_destroy_sock+0x68/0x164 net/ipv4/udp.c:2645 sk_common_release+0x34/0x1d4 net/core/sock.c:3648 udp_lib_close+0x20/0x30 include/net/udp.h:189 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x34/0xac net/socket.c:678 l2tp_tunnel_register+0x52c/0x79c net/l2tp/l2tp_core.c:1530 l2tp_nl_cmd_tunnel_create+0x1f8/0x330 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x458/0x4f4 net/netlink/genetlink.c:850 netlink_rcv_skb+0xe8/0x1d4 net/netlink/af_netlink.c:2540 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel+0xfc/0x1dc net/netlink/af_netlink.c:1319 netlink_unicast+0x164/0x248 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x484/0x584 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x2f8/0x440 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x1ac/0x228 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __arm64_sys_sendmsg+0x2c/0x3c net/socket.c:2572 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(k-clock-AF_INET); lock(k-sk_lock-AF_INET); lock(k-clock-AF_INET); lock(k-sk_lock-AF_INET); *** DEADLOCK *** 3 locks held by syz-executor.5/17744: #0: ffff80000d894668 (cb_lock){++++}-{3:3}, at: genl_rcv+0x28/0x50 net/netlink/genetlink.c:860 #1: ffff80000d894578 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffff80000d894578 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x80/0x4f4 net/netlink/genetlink.c:848 #2: ffff0001134d9138 (k-clock-AF_INET){+++.}-{2:2}, at: l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 stack backtrace: CPU: 1 PID: 17744 Comm: syz-executor.5 Not tainted 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2055 check_noncircular+0x14c/0x154 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+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 lock_sock_fast include/net/sock.h:1753 [inline] udp_destroy_sock+0x68/0x164 net/ipv4/udp.c:2645 sk_common_release+0x34/0x1d4 net/core/sock.c:3648 udp_lib_close+0x20/0x30 include/net/udp.h:189 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x34/0xac net/socket.c:678 l2tp_tunnel_register+0x52c/0x79c net/l2tp/l2tp_core.c:1530 l2tp_nl_cmd_tunnel_create+0x1f8/0x330 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x458/0x4f4 net/netlink/genetlink.c:850 netlink_rcv_skb+0xe8/0x1d4 net/netlink/af_netlink.c:2540 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel+0xfc/0x1dc net/netlink/af_netlink.c:1319 netlink_unicast+0x164/0x248 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x484/0x584 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x2f8/0x440 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x1ac/0x228 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __arm64_sys_sendmsg+0x2c/0x3c net/socket.c:2572 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 BUG: sleeping function called from invalid context at net/core/sock.c:3479 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 17744, name: syz-executor.5 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [] l2tp_tunnel_register+0x354/0x79c net/l2tp/l2tp_core.c:1477 CPU: 1 PID: 17744 Comm: syz-executor.5 Not tainted 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 __might_resched+0x208/0x218 kernel/sched/core.c:9908 __might_sleep+0x48/0x78 kernel/sched/core.c:9837 __lock_sock_fast+0x2c/0x8c net/core/sock.c:3479 lock_sock_fast include/net/sock.h:1755 [inline] udp_destroy_sock+0x70/0x164 net/ipv4/udp.c:2645 sk_common_release+0x34/0x1d4 net/core/sock.c:3648 udp_lib_close+0x20/0x30 include/net/udp.h:189 inet_release+0xc8/0xe4 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x34/0xac net/socket.c:678 l2tp_tunnel_register+0x52c/0x79c net/l2tp/l2tp_core.c:1530 l2tp_nl_cmd_tunnel_create+0x1f8/0x330 net/l2tp/l2tp_netlink.c:245 genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline] genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x458/0x4f4 net/netlink/genetlink.c:850 netlink_rcv_skb+0xe8/0x1d4 net/netlink/af_netlink.c:2540 genl_rcv+0x38/0x50 net/netlink/genetlink.c:861 netlink_unicast_kernel+0xfc/0x1dc net/netlink/af_netlink.c:1319 netlink_unicast+0x164/0x248 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x484/0x584 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x2f8/0x440 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x1ac/0x228 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __arm64_sys_sendmsg+0x2c/0x3c net/socket.c:2572 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584