2026-09-29 02:13 UTC+0900 ~ Tianyi Chen <[email protected]>
> The kernel copies bpf_map_info from userspace and only fills in the BTF
> fields when a map has BTF. Reusing the structure for a later map without
> BTF therefore retains the preceding map's BTF IDs.
> 
> Clear the structure and restore its length before each query in map
> listing, named-map listing, BTF detection and dumping. This prevents
> reporting stale BTF IDs, choosing BTF output for mixed map selections,
> and formatting a map with another map's key and value types.
> 
> Reported-by: Quentin Monnet <[email protected]>
> Link: 
> https://lore.kernel.org/r/[email protected]
> Assisted-by: LLM
> Signed-off-by: Tianyi Chen <[email protected]>


Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
Fixes: 99f9863a0c45 ("bpftool: Match maps by name")

Acked-by: Quentin Monnet <[email protected]>

Thanks for this.

Reply via email to