====================================================== WARNING: possible circular locking dependency detected 6.8.0-rc6-syzkaller-g9910665503b3 #0 Not tainted ------------------------------------------------------ syz-executor.2/10863 is trying to acquire lock: ffff0000c81d0e30 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline] ffff0000c81d0e30 (k-sk_lock-AF_INET6){+.+.}-{0:0}, at: tcp_diag_get_aux+0x680/0x750 net/ipv4/tcp_diag.c:137 but task is already holding lock: ffff0000c32b6fd8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff0000c32b6fd8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x2f4/0x1b94 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+0x48/0x60 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __inet_hash+0x2a4/0xb6c net/ipv4/inet_hashtables.c:743 inet6_hash+0x74/0x9c net/ipv6/inet6_hashtables.c:355 inet_csk_listen_start+0x1e4/0x2c8 net/ipv4/inet_connection_sock.c:1261 __inet_listen_sk+0x204/0x640 net/ipv4/af_inet.c:217 inet_listen+0xac/0x120 net/ipv4/af_inet.c:239 rds_tcp_listen_init+0x378/0x504 net/rds/tcp_listen.c:316 rds_tcp_init_net+0x12c/0x2e8 net/rds/tcp.c:577 ops_init+0x2e8/0x548 net/core/net_namespace.c:136 __register_pernet_operations net/core/net_namespace.c:1214 [inline] register_pernet_operations+0x268/0x700 net/core/net_namespace.c:1283 register_pernet_device+0x3c/0x9c net/core/net_namespace.c:1370 rds_tcp_init+0x74/0xe0 net/rds/tcp.c:735 do_one_initcall+0x23c/0x98c init/main.c:1236 do_initcall_level+0x154/0x214 init/main.c:1298 do_initcalls+0x58/0xac init/main.c:1314 do_basic_setup+0x8c/0xa0 init/main.c:1333 kernel_init_freeable+0x320/0x474 init/main.c:1551 kernel_init+0x24/0x29c init/main.c:1441 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 -> #0 (k-sk_lock-AF_INET6){+.+.}-{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+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5754 lock_sock_fast include/net/sock.h:1723 [inline] subflow_get_info+0x150/0xb2c net/mptcp/diag.c:28 tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline] tcp_diag_get_aux+0x680/0x750 net/ipv4/tcp_diag.c:137 inet_sk_diag_fill+0xd60/0x1818 net/ipv4/inet_diag.c:345 inet_diag_dump_icsk+0x460/0x1b94 net/ipv4/inet_diag.c:1061 tcp_diag_dump+0xb0/0xc8 net/ipv4/tcp_diag.c:188 __inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1263 inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1371 netlink_dump+0x474/0xa8c net/netlink/af_netlink.c:2264 __netlink_dump_start+0x4f0/0x704 net/netlink/af_netlink.c:2370 netlink_dump_start include/linux/netlink.h:338 [inline] inet_diag_rcv_msg_compat+0x1cc/0x420 net/ipv4/inet_diag.c:1405 sock_diag_rcv_msg+0x174/0x39c netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2543 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:280 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1367 netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2667 __do_sys_sendmsg net/socket.c:2676 [inline] __se_sys_sendmsg net/socket.c:2674 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2674 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&h->lhash2[i].lock); lock(k-sk_lock-AF_INET6); lock(&h->lhash2[i].lock); lock(k-sk_lock-AF_INET6); *** DEADLOCK *** 5 locks held by syz-executor.2/10863: #0: ffff800091959dc8 (sock_diag_mutex){+.+.}-{3:3}, at: sock_diag_rcv+0x2c/0x54 net/core/sock_diag.c:279 #1: ffff800091959c28 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg+0x15c/0x39c net/core/sock_diag.c:259 #2: ffff0000cce39680 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: netlink_dump+0xc4/0xa8c net/netlink/af_netlink.c:2211 #3: ffff800091a362c8 (inet_diag_table_mutex){+.+.}-{3:3}, at: inet_diag_lock_handler net/ipv4/inet_diag.c:63 [inline] #3: ffff800091a362c8 (inet_diag_table_mutex){+.+.}-{3:3}, at: __inet_diag_dump+0x17c/0x33c net/ipv4/inet_diag.c:1261 #4: ffff0000c32b6fd8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #4: ffff0000c32b6fd8 (&h->lhash2[i].lock){+.+.}-{2:2}, at: inet_diag_dump_icsk+0x2f4/0x1b94 net/ipv4/inet_diag.c:1038 stack backtrace: CPU: 1 PID: 10863 Comm: syz-executor.2 Not tainted 6.8.0-rc6-syzkaller-g9910665503b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060 check_noncircular+0x310/0x404 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+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5754 lock_sock_fast include/net/sock.h:1723 [inline] subflow_get_info+0x150/0xb2c net/mptcp/diag.c:28 tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline] tcp_diag_get_aux+0x680/0x750 net/ipv4/tcp_diag.c:137 inet_sk_diag_fill+0xd60/0x1818 net/ipv4/inet_diag.c:345 inet_diag_dump_icsk+0x460/0x1b94 net/ipv4/inet_diag.c:1061 tcp_diag_dump+0xb0/0xc8 net/ipv4/tcp_diag.c:188 __inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1263 inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1371 netlink_dump+0x474/0xa8c net/netlink/af_netlink.c:2264 __netlink_dump_start+0x4f0/0x704 net/netlink/af_netlink.c:2370 netlink_dump_start include/linux/netlink.h:338 [inline] inet_diag_rcv_msg_compat+0x1cc/0x420 net/ipv4/inet_diag.c:1405 sock_diag_rcv_msg+0x174/0x39c netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2543 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:280 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1367 netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2667 __do_sys_sendmsg net/socket.c:2676 [inline] __se_sys_sendmsg net/socket.c:2674 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2674 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 BUG: sleeping function called from invalid context at net/core/sock.c:3553 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 10863, name: syz-executor.2 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [] spin_lock include/linux/spinlock.h:351 [inline] [] inet_diag_dump_icsk+0x2f4/0x1b94 net/ipv4/inet_diag.c:1038 CPU: 1 PID: 10863 Comm: syz-executor.2 Not tainted 6.8.0-rc6-syzkaller-g9910665503b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 __might_resched+0x374/0x4d0 kernel/sched/core.c:10176 __might_sleep+0x90/0xe4 kernel/sched/core.c:10105 __lock_sock_fast+0x38/0xec net/core/sock.c:3553 lock_sock_fast include/net/sock.h:1725 [inline] subflow_get_info+0x158/0xb2c net/mptcp/diag.c:28 tcp_diag_put_ulp net/ipv4/tcp_diag.c:100 [inline] tcp_diag_get_aux+0x680/0x750 net/ipv4/tcp_diag.c:137 inet_sk_diag_fill+0xd60/0x1818 net/ipv4/inet_diag.c:345 inet_diag_dump_icsk+0x460/0x1b94 net/ipv4/inet_diag.c:1061 tcp_diag_dump+0xb0/0xc8 net/ipv4/tcp_diag.c:188 __inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1263 inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1371 netlink_dump+0x474/0xa8c net/netlink/af_netlink.c:2264 __netlink_dump_start+0x4f0/0x704 net/netlink/af_netlink.c:2370 netlink_dump_start include/linux/netlink.h:338 [inline] inet_diag_rcv_msg_compat+0x1cc/0x420 net/ipv4/inet_diag.c:1405 sock_diag_rcv_msg+0x174/0x39c netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2543 sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:280 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1367 netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2667 __do_sys_sendmsg net/socket.c:2676 [inline] __se_sys_sendmsg net/socket.c:2674 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2674 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598