diff options
author | 2016-03-07 21:57:16 -0800 | |
---|---|---|
committer | 2016-03-08 15:28:31 -0500 | |
commit | 823707b68d6e6c4b1be619b039c7045fef1740e6 (patch) | |
tree | 32149b0605061d1559c51e29a817a48a84ddcf6d /kernel/bpf/arraymap.c | |
parent | bpf: pre-allocate hash map elements (diff) | |
download | linux-dev-823707b68d6e6c4b1be619b039c7045fef1740e6.tar.xz linux-dev-823707b68d6e6c4b1be619b039c7045fef1740e6.zip |
bpf: check for reserved flag bits in array and stack maps
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index bd3bdf2486a7..76d5a794e426 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -53,7 +53,7 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr) /* check sanity of attributes */ if (attr->max_entries == 0 || attr->key_size != 4 || - attr->value_size == 0) + attr->value_size == 0 || attr->map_flags) return ERR_PTR(-EINVAL); if (attr->value_size >= 1 << (KMALLOC_SHIFT_MAX - 1)) |