WARNING: possible circular locking dependency detected
6.8.0-rc5-syzkaller-00278-g603c04e27c3e #0 Not tainted
------------------------------------------------------
syz-executor.0/32718 is trying to acquire lock:
ffff888011c48d70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
ffff888011c48d70 (k-sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_diag_get_aux+0x515/0x9f0 net/ipv4/tcp_diag.c:137
but task is already holding lock:
ffffc90000a771f8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffffc90000a771f8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x3b5/0x1e20 net/ipv4/inet_diag.c:1038
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&h->lhash2[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:351 [inline]
__inet_hash+0x116/0xaf0 net/ipv4/inet_hashtables.c:743
inet_hash net/ipv4/inet_hashtables.c:768 [inline]
inet_hash+0x60/0x80 net/ipv4/inet_hashtables.c:763
inet_csk_listen_start+0x2b8/0x380 net/ipv4/inet_connection_sock.c:1261
__inet_listen_sk+0x211/0x670 net/ipv4/af_inet.c:217
mptcp_listen+0x187/0x410 net/mptcp/protocol.c:3786
__sys_listen+0x19b/0x280 net/socket.c:1881
__do_sys_listen net/socket.c:1890 [inline]
__se_sys_listen net/socket.c:1888 [inline]
__ia32_sys_listen+0x53/0x80 net/socket.c:1888
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7c/0x86
-> #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 kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
lock_sock_fast include/net/sock.h:1723 [inline]
subflow_get_info+0x145/0xcf0 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x515/0x9f0 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0xc99/0x1fd0 net/ipv4/inet_diag.c:345
inet_diag_dump_icsk+0x5d2/0x1e20 net/ipv4/inet_diag.c:1061
__inet_diag_dump+0x115/0x300 net/ipv4/inet_diag.c:1263
inet_diag_dump_compat+0x219/0x2a0 net/ipv4/inet_diag.c:1371
netlink_dump+0x58f/0xcc0 net/netlink/af_netlink.c:2264
__netlink_dump_start+0x6e0/0x9c0 net/netlink/af_netlink.c:2370
netlink_dump_start include/linux/netlink.h:338 [inline]
inet_diag_rcv_msg_compat+0x277/0x2d0 net/ipv4/inet_diag.c:1405
sock_diag_rcv_msg net/core/sock_diag.c:261 [inline]
sock_diag_rcv_msg+0x2e8/0x450 net/core/sock_diag.c:248
netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2543
sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9b4/0xb50 net/socket.c:2584
___sys_sendmsg+0x135/0x1e0 net/socket.c:2638
__sys_sendmsg+0x117/0x1f0 net/socket.c:2667
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7c/0x86
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 ***
5 locks held by syz-executor.0/32718:
#0: ffffffff8f0be6c8 (sock_diag_mutex){+.+.}-{3:3}, at: sock_diag_rcv+0x1b/0x40 net/core/sock_diag.c:279
#1: ffffffff8f0be848 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg net/core/sock_diag.c:259 [inline]
#1: ffffffff8f0be848 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg+0x2ce/0x450 net/core/sock_diag.c:248
#2: ffff888047db9680 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: netlink_dump+0xc1/0xcc0 net/netlink/af_netlink.c:2211
#3: ffffffff8f24f108 (inet_diag_table_mutex){+.+.}-{3:3}, at: inet_diag_lock_handler+0x6e/0x100 net/ipv4/inet_diag.c:63
#4: ffffc90000a771f8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#4: ffffc90000a771f8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x3b5/0x1e20 net/ipv4/inet_diag.c:1038
stack backtrace:
CPU: 1 PID: 32718 Comm: syz-executor.0 Not tainted 6.8.0-rc5-syzkaller-00278-g603c04e27c3e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
check_noncircular+0x31b/0x400 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 kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
lock_sock_fast include/net/sock.h:1723 [inline]
subflow_get_info+0x145/0xcf0 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x515/0x9f0 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0xc99/0x1fd0 net/ipv4/inet_diag.c:345
inet_diag_dump_icsk+0x5d2/0x1e20 net/ipv4/inet_diag.c:1061
__inet_diag_dump+0x115/0x300 net/ipv4/inet_diag.c:1263
inet_diag_dump_compat+0x219/0x2a0 net/ipv4/inet_diag.c:1371
netlink_dump+0x58f/0xcc0 net/netlink/af_netlink.c:2264
__netlink_dump_start+0x6e0/0x9c0 net/netlink/af_netlink.c:2370
netlink_dump_start include/linux/netlink.h:338 [inline]
inet_diag_rcv_msg_compat+0x277/0x2d0 net/ipv4/inet_diag.c:1405
sock_diag_rcv_msg net/core/sock_diag.c:261 [inline]
sock_diag_rcv_msg+0x2e8/0x450 net/core/sock_diag.c:248
netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2543
sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9b4/0xb50 net/socket.c:2584
___sys_sendmsg+0x135/0x1e0 net/socket.c:2638
__sys_sendmsg+0x117/0x1f0 net/socket.c:2667
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7c/0x86
RIP: 0023:0xf72f2579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f5eec5ac EFLAGS: 00000292 ORIG_RAX: 0000000000000172
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000240
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
BUG: sleeping function called from invalid context at net/core/sock.c:3553
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 32718, name: syz-executor.0
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 32718 Comm: syz-executor.0 Not tainted 6.8.0-rc5-syzkaller-00278-g603c04e27c3e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106
__might_resched+0x3c7/0x5e0 kernel/sched/core.c:10176
__lock_sock_fast+0x25/0xe0 net/core/sock.c:3553
lock_sock_fast include/net/sock.h:1725 [inline]
subflow_get_info+0x14d/0xcf0 net/mptcp/diag.c:28
tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline]
tcp_diag_get_aux+0x515/0x9f0 net/ipv4/tcp_diag.c:137
inet_sk_diag_fill+0xc99/0x1fd0 net/ipv4/inet_diag.c:345
inet_diag_dump_icsk+0x5d2/0x1e20 net/ipv4/inet_diag.c:1061
__inet_diag_dump+0x115/0x300 net/ipv4/inet_diag.c:1263
inet_diag_dump_compat+0x219/0x2a0 net/ipv4/inet_diag.c:1371
netlink_dump+0x58f/0xcc0 net/netlink/af_netlink.c:2264
__netlink_dump_start+0x6e0/0x9c0 net/netlink/af_netlink.c:2370
netlink_dump_start include/linux/netlink.h:338 [inline]
inet_diag_rcv_msg_compat+0x277/0x2d0 net/ipv4/inet_diag.c:1405
sock_diag_rcv_msg net/core/sock_diag.c:261 [inline]
sock_diag_rcv_msg+0x2e8/0x450 net/core/sock_diag.c:248
netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2543
sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9b4/0xb50 net/socket.c:2584
___sys_sendmsg+0x135/0x1e0 net/socket.c:2638
__sys_sendmsg+0x117/0x1f0 net/socket.c:2667
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7c/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7c/0x86
RIP: 0023:0xf72f2579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f5eec5ac EFLAGS: 00000292 ORIG_RAX: 0000000000000172
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000240
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 10 06 adc %al,(%rsi)
2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi
6: 10 07 adc %al,(%rdi)
8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi
c: 10 08 adc %cl,(%rax)
e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi
1e: 00 51 52 add %dl,0x52(%rcx)
21: 55 push %rbp
22: 89 e5 mov %esp,%ebp
24: 0f 34 sysenter
26: cd 80 int $0x80
* 28: 5d pop %rbp <-- trapping instruction
29: 5a pop %rdx
2a: 59 pop %rcx
2b: c3 ret
2c: 90 nop
2d: 90 nop
2e: 90 nop
2f: 90 nop
30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi
37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi