Re: [PATCH RFC bpf-next v1 18/32] bpf: Support bpf_spin_lock in local kptrs

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

 



On Fri, 9 Sept 2022 at 10:25, Dave Marchevsky <davemarchevsky@xxxxxx> wrote:
>
> On 9/7/22 8:35 PM, Alexei Starovoitov wrote:
> > On Sun, Sep 04, 2022 at 10:41:31PM +0200, Kumar Kartikeya Dwivedi wrote:
> >> diff --git a/include/linux/poison.h b/include/linux/poison.h
> >> index d62ef5a6b4e9..753e00b81acf 100644
> >> --- a/include/linux/poison.h
> >> +++ b/include/linux/poison.h
> >> @@ -81,4 +81,7 @@
> >>  /********** net/core/page_pool.c **********/
> >>  #define PP_SIGNATURE                (0x40 + POISON_POINTER_DELTA)
> >>
> >> +/********** kernel/bpf/helpers.c **********/
> >> +#define BPF_PTR_POISON              ((void *)((0xeB9FUL << 2) + POISON_POINTER_DELTA))
> >> +
> >
> > That was part of Dave's patch set as well.
> > Please keep his SOB and authorship and keep it as separate patch.
>
> My patch picked a different constant :). But on that note, it also added some
> checking in verifier.c so that verification fails if any arg or retval type
> was BPF_PTR_POISON after it should've been replaced. Perhaps it's worth shipping
> that patch ("bpf: Add verifier check for BPF_PTR_POISON retval and arg")
> separately? Would allow both rbtree series and this lock-focused patch to drop
> BPF_PTR_POISON changes after rebase.

Yeah, feel free to post it separately. I'm using the constant in this
patch for a different purpose (I separate the BPF_PTR_POISON case into
its own different argument type, and then check that it is always set
for it in check_btf_id_ok, to ensure DYN_BTF_ID is not setting some
static real BTF ID).

But why change the constant, eB9F looks very close to eBPF already :).
UL is just for unsigned long.



[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