====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc5-syzkaller-01316-g170d97739de4 #0 Not tainted ------------------------------------------------------ syz-executor.2/32217 is trying to acquire lock: ffff8880451dbb30 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: sk_common_release+0x68/0x390 net/core/sock.c:3662 but task is already holding lock: ffff8880451dbdb8 (k-clock-AF_INET){+++.}-{2:2}, at: l2tp_tunnel_register+0x126/0x1210 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+0x33/0x40 kernel/locking/spinlock.c:334 sock_orphan include/net/sock.h:2090 [inline] dccp_close+0x4c8/0xd60 net/dccp/proto.c:1045 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x8b/0x1b0 net/socket.c:678 inet_ctl_sock_destroy include/net/inet_common.h:71 [inline] dccp_v4_exit_net+0x15a/0x2c0 net/dccp/ipv4.c:1050 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #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+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 lock_sock_fast include/net/sock.h:1753 [inline] udp_destroy_sock+0x34/0x250 net/ipv4/udp.c:2661 sk_common_release+0x68/0x390 net/core/sock.c:3662 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x8b/0x1b0 net/socket.c:678 l2tp_tunnel_register+0xc75/0x1210 net/l2tp/l2tp_core.c:1530 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+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 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: 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.2/32217: #0: ffffffff8df53370 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1075 #1: ffffffff8df53428 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8df53428 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x51a/0x7e0 net/netlink/genetlink.c:1063 #2: ffff8880451dbdb8 (k-clock-AF_INET){+++.}-{2:2}, at: l2tp_tunnel_register+0x126/0x1210 net/l2tp/l2tp_core.c:1477 stack backtrace: CPU: 1 PID: 32217 Comm: syz-executor.2 Not tainted 6.1.0-rc5-syzkaller-01316-g170d97739de4 #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 lock_sock_fast include/net/sock.h:1753 [inline] udp_destroy_sock+0x34/0x250 net/ipv4/udp.c:2661 sk_common_release+0x68/0x390 net/core/sock.c:3662 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x8b/0x1b0 net/socket.c:678 l2tp_tunnel_register+0xc75/0x1210 net/l2tp/l2tp_core.c:1530 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+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 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:0x7f96d208c0d9 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:00007f96d2e82168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f96d21abf80 RCX: 00007f96d208c0d9 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00007f96d20e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff22263f3f R14: 00007f96d2e82300 R15: 0000000000022000 BUG: sleeping function called from invalid context at net/core/sock.c:3493 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 32217, name: syz-executor.2 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 32217 Comm: syz-executor.2 Not tainted 6.1.0-rc5-syzkaller-01316-g170d97739de4 #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 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9890 __lock_sock_fast+0x25/0xe0 net/core/sock.c:3493 lock_sock_fast include/net/sock.h:1755 [inline] udp_destroy_sock+0x3c/0x250 net/ipv4/udp.c:2661 sk_common_release+0x68/0x390 net/core/sock.c:3662 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_release+0x8b/0x1b0 net/socket.c:678 l2tp_tunnel_register+0xc75/0x1210 net/l2tp/l2tp_core.c:1530 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+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 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:0x7f96d208c0d9 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:00007f96d2e82168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f96d21abf80 RCX: 00007f96d208c0d9 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 00007f96d20e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff22263f3f R14: 00007f96d2e82300 R15: 0000000000022000