浏览代码

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 <khoroshilov@ispras.ru>
Signed-off-by: David Howells <dhowells@redhat.com>
Alexey Khoroshilov 11 年之前
父节点
当前提交
8f22ba61b5
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/rxrpc/ar-connection.c

+ 2 - 0
net/rxrpc/ar-connection.c

@@ -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