linux/tools/testing/selftests
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
..
bpf bpf: Fix values type used in test_maps 2017-04-21 15:16:46 -04:00
breakpoints
capabilities
cpu-hotplug
cpufreq
drivers/gpu
efivarfs
exec
filesystems
firmware
ftrace selftests: ftrace: Add check for function-fork before running pid filter test 2017-04-18 12:46:11 -04:00
futex
gpio
ia64
intel_pstate
ipc
kcmp
lib
locking
media_tests
membarrier
memfd
memory-hotplug
mount
mqueue
net selftests/net: Fixes psock_fanout CBPF test case 2017-04-20 15:39:19 -04:00
networking/timestamping
nsfs
ntb
powerpc selftests/powerpc: Fix standalone powerpc build 2017-03-27 15:11:44 +11:00
prctl
pstore
ptp
ptrace
rcutorture
seccomp
sigaltstack
size
splice
static_keys
sync
sysctl
timers
user
vDSO
vm userfaultfd: selftest: vm: allow to build in vm/ directory 2017-03-09 17:01:10 -08:00
watchdog
x86 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-03-07 14:47:24 -08:00
zram
.gitignore
Makefile
gen_kselftest_tar.sh
kselftest.h
kselftest_install.sh
lib.mk