diff options
| author | 2018-10-18 11:13:01 -0300 | |
|---|---|---|
| committer | 2018-10-18 11:13:01 -0300 | |
| commit | ce6c9da1113ad681bff27a3e376d2017f7f8a59c (patch) | |
| tree | 922ee99522f8e47e4fa5c735d4ea378dfdb79085 /kernel/bpf/local_storage.c | |
| parent | perf/x86/intel: Export mem events only if there's PEBS support (diff) | |
| parent | Merge tag 'perf-urgent-for-mingo-4.19-20181017' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (diff) | |
| download | wireguard-linux-ce6c9da1113ad681bff27a3e376d2017f7f8a59c.tar.xz wireguard-linux-ce6c9da1113ad681bff27a3e376d2017f7f8a59c.zip | |
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
To pick up fixes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'kernel/bpf/local_storage.c')
| -rw-r--r-- | kernel/bpf/local_storage.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c index 22ad967d1e5f..830d7f095748 100644 --- a/kernel/bpf/local_storage.c +++ b/kernel/bpf/local_storage.c @@ -129,7 +129,7 @@ static int cgroup_storage_update_elem(struct bpf_map *map, void *_key, struct bpf_cgroup_storage *storage; struct bpf_storage_buffer *new; - if (flags & BPF_NOEXIST) + if (flags != BPF_ANY && flags != BPF_EXIST) return -EINVAL; storage = cgroup_storage_lookup((struct bpf_cgroup_storage_map *)map, @@ -195,6 +195,9 @@ static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr) if (attr->key_size != sizeof(struct bpf_cgroup_storage_key)) return ERR_PTR(-EINVAL); + if (attr->value_size == 0) + return ERR_PTR(-EINVAL); + if (attr->value_size > PAGE_SIZE) return ERR_PTR(-E2BIG); |
