======================================================
WARNING: possible circular locking dependency detected
6.8.0-rc5-syzkaller-01592-g25d434257464 #0 Not tainted
------------------------------------------------------
syz-executor.1/14343 is trying to acquire lock:
ffff88807c257098 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
ffff88807c257098 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_diag_get_aux+0x738/0x830 net/ipv4/tcp_diag.c:137
but task is already holding lock:
ffffc90001338c90 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffffc90001338c90 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x3d8/0x2050 net/ipv4/inet_diag.c:1052
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&h->lhash2[i].lock){+.+.}-{2:2}:
lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
__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:351 [inline]
__inet_hash+0x335/0xbe0 net/ipv4/inet_hashtables.c:743
inet_csk_listen_start+0x23a/0x320 net/ipv4/inet_connection_sock.c:1261
__inet_listen_sk+0x2a2/0x770 net/ipv4/af_inet.c:217
mptcp_listen+0x22a/0x670 net/mptcp/protocol.c:3788
__sys_listen+0x1b7/0x230 net/socket.c:1881
__do_sys_listen net/socket.c:1890 [inline]
__se_sys_listen net/socket.c:1888 [inline]
__x64_sys_listen+0x5a/0x70 net/socket.c:1888
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
-> #0 (k-sk_lock-AF_INET){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18ca/0x58e0 kernel/locking/lockdep.c:3869
__lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
lock_sock_fast include/net/sock.h:1737 [inline]
subflow_get_info+0x166/0xd20 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x738/0x830 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0x10f3/0x1e10 net/ipv4/inet_diag.c:354
inet_diag_dump_icsk+0x587/0x2050 net/ipv4/inet_diag.c:1075
__inet_diag_dump net/ipv4/inet_diag.c:1281 [inline]
inet_diag_dump_compat+0x2cb/0x540 net/ipv4/inet_diag.c:1389
netlink_dump+0x730/0xda0 net/netlink/af_netlink.c:2268
__netlink_dump_start+0x59d/0x780 net/netlink/af_netlink.c:2376
netlink_dump_start include/linux/netlink.h:340 [inline]
inet_diag_rcv_msg_compat+0x209/0x4c0 net/ipv4/inet_diag.c:1423
sock_diag_rcv_msg+0x3dd/0x5f0
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2549
netlink_unicast_kernel net/netlink/af_netlink.c:1337 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1363
netlink_sendmsg+0xa3b/0xd70 net/netlink/af_netlink.c:1904
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&h->lhash2[i].lock);
lock(k-sk_lock-AF_INET);
lock(&h->lhash2[i].lock);
lock(k-sk_lock-AF_INET);
*** DEADLOCK ***
2 locks held by syz-executor.1/14343:
#0: ffff8880394cf678 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: __netlink_dump_start+0x119/0x780 net/netlink/af_netlink.c:2340
#1: ffffc90001338c90 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#1: ffffc90001338c90 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x3d8/0x2050 net/ipv4/inet_diag.c:1052
stack backtrace:
CPU: 0 PID: 14343 Comm: syz-executor.1 Not tainted 6.8.0-rc5-syzkaller-01592-g25d434257464 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18ca/0x58e0 kernel/locking/lockdep.c:3869
__lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5754
lock_sock_fast include/net/sock.h:1737 [inline]
subflow_get_info+0x166/0xd20 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x738/0x830 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0x10f3/0x1e10 net/ipv4/inet_diag.c:354
inet_diag_dump_icsk+0x587/0x2050 net/ipv4/inet_diag.c:1075
__inet_diag_dump net/ipv4/inet_diag.c:1281 [inline]
inet_diag_dump_compat+0x2cb/0x540 net/ipv4/inet_diag.c:1389
netlink_dump+0x730/0xda0 net/netlink/af_netlink.c:2268
__netlink_dump_start+0x59d/0x780 net/netlink/af_netlink.c:2376
netlink_dump_start include/linux/netlink.h:340 [inline]
inet_diag_rcv_msg_compat+0x209/0x4c0 net/ipv4/inet_diag.c:1423
sock_diag_rcv_msg+0x3dd/0x5f0
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2549
netlink_unicast_kernel net/netlink/af_netlink.c:1337 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1363
netlink_sendmsg+0xa3b/0xd70 net/netlink/af_netlink.c:1904
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f0ef447dda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0ef52280c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f0ef45abf80 RCX: 00007f0ef447dda9
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00007f0ef44ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f0ef45abf80 R15: 00007ffcae72b1c8
BUG: sleeping function called from invalid context at net/core/sock.c:3563
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 14343, name: syz-executor.1
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 14343 Comm: syz-executor.1 Not tainted 6.8.0-rc5-syzkaller-01592-g25d434257464 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
__might_resched+0x5d3/0x780 kernel/sched/core.c:10176
__lock_sock_fast+0x31/0xe0 net/core/sock.c:3563
lock_sock_fast include/net/sock.h:1739 [inline]
subflow_get_info+0x172/0xd20 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x738/0x830 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0x10f3/0x1e10 net/ipv4/inet_diag.c:354
inet_diag_dump_icsk+0x587/0x2050 net/ipv4/inet_diag.c:1075
__inet_diag_dump net/ipv4/inet_diag.c:1281 [inline]
inet_diag_dump_compat+0x2cb/0x540 net/ipv4/inet_diag.c:1389
netlink_dump+0x730/0xda0 net/netlink/af_netlink.c:2268
__netlink_dump_start+0x59d/0x780 net/netlink/af_netlink.c:2376
netlink_dump_start include/linux/netlink.h:340 [inline]
inet_diag_rcv_msg_compat+0x209/0x4c0 net/ipv4/inet_diag.c:1423
sock_diag_rcv_msg+0x3dd/0x5f0
netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2549
netlink_unicast_kernel net/netlink/af_netlink.c:1337 [inline]
netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1363
netlink_sendmsg+0xa3b/0xd70 net/netlink/af_netlink.c:1904
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0x221/0x270 net/socket.c:745
____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f0ef447dda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0ef52280c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f0ef45abf80 RCX: 00007f0ef447dda9
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00007f0ef44ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f0ef45abf80 R15: 00007ffcae72b1c8