[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP01T74N6091SZJ4Osht8NBNksOdx-D3mbtNRjWAt6w4uJ4y2Q@mail.gmail.com>
Date: Tue, 23 Jul 2024 03:00:10 +0200
From: Kumar Kartikeya Dwivedi <memxor@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Juntong Deng <juntong.deng@...look.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>,
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>,
Andrii Nakryiko <andrii@...nel.org>, Andrei Vagin <avagin@...il.com>, snorcht@...il.com,
bpf <bpf@...r.kernel.org>, Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH bpf-next RESEND 00/16] bpf: Checkpoint/Restore In eBPF (CRIB)
On Tue, 23 Jul 2024 at 02:58, Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Mon, Jul 22, 2024 at 5:50 PM Kumar Kartikeya Dwivedi
> <memxor@...il.com> wrote:
> >
> > >
> > > > Currently we cannot pass the pointer returned by the iterator next
> > > > method as argument to the KF_TRUSTED_ARGS kfuncs, because the pointer
> > > > returned by the iterator next method is not "valid".
> >
> > I've replied to this particular patch to explain what exact unsafety
> > it might introduce.
>
> What do you mean?
> I think we can make the return value from iter_next() trusted in
> certain cases.
> For example bpf_iter_task_next() returns task_struct and it
> can be safely marked as MEM_RCU, since the whole iterator is
> KF_RCU_PROTECTED.
Yes, iter_next is ok (see reply here:
https://lore.kernel.org/bpf/CAP01T74pq7pozpMi_LJUA8wehjpATMR3oM4vj7HHxohBPb0LbA@mail.gmail.com/).
But number 1 doesn't seem ok. Number 2 should now be possible if I'm
not mistaken.
Powered by blists - more mailing lists