diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-03-10 10:02:41 +0100 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2024-03-26 18:22:03 -0400 |
| commit | b36b83297ff4910dfc8705402c8abffd4bbf8144 (patch) | |
| tree | 8c032b0dd079e66ee2c56006a4043ad8691eb326 | |
| parent | 766c2627acb2d9d1722cce2e24837044d52d888a (diff) | |
| download | linux-b36b83297ff4910dfc8705402c8abffd4bbf8144.tar.gz linux-b36b83297ff4910dfc8705402c8abffd4bbf8144.tar.bz2 linux-b36b83297ff4910dfc8705402c8abffd4bbf8144.zip | |
netfilter: nft_set_pipapo: release elements in clone only from destroy path
[ 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 <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | net/netfilter/nft_set_pipapo.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index 70a59a35d176..b9682e085fce 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); |
