Skip to content

Commit 8f22ba6

Browse files
khoroshilovdhowells
authored andcommitted
RxRPC: do not unlock unheld spinlock in rxrpc_connect_exclusive()
If rx->conn is not NULL, rxrpc_connect_exclusive() does not acquire the transport's client lock, but it still releases it. The patch adds locking of the spinlock to this path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent d8ec26d commit 8f22ba6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/rxrpc/ar-connection.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
381381

382382
rxrpc_assign_connection_id(conn);
383383
rx->conn = conn;
384+
} else {
385+
spin_lock(&trans->client_lock);
384386
}
385387

386388
/* we've got a connection with a free channel and we can now attach the

0 commit comments

Comments
 (0)