Skip to content

Commit 929c731

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 fb42a92 commit 929c731

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

2248922489
if (!bpf_jit_supports_far_kfunc_call())
2249022490
insn->imm = BPF_CALL_IMM(desc->addr);
22491-
if (insn->off)
22492-
return 0;
22491+
2249322492
if (desc->func_id == special_kfunc_list[KF_bpf_obj_new_impl] ||
2249422493
desc->func_id == special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
2249522494
struct btf_struct_meta *kptr_struct_meta = env->insn_aux_data[insn_idx].kptr_struct_meta;

0 commit comments

Comments
 (0)