Re: [PATCH bpf-next v2] bpf: Fix resetting logic for unreferenced kptrs

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

 



On Wed, Sep 7, 2022 at 8:58 AM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote:
>
> On Wed, 7 Sept 2022 at 17:24, Jules Irenge <jbi.octave@xxxxxxxxx> wrote:
> >
> > Sparse reported a warning at bpf_map_free_kptrs()
> >
> > "warning: Using plain integer as NULL pointer"
> >
> > During the process of fixing this warning,
> > it was discovered that the current code
> > erroneously writes to the pointer variable
> > instead of deferencing and writing to the actual kptr.
> > Hence, Sparse tool accidentally helped to uncover this problem.
> >
> > Fix this by doing WRITE_ONCE(*p, 0) instead of WRITE_ONCE(p, 0).
> >
> > Note that the effect of this bug is that
> > unreferenced kptrs will not be cleared during check_and_free_fields.
> > It is not a problem if the clearing is not done during map_free stage,
> > as there is nothing to free for them.
> >
>
> You're still missing the fixes tag right before your Signed-off-By.
>
> Instead of
>
> Signed-off-by: Jules Irenge <jbi.octave@xxxxxxxxx>
>
> It must be
>
> Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr")
> Signed-off-by: Jules Irenge <jbi.octave@xxxxxxxxx>

Added while applying.



[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