Skip to content

Commit 3a5abd2

Browse files
committed
netfilter: nft_set_pipapo: skip inactive elements during set walk
jira VULN-4132 cve CVE-2023-6817 commit-author Florian Westphal <[email protected]> commit 317eb96 upstream-diff The change itself is the same as upstream, but there was a minor conflict in code surrounding the change because this kernel hasn't moved set element objects into the transaction yet. 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]> (cherry picked from commit 317eb96) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 64795c6 commit 3a5abd2

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
@@ -1874,6 +1874,9 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
18741874

18751875
elem.priv = e;
18761876

1877+
if (!nft_set_elem_active(&e->ext, iter->genmask))
1878+
goto cont;
1879+
18771880
iter->err = iter->fn(ctx, set, iter, &elem);
18781881
if (iter->err < 0)
18791882
goto out;

0 commit comments

Comments
 (0)