Re: [PATCH bpf-next v2] libbpf: Fix stale raw data after btf__relocate()
From: patchwork-bot+netdevbpf
Date: Tue Nov 03 2026 - 13:10:17 EST
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@xxxxxxxxxx>:
On Tue, 3 Nov 2026 16:18:35 +0800 you wrote:
> btf_relocate() rewrites type ids in place but doesn't drop the cached
> raw_data, so btf__raw_data() after btf__relocate() returns the old
> bytes with pre-relocation ids.
>
> Only modifiable BTF keeps raw_data as a cache. For read-only BTF, e.g.
> module BTF relocated in btf_parse_elf(), types_data points into
> raw_data and is already rewritten in place, so it must not be freed.
> Make btf_invalidate_raw_data() tell the two apart and call it from
> btf__relocate(). Also recompute named_start_id since start_id changes
> after relocation, like the kernel does.
>
> [...]
Here is the summary with links:
- [bpf-next,v2] libbpf: Fix stale raw data after btf__relocate()
https://git.kernel.org/bpf/bpf-next/c/b2bb14d8035d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html