From: David Miller <davem@davemloft.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
laforge@netfilter.org, fw@strlen.de, daniel@iogearbox.net,
alexei.starovoitov@gmail.com
Subject: Re: [PATCH RFC 3/3] netfilter: nf_tables: add BPF-based jit infrastructure
Date: Mon, 19 Feb 2018 13:53:34 -0500 (EST) [thread overview]
Message-ID: <20180219.135334.93041549091981531.davem@davemloft.net> (raw)
In-Reply-To: <20180219163706.5388-4-pablo@netfilter.org>
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Mon, 19 Feb 2018 17:37:06 +0100
> From nf_tables_newrule(), this calls nft_jit_rule() that transforms
> our internal expression structure layout to abstract syntax tree, then
> we walk over this syntax tree to generate the BPF instructions that are
> placed in the rule jit buffer. From the commit phase, collect all jit
> buffers, place them in a BPF program that gets attached to the chain.
>
> This should be good enough to test simple payload and meta match. For
> more sophisticated stuff, we may use internal bpf helpers to call our
> _eval() functions.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
I'm very suprised that this is generating classical BPF filters.
We have native eBPF and that is what anything generating new code
should be using, rather than the 20+ year old CBPF.
Furthermore, we should not ever generate and use bpf code snippets to
use directly in the kernel.
Instead, all BPF code should be given to the kernel from userspace
through the bpf syscall interface, so that the boundry is distinct and
the verifier can be run properly on all pieces of eBPF code before the
kernel uses it.
next prev parent reply other threads:[~2018-02-19 18:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 16:37 [PATCH RFC PoC 0/3] nftables meets bpf Pablo Neira Ayuso
2018-02-19 16:37 ` [PATCH RFC 1/3] netfilter: nf_tables: add infrastructure to provide intermediate representation Pablo Neira Ayuso
2018-02-19 16:37 ` [PATCH RFC 2/3] netfilter: add ast to target transformation Pablo Neira Ayuso
2018-02-19 16:37 ` [PATCH RFC 3/3] netfilter: nf_tables: add BPF-based jit infrastructure Pablo Neira Ayuso
2018-02-19 18:53 ` David Miller [this message]
2018-02-20 10:53 ` Pablo Neira Ayuso
2018-02-21 2:01 ` Alexei Starovoitov
2018-02-21 11:48 ` Pablo Neira Ayuso
2018-02-19 19:57 ` [PATCH RFC PoC 0/3] nftables meets bpf Daniel Borkmann
2018-02-20 10:58 ` Pablo Neira Ayuso
2018-02-20 15:03 ` Daniel Borkmann
2018-02-21 23:46 ` Jakub Kicinski
2018-02-22 0:30 ` Florian Fainelli
2018-02-22 1:56 ` Jakub Kicinski
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=20180219.135334.93041549091981531.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=fw@strlen.de \
--cc=laforge@netfilter.org \
--cc=netdev@vger.kernel.org \
--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).