Skip to content

Commit

Permalink
RxRPC: do not unlock unheld spinlock in rxrpc_connect_exclusive()
Browse files Browse the repository at this point in the history
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 <khoroshilov@ispras.ru>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
khoroshilov authored and dhowells committed Jan 26, 2014
1 parent d8ec26d commit 8f22ba6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/rxrpc/ar-connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,

rxrpc_assign_connection_id(conn);
rx->conn = conn;
} else {
spin_lock(&trans->client_lock);
}

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

0 comments on commit 8f22ba6

Please sign in to comment.