Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2620383lqp; Mon, 25 Mar 2024 04:49:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxJB8TWAFRZhs9602YiddHEbvYY5z2/MclaLkNnKNookO332lPUtBEB3KohVcB1Uo1Zklt54KhbPHWXy27zT4LVS4P6CaZtk308RLcSQ== X-Google-Smtp-Source: AGHT+IFFoZpZglviYBcKbSMe2GsF53qdFR7CkbzP13n5l9MLE91KpwVHEuqPrK75qEN4uLNFNm1a X-Received: by 2002:a17:907:72cb:b0:a47:4bd6:9857 with SMTP id du11-20020a17090772cb00b00a474bd69857mr3846654ejc.64.1711367363702; Mon, 25 Mar 2024 04:49:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711367363; cv=pass; d=google.com; s=arc-20160816; b=IYviN+6oiplSsXdtbX87NaCT6zpJmejOLyUJor0iYtCOVzRwE5tEHITxOedzq7dewF YPAPIek3dxBusPegzN6xbR2HS4w9WNn+CzzjgGGytO88RMhLPosq1aHaPGZAzgQsIE6/ ZjNKBd465+A7MHSI9513GPJrp/GZw7ayTheHsAEif0Ah4SwIkwONnkD03VFN705xqAkn wtHrlMyUzz5EVT4ffw3AGPANYrnAj7wC923irESG57GSZl1YXoitTj3tmHCCUbhzq1dJ fF/abckQrnc5rHxB0mUHdbPZKqTxHlGX6LamTopbXkKSt+myvIjDW8KZ0GkbNwmFqTCe CiwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cYiMgdc35XZSU6vBriyrkL9qdt8cgfhWaTQIAif57NM=; fh=JCupzcIQwtmyJ2C2xrsc2nqgcJfRphMLLtiVBgyhfvk=; b=QmyPWmSKLo1G4eO+CxzfdmjUc/6YF7V2r1wVxuk2nmNu7EIZnPKcn1jBec/kbQw9Ct sq6byBjbTNDySadQ62OgkSKi2zAs5IUAeGZ/pdqBOSwK6eDaEx/6zhDmh9G4NiLFnnSh rqBqoy7QBOrWuYRGfhO5ZacI5tefHp6xwioW1AjY1NWKstQRKCfzJ07hTN5yxzqGOCsh D0igRnH22rv0/m+iK+XXz63q0f/If6X6JRFk6cCwEU9onCOBlwK/at2ueh0xt3x75Hjw P+6O+BvRKXMAe4cSleHuGk+qfT6CcVBQ216BTN7vV5VAC9vB+X2ao32zJdc/90sfCX6x 0vEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i7SvjVa9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ho43-20020a1709070eab00b00a4666ecd61bsi2591602ejc.217.2024.03.25.04.49.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i7SvjVa9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6A96F1F368AA for ; Mon, 25 Mar 2024 11:49:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E48293BFFD9; Mon, 25 Mar 2024 03:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="i7SvjVa9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1BB417DC3F; Sun, 24 Mar 2024 23:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323852; cv=none; b=rR+e3id2kFgbvgTtu6pwwV+ImHpSBS+9QIJ37CNgIszfF6UE920KYUnzKvv+tadeX0T8nH82CeLbJGjVbGa5WSED56KwFp2wZOZKZQKCjkFVvylXsWLmJA0kPHp17sWuJ+l2FkYQb6rSBz6lt6oEKxh1q4CoYMfgTarS6NnTLjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323852; c=relaxed/simple; bh=5+hdcCy5NUJAL46bniLz2w4EeDTmKteFOedaHnQJd5c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CV0NpGQfQ0fXgQsXyAkc7o4DJ7OT9xiOOK3826TfYCrO2lhtoxUnP2470oRWEVoTcB8jIPY38pv4oauNK8gSsSLNRBHOKEKACazKPq6Qs5LcQBKiVsUmV/XXwV63e3z9+xykF5jLlNQALAxobRw2g5EkJmI9G2KFy1Tt7x8VFwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i7SvjVa9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD3A9C433F1; Sun, 24 Mar 2024 23:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323852; bh=5+hdcCy5NUJAL46bniLz2w4EeDTmKteFOedaHnQJd5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7SvjVa9rzRBUbMcI0j2Rc5jFqfeEyUDIEbPlj4597G3zN07DWAWsdkT5L5CV9Zl+ DDiF9b2sOowTuS1WBtfGVUbYXimHp5DBmrXWaMlN3hYwvyWnG283e75fOG1yy8AMm5 mA7QC9sU5U2FMsbapY6K4ua7l2B116f5A2+GF7KeomUK3IuNHdc6O11NBp9Z/03bGO /G3s3uowFTcbbJpgGi2dfTZ9kbYoVyT1YmgEbt6P4mcRGwO28V1uCmfJcA53jLwY+U HbTuYX42teXGTuI0myDTjmHtF/1ZbW5NPPBHYNrC3jsZ2PrMQ2QLXODPHlPuSpXLVD zAc8LeJz33Vog== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.10 230/238] netfilter: nft_set_pipapo: release elements in clone only from destroy path Date: Sun, 24 Mar 2024 19:40:18 -0400 Message-ID: <20240324234027.1354210-231-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Pablo Neira Ayuso [ Upstream commit b0e256f3dd2ba6532f37c5c22e07cb07a36031ee ] Clone already always provides a current view of the lookup table, use it to destroy the set, otherwise it is possible to destroy elements twice. This fix requires: 212ed75dc5fb ("netfilter: nf_tables: integrate pipapo into commit protocol") which came after: 9827a0e6e23b ("netfilter: nft_set_pipapo: release elements in clone from abort path"). Fixes: 9827a0e6e23b ("netfilter: nft_set_pipapo: release elements in clone from abort path") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_set_pipapo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index 70a59a35d1761..b9682e085fcef 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -2226,8 +2226,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, if (m) { rcu_barrier(); - nft_set_pipapo_match_destroy(ctx, set, m); - for_each_possible_cpu(cpu) pipapo_free_scratch(m, cpu); free_percpu(m->scratch); @@ -2239,8 +2237,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, if (priv->clone) { m = priv->clone; - if (priv->dirty) - nft_set_pipapo_match_destroy(ctx, set, m); + nft_set_pipapo_match_destroy(ctx, set, m); for_each_possible_cpu(cpu) pipapo_free_scratch(priv->clone, cpu); -- 2.43.0