====================================================== WARNING: possible circular locking dependency detected 5.15.186-syzkaller #0 Not tainted ------------------------------------------------------ syz.8.577/6573 is trying to acquire lock: ffff0000c6228120 (sk_lock-AF_INET6){+.+.}-{0:0}, at: inet_sk_diag_fill+0xbb4/0x1584 net/ipv4/inet_diag.c:342 but task is already holding lock: ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline] ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x830/0x10f0 net/mptcp/mptcp_diag.c:194 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:142 [inline] _raw_spin_lock+0xb0/0x10c kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:363 [inline] __inet_hash+0xd0/0x858 net/ipv4/inet_hashtables.c:613 inet6_hash+0x74/0x9c net/ipv6/inet6_hashtables.c:343 inet_csk_listen_start+0x1e4/0x2c8 net/ipv4/inet_connection_sock.c:1115 inet_listen+0x290/0x694 net/ipv4/af_inet.c:231 __sys_listen+0x198/0x21c net/socket.c:1754 __do_sys_listen net/socket.c:1763 [inline] __se_sys_listen net/socket.c:1761 [inline] __arm64_sys_listen+0x5c/0x74 net/socket.c:1761 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 -> #0 (sk_lock-AF_INET6){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2928/0x651c kernel/locking/lockdep.c:5012 lock_acquire+0x1f4/0x620 kernel/locking/lockdep.c:5623 lock_sock_fast include/net/sock.h:1726 [inline] mptcp_diag_get_info+0x1fc/0x868 net/mptcp/mptcp_diag.c:224 inet_sk_diag_fill+0xbb4/0x1584 net/ipv4/inet_diag.c:342 sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline] mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline] mptcp_diag_dump+0xb5c/0x10f0 net/mptcp/mptcp_diag.c:194 __inet_diag_dump+0x1dc/0x350 net/ipv4/inet_diag.c:1179 inet_diag_dump_compat+0x140/0x1d4 net/ipv4/inet_diag.c:1288 netlink_dump+0x49c/0xab4 net/netlink/af_netlink.c:2265 __netlink_dump_start+0x480/0x6f0 net/netlink/af_netlink.c:2368 netlink_dump_start include/linux/netlink.h:258 [inline] inet_diag_rcv_msg_compat+0x1ac/0x34c net/ipv4/inet_diag.c:1323 sock_diag_rcv_msg+0x168/0x390 net/core/sock_diag.c:-1 netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2489 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x60c/0x89c net/netlink/af_netlink.c:1337 netlink_sendmsg+0x6e8/0x9cc net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x61c/0x920 net/socket.c:2436 ___sys_sendmsg+0x1d0/0x240 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg net/socket.c:2526 [inline] __arm64_sys_sendmsg+0x1a8/0x254 net/socket.c:2526 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&h->lhash2[i].lock); lock(sk_lock-AF_INET6); lock(&h->lhash2[i].lock); lock(sk_lock-AF_INET6); *** DEADLOCK *** 6 locks held by syz.8.577/6573: #0: ffff8000162b6da8 (sock_diag_mutex){+.+.}-{3:3}, at: sock_diag_rcv+0x2c/0x54 net/core/sock_diag.c:275 #1: ffff8000162b6c68 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg+0x150/0x390 net/core/sock_diag.c:255 #2: ffff0000dcfb9690 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: __netlink_dump_start+0x108/0x6f0 net/netlink/af_netlink.c:2334 #3: ffff80001638dd48 (inet_diag_table_mutex){+.+.}-{3:3}, at: inet_diag_lock_handler net/ipv4/inet_diag.c:63 [inline] #3: ffff80001638dd48 (inet_diag_table_mutex){+.+.}-{3:3}, at: __inet_diag_dump+0x170/0x350 net/ipv4/inet_diag.c:1177 #4: ffff800014351360 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:311 #5: ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #5: ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline] #5: ffff0000c5827198 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x830/0x10f0 net/mptcp/mptcp_diag.c:194 stack backtrace: CPU: 0 PID: 6573 Comm: syz.8.577 Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2011 check_noncircular+0x240/0x2d4 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2928/0x651c kernel/locking/lockdep.c:5012 lock_acquire+0x1f4/0x620 kernel/locking/lockdep.c:5623 lock_sock_fast include/net/sock.h:1726 [inline] mptcp_diag_get_info+0x1fc/0x868 net/mptcp/mptcp_diag.c:224 inet_sk_diag_fill+0xbb4/0x1584 net/ipv4/inet_diag.c:342 sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline] mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline] mptcp_diag_dump+0xb5c/0x10f0 net/mptcp/mptcp_diag.c:194 __inet_diag_dump+0x1dc/0x350 net/ipv4/inet_diag.c:1179 inet_diag_dump_compat+0x140/0x1d4 net/ipv4/inet_diag.c:1288 netlink_dump+0x49c/0xab4 net/netlink/af_netlink.c:2265 __netlink_dump_start+0x480/0x6f0 net/netlink/af_netlink.c:2368 netlink_dump_start include/linux/netlink.h:258 [inline] inet_diag_rcv_msg_compat+0x1ac/0x34c net/ipv4/inet_diag.c:1323 sock_diag_rcv_msg+0x168/0x390 net/core/sock_diag.c:-1 netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2489 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x60c/0x89c net/netlink/af_netlink.c:1337 netlink_sendmsg+0x6e8/0x9cc net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x61c/0x920 net/socket.c:2436 ___sys_sendmsg+0x1d0/0x240 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg net/socket.c:2526 [inline] __arm64_sys_sendmsg+0x1a8/0x254 net/socket.c:2526 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 BUG: sleeping function called from invalid context at net/core/sock.c:3283 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6573, name: syz.8.577 INFO: lockdep is turned off. Preemption disabled at: [] spin_lock include/linux/spinlock.h:363 [inline] [] mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline] [] mptcp_diag_dump+0x830/0x10f0 net/mptcp/mptcp_diag.c:194 CPU: 0 PID: 6573 Comm: syz.8.577 Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ___might_sleep+0x358/0x4d4 kernel/sched/core.c:9639 __might_sleep+0x98/0x124 kernel/sched/core.c:9593 __lock_sock_fast+0x3c/0xec net/core/sock.c:3283 lock_sock_fast include/net/sock.h:1728 [inline] mptcp_diag_get_info+0x204/0x868 net/mptcp/mptcp_diag.c:224 inet_sk_diag_fill+0xbb4/0x1584 net/ipv4/inet_diag.c:342 sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline] mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline] mptcp_diag_dump+0xb5c/0x10f0 net/mptcp/mptcp_diag.c:194 __inet_diag_dump+0x1dc/0x350 net/ipv4/inet_diag.c:1179 inet_diag_dump_compat+0x140/0x1d4 net/ipv4/inet_diag.c:1288 netlink_dump+0x49c/0xab4 net/netlink/af_netlink.c:2265 __netlink_dump_start+0x480/0x6f0 net/netlink/af_netlink.c:2368 netlink_dump_start include/linux/netlink.h:258 [inline] inet_diag_rcv_msg_compat+0x1ac/0x34c net/ipv4/inet_diag.c:1323 sock_diag_rcv_msg+0x168/0x390 net/core/sock_diag.c:-1 netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2489 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x60c/0x89c net/netlink/af_netlink.c:1337 netlink_sendmsg+0x6e8/0x9cc net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x61c/0x920 net/socket.c:2436 ___sys_sendmsg+0x1d0/0x240 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg net/socket.c:2526 [inline] __arm64_sys_sendmsg+0x1a8/0x254 net/socket.c:2526 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584