2026-09-29 11:28 UTC+0100 ~ Quentin Monnet <[email protected]>
> 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.


Hi Tianyi, sorry for the delay, it seems your series somehow fell
through the cracks. Daniel sent a fix on kernel side for this [0], but I
think it's still worth getting the fix in bpftool as well, to avoid
hitting the bug if we run it on older kernels that won't have the fix.

Would you please send a rebased version of your series (and drop the
mention of recursing dumps in patch 2's description, keep the Fixes: and
Acked-by: tags)? Similarly, can you repost a rebased version of your
patches for the batch lookups for hashmap dumps in bpftool, please?

Thanks,
Quentin


[0]
https://lore.kernel.org/all/[email protected]/

Reply via email to