summaryrefslogtreecommitdiff
path: root/kernel/bpf/reuseport_array.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-06-14 01:35:32 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-06-19 15:04:04 +0300
commit6c3eba1c5e283fd2bb1c076dbfcb47f569c3bfde (patch)
tree529142270bc25c37d2a49fc15ab078ed9996fb6f /kernel/bpf/reuseport_array.c
parent22db41226b679768df8f0a4ff5de8e58f625f45b (diff)
downloadlinux-6c3eba1c5e283fd2bb1c076dbfcb47f569c3bfde.tar.xz
bpf: Centralize permissions checks for all BPF map types
This allows to do more centralized decisions later on, and generally makes it very explicit which maps are privileged and which are not (e.g., LRU_HASH and LRU_PERCPU_HASH, which are privileged HASH variants, as opposed to unprivileged HASH and HASH_PERCPU; now this is explicit and easy to verify). Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20230613223533.3689589-4-andrii@kernel.org
Diffstat (limited to 'kernel/bpf/reuseport_array.c')
-rw-r--r--kernel/bpf/reuseport_array.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/bpf/reuseport_array.c b/kernel/bpf/reuseport_array.c
index cbf2d8d784b8..4b4f9670f1a9 100644
--- a/kernel/bpf/reuseport_array.c
+++ b/kernel/bpf/reuseport_array.c
@@ -151,9 +151,6 @@ static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr)
int numa_node = bpf_map_attr_numa_node(attr);
struct reuseport_array *array;
- if (!bpf_capable())
- return ERR_PTR(-EPERM);
-
/* allocate all map elements and zero-initialize them */
array = bpf_map_area_alloc(struct_size(array, ptrs, attr->max_entries), numa_node);
if (!array)