rxrpc: Access socket accept queue under right lock
authorDavid Howells <dhowells@redhat.com>
Tue, 28 Jun 2016 15:58:36 +0000 (16:58 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 6 Jul 2016 09:43:51 +0000 (10:43 +0100)
The socket's accept queue (socket->acceptq) should be accessed under
socket->call_lock, not under the connection lock.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/call_event.c

index 638d66df284af6fa33388874d206a6cd9b996c63..fc32aa5764a24268ecf09526f34969f5dc1e0845 100644 (file)
@@ -1089,7 +1089,7 @@ void rxrpc_process_call(struct work_struct *work)
 
                if (call->state == RXRPC_CALL_SERVER_SECURING) {
                        _debug("securing");
-                       write_lock(&call->conn->lock);
+                       write_lock(&call->socket->call_lock);
                        if (!test_bit(RXRPC_CALL_RELEASED, &call->flags) &&
                            !test_bit(RXRPC_CALL_EV_RELEASE, &call->events)) {
                                _debug("not released");
@@ -1097,7 +1097,7 @@ void rxrpc_process_call(struct work_struct *work)
                                list_move_tail(&call->accept_link,
                                               &call->socket->acceptq);
                        }
-                       write_unlock(&call->conn->lock);
+                       write_unlock(&call->socket->call_lock);
                        read_lock(&call->state_lock);
                        if (call->state < RXRPC_CALL_COMPLETE)
                                set_bit(RXRPC_CALL_EV_POST_ACCEPT, &call->events);