Re: [PATCH v2] libbpf: Fix null pointer dereference in btf_dump__free on allocation failure
From: patchwork-bot+netdevbpf
Date: Mon Jun 23 2025 - 14:19:49 EST
Hello:
This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@xxxxxxxxxx>:
On Wed, 18 Jun 2025 09:19:33 +0800 you wrote:
> From: chenyuan <chenyuan@xxxxxxxxxx>
>
> 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.
>
> [...]
Here is the summary with links:
- [v2] libbpf: Fix null pointer dereference in btf_dump__free on allocation failure
https://git.kernel.org/bpf/bpf/c/aa485e8789d5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html