From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEFD3C32771 for ; Mon, 26 Sep 2022 10:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235967AbiIZKg3 (ORCPT ); Mon, 26 Sep 2022 06:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236021AbiIZKdw (ORCPT ); Mon, 26 Sep 2022 06:33:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40ED450196; Mon, 26 Sep 2022 03:20:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B674060B60; Mon, 26 Sep 2022 10:20:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6181C433D6; Mon, 26 Sep 2022 10:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187653; bh=11Vr/+rv4NoqlGZZbuKjZyicUsv1R4vQPEaYub1IdIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gRwpmPjrtj2BF1k5KRlSHIIVcI40NeNu61/ORsHr2ooZ76/0AC93pOKovZLqVMJGd SisYvsgYJnWX90WPW+0HAbEsEkE3I8t4pmJGhngGfgt5nbdEky98zEYjsxBZLOvr+L OwL5YOYaQL3SWQjHGvxMmtcMEN963GjGDHKq8Ayw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 5.4 018/120] rxrpc: Fix local destruction being repeated Date: Mon, 26 Sep 2022 12:10:51 +0200 Message-Id: <20220926100751.271312705@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ 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 Signed-off-by: Sasha Levin --- net/rxrpc/local_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index 01135e54d95d..fc784fcc3a94 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -448,6 +448,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); -- 2.35.1