Re: [PATCH bpf-next v2] bpf: Fix unaligned interpreter panic on JIT fallback path

From: Tiezhu Yang

Date: Thu Jun 11 2026 - 07:28:42 EST


On 2026/6/11 下午6:54, bot+bpf-ci@xxxxxxxxxx wrote:
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 649cce41e13f..5785c8cb4dbe 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -2608,6 +2608,31 @@ static struct bpf_prog *bpf_prog_jit_compile(struct bpf_verifier_env *env, struc
return prog;
}

+/* Fix up helper call offsets for inlined helpers on JIT fallback path. */
+static void bpf_fixup_fallback_inline_helpers(struct bpf_verifier_env *env, struct bpf_prog *fp)
+{
+ struct bpf_insn *insn = fp->insnsi;
+ const struct bpf_func_proto *fn;
+ int i;
+
+ if (!env || !env->ops->get_func_proto)
+ return;
+
+ for (i = 0; i < fp->len; i++, insn++) {
+ if (insn->code == (BPF_JMP | BPF_CALL) && insn->src_reg == 0) {

Would it be cleaner to use bpf_helper_call(insn) here instead of the
manual condition check?

The bpf_helper_call() helper from include/linux/bpf_verifier.h performs
the same check and is used throughout the codebase for consistency. It
improves readability and makes the intent more explicit.

OK, this is better.

I will send v3 after waiting for more review comments.

Thanks,
Tiezhu