Re: [PATCH bpf-next v5 2/2] selftests/bpf: Add tests with stack ptr register in conditional jmp

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

 



On Wed, Jul 16, 2025 at 09:05:05AM -0700, Yonghong Song wrote:
> On 7/16/25 3:13 AM, Shung-Hsi Yu wrote:
> > Hi Andrii and Yonghong,
> > 
> > On Fri, May 23, 2025 at 09:13:40PM -0700, Yonghong Song wrote:
> > > Add two tests:
> > >    - one test has 'rX <op> r10' where rX is not r10, and
> > >    - another test has 'rX <op> rY' where rX and rY are not r10
> > >      but there is an early insn 'rX = r10'.
> > > 
> > > Without previous verifier change, both tests will fail.
> > > 
> > > Signed-off-by: Yonghong Song <yonghong.song@xxxxxxxxx>
> > > ---
> > >   .../selftests/bpf/progs/verifier_precision.c  | 53 +++++++++++++++++++
> > >   1 file changed, 53 insertions(+)
> > I was looking this commit (5ffb537e416e) since it was a BPF selftest
> > test for CVE-2025-38279, but upon looking I found that the commit
> > differs from the patch, there is an extra hunk that changed
> > kernel/bpf/verifier.c that wasn't found the Yonghong's original patch.
> > 
> > I suppose it was meant to be squashed into the previous commit
> > e2d2115e56c4 "bpf: Do not include stack ptr register in precision
> > backtracking bookkeeping"?
> 
> Andrii made some change to my original patch for easy understanding.
> See
>   https://lore.kernel.org/bpf/20250524041335.4046126-1-yonghong.song@xxxxxxxxx
> Quoted below:
> "
> I've moved it inside the preceding if/else (twice), so it's more
> obvious that BPF_X deal with both src_reg and dst_reg, and BPF_K case
> deals only with BPF_K. The end result is the same, but I found this
> way a bit easier to follow. Applied to bpf-next, thanks.

Argh, indeed I missed the sibling thread. Thanks for point that out.

Shung-Hsi

...




[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