alistair23-linux/tools
Daniel Borkmann 2c460621bb bpf: fix byte order test in test_verifier
We really must check with #if __BYTE_ORDER == XYZ instead of
just presence of #ifdef __LITTLE_ENDIAN. I noticed that when
actually running this on big endian machine, the latter test
resolves to true for user space, same for #ifdef __BIG_ENDIAN.

E.g., looking at endian.h from libc, both are also defined
there, so we really must test this against __BYTE_ORDER instead
for proper insns selection. For the kernel, such checks are
fine though e.g. see 13da9e200f ("Revert "endian: #define
__BYTE_ORDER"") and 415586c9e6 ("UAPI: fix endianness conditionals
in M32R's asm/stat.h") for some more context, but not for
user space. Lets also make sure to properly include endian.h.
After that, suite passes for me:

./test_verifier: ELF 64-bit MSB executable, [...]

Linux foo 4.13.0-rc3+ #4 SMP Fri Aug 4 06:59:30 EDT 2017 s390x s390x s390x GNU/Linux

Before fix: Summary: 505 PASSED, 11 FAILED
After  fix: Summary: 516 PASSED,  0 FAILED

Fixes: 18f3d6be6b ("selftests/bpf: Add test cases to test narrower ctx field loads")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong <yhs@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-04 16:09:06 -07:00
..
accounting
arch
build bpf, s390: fix build for libbpf and selftest suite 2017-08-04 11:18:01 -07:00
cgroup
firewire
gpio
hv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
iio
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
kvm/kvm_stat tools/kvm_stat: add '-f help' to get the available event list 2017-07-26 19:04:53 +02:00
laptop
leds
lguest
lib bpf, s390: fix build for libbpf and selftest suite 2017-08-04 11:18:01 -07:00
net
nfsd
objtool objtool: Fix sibling call detection logic 2017-07-08 10:29:48 +02:00
pci
pcmcia
perf Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 11:12:48 -07:00
power ACPI updates for v4.13-rc1 2017-07-04 14:16:49 -07:00
scripts
spi
testing bpf: fix byte order test in test_verifier 2017-08-04 16:09:06 -07:00
thermal/tmon
time
usb usb: changes for v4.13 merge window 2017-06-20 11:39:34 +08:00
virtio
vm
Makefile