From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, fw@strlen.de
Subject: [PATCH net 2/6] netfilter: nft_set_pipapo: skip inactive elements during set walk
Date: Wed, 6 Dec 2023 19:03:53 +0100 [thread overview]
Message-ID: <20231206180357.959930-3-pablo@netfilter.org> (raw)
In-Reply-To: <20231206180357.959930-1-pablo@netfilter.org>
From: Florian Westphal <fw@strlen.de>
Otherwise set elements can be deactivated twice which will cause a crash.
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Fixes: 3c4287f62044 ("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>
---
net/netfilter/nft_set_pipapo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index 701977af3ee8..7252fcdae349 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -2043,6 +2043,9 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
e = f->mt[r].e;
+ if (!nft_set_elem_active(&e->ext, iter->genmask))
+ goto cont;
+
iter->err = iter->fn(ctx, set, iter, &e->priv);
if (iter->err < 0)
goto out;
--
2.30.2
next prev parent reply other threads:[~2023-12-06 18:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 18:03 [PATCH net 0/6] Netfilter fixes for net Pablo Neira Ayuso
2023-12-06 18:03 ` [PATCH net 1/6] netfilter: bpf: fix bad registration on nf_defrag Pablo Neira Ayuso
2023-12-07 18:00 ` patchwork-bot+netdevbpf
2023-12-06 18:03 ` Pablo Neira Ayuso [this message]
2023-12-06 18:03 ` [PATCH net 3/6] netfilter: nf_tables: fix 'exist' matching on bigendian arches Pablo Neira Ayuso
2023-12-06 18:03 ` [PATCH net 4/6] netfilter: nf_tables: bail out on mismatching dynset and set expressions Pablo Neira Ayuso
2023-12-06 18:03 ` [PATCH net 5/6] netfilter: nf_tables: validate family when identifying table via handle Pablo Neira Ayuso
2023-12-06 18:03 ` [PATCH net 6/6] netfilter: xt_owner: Fix for unsafe access of sk->sk_socket Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231206180357.959930-3-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.