[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<AM6PR03MB5848D364CD9297DE667B401999962@AM6PR03MB5848.eurprd03.prod.outlook.com>
Date: Thu, 29 Aug 2024 21:18:08 +0100
From: Juntong Deng <juntong.deng@...look.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau
<martin.lau@...ux.dev>, Eddy Z <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Kumar Kartikeya Dwivedi <memxor@...il.com>, snorcht@...il.com,
bpf <bpf@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v3 1/2] bpf: Make the pointer returned by iter
next method valid
On 8/29/24 19:37, Alexei Starovoitov wrote:
> On Thu, Aug 29, 2024 at 3:45 AM Juntong Deng <juntong.deng@...look.com> 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@AM6PR03MB5848.eurprd03.prod.outlook.com/T/#t
Powered by blists - more mailing lists