Skip to content

Commit d53f345

Browse files
committed
netfilter: nft_set_pipapo: skip inactive elements during set walk
jira VULN-6807 cve CVE-2023-6817 commit-author Florian Westphal <fw@strlen.de> commit 317eb96 upstream-diff Additional newline because this kernel has not removed the nft_set_elem_expired call yet 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> (cherry picked from commit 317eb96) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent bdb00b4 commit d53f345

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,10 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
18701870
goto cont;
18711871

18721872
e = f->mt[r].e;
1873+
1874+
if (!nft_set_elem_active(&e->ext, iter->genmask))
1875+
goto cont;
1876+
18731877
if (nft_set_elem_expired(&e->ext))
18741878
goto cont;
18751879

0 commit comments

Comments
 (0)