On 8/29/24 19:37, Alexei Starovoitov wrote:
On Thu, Aug 29, 2024 at 3:45 AM Juntong Deng <juntong.deng@xxxxxxxxxxx> wrote:
if (prev_st)
@@ -12860,6 +12867,16 @@ static int check_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
/* For mark_ptr_or_null_reg, see 93c230e3f5bd6 */
regs[BPF_REG_0].id = ++env->id_gen;
}
+
+ if (is_iter_next_kfunc(&meta) && base_type(regs[BPF_REG_0].type) != PTR_TO_MEM) {
The != PTR_TO_MEM part is a bit ugly.
Why not do it in {} scope right above?
Just move it up by a few lines?
Right after regs[BPF_REG_0].type = PTR_TO_BTF_ID;
You are right, I eliminated the != PTR_TO_MEM part and sent the
version 4 patch set:
https://lore.kernel.org/bpf/AM6PR03MB584869F8B448EA1C87B7CDA399962@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/#t