[PATCH] vsock/vmci: Fix lockdep warnings

From: Ian Forbes

Date: Fri Mar 13 2026 - 12:34:09 EST


We are taking the same class of lock when accepting a new socket while
holding the lock for the accepting socket itself. This pattern can be
found in many other net drivers so just copy what they are doing.

Signed-off-by: Ian Forbes <ian.forbes@xxxxxxxxxxxx>
---
net/vmw_vsock/vmci_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 4296ca1183f1..3176cc8af2c7 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -964,7 +964,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
*/
pending = vmci_transport_get_pending(sk, pkt);
if (pending) {
- lock_sock(pending);
+ lock_sock_nested(pending, SINGLE_DEPTH_NESTING);

/* The local context ID may be out of date. */
vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context;
--
2.53.0