diff options
| author | Yichong Chen <chenyichong@uniontech.com> | 2026-06-24 10:50:54 +0800 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2026-07-01 11:17:43 -0700 |
| commit | 66d7e39e49b0dd57610c9b63afc65b4d5690983b (patch) | |
| tree | 9d2853665f3ed96feda0e52cac4190d116607ee1 /tools/perf/scripts/python/bin | |
| parent | a954c9e3168cdf0c3cad07b43dfc8ca2945d773a (diff) | |
tools/bpf/bpftool: Reset vmlinux BTF after map commands
get_map_kv_btf() caches the vmlinux BTF object when a map uses
btf_vmlinux_value_type_id. map dump released that object when the
command completed, but left the global pointer stale.
The same cached object can also be returned to print_key_value(), which
freed it directly. That leaves btf_vmlinux dangling before the command
cleanup path runs.
Use free_map_kv_btf() for per-entry cleanup, and reset the cached
btf_vmlinux pointer when the map command releases the object. This keeps
batch mode from reusing a freed BTF object.
Fixes: 4e1ea33292ff ("bpftool: Support dumping a map with btf_vmlinux_value_type_id")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/bpf/9072F43B3F74DF91+20260624025055.1574875-2-chenyichong@uniontech.com
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
