Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp794752rwb; Mon, 26 Sep 2022 06:04:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4INCTzdiQppkCjk8Zp6cmysXlhPCtyBFuemmar+nTPD5JOw0AqP77GT7oJIq5/OCBsgn5b X-Received: by 2002:a05:6402:3547:b0:451:3be6:d55b with SMTP id f7-20020a056402354700b004513be6d55bmr22101408edd.57.1664197463793; Mon, 26 Sep 2022 06:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197463; cv=none; d=google.com; s=arc-20160816; b=BjQ5+jVhFmRhMWSeGMXHuYADohjhLmDHfckURSj3Rj5sThb3WA976rtKn9MSYdNi37 5GOVoceGBB0wAzHrXoSWRVRlu01VVHTb79jDlfd5Mor/KCDQBggzgFzc/wlYpiyOe6a/ MOqsKidgaodrHR2GD+Ls/tcAJe/ipqJFrPwvVONJG9G1ntAVsf3/bU1+gPWpfCpYmWRI fIPFvDvWio7GVtcOAgG8vxPRe5i5RHCQDhK+u2RYNyF59kAdI6yxIcHPwqyfqKeCpjd7 SkUD7NUdVQ826uK3KRBy9nUJ/PsXyIlRHg1DQoPeYfmQCsG4rRnESZKUuN53LWh2OLhf 5nXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=blKN4ftZ8WwViYpk0HJJYUSQmkKyWgKP9yzo/rKQ6bE=; b=K6oJ2vRHOdVOudFBrgmeRUrQ7rndddgtIKmTkgZ0fgzNsQCHftW2g7veb8AQbizGVT iCYUorGM9cExFV88h27tX1BgZO+VShQ6CN91JKhc8v+/Q2n1irwLCOkimgFG0ElFbDGB 8F2NSoHrd/w2TZojTcRyCQIYiR/oG4+UOsOYoT3klDGSgNNa8Hrw+Who5CUwxVb7Ufvi uenOnjjfWbZMZZvgp1WJ+eyZQqJmHbRP3mn9E7izycxIF5ecFtwjzOhB3KLeQdjRHuV+ S2XrXicLSjrPR2bzSIm9ISoMGqC85vwnkJwSqj3AcX3CtqFS4wTFda5ViG5yuNDpszqK KfTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PKs2793n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a170906658a00b00780ada0f8easi12606169ejn.865.2022.09.26.06.03.56; Mon, 26 Sep 2022 06:04:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PKs2793n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235306AbiIZK1e (ORCPT + 99 others); Mon, 26 Sep 2022 06:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235700AbiIZKYm (ORCPT ); Mon, 26 Sep 2022 06:24:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 272A837F93; Mon, 26 Sep 2022 03:18:15 -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 0B84660BBF; Mon, 26 Sep 2022 10:17:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF6BEC433D7; Mon, 26 Sep 2022 10:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187451; bh=KNRkChDz/lxghQSg1o/o/sFxhP3xl2eP6X2+b6fcYQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKs2793nydi5PXjtrlgaVNHBTFwShcYcNAEh5+e/yhz9HvT81sDVnV6ZWTChJKEuW oTjD/hgXn+wVv6UCDQQsSy/HcOoNzky7RQUKa6taIjAFBU4GpCDfgodhmLeOXqe7RN OU16bwmhsq1v62YiEJVzn7OuXhxyXC+eNluHccJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 4.19 12/58] rxrpc: Fix local destruction being repeated Date: Mon, 26 Sep 2022 12:11:31 +0200 Message-Id: <20220926100741.855339878@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100741.430882406@linuxfoundation.org> References: <20220926100741.430882406@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 fe190a691872..5a01479aae3f 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -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); -- 2.35.1