Commit 88d1d4a7 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by Martin KaFai Lau
Browse files

bpf: Allow kfuncs return 'void *'

parent e63985ec
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -12364,6 +12364,9 @@ static int check_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
					meta.func_name);
				return -EFAULT;
			}
		} else if (btf_type_is_void(ptr_type)) {
			/* kfunc returning 'void *' is equivalent to returning scalar */
			mark_reg_unknown(env, regs, BPF_REG_0);
		} else if (!__btf_type_is_struct(ptr_type)) {
			if (!meta.r0_size) {
				__u32 sz;