Skip to content

Commit 5c16e1b

Browse files
Florian Westphalroxanan1996
authored andcommitted
netfilter: nft_set_pipapo: skip inactive elements during set walk
Otherwise set elements can be deactivated twice which will cause a crash. Reported-by: Xingyuan Mo <[email protected]> Fixes: 3c4287f ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]> (backported from commit 317eb96) [cascardo: context conflict due to missing 0e1ea65] CVE-2023-6817 Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Acked-by: Yuxuan Luo <[email protected]> Acked-by: Thibault Ferrante <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent d2fff27 commit 5c16e1b

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)