From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
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:04:23 +0100 [thread overview]
Message-ID: <aR0Jh0XH3FyqGr2k@strlen.de> (raw)
In-Reply-To: <20251118235009.149562-1-pablo@netfilter.org>
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?
Wouldn't it make more sense to elide the check if we have
ctx->table->validate_state != NFT_VALIDATE_DO ?
next prev parent reply other threads:[~2025-11-19 0:04 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 ` Florian Westphal [this message]
2025-11-19 0:27 ` [PATCH nf-next 1/2] netfilter: nf_tables: skip register jump/goto validation for non-base chain 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=aR0Jh0XH3FyqGr2k@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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.