mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: chensong_2000@126.com,andrii@kernel.org,eddyz87@gmail.com,ast@kernel.org,daniel@iogearbox.net,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,john.fastabend@gmail.com,kpsingh@kernel.org,sdf@fomichev.me,haoluo@google.com,jolsa@kernel.org,alexei.starovoitov@gmail.com
Cc: bpf@vger.kernel.org,linux-kernel@vger.kernel.org,chensong_2000@126.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH V2 2/2] kernel/bpf/verifier: Support module kfunc resolution via instruction offset
Date: Sun, 10 May 2026 03:37:42 +0000 (UTC)	[thread overview]
Message-ID: <94121dde23acce08992f446a4e3321b6c48b3f833f8b00c181485bcd6de63d87@mail.kernel.org> (raw)
In-Reply-To: <20260510030147.27900-1-chensong_2000@126.com>

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

> 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

  reply	other threads:[~2026-05-10  3:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10  3:01 Song Chen
2026-05-10  3:37 ` bot+bpf-ci [this message]
2026-05-12  3:56 ` Kaitao Cheng
2026-05-14 12:30   ` Song Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94121dde23acce08992f446a4e3321b6c48b3f833f8b00c181485bcd6de63d87@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chensong_2000@126.com \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®