Skip to content

Commit 9fe8bf2

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 634398c commit 9fe8bf2

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

2200522005
if (!bpf_jit_supports_far_kfunc_call())
2200622006
insn->imm = BPF_CALL_IMM(desc->addr);
22007-
if (insn->off)
22008-
return 0;
22007+
2200922008
if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
2201022009
desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
2201122010
struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;

0 commit comments

Comments
 (0)