Skip to content

Commit

Permalink
netfilter: nft_set_pipapo: release elements in clone only from destro…
Browse files Browse the repository at this point in the history
…y path

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:

 212ed75 ("netfilter: nf_tables: integrate pipapo into commit protocol")

which came after:

 9827a0e ("netfilter: nft_set_pipapo: release elements in clone from abort path").

Fixes: 9827a0e ("netfilter: nft_set_pipapo: release elements in clone from abort path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Pablo Neira Ayuso committed Mar 20, 2024
1 parent 9c6a595 commit b0e256f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/netfilter/nft_set_pipapo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2329,8 +2329,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);
Expand All @@ -2342,8 +2340,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);
Expand Down

0 comments on commit b0e256f

Please sign in to comment.