Re: [PATCH bpf-next 1/6] bpf: Extend BTF UAPI vlen, kinds to use unused bits

bot+bpf-ci
2026-04-14T20:42:39Z

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index a62d78581207..1663970fc1bf 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c

[ ... ]

> @@ -289,7 +288,7 @@ enum verifier_phase {
> struct resolve_vertex {
> const struct btf_type *t;
> u32 type_id;
> - u16 next_member;
> + u32 next_member;
> };

The next_member field is widened to u32 here, but
env_stack_set_next_member() still takes a u16 parameter:

static void env_stack_set_next_member(struct btf_verifier_env *env,
u16 next_member)
{
env->stack[env->top_stack - 1].next_member = next_member;
}

Both callers, btf_struct_resolve() and btf_datasec_resolve(), now use
u32 loop iterators and pass i + 1 to this function. For vlen values
above 65535, the u16 parameter would silently truncate the index,
causing the resolve loop to resume at the wrong member.

Should the next_member parameter be u32 to match the struct field?

---
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/24420385267