Skip to content

Commit 189c2a8

Browse files
Florian Westphalgregkh
authored andcommitted
netfilter: nft_set_pipapo: skip inactive elements during set walk
commit 317eb96 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b4e440c commit 189c2a8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,9 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
20422042

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

2045+
if (!nft_set_elem_active(&e->ext, iter->genmask))
2046+
goto cont;
2047+
20452048
elem.priv = e;
20462049

20472050
iter->err = iter->fn(ctx, set, iter, &elem);

0 commit comments

Comments
 (0)