__xfrm_init_state+0x60e/0x1030 net/xfrm/xfrm_state.c:2271 ============================================ WARNING: possible recursive locking detected 4.16.0+ #10 Not tainted -------------------------------------------- xfrm_init_state+0x1e/0x80 net/xfrm/xfrm_state.c:2297 syz-executor5/30110 is trying to acquire lock: pfkey_msg2xfrm_state net/key/af_key.c:1282 [inline] pfkey_add+0x1f52/0x3210 net/key/af_key.c:1499 000000002cc6814e ( rtnl_mutex ){+.+.}, at: rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 but task is already holding lock: 000000002cc6814e ( rtnl_mutex){+.+.} pfkey_process+0x7cc/0x8a0 net/key/af_key.c:2819 , at: rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 other info that might help us debug this: Possible unsafe locking scenario: pfkey_sendmsg+0x5f4/0x1050 net/key/af_key.c:3658 CPU0 ---- lock( rtnl_mutex); lock( sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 rtnl_mutex); ___sys_sendmsg+0x805/0x940 net/socket.c:2117 *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz-executor5/30110: #0: 000000002cc6814e ( rtnl_mutex){+.+.} , at: rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 #1: 000000000351fa7f ( ipvs->sync_mutex ){+.+.}, at: do_ip_vs_set_ctl+0x562/0x1d30 net/netfilter/ipvs/ip_vs_ctl.c:2388 stack backtrace: __sys_sendmsg+0x115/0x270 net/socket.c:2155 SYSC_sendmsg net/socket.c:2164 [inline] SyS_sendmsg+0x29/0x30 net/socket.c:2162 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x455389 RSP: 002b:00007f2cf32dec68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f2cf32df6d4 RCX: 0000000000455389 RDX: 0000000000000000 RSI: 0000000020f56000 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000014 R13: 00000000000004f3 R14: 00000000006fa768 R15: 0000000000000005 CPU: 0 PID: 30110 Comm: syz-executor5 Not tainted 4.16.0+ #10 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1b9/0x294 lib/dump_stack.c:113 print_deadlock_bug kernel/locking/lockdep.c:1761 [inline] check_deadlock kernel/locking/lockdep.c:1805 [inline] validate_chain kernel/locking/lockdep.c:2401 [inline] __lock_acquire.cold.62+0x18c/0x55b kernel/locking/lockdep.c:3431 lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3920 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16d/0x17f0 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 ip_mc_drop_socket+0x8f/0x270 net/ipv4/igmp.c:2643 inet_release+0x4e/0x1f0 net/ipv4/af_inet.c:413 sock_release+0x96/0x1b0 net/socket.c:594 start_sync_thread+0xdc3/0x2d40 net/netfilter/ipvs/ip_vs_sync.c:1924 do_ip_vs_set_ctl+0x59c/0x1d30 net/netfilter/ipvs/ip_vs_ctl.c:2389 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x7d/0xd0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0xd8/0xf0 net/ipv4/ip_sockglue.c:1253 tcp_setsockopt+0x93/0xe0 net/ipv4/tcp.c:3027 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:3042 __sys_setsockopt+0x1bd/0x390 net/socket.c:1903 SYSC_setsockopt net/socket.c:1914 [inline] SyS_setsockopt+0x34/0x50 net/socket.c:1911 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x455389 RSP: 002b:00007fc390655c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fc3906566d4 RCX: 0000000000455389 RDX: 000000000000048b RSI: 0000000000000000 RDI: 0000000000000014 RBP: 000000000072bea0 R08: 0000000000000018 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000529 R14: 00000000006fac78 R15: 0000000000000000