From: Florian Westphal <fw@strlen.de>
To: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nft_compat: restrict raw table targets/matches
Date: Wed, 7 Oct 2026 13:29:36 +0200 [thread overview]
Message-ID: <asYtIDf01NCIlOLf@strlen.de> (raw)
In-Reply-To: <20261006231549.5901-1-fw@strlen.de>
Florian Westphal <fw@strlen.de> wrote:
> xt targets and matches declaring .table = "raw" (CT, NOTRACK) rely on
> only ever running in the legacy raw table's prerouting/output chains,
> ahead of conntrack. nft_compat_chain_validate_dependency() already
> enforces this kind of correspondence for "nat" by requiring the chain
> type to actually be NAT, but did nothing for "raw": a rule wrapping
> the CT target could be loaded into any hook and any priority via
> nft_compat, including after the real conntrack hook has already run.
>
> The CT target attaches a conntrack template to the skb when none is
> set yet.
>
> Require that a "raw" table dependency actually matches what xtables
> enforces via the implict/builtin table dependency.
https://sashiko.dev/#/patchset/20261006231549.5901-1-fw%40strlen.de
| Does this strict equality check reject legitimate pre-defragmentation
| priorities?
I don't think so. While its technically allowed, iptables-nft doesn't
support NF_IP_PRI_RAW_BEFORE_DEFRAG / NF_IP6_PRI_RAW_BEFORE_DEFRAG.
| If users recreate this state in nftables by creating a base chain at priority
| -450 and attach the xt_CT target via nft_compat, it seems this check would
| unintentionally reject NF_IP_PRI_RAW_BEFORE_DEFRAG and return -EINVAL.
I don't think that makes sense. Native nft users would not use
nft_compat.
But if you prefer, I can relax this check to use ">" instead.
prev parent reply other threads:[~2026-10-07 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 23:15 [PATCH nf-next] netfilter: nft_compat: restrict raw table targets/matches Florian Westphal
2026-10-07 11:29 ` Florian Westphal [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=asYtIDf01NCIlOLf@strlen.de \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox