Re: [PATCH bpf-next v3 1/2] bpf: Make the pointer returned by iter next method valid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux