aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/arraymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r--kernel/bpf/arraymap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index e2636737b69b..7c25426d3cf5 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -19,6 +19,9 @@
19 19
20#include "map_in_map.h" 20#include "map_in_map.h"
21 21
22#define ARRAY_CREATE_FLAG_MASK \
23 (BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY)
24
22static void bpf_array_free_percpu(struct bpf_array *array) 25static void bpf_array_free_percpu(struct bpf_array *array)
23{ 26{
24 int i; 27 int i;
@@ -56,7 +59,8 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
56 59
57 /* check sanity of attributes */ 60 /* check sanity of attributes */
58 if (attr->max_entries == 0 || attr->key_size != 4 || 61 if (attr->max_entries == 0 || attr->key_size != 4 ||
59 attr->value_size == 0 || attr->map_flags & ~BPF_F_NUMA_NODE || 62 attr->value_size == 0 ||
63 attr->map_flags & ~ARRAY_CREATE_FLAG_MASK ||
60 (percpu && numa_node != NUMA_NO_NODE)) 64 (percpu && numa_node != NUMA_NO_NODE))
61 return ERR_PTR(-EINVAL); 65 return ERR_PTR(-EINVAL);
62 66
@@ -492,7 +496,7 @@ static void *perf_event_fd_array_get_ptr(struct bpf_map *map,
492 496
493 ee = ERR_PTR(-EOPNOTSUPP); 497 ee = ERR_PTR(-EOPNOTSUPP);
494 event = perf_file->private_data; 498 event = perf_file->private_data;
495 if (perf_event_read_local(event, &value) == -EOPNOTSUPP) 499 if (perf_event_read_local(event, &value, NULL, NULL) == -EOPNOTSUPP)
496 goto err_out; 500 goto err_out;
497 501
498 ee = bpf_event_entry_gen(perf_file, map_file); 502 ee = bpf_event_entry_gen(perf_file, map_file);