Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Lorenz Bauer <lmb@cloudflare.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Yonghong Song <yhs@fb.com>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team <kernel-team@cloudflare.com>,
	Network Development <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v3 0/6] Allow updating sockmap / sockhash from BPF
Date: Fri, 21 Aug 2020 15:23:07 -0700	[thread overview]
Message-ID: <CAADnVQKj5yEcRLq83B_Otp5AfY4TNWA6q9DSUGTr02kBXZmiyg@mail.gmail.com> (raw)
In-Reply-To: <20200821102948.21918-1-lmb@cloudflare.com>

On Fri, Aug 21, 2020 at 3:30 AM Lorenz Bauer <lmb@cloudflare.com> wrote:
>
> We're currently building a control plane for our BPF socket dispatch
> work. As part of that, we have a need to create a copy of an existing
> sockhash, to allow us to change the keys. I previously proposed allowing
> privileged userspace to look up sockets, which doesn't work due to
> security concerns (see [1]).
>
> In follow up discussions during BPF office hours we identified bpf_iter
> as a possible solution: instead of accessing sockets from user space
> we can iterate the source sockhash, and insert the values into a new
> map. Enabling this requires two pieces: the ability to iterate
> sockmap and sockhash, as well as being able to call map_update_elem
> from BPF.
>
> This patch set implements the latter: it's now possible to update
> sockmap from BPF context. As a next step, we can implement bpf_iter
> for sockmap.
>
> ===
>
> I've done some more fixups, and audited the safe contexts more
> thoroughly. As a result I'm removing CGROUP_SKB, SK_MSG and SK_SKB
> for now.
>
> Changes in v3:
> - Use CHECK as much as possible (Yonghong)
> - Reject ARG_PTR_TO_MAP_VALUE_OR_NULL for sockmap (Yonghong)
> - Remove CGROUP_SKB, SK_MSG, SK_SKB from safe contexts
> - Test that the verifier rejects update from unsafe context

All looks good to me.
I've applied the set.
Please follow up with a cleanup to selftests as Yonghong suggested.

      parent reply	other threads:[~2020-08-21 22:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 10:29 Lorenz Bauer
2020-08-21 10:29 ` [PATCH bpf-next v3 1/6] net: sk_msg: simplify sk_psock initialization Lorenz Bauer
2020-08-21 10:29 ` [PATCH bpf-next v3 2/6] bpf: sockmap: merge sockmap and sockhash update functions Lorenz Bauer
2020-08-21 10:29 ` [PATCH bpf-next v3 3/6] bpf: sockmap: call sock_map_update_elem directly Lorenz Bauer
2020-08-21 10:29 ` [PATCH bpf-next v3 4/6] bpf: override the meaning of ARG_PTR_TO_MAP_VALUE for sockmap and sockhash Lorenz Bauer
2020-08-21 15:46   ` Yonghong Song
2020-08-21 10:29 ` [PATCH bpf-next v3 5/6] bpf: sockmap: allow update from BPF Lorenz Bauer
2020-08-21 15:47   ` Yonghong Song
2020-08-21 10:29 ` [PATCH bpf-next v3 6/6] selftests: bpf: test sockmap " Lorenz Bauer
2020-08-21 16:13   ` Yonghong Song
2020-08-21 22:23 ` Alexei Starovoitov [this message]

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=CAADnVQKj5yEcRLq83B_Otp5AfY4TNWA6q9DSUGTr02kBXZmiyg@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@cloudflare.com \
    --cc=lmb@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    --subject='Re: [PATCH bpf-next v3 0/6] Allow updating sockmap / sockhash from BPF' \
    /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

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