diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-08-04 22:24:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-04 16:09:06 -0700 |
commit | 2c460621bb2e6baf8a475c407cdb29029b2497ac (patch) | |
tree | a01b0b305e15c0dbc5ccddb4705804a903d2cb31 /scripts/extract_xc3028.pl | |
parent | aaf83aecd294fd61db6b34051f718f3e7ea34c22 (diff) | |
download | blackbird-obmc-linux-2c460621bb2e6baf8a475c407cdb29029b2497ac.tar.gz blackbird-obmc-linux-2c460621bb2e6baf8a475c407cdb29029b2497ac.zip |
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 13da9e200fe4 ("Revert "endian: #define
__BYTE_ORDER"") and 415586c9e6d3 ("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: 18f3d6be6be1 ("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>
Diffstat (limited to 'scripts/extract_xc3028.pl')
0 files changed, 0 insertions, 0 deletions