2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 07:34:06 +08:00
linux-next/tools/testing/selftests/bpf
David Miller 89087c456f bpf: Fix values type used in test_maps
Maps of per-cpu type have their value element size adjusted to 8 if it
is specified smaller during various map operations.

This makes test_maps as a 32-bit binary fail, in fact the kernel
writes past the end of the value's array on the user's stack.

To be quite honest, I think the kernel should reject creation of a
per-cpu map that doesn't have a value size of at least 8 if that's
what the kernel is going to silently adjust to later.

If the user passed something smaller, it is a sizeof() calcualtion
based upon the type they will actually use (just like in this testcase
code) in later calls to the map operations.

Fixes: df570f5772 ("samples/bpf: unit test for BPF_MAP_TYPE_PERCPU_ARRAY")
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
2017-04-21 15:16:46 -04:00
..
.gitignore bpf: Add test_tag to .gitignore 2017-02-10 15:56:08 -05:00
bpf_util.h bpf: fix multiple issues in selftest suite and samples 2016-11-27 20:38:47 -05:00
config bpf: add initial suite for selftests 2016-10-18 11:35:55 -04:00
Makefile bpf: add various verifier test cases for self-tests 2017-04-01 12:36:37 -07:00
test_kmod.sh selftests: do not require bash to run bpf tests 2017-01-05 13:19:47 -07:00
test_lpm_map.c bpf: Remove bpf_sys.h from selftests 2017-02-10 15:56:08 -05:00
test_lru_map.c bpf: Remove bpf_sys.h from selftests 2017-02-10 15:56:08 -05:00
test_maps.c bpf: Fix values type used in test_maps 2017-04-21 15:16:46 -04:00
test_tag.c bpf: Remove bpf_sys.h from selftests 2017-02-10 15:56:08 -05:00
test_verifier.c bpf: add various verifier test cases for self-tests 2017-04-01 12:36:37 -07:00