diff options
| author | Andrii Nakryiko <[email protected]> | 2023-12-13 19:08:33 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2023-12-13 23:47:04 +0000 |
| commit | f5fdb51fb980077a4c6c78f3f775821f611fb38b (patch) | |
| tree | fa1e7a72820564b8bab55f1c448f446d68b0c41f /tools/lib/bpf/str_error.h | |
| parent | bpf: selftests: Add verifier tests for CO-RE bitfield writes (diff) | |
| download | kernel-f5fdb51fb980077a4c6c78f3f775821f611fb38b.tar.gz kernel-f5fdb51fb980077a4c6c78f3f775821f611fb38b.zip | |
bpf: fail BPF_TOKEN_CREATE if no delegation option was set on BPF FS
It's quite confusing in practice when it's possible to successfully
create a BPF token from BPF FS that didn't have any of delegate_xxx
mount options set up. While it's not wrong, it's actually more
meaningful to reject BPF_TOKEN_CREATE with specific error code (-ENOENT)
to let user-space know that no token delegation is setup up.
So, instead of creating empty BPF token that will be always ignored
because it doesn't have any of the allow_xxx bits set, reject it with
-ENOENT. If we ever need empty BPF token to be possible, we can support
that with extra flag passed into BPF_TOKEN_CREATE.
Acked-by: Christian Brauner <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/str_error.h')
0 files changed, 0 insertions, 0 deletions
