linux-yocto/tools/lib
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
..
api libapi: Add missing linux/types.h header to get the __u64 type on io.h 2024-01-25 15:27:46 -08:00
bpf libbpf: Fix null pointer dereference in btf_dump__free on allocation failure 2025-07-06 10:58:00 +02:00
perf libperf evlist: Avoid out-of-bounds access 2024-04-13 13:05:12 +02:00
subcmd libsubcmd: Don't free the usage string 2024-10-17 15:22:11 +02:00
symbol
thermal thermal/lib: Fix memory leak on error in thermal_genl_auto() 2024-12-14 19:53:19 +01:00
traceevent
argv_split.c
bitmap.c
ctype.c
find_bit.c
hweight.c
list_sort.c
rbtree.c
slab.c
str_error_r.c
string.c
vsprintf.c
zalloc.c