Patch "rxrpc: Fix missing locking causing hanging calls" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rxrpc: Fix missing locking causing hanging calls

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rxrpc-fix-missing-locking-causing-hanging-calls.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2031a4f3901c3da938c1225a117d78d853006bd1
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Wed Nov 6 13:03:22 2024 +0000

    rxrpc: Fix missing locking causing hanging calls
    
    [ Upstream commit fc9de52de38f656399d2ce40f7349a6b5f86e787 ]
    
    If a call gets aborted (e.g. because kafs saw a signal) between it being
    queued for connection and the I/O thread picking up the call, the abort
    will be prioritised over the connection and it will be removed from
    local->new_client_calls by rxrpc_disconnect_client_call() without a lock
    being held.  This may cause other calls on the list to disappear if a race
    occurs.
    
    Fix this by taking the client_call_lock when removing a call from whatever
    list its ->wait_link happens to be on.
    
    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    cc: linux-afs@xxxxxxxxxxxxxxxxxxx
    Reported-by: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    Fixes: 9d35d880e0e4 ("rxrpc: Move client call connection to the I/O thread")
    Link: https://patch.msgid.link/726660.1730898202@xxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index a1b126a6b0d72..cc22596c7250c 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -287,6 +287,7 @@
 	EM(rxrpc_call_see_input,		"SEE input   ") \
 	EM(rxrpc_call_see_release,		"SEE release ") \
 	EM(rxrpc_call_see_userid_exists,	"SEE u-exists") \
+	EM(rxrpc_call_see_waiting_call,		"SEE q-conn  ") \
 	E_(rxrpc_call_see_zap,			"SEE zap     ")
 
 #define rxrpc_txqueue_traces \
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index d25bf1cf36700..bb11e8289d6dc 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -516,6 +516,7 @@ void rxrpc_connect_client_calls(struct rxrpc_local *local)
 
 		spin_lock(&local->client_call_lock);
 		list_move_tail(&call->wait_link, &bundle->waiting_calls);
+		rxrpc_see_call(call, rxrpc_call_see_waiting_call);
 		spin_unlock(&local->client_call_lock);
 
 		if (rxrpc_bundle_has_space(bundle))
@@ -586,7 +587,10 @@ void rxrpc_disconnect_client_call(struct rxrpc_bundle *bundle, struct rxrpc_call
 		_debug("call is waiting");
 		ASSERTCMP(call->call_id, ==, 0);
 		ASSERT(!test_bit(RXRPC_CALL_EXPOSED, &call->flags));
+		/* May still be on ->new_client_calls. */
+		spin_lock(&local->client_call_lock);
 		list_del_init(&call->wait_link);
+		spin_unlock(&local->client_call_lock);
 		return;
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux