netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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] netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
Date: Fri, 9 Feb 2024 13:38:12 +0100	[thread overview]
Message-ID: <ZcYctDP7BTBRgY+h@calendula> (raw)
In-Reply-To: <20240209121954.81223-1-ignat@cloudflare.com>

Hi,

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.

>         }
>     }
> 
> 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.

  reply	other threads:[~2024-02-09 12:38 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 [this message]
2024-02-09 15:03   ` Ignat Korchagin
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=ZcYctDP7BTBRgY+h@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 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).