Skip to content

Commit a5d30cb

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 1aeb398 commit a5d30cb

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
@@ -22416,8 +22416,7 @@ static int fixup_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
2241622416

2241722417
if (!bpf_jit_supports_far_kfunc_call())
2241822418
insn->imm = BPF_CALL_IMM(desc->addr);
22419-
if (insn->off)
22420-
return 0;
22419+
2242122420
if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
2242222421
desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
2242322422
struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;

0 commit comments

Comments
 (0)