diff options
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 68d866628be0..988c04c91e10 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 | |||
22 | static void bpf_array_free_percpu(struct bpf_array *array) | 25 | static 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 | ||