rxrpc: Fix local destruction being repeated
authorDavid Howells <dhowells@redhat.com>
Fri, 6 May 2022 22:55:21 +0000 (23:55 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 1 Sep 2022 10:44:12 +0000 (11:44 +0100)
If the local processor work item for the rxrpc local endpoint gets requeued
by an event (such as an incoming packet) between it getting scheduled for
destruction and the UDP socket being closed, the rxrpc_local_destroyer()
function can get run twice.  The second time it can hang because it can end
up waiting for cleanup events that will never happen.

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

index 79bb02eb67b2b40cb41b4d0ae877ca8d78451d7e..38ea98ff426bdb0de27d2dc631aca259cc3e832b 100644 (file)
@@ -406,6 +406,9 @@ static void rxrpc_local_processor(struct work_struct *work)
                container_of(work, struct rxrpc_local, processor);
        bool again;
 
+       if (local->dead)
+               return;
+
        trace_rxrpc_local(local->debug_id, rxrpc_local_processing,
                          refcount_read(&local->ref), NULL);