From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Kernel Team <kernel-team@meta.com>
Subject: Re: [PATCH bpf-next 2/3] bpf: don't require CAP_SYS_ADMIN for getting NEXT_ID
Date: Thu, 25 May 2023 10:04:50 -0700 [thread overview]
Message-ID: <CAEf4BzZNfj1M5NcmUEQLudH0DjiexaR9UZPQ_U+xvbtviXGtAA@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQJ1UEDVH6L=CEjbAudgKmDbp26=-3AfU0sFA_j92Dhn7Q@mail.gmail.com>
On Wed, May 24, 2023 at 8:23 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Wed, May 24, 2023 at 3:55 PM Andrii Nakryiko <andrii@kernel.org> wrote:
> >
> > Getting ID of map/prog/btf/link doesn't give any access to underlying
> > BPF objects, so there is no point in requiring CAP_SYS_ADMIN for these
> > commands.
>
> I don't think it's a good idea to allow unpriv to figure out
> all prog/map/btf/link IDs.
> Since unpriv is typically disabled it's not a security issue,
> but rather a concern over abuse of IDR logic and potential
> for exploits in *get_next_id() code.
> At least CAP_BPF is needed.
Ok, sounds good. I was just trying to minimize the number of commands
that would need token_fd.
BPF_MAP_FREEZE is the one I care about the most, if that one looks
good, should we land that single patch?
next prev parent reply other threads:[~2023-05-25 17:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 22:54 [PATCH bpf-next 0/3] Relax checks for unprivileged bpf() commands Andrii Nakryiko
2023-05-24 22:54 ` [PATCH bpf-next 1/3] bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command Andrii Nakryiko
2023-05-24 22:54 ` [PATCH bpf-next 2/3] bpf: don't require CAP_SYS_ADMIN for getting NEXT_ID Andrii Nakryiko
2023-05-25 3:22 ` Alexei Starovoitov
2023-05-25 17:04 ` Andrii Nakryiko [this message]
2023-05-25 17:11 ` Alexei Starovoitov
2023-05-25 17:30 ` Andrii Nakryiko
2023-05-24 22:54 ` [PATCH bpf-next 3/3] bpf: don't require bpf_capable() for GET_INFO_BY_FD Andrii Nakryiko
2023-05-25 13:13 ` Daniel Borkmann
2023-05-25 17:20 ` Andrii Nakryiko
2023-05-25 19:49 ` Daniel Borkmann
2023-05-25 17:20 ` [PATCH bpf-next 0/3] Relax checks for unprivileged bpf() commands patchwork-bot+netdevbpf
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=CAEf4BzZNfj1M5NcmUEQLudH0DjiexaR9UZPQ_U+xvbtviXGtAA@mail.gmail.com \
--to=andrii.nakryiko@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@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).