Commit b0e256f3 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

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:

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

which came after:

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

Fixes: 9827a0e6 ("netfilter: nft_set_pipapo: release elements in clone from abort path")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 9c6a5954
......@@ -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);
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment