From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next 1/2] netfilter: nf_tables: skip register jump/goto validation for non-base chain
Date: Wed, 19 Nov 2025 01:27:31 +0100 [thread overview]
Message-ID: <aR0O8y55ceCmrIHf@calendula> (raw)
In-Reply-To: <aR0Jh0XH3FyqGr2k@strlen.de>
On Wed, Nov 19, 2025 at 01:04:23AM +0100, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > Validating a non-base chain for each register store slows down
> > validation unnecessarily, remove it.
> >
> > Fixes: a654de8fdc18 ("netfilter: nf_tables: fix chain dependency validation")
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > ---
> > net/netfilter/nf_tables_api.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> > index 6f35f0b7a33c..bef95cede7b5 100644
> > --- a/net/netfilter/nf_tables_api.c
> > +++ b/net/netfilter/nf_tables_api.c
> > @@ -11846,6 +11846,9 @@ static int nft_validate_register_store(const struct nft_ctx *ctx,
> > if (data != NULL &&
> > (data->verdict.code == NFT_GOTO ||
> > data->verdict.code == NFT_JUMP)) {
> > + if (!nft_is_base_chain(ctx->chain))
> > + break;
> > +
>
> This is confusing. ctx->chain? data->verdict.chain?
ctx->chain is the current chain for this new rule.
data->verdict.chain is the destination chain.
> Wouldn't it make more sense to elide the check if we have
> ctx->table->validate_state != NFT_VALIDATE_DO ?
I am sure we have to skip non-basechains in this case, it makes us
walk the graph for no reason, even with NFT_VALIDATE_DO.
Let me have a second look, thanks for reviewing.
prev parent reply other threads:[~2025-11-19 0:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 23:50 [PATCH nf-next 1/2] netfilter: nf_tables: skip register jump/goto validation for non-base chain Pablo Neira Ayuso
2025-11-18 23:50 ` [PATCH nf-next 2/2] netfilter: nfnetlink: bail out batch processing with EMLINK Pablo Neira Ayuso
2025-11-19 0:09 ` Florian Westphal
2025-11-19 0:32 ` Pablo Neira Ayuso
2025-11-19 0:04 ` [PATCH nf-next 1/2] netfilter: nf_tables: skip register jump/goto validation for non-base chain Florian Westphal
2025-11-19 0:27 ` Pablo Neira Ayuso [this message]
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=aR0O8y55ceCmrIHf@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/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.