aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/stackmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/stackmap.c')
-rw-r--r--kernel/bpf/stackmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 135be433e9a0..a15bc636cc98 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -11,6 +11,9 @@
11#include <linux/perf_event.h> 11#include <linux/perf_event.h>
12#include "percpu_freelist.h" 12#include "percpu_freelist.h"
13 13
14#define STACK_CREATE_FLAG_MASK \
15 (BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY)
16
14struct stack_map_bucket { 17struct stack_map_bucket {
15 struct pcpu_freelist_node fnode; 18 struct pcpu_freelist_node fnode;
16 u32 hash; 19 u32 hash;
@@ -60,7 +63,7 @@ static struct bpf_map *stack_map_alloc(union bpf_attr *attr)
60 if (!capable(CAP_SYS_ADMIN)) 63 if (!capable(CAP_SYS_ADMIN))
61 return ERR_PTR(-EPERM); 64 return ERR_PTR(-EPERM);
62 65
63 if (attr->map_flags & ~BPF_F_NUMA_NODE) 66 if (attr->map_flags & ~STACK_CREATE_FLAG_MASK)
64 return ERR_PTR(-EINVAL); 67 return ERR_PTR(-EINVAL);
65 68
66 /* check sanity of attributes */ 69 /* check sanity of attributes */