From nobody Wed Oct 15 22:47:24 2025 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 E24CD27F09D; Sun, 24 Mar 2024 23:39:59 +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=1711323601; cv=none; b=kD6dc63YKaBsthQM/2oYwe18EGXAzuLDUwoZtRgvuBNLawFA29t1YBXKl9izKI33s/0uOt8J6ft4qDLJMwgV3TgfhzOnWUtgMLW7m1n/TBkhv+VAKAwDFFvEKeJgXKFtnGDNCdGiWLpcyWrVRBRHjlOa0hkGwkP8hMJtfmMrop0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323601; c=relaxed/simple; bh=D/U6K3wYlUvCX0zIlRt82+95pj2oHpt2nOXoNWzTP38=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DKi0qFKaMQLjzfQd85CY0iIP+xyBWa9XL2iuotdGuQ6MGVfY9bNACpm5AJeJgKE9wraIAIBR0/LfEI7QPJuFdEdOtnkk/HwPEkJ6QKlvxKxoGca3kDIKrXUguY09vsX5wNz4iNN8tjjCAitrZXnVI06GzkIFtdrzsk8683OYrcU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HLCZBELk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HLCZBELk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43F71C43390; Sun, 24 Mar 2024 23:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323599; bh=D/U6K3wYlUvCX0zIlRt82+95pj2oHpt2nOXoNWzTP38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HLCZBELkoGSydkz1sXv1Dl+JemmUIlupMB8cB5cgrsEbku9xwtC6GhXts2bFUAjS/ qi+6uoaeMzvbgXNYBL2V1Mjmi8IM+CiXTIg/yLmfgHvJ3Fzezphfq68+SX+sZldtzS 5HLia9TwTcrlgsWoAA58MPgi/UylnsU/2iKhRZnay8mTg2wrTkLqih3j/Ckavct6eq lDZLQULhy5NiW05xnjfj9g/yz/602DkALyHriqrFTRBtjFxswNmUWAJ54Gi2Pz0U1W blTjgbtYtQE0dJM4sVRBhmspUgEOUa6JPPpEsZRq2+UqJqHglqxxnUtlf3fK8Q2ZXY 6DqcJoC/g1mdQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.15 306/317] netfilter: nft_set_pipapo: release elements in clone only from destroy path Date: Sun, 24 Mar 2024 19:34:46 -0400 Message-ID: <20240324233458.1352854-307-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324233458.1352854-1-sashal@kernel.org> References: <20240324233458.1352854-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 a= bort 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 e1969209b3abb..58eca26162735 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -2240,8 +2240,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *= ctx, if (m) { rcu_barrier(); =20 - nft_set_pipapo_match_destroy(ctx, set, m); - for_each_possible_cpu(cpu) pipapo_free_scratch(m, cpu); free_percpu(m->scratch); @@ -2253,8 +2251,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *= ctx, if (priv->clone) { m =3D priv->clone; =20 - if (priv->dirty) - nft_set_pipapo_match_destroy(ctx, set, m); + nft_set_pipapo_match_destroy(ctx, set, m); =20 for_each_possible_cpu(cpu) pipapo_free_scratch(priv->clone, cpu); --=20 2.43.0