From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nft_compat: run checkentry() from .validate
Date: Mon, 20 Apr 2026 20:21:18 +0200 [thread overview]
Message-ID: <aeZunt0QSt2EdFdF@strlen.de> (raw)
In-Reply-To: <aeZpj9r368paudyZ@chamomile>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Mon, Apr 20, 2026 at 07:55:22PM +0200, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > Several matches and one target check that the hook is correct from
> > > checkentry(), however, the basechain is only available from
> > > nft_table_validate().
> > >
> > > This patch calls checkentry() for matches and targets from the
> > > nft_compat expression .validate path for the following matches/target:
> >
> > I worry that this is fragile. Not all ->checkentry callbacks are pure.
> > Some create /proc entries or bump reference counts.
>
> xt_set does bump the reference count. This calls xt.destroy to restore it.
> I am only calling them for the list of expression you mentioned.
I worry this will lead to trouble later, e.g. info->priv = kmalloc( ...)
-> memory leak.
But OK, at least there is a test case in iptables.git for this.
next prev parent reply other threads:[~2026-04-20 18:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 17:42 [PATCH nf] netfilter: nft_compat: run checkentry() from .validate Pablo Neira Ayuso
2026-04-20 17:55 ` Florian Westphal
2026-04-20 17:59 ` Pablo Neira Ayuso
2026-04-20 18:21 ` Florian Westphal [this message]
2026-04-20 18:48 ` Pablo Neira Ayuso
2026-04-20 18:53 ` Florian Westphal
2026-04-20 19:07 ` 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=aeZunt0QSt2EdFdF@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.