From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Ignat Korchagin <ignat@cloudflare.com>
Cc: kadlec@netfilter.org, fw@strlen.de,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
kernel-team@cloudflare.com, jgriege@cloudflare.com
Subject: Re: [PATCH v2] netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
Date: Thu, 22 Feb 2024 01:15:29 +0100 [thread overview]
Message-ID: <ZdaSIRv3HBcEUpy9@calendula> (raw)
In-Reply-To: <20240220145509.53357-1-ignat@cloudflare.com>
On Tue, Feb 20, 2024 at 02:55:09PM +0000, Ignat Korchagin wrote:
> Commit d0009effa886 ("netfilter: nf_tables: validate NFPROTO_* family") added
> some validation of NFPROTO_* families in the nft_compat module, but it broke
> the ability to use legacy iptables modules in dual-stack nftables.
>
> While with legacy iptables one had to independently manage IPv4 and IPv6 tables,
> with nftables it is possible to have dual-stack tables sharing the rules.
> Moreover, it was possible to use rules based on legacy iptables match/target
> modules in dual-stack nftables. Consider the following program:
>
> ```
>
> /* #define TBL_FAMILY NFPROTO_IPV4 */
>
> /*
> * creates something like below
> * table inet testfw {
> * chain input {
> * type filter hook prerouting priority filter; policy accept;
> * bytecode counter packets 0 bytes 0 accept
Upstream nft does not provides this. Please, clarify that this the
output with the out-of-tree patch,
> * }
> * }
> *
> * compile:
> * cc -o nftbpf nftbpf.c -lnftnl -lmnl
> */
> int main(void)
Please, no program in the commit description, it makes it too long,
I am not sure this is the good place to store this.
> ```
>
> Above creates an INET dual-stack family table using xt_bpf based rule. After
> d0009effa886 ("netfilter: nf_tables: validate NFPROTO_* family") we get
> EOPNOTSUPP for the above configuration.
>
> Fix this by allowing NFPROTO_INET for nft_(match/target)_validate(), but also
> restrict the functions to classic iptables hooks.
>
> Changes in v2:
> * restrict nft_(match/target)_validate() to classic iptables hooks
> * rewrite example program to use unmodified libnftnl
Thanks! Please send a v3 with updates.
next prev parent reply other threads:[~2024-02-22 0:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 14:55 [PATCH v2] netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate() Ignat Korchagin
2024-02-22 0:15 ` Pablo Neira Ayuso [this message]
2024-02-22 7:44 ` Ignat Korchagin
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=ZdaSIRv3HBcEUpy9@calendula \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=fw@strlen.de \
--cc=ignat@cloudflare.com \
--cc=jgriege@cloudflare.com \
--cc=kadlec@netfilter.org \
--cc=kernel-team@cloudflare.com \
--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.