summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTony Ambardar <tony.ambardar@gmail.com>2020-09-19 22:01:35 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2020-09-21 21:50:49 +0200
commit1245008122d7311683d70c05b2eea167a314fb5f (patch)
treefb3854c517928306ff686f114caa7eafc6e07d75 /mm
parent65c204398928f9c79f1a29912b410439f7052635 (diff)
downloadlinux-1245008122d7311683d70c05b2eea167a314fb5f.tar.gz
linux-1245008122d7311683d70c05b2eea167a314fb5f.tar.bz2
linux-1245008122d7311683d70c05b2eea167a314fb5f.zip
libbpf: Fix native endian assumption when parsing BTF
Code in btf__parse_raw() fails to detect raw BTF of non-native endianness and assumes it must be ELF data, which then fails to parse as ELF and yields a misleading error message: root:/# bpftool btf dump file /sys/kernel/btf/vmlinux libbpf: failed to get EHDR from /sys/kernel/btf/vmlinux For example, this could occur after cross-compiling a BTF-enabled kernel for a target with non-native endianness, which is currently unsupported. Check for correct endianness and emit a clearer error message: root:/# bpftool btf dump file /sys/kernel/btf/vmlinux libbpf: non-native BTF endianness is not supported Fixes: 94a1fedd63ed ("libbpf: Add btf__parse_raw() and generic btf__parse() APIs") Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/90f81508ecc57bc0da318e0fe0f45cfe49b17ea7.1600417359.git.Tony.Ambardar@gmail.com
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions