Skip to content

Commit

Permalink
netfilter: nft_set_pipapo: skip inactive elements during set walk
Browse files Browse the repository at this point in the history
Otherwise set elements can be deactivated twice which will cause a crash.

Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Fixes: 3c4287f ("nf_tables: Add set type for arbitrary concatenation of ranges")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Florian Westphal authored and ummakynes committed Dec 6, 2023
1 parent 1834d62 commit 317eb96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/nft_set_pipapo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,9 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,

e = f->mt[r].e;

if (!nft_set_elem_active(&e->ext, iter->genmask))
goto cont;

iter->err = iter->fn(ctx, set, iter, &e->priv);
if (iter->err < 0)
goto out;
Expand Down

0 comments on commit 317eb96

Please sign in to comment.