]> git.itanic.dy.fi Git - linux-stable/commitdiff
rxrpc: Fix local destruction being repeated
authorDavid Howells <dhowells@redhat.com>
Fri, 6 May 2022 22:55:21 +0000 (23:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:02:52 +0000 (11:02 +0200)
[ Upstream commit d3d863036d688313f8d566b87acd7d99daf82749 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rxrpc/local_object.c

index fe190a6918727891a0830ec6c812881d6ea428d4..5a01479aae3f3248ac42e62cbb5fb354fb9591b5 100644 (file)
@@ -452,6 +452,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,
                          atomic_read(&local->usage), NULL);