diff options
author | John Fastabend | 2017-08-16 08:35:12 +0200 |
---|---|---|
committer | David S. Miller | 2017-08-16 20:35:14 +0200 |
commit | cf9d01405925e3f8144c99d7bf7b184449794066 (patch) | |
tree | dc5184ad35fb003e81db458315b5768bfb26c18a /kernel/bpf/devmap.c | |
parent | Merge branch 'bpf-sockmap' (diff) | |
download | kernel-qcow2-linux-cf9d01405925e3f8144c99d7bf7b184449794066.tar.gz kernel-qcow2-linux-cf9d01405925e3f8144c99d7bf7b184449794066.tar.xz kernel-qcow2-linux-cf9d01405925e3f8144c99d7bf7b184449794066.zip |
bpf: devmap: remove unnecessary value size check
In the devmap alloc map logic we check to ensure that the sizeof the
values are not greater than KMALLOC_MAX_SIZE. But, in the dev map case
we ensure the value size is 4bytes earlier in the function because all
values should be netdev ifindex values.
The second check is harmless but is not needed so remove it.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/devmap.c')
-rw-r--r-- | kernel/bpf/devmap.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 7192fb67d4de..18a72a8add43 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -83,12 +83,6 @@ static struct bpf_map *dev_map_alloc(union bpf_attr *attr) attr->value_size != 4 || attr->map_flags) return ERR_PTR(-EINVAL); - /* if value_size is bigger, the user space won't be able to - * access the elements. - */ - if (attr->value_size > KMALLOC_MAX_SIZE) - return ERR_PTR(-E2BIG); - dtab = kzalloc(sizeof(*dtab), GFP_USER); if (!dtab) return ERR_PTR(-ENOMEM); |