From: Stanislav Fomichev <sdf@fomichev.me>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Stanislav Fomichev <sdf@google.com>,
Network Development <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>, David Miller <davem@davemloft.net>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Willem de Bruijn <willemb@google.com>,
Petar Penkov <ppenkov@google.com>
Subject: Re: [PATCH bpf 1/2] flow_dissector: support FLOW_DISSECTOR_KEY_ETH_ADDRS with BPF
Date: Mon, 13 May 2019 16:05:13 -0700 [thread overview]
Message-ID: <20190513230513.GA10244@mini-arch> (raw)
In-Reply-To: <CAF=yD-Lg16ETT09=fRd2FTx2FJoGZ9K0s-JHrhv-9OMTqE+5BQ@mail.gmail.com>
On 05/13, Willem de Bruijn wrote:
> On Mon, May 13, 2019 at 5:21 PM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > On Mon, May 13, 2019 at 5:02 PM Stanislav Fomichev <sdf@fomichev.me> wrote:
> > >
> > > On 05/13, Willem de Bruijn wrote:
> > > > On Mon, May 13, 2019 at 3:53 PM Stanislav Fomichev <sdf@google.com> wrote:
> > > > >
> > > > > If we have a flow dissector BPF program attached to the namespace,
> > > > > FLOW_DISSECTOR_KEY_ETH_ADDRS won't trigger because we exit early.
> > > >
> > > > I suppose that this is true for a variety of keys? For instance, also
> > > > FLOW_DISSECTOR_KEY_IPV4_ADDRS.
> >
> > > I though the intent was to support most of the basic stuff (eth/ip/tcp/udp)
> > > without any esoteric protocols.
> >
> > Indeed. But this applies both to protocols and the feature set. Both
> > are more limited.
> >
> > > Not sure about FLOW_DISSECTOR_KEY_IPV4_ADDRS,
> > > looks like we support that (except FLOW_DISSECTOR_KEY_TIPC part).
> >
> > Ah, I chose a bad example then.
> >
> > > > We originally intended BPF flow dissection for all paths except
> > > > tc_flower. As that catches all the vulnerable cases on the ingress
> > > > path on the one hand and it is infeasible to support all the
> > > > flower features, now and future. I think that is the real fix.
> >
> > > Sorry, didn't get what you meant by the real fix.
> > > Don't care about tc_flower? Just support a minimal set of features
> > > needed by selftests?
> >
> > I do mean exclude BPF flow dissector (only) for tc_flower, as we
> > cannot guarantee that the BPF program can fully implement the
> > requested feature.
>
> Though, the user inserting the BPF flow dissector is the same as the
> user inserting the flower program, the (per netns) admin. So arguably
> is aware of the constraints incurred by BPF flow dissection. And else
> can still detect when a feature is not supported from the (lack of)
> output, as in this case of Ethernet address. I don't think we want to
> mix BPF and non-BPF flow dissection though. That subverts the safety
> argument of switching to BPF for flow dissection.
Yes, we cannot completely avoid tc_flower because we use it to do
the end-to-end testing. That's why I was trying to make sure "basic"
stuff works (it might feel confusing that tc_flower {src,dst}_mac
stop working with a bpf program installed).
TBH, I'd not call this particular piece of code that exports src/dst
addresses a dissection. At this point, it's a well-formed skb with
a proper l2 header and we just copy the addresses out. It's probably
part of the reason the original patch didn't include any skb->protocol
checks.
next prev parent reply other threads:[~2019-05-13 23:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 18:54 [PATCH bpf 1/2] flow_dissector: support FLOW_DISSECTOR_KEY_ETH_ADDRS with BPF Stanislav Fomichev
2019-05-13 18:54 ` [PATCH bpf 2/2] selftests/bpf: test L2 dissection in flow dissector Stanislav Fomichev
2019-05-13 20:33 ` [PATCH bpf 1/2] flow_dissector: support FLOW_DISSECTOR_KEY_ETH_ADDRS with BPF Willem de Bruijn
2019-05-13 21:02 ` Stanislav Fomichev
2019-05-13 21:21 ` Willem de Bruijn
2019-05-13 22:47 ` Willem de Bruijn
2019-05-13 23:05 ` Stanislav Fomichev [this message]
2019-05-13 23:21 ` Stanislav Fomichev
2019-05-13 23:44 ` Willem de Bruijn
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=20190513230513.GA10244@mini-arch \
--to=sdf@fomichev.me \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ppenkov@google.com \
--cc=sdf@google.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/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).