linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenz Bauer <lmb@cloudflare.com>
To: jannh@google.com
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed
Date: Fri, 5 Oct 2018 15:21:16 +0100	[thread overview]
Message-ID: <CACAyw9-JcORMGDb3wm-E4VYmjVmvWqB5vVh+=qTvXmpFWye_QA@mail.gmail.com> (raw)
In-Reply-To: <CAG48ez3wwGgc40uAg5nq9dnC3qsAD04jQZTWtPi7jg_VDws-fg@mail.gmail.com>

On Fri, 5 Oct 2018 at 15:12, Jann Horn <jannh@google.com> wrote:
>
> On Fri, Oct 5, 2018 at 9:42 AM Lorenz Bauer <lmb@cloudflare.com> wrote:
> > On Tue, 2 Oct 2018 at 21:00, Jann Horn <jannh@google.com> wrote:
> > >
> > > If this is for testing only, you can slap a capable(CAP_SYS_ADMIN)
> > > check in here, right? I doubt it matters, but I don't really like
> > > seeing something like this exposed to unprivileged userspace just
> > > because you need it for kernel testing.
> >
> > That would mean all tests have to run as root / with CAP_SYS_ADMIN
> > which isn't ideal.
>
> This patch basically means that it becomes easier for a local user to
> construct a BPF hash table that has all of its values stuffed into a
> single hash bucket, correct? Which makes it easier to create a BPF
> program that generates unusually large RCU stalls by performing ~40000
> BPF map lookups, each of which has to walk through the entire linked
> list of the hash map bucket? I dislike exposing something like that to
> unprivileged userspace.

That's a good point, for which I don't have an answer. You could argue that
this was the status quo until the seed was randomised, so it seems
like this hasn't been a worry so far. Should it be going forward?

> And if you want to run the whole BPF test suite with all its tests,
> don't you already need root privileges? Or is this a different test
> suite?

No, I'm thinking about third parties that want to test their own BPF.
If you enable unprivileged BPF you can use BPF_PROG_TEST_RUN to
test your programs without root, if I'm not mistaken.
-- 
Lorenz Bauer  |  Systems Engineer
25 Lavington St., London SE1 0NZ

www.cloudflare.com

  reply	other threads:[~2018-10-05 14:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 10:45 [PATCH 0/3] bpf: allow zero-initialising hash map seed Lorenz Bauer
2018-10-01 10:45 ` [PATCH 1/3] bpf: allow zero-initializing " Lorenz Bauer
2018-10-02 19:59   ` Jann Horn
2018-10-05  7:42     ` Lorenz Bauer
2018-10-05 14:12       ` Jann Horn
2018-10-05 14:21         ` Lorenz Bauer [this message]
2018-10-05 14:27           ` Jann Horn
2018-10-05 21:07             ` Alexei Starovoitov
2018-10-08  9:48               ` Lorenz Bauer
2018-10-01 10:45 ` [PATCH 2/3] tools: sync linux/bpf.h Lorenz Bauer
2018-10-01 10:45 ` [PATCH 3/3] tools: add selftest for BPF_F_ZERO_SEED Lorenz Bauer
2018-10-01 19:12 ` [PATCH 0/3] bpf: allow zero-initialising hash map seed Daniel Borkmann
2018-10-05 14:27   ` Lorenz Bauer
2018-10-05 14:29     ` Jann Horn
2018-10-08 10:32 ` [PATCH v2 " Lorenz Bauer
2018-10-08 10:32   ` [PATCH v2 1/3] bpf: allow zero-initializing " Lorenz Bauer
2018-10-08 23:07     ` Song Liu
2018-10-25 15:12       ` Lorenz Bauer
2018-11-07  0:39         ` Song Liu
2018-10-08 10:32   ` [PATCH v2 2/3] tools: sync linux/bpf.h Lorenz Bauer
2018-10-08 23:12     ` Song Liu
2018-10-25 15:07       ` Lorenz Bauer
2018-10-08 10:32   ` [PATCH v2 3/3] tools: add selftest for BPF_F_ZERO_SEED Lorenz Bauer
2018-10-08 23:15     ` Song Liu
2018-11-16 11:41 ` [PATCH v3 0/4] bpf: allow zero-initialising hash map seed Lorenz Bauer
2018-11-16 11:41   ` [PATCH v3 1/4] bpf: allow zero-initializing " Lorenz Bauer
2018-11-16 11:41   ` [PATCH v3 2/4] bpf: move BPF_F_QUERY_EFFECTIVE after map flags Lorenz Bauer
2018-11-16 11:41   ` [PATCH v3 3/4] tools: sync linux/bpf.h Lorenz Bauer
2018-11-16 11:41   ` [PATCH v3 4/4] tools: add selftest for BPF_F_ZERO_SEED Lorenz Bauer
2018-11-16 17:33   ` [PATCH v3 0/4] bpf: allow zero-initialising hash map seed Song Liu
2018-11-16 17:34   ` Song Liu
2018-11-19 23:56   ` Daniel Borkmann

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='CACAyw9-JcORMGDb3wm-E4VYmjVmvWqB5vVh+=qTvXmpFWye_QA@mail.gmail.com' \
    --to=lmb@cloudflare.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jannh@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=netdev@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).