Re: [PATCHv3 bpf] libbpf: Prevent double close and leak of btf objects

patchwork-bot+netdevbpf
2026-04-16T23:10:37Z

Hello:

This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu, 16 Apr 2026 12:00:34 +0200 you wrote:
> Sashiko found possible double close of btf object fd [1],
> which happens when strdup in load_module_btfs fails at which
> point the obj->btf_module_cnt is already incremented.
>
> The error path close btf fd and so does later cleanup code in
> bpf_object_post_load_cleanup function.
>
> [...]

Here is the summary with links:
- [PATCHv3,bpf] libbpf: Prevent double close and leak of btf objects
https://git.kernel.org/bpf/bpf/c/380044c40b16

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.