diff options
| author | Yuan Chen <[email protected]> | 2025-06-18 01:19:33 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2025-06-23 18:13:40 +0000 |
| commit | aa485e8789d56a4573f7c8d000a182b749eaa64d (patch) | |
| tree | 5ae84d0ea7fd6c9b972950601d6a5ab7eada9fae /tools/lib/bpf/libbpf.c | |
| parent | bpf: Adjust free target to avoid global starvation of LRU map (diff) | |
| download | kernel-aa485e8789d56a4573f7c8d000a182b749eaa64d.tar.gz kernel-aa485e8789d56a4573f7c8d000a182b749eaa64d.zip | |
libbpf: Fix null pointer dereference in btf_dump__free on allocation failure
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: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion")
Signed-off-by: Yuan Chen <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
0 files changed, 0 insertions, 0 deletions
