Re: [PATCH bpf-next 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 Mon, Aug 19, 2024 at 6:24 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> > >
> > > [0]:
> > > https://lore.kernel.org/bpf/CAP01T75na=fz7EhrP4Aw0WZ33R7jTbZ4BcmY56S1xTWczxHXWw@xxxxxxxxxxxxxx/
> > >
> > > Maybe we can have more discussion?
> > >
> > > (This email has been CC Kumar)
> >
> > +1
> > pointer from iterator should always be trusted except
> > the case of KF_RCU_PROTECTED iterators.
> > Those iters clear iter itself outside of RCU CS,
> > so a pointer returned from iter_next should probably be
> > PTR_TO_BTF_ID | MEM_RCU | PTR_MAYBE_NULL.
> >
> > For all other iters it should be safe to return
> > PTR_TO_BTF_ID | PTR_TRUSTED | PTR_MAYBE_NULL
> >
>
> Ok, but we at some point might need to return a non-RCU/non-trusted
> pointer, so I guess we'll have to add yet another flag to opt-out of
> "trustedness"?

If such case ever happens then yes, we'd need a new flag,
but I don't see it's happening





[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