All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amery Hung <ameryhung@gmail.com>
To: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org, alexei.starovoitov@gmail.com,
	andrii@kernel.org, daniel@iogearbox.net, tj@kernel.org,
	martin.lau@kernel.org, ameryhung@gmail.com, kernel-team@meta.com
Subject: [PATCH bpf-next v7 1/6] bpf: Allow verifier to fixup kernel module kfuncs
Date: Fri, 21 Nov 2025 15:13:47 -0800	[thread overview]
Message-ID: <20251121231352.4032020-2-ameryhung@gmail.com> (raw)
In-Reply-To: <20251121231352.4032020-1-ameryhung@gmail.com>

Allow verifier to fixup kfuncs in kernel module to support kfuncs with
__prog arguments. Currently, special kfuncs and kfuncs with __prog
arguments are kernel kfuncs. Allowing kernel module kfuncs should not
affect existing kfunc fixup as kernel module kfuncs have BTF IDs greater
than kernel kfuncs' BTF IDs.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
---
 kernel/bpf/verifier.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 098dd7f21c89..182d63b075af 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -22432,8 +22432,7 @@ static int fixup_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
 
 	if (!bpf_jit_supports_far_kfunc_call())
 		insn->imm = BPF_CALL_IMM(desc->addr);
-	if (insn->off)
-		return 0;
+
 	if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
 	    desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
 		struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;
-- 
2.47.3


  reply	other threads:[~2025-11-21 23:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 23:13 [PATCH bpf-next v7 0/6] Support associating BPF programs with struct_ops Amery Hung
2025-11-21 23:13 ` Amery Hung [this message]
2025-11-25 23:54   ` [PATCH bpf-next v7 1/6] bpf: Allow verifier to fixup kernel module kfuncs Andrii Nakryiko
2025-11-21 23:13 ` [PATCH bpf-next v7 2/6] bpf: Support associating BPF program with struct_ops Amery Hung
2025-11-25 23:54   ` Andrii Nakryiko
2025-12-02  5:40   ` Martin KaFai Lau
2025-11-21 23:13 ` [PATCH bpf-next v7 3/6] libbpf: Add support for " Amery Hung
2025-11-22  0:58   ` bot+bpf-ci
2025-11-25 23:54   ` Andrii Nakryiko
2025-11-25 23:56     ` Amery Hung
2025-11-21 23:13 ` [PATCH bpf-next v7 4/6] selftests/bpf: Test BPF_PROG_ASSOC_STRUCT_OPS command Amery Hung
2025-11-22  0:22   ` Alexei Starovoitov
2025-11-22  0:34     ` Amery Hung
2025-11-21 23:13 ` [PATCH bpf-next v7 5/6] selftests/bpf: Test ambiguous associated struct_ops Amery Hung
2025-11-21 23:13 ` [PATCH bpf-next v7 6/6] selftests/bpf: Test getting associated struct_ops in timer callback Amery Hung

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=20251121231352.4032020-2-ameryhung@gmail.com \
    --to=ameryhung@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.