linux-yocto/tools/lib/bpf
Yuan Chen e32a996582 libbpf: Fix null pointer dereference in btf_dump__free on allocation failure
[ Upstream commit aa485e8789 ]

When btf_dump__new() fails to allocate memory for the internal hashmap
(btf_dump->type_names), it returns an error code. However, the cleanup
function btf_dump__free() does not check if btf_dump->type_names is NULL
before attempting to free it. This leads to a null pointer dereference
when btf_dump__free() is called on a btf_dump object.

Fixes: 351131b51c ("libbpf: add btf_dump API for BTF-to-C conversion")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250618011933.11423-1-chenyuan_fl@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-06 10:58:00 +02:00
..
.gitignore
bpf_core_read.h bpf: Fix uninitialized values in BPF_{CORE,PROBE}_READ 2025-06-27 11:07:10 +01:00
bpf_endian.h
bpf_gen_internal.h
bpf_helpers.h
bpf_prog_linfo.c
bpf_tracing.h
bpf.c
bpf.h libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API 2024-03-26 18:20:32 -04:00
btf_dump.c libbpf: Fix null pointer dereference in btf_dump__free on allocation failure 2025-07-06 10:58:00 +02:00
btf.c libbpf: Add identical pointer detection to btf_dedup_is_equiv() 2025-06-27 11:07:34 +01:00
btf.h
Build
gen_loader.c
hashmap.c
hashmap.h
libbpf_common.h
libbpf_errno.c
libbpf_internal.h libbpf: Fix faccessat() usage on Android 2024-03-26 18:20:32 -04:00
libbpf_legacy.h
libbpf_probes.c
libbpf_version.h
libbpf.c libbpf: Fix buffer overflow in bpf_object__init_prog 2025-06-27 11:07:09 +01:00
libbpf.h
libbpf.map
libbpf.pc.template
linker.c libbpf: Use proper errno value in linker 2025-06-27 11:07:10 +01:00
Makefile
netlink.c
nlattr.c libbpf: Use proper errno value in nlattr 2025-06-27 11:07:11 +01:00
nlattr.h
relo_core.c
relo_core.h
ringbuf.c
skel_internal.h
str_error.c
str_error.h
strset.c
strset.h
usdt.bpf.h
usdt.c libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing 2025-02-21 13:49:06 +01:00