Skip to content

Commit ba24727

Browse files
committed
netfilter: nft_set_pipapo: .walk does not deal with generations
jira VULN-430 cve-pre CVE-2023-4244 commit-author Pablo Neira Ayuso <pablo@netfilter.org> commit 2b84e21 The .walk callback iterates over the current active set, but it might be useful to iterate over the next generation set. Use the generation mask to determine what set view (either current or next generation) is use for the walk iteration. Fixes: 3c4287f ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> (cherry picked from commit 2b84e21) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent 2efc7fd commit ba24727

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,12 +1978,16 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
19781978
struct nft_set_iter *iter)
19791979
{
19801980
struct nft_pipapo *priv = nft_set_priv(set);
1981+
struct net *net = read_pnet(&set->net);
19811982
struct nft_pipapo_match *m;
19821983
struct nft_pipapo_field *f;
19831984
int i, r;
19841985

19851986
rcu_read_lock();
1986-
m = rcu_dereference(priv->match);
1987+
if (iter->genmask == nft_genmask_cur(net))
1988+
m = rcu_dereference(priv->match);
1989+
else
1990+
m = priv->clone;
19871991

19881992
if (unlikely(!m))
19891993
goto out;

0 commit comments

Comments
 (0)