Skip to content

Commit b0e256f

Browse files
committed
netfilter: nft_set_pipapo: release elements in clone only from destroy 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 <[email protected]>
1 parent 9c6a595 commit b0e256f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,8 +2329,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
23292329
if (m) {
23302330
rcu_barrier();
23312331

2332-
nft_set_pipapo_match_destroy(ctx, set, m);
2333-
23342332
for_each_possible_cpu(cpu)
23352333
pipapo_free_scratch(m, cpu);
23362334
free_percpu(m->scratch);
@@ -2342,8 +2340,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
23422340
if (priv->clone) {
23432341
m = priv->clone;
23442342

2345-
if (priv->dirty)
2346-
nft_set_pipapo_match_destroy(ctx, set, m);
2343+
nft_set_pipapo_match_destroy(ctx, set, m);
23472344

23482345
for_each_possible_cpu(cpu)
23492346
pipapo_free_scratch(priv->clone, cpu);

0 commit comments

Comments
 (0)