Re: [PATCH v3 2/3] libbpf: zero out btf_key_type_id for STRUCT_OPS maps

From: bot+bpf-ci

Date: Tue May 26 2026 - 11:07:13 EST


> commit df12a01912b915400d5eedf67067cd516e5d81eb
> Author: Siddharth Nayyar <sidnayyar@xxxxxxxxxx>
>
> libbpf: zero out btf_key_type_id for STRUCT_OPS maps
>
> For BPF `STRUCT_OPS` maps (such as `sched_ext_ops` maps), the kernel BPF
> subsystem enforces strict map-creation safety validations inside
> `map_create()`. That is, if `btf_vmlinux_value_type_id` is set, the
> kernel forbids passing any userspace `btf_key_type_id` or
> `btf_value_type_id` (they must both be `0`).
>
> However, inside libbpf's map-creation options initialization
> (`bpf_object__create_map()`), libbpf zeroed out
> `create_attr.btf_value_type_id` but does not zero out
> `create_attr.btf_key_type_id`.
>
> Fix this by explicitly zeroing out `create_attr.btf_key_type_id`.
>
> Signed-off-by: Siddharth Nayyar <sidnayyar@xxxxxxxxxx>

This looks like a bug fix for STRUCT_OPS map creation support. The bug
was introduced in commit f1eeafaa2798 which added the STRUCT_OPS case in
bpf_object__create_map() that only zeroed out btf_value_type_id but
forgot to also zero out btf_key_type_id. This causes kernel validation
to fail for STRUCT_OPS maps.

Should this include:

Fixes: f1eeafaa2798 ("adding ci files")


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/26454419965