|
@@ -2545,8 +2545,12 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn
|
|
mark_reg_unknown(env, regs, BPF_REG_0);
|
|
mark_reg_unknown(env, regs, BPF_REG_0);
|
|
} else if (fn->ret_type == RET_VOID) {
|
|
} else if (fn->ret_type == RET_VOID) {
|
|
regs[BPF_REG_0].type = NOT_INIT;
|
|
regs[BPF_REG_0].type = NOT_INIT;
|
|
- } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL) {
|
|
|
|
- regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL;
|
|
|
|
|
|
+ } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL ||
|
|
|
|
+ fn->ret_type == RET_PTR_TO_MAP_VALUE) {
|
|
|
|
+ if (fn->ret_type == RET_PTR_TO_MAP_VALUE)
|
|
|
|
+ regs[BPF_REG_0].type = PTR_TO_MAP_VALUE;
|
|
|
|
+ else
|
|
|
|
+ regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL;
|
|
/* There is no offset yet applied, variable or fixed */
|
|
/* There is no offset yet applied, variable or fixed */
|
|
mark_reg_known_zero(env, regs, BPF_REG_0);
|
|
mark_reg_known_zero(env, regs, BPF_REG_0);
|
|
regs[BPF_REG_0].off = 0;
|
|
regs[BPF_REG_0].off = 0;
|