Re: [PATCH bpf-next v4 02/13] bpf: Add helpers to describe the R0:R2 return register pair
Yonghong Song <[email protected]>
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
On 8/10/26 6:24 PM, [email protected] wrote: >> - subprog_ret_type() resolves a subprogram's BTF return type. It is >> factored out of subprog_returns_void(). The verifier_bug_if(!func) and >> !func_proto checks it replaces are redundant, since >> check_btf_func_early() already rejects a func_info record whose type_id >> is not a BTF_KIND_FUNC pointing at a BTF_KIND_FUNC_PROTO. > Is check_btf_func_early() the correct function name here? Running > `git grep check_btf_func_early` at this commit returns nothing, and the > validation the changelog describes lives in prepare_btf_func() > (kernel/bpf/check_btf.c:31): > > /* check type_id */ > type = btf_type_by_id(btf, krecord[i].type_id); > if (!type || !btf_type_is_func(type)) { ... goto err_free; } > func_proto = btf_type_by_id(btf, type->type); > if (unlikely(!func_proto || !btf_type_is_func_proto(func_proto))) > goto err_free; > > The in-code comment added by the same hunk already uses the correct > name: "Both already validated by prepare_btf_func() at prog load." Okay, replaced check_btf_func_early() with prepare_btf_func() in the commit message. > > > --- > 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/31446101762