diff options
author | Okash Khawaja <osk@fb.com> | 2018-07-10 14:33:07 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-07-11 22:36:08 +0200 |
commit | b65f370d0671c4980ffe866c41e327b88893245c (patch) | |
tree | 6f2c9bc4ce56c7d0f63b7754d5cb34bb3960b4a4 /net/bpf | |
parent | 61d769807f273fda962866f3d4c677cda9974d3c (diff) | |
download | linux-stable-b65f370d0671c4980ffe866c41e327b88893245c.tar.gz linux-stable-b65f370d0671c4980ffe866c41e327b88893245c.tar.bz2 linux-stable-b65f370d0671c4980ffe866c41e327b88893245c.zip |
bpf: btf: Fix bitfield extraction for big endian
When extracting bitfield from a number, btf_int_bits_seq_show() builds
a mask and accesses least significant byte of the number in a way
specific to little-endian. This patch fixes that by checking endianness
of the machine and then shifting left and right the unneeded bits.
Thanks to Martin Lau for the help in navigating potential pitfalls when
dealing with endianess and for the final solution.
Fixes: b00b8daec828 ("bpf: btf: Add pretty print capability for data with BTF type info")
Signed-off-by: Okash Khawaja <osk@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/bpf')
0 files changed, 0 insertions, 0 deletions