Skip to content

Commit 13cd013

Browse files
ameryhungKernel Patches Daemon
authored andcommitted
bpf: Allow verifier to fixup kernel module kfuncs
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 <[email protected]>
1 parent 631bcf6 commit 13cd013

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21917,8 +21917,7 @@ static int fixup_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
2191721917

2191821918
if (!bpf_jit_supports_far_kfunc_call())
2191921919
insn->imm = BPF_CALL_IMM(desc->addr);
21920-
if (insn->off)
21921-
return 0;
21920+
2192221921
if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
2192321922
desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
2192421923
struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;

0 commit comments

Comments
 (0)