Re: [PATCH V2 2/2] kernel/bpf/verifier: Support module kfunc resolution via instruction offset
From: bot+bpf-ci
Date: Sat May 09 2026 - 23:37:50 EST
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> old mode 100644
> new mode 100755
Should this file really be made executable? Kernel source files should
not have the executable bit set. This appears to be an accidental
file mode change.
> index 11054ad89c14..7c7441cc3c2e
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
[ ... ]
> @@ -2734,7 +2735,16 @@ int bpf_add_kfunc_call(struct bpf_verifier_env *env, u32 func_id, u16 offset)
> if (err)
> return err;
>
> - addr = kallsyms_lookup_name(kfunc.name);
> + if (offset) {
> + struct bpf_kfunc_btf kf_btf = { .offset = offset };
> + struct module *mod;
> + struct bpf_kfunc_btf *b;
> + b = bsearch(&kf_btf, btf_tab->descs, btf_tab->nr_descs,
> + sizeof(btf_tab->descs[0]), kfunc_btf_cmp_by_off);
^^^^
The continuation line here uses spaces instead of tabs. Should this be
indented with tabs to match the kernel coding style?
> + mod = b->module;
> + addr = find_kallsyms_symbol_value(mod, kfunc.name);
> + } else
> + addr = kallsyms_lookup_name(kfunc.name);
The if branch uses braces for multiple statements, but the else branch
omits them. Does this match the expected style for the rest of the
file? The coding style guide suggests using braces on both branches
when one requires them.
> if (!addr) {
> verbose(env, "cannot find address for kernel function %s\n", kfunc.name);
> return -EINVAL;
---
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/25618517155