linux-kernelorg-stable/tools/lib
Andrii Nakryiko 02670deede libbpf: Handle unsupported mmap-based /sys/kernel/btf/vmlinux correctly
libbpf_err_ptr() helpers are meant to return NULL and set errno, if
there is an error. But btf_parse_raw_mmap() is meant to be used
internally and is expected to return ERR_PTR() values. Because of this
mismatch, when libbpf tries to mmap /sys/kernel/btf/vmlinux, we don't
detect the error correctly with IS_ERR() check, and never fallback to
old non-mmap-based way of loading vmlinux BTF.

Fix this by using proper ERR_PTR() returns internally.

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Fixes: 3c0421c93c ("libbpf: Use mmap to parse vmlinux BTF from sysfs")
Cc: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20250606202134.2738910-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2025-06-06 14:07:07 -07:00
..
api libapi: Add missing header with NAME_MAX define to io_dir.h 2025-03-13 00:29:36 -07:00
bpf libbpf: Handle unsupported mmap-based /sys/kernel/btf/vmlinux correctly 2025-06-06 14:07:07 -07:00
perf libperf threadmap: Add perf_thread_map__idx() 2025-05-21 15:07:13 -03:00
subcmd
symbol
thermal tools: Remove redundant quiet setup 2025-02-18 16:27:43 -03:00
argv_split.c
bitmap.c lib/interval_tree: add test case for interval_tree_iter_xxx() helpers 2025-03-17 12:17:00 -07:00
cmdline.c
ctype.c
find_bit.c
hweight.c
list_sort.c
rbtree.c
slab.c lib/rbtree: enable userland test suite for rbtree related data structure 2025-03-17 12:17:00 -07:00
str_error_r.c
string.c
vsprintf.c
zalloc.c