]> git.hungrycats.org Git - linux/commitdiff
rxrpc: Fix double IRQ enablement
authorDavid Howells <dhowells@redhat.com>
Tue, 6 Oct 2026 13:30:00 +0000 (14:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:06:08 +0000 (12:06 -0500)
commit 41eb0af096ba8754e584d47e6de42f1e4980ceae upstream.

rxrpc_notify_socket() explicitly disables and then re-enables IRQs, but one
of its call chains (rxrpc_input_queue_data() -> rxrpc_end_rx_phase() ->
rxrpc_call_completed() -> rxrpc_set_call_completion()) has IRQs disabled
around it.

Fix this by making rxrpc_notify_socket() use irqsave spinlocks.

Fixes: a2ea9a907260 ("rxrpc: Use irq-disabling spinlocks between app and I/O thread")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260812110129.979970-6-dhowells@redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
Link: https://patch.msgid.link/20261006133011.531806-9-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rxrpc/recvmsg.c

index efcba4b2e74f0c903317a1a7ec4559107b290c93..56fa324d0962e2978a7ec995c426b7fdb38adcdb 100644 (file)
@@ -24,6 +24,7 @@ void rxrpc_notify_socket(struct rxrpc_call *call)
 {
        struct rxrpc_sock *rx;
        struct sock *sk;
+       unsigned long flags;
 
        _enter("%d", call->debug_id);
 
@@ -38,16 +39,16 @@ void rxrpc_notify_socket(struct rxrpc_call *call)
        sk = &rx->sk;
        if (rx && sk->sk_state < RXRPC_CLOSE) {
                if (call->notify_rx) {
-                       spin_lock_irq(&call->notify_lock);
+                       spin_lock_irqsave(&call->notify_lock, flags);
                        call->notify_rx(sk, call, call->user_call_ID);
-                       spin_unlock_irq(&call->notify_lock);
+                       spin_unlock_irqrestore(&call->notify_lock, flags);
                } else {
-                       spin_lock_irq(&rx->recvmsg_lock);
+                       spin_lock_irqsave(&rx->recvmsg_lock, flags);
                        if (list_empty(&call->recvmsg_link)) {
                                rxrpc_get_call(call, rxrpc_call_get_notify_socket);
                                list_add_tail(&call->recvmsg_link, &rx->recvmsg_q);
                        }
-                       spin_unlock_irq(&rx->recvmsg_lock);
+                       spin_unlock_irqrestore(&rx->recvmsg_lock, flags);
 
                        if (!sock_flag(sk, SOCK_DEAD)) {
                                _debug("call %ps", sk->sk_data_ready);