From: Ignat Korchagin <ignat@cloudflare.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>, jgriege@cloudflare.com
Cc: kadlec@netfilter.org, fw@strlen.de,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
kernel-team@cloudflare.com
Subject: Re: [PATCH] netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
Date: Fri, 9 Feb 2024 15:03:08 +0000 [thread overview]
Message-ID: <CALrw=nHRJ-a0k6YF=DQO7v0dLUUrJLH4v2c4v8wxA++yAzdUoQ@mail.gmail.com> (raw)
In-Reply-To: <ZcYctDP7BTBRgY+h@calendula>
On Fri, Feb 9, 2024 at 12:38 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> Hi,
Thanks for the prompt reply
> On Fri, Feb 09, 2024 at 12:19:54PM +0000, Ignat Korchagin wrote:
> > Commit 67ee37360d41 ("netfilter: nf_tables: validate NFPROTO_* family") added
> > some validation of NFPROTO_* families in nftables, but it broke our use case for
> > xt_bpf module:
> >
> > * assuming we have a simple bpf program:
> >
> > #include <linux/bpf.h>
> > #include <bpf/bpf_helpers.h>
> >
> > char _license[] SEC("license") = "GPL";
> >
> > SEC("socket")
> > int prog(struct __sk_buff *skb) { return BPF_OK; }
> >
> > * we can compile it and pin into bpf FS:
> > bpftool prog load bpf.o /sys/fs/bpf/test
> >
> > * now we want to create a following table
> >
> > table inet firewall {
> > chain input {
> > type filter hook prerouting priority filter; policy accept;
> > bpf pinned "/sys/fs/bpf/test" drop
>
> This feature does not exist in the tree.
Sorry - should have clarified this. We did indeed patch some userspace
tools to support easy creation of the above table (so it is presented
here for clarity) however we don't have any kernel-specific patches
with respect to this and it is technically possible to craft such a
table via raw netlink interface.
In fact - I just retested it on a freshly compiled 6.6.16 vanilla
kernel from a stable branch (with and without commit 67ee37360d41)
with a small program that does raw netlink messages.
> > }
> > }
> >
> > All above used to work, but now we get EOPNOTSUPP, when creating the table.
> >
> > Fix this by allowing NFPROTO_INET for nft_(match/target)_validate()
>
> We don't support inet family for iptables.
I've added Jordan Griege (Jordan, please comment) as he is likely more
competent here than me, but appears that we used it somehow.
For more context - we encountered this problem on 6.1 and 6.6 stable
kernels (when commit 67ee37360d41 was backported).
Ignat
next prev parent reply other threads:[~2024-02-09 15:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 12:19 [PATCH] netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate() Ignat Korchagin
2024-02-09 12:38 ` Pablo Neira Ayuso
2024-02-09 15:03 ` Ignat Korchagin [this message]
2024-02-12 12:52 ` Jordan Griege
2024-02-14 23:40 ` 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='CALrw=nHRJ-a0k6YF=DQO7v0dLUUrJLH4v2c4v8wxA++yAzdUoQ@mail.gmail.com' \
--to=ignat@cloudflare.com \
--cc=coreteam@netfilter.org \
--cc=fw@strlen.de \
--cc=jgriege@cloudflare.com \
--cc=kadlec@netfilter.org \
--cc=kernel-team@cloudflare.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).