lkml.org 
[lkml]   [2021]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] selftests/bpf: add verifier test for PTR_TO_MEM spill
On Tue, Jan 12, 2021 at 4:43 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 1/12/21 4:35 PM, Gilad Reti wrote:
> > On Tue, Jan 12, 2021 at 4:56 PM KP Singh <kpsingh@kernel.org> wrote:
> >> On Tue, Jan 12, 2021 at 10:16 AM Gilad Reti <gilad.reti@gmail.com> wrote:
> >>>
> >>> Add test to check that the verifier is able to recognize spilling of
> >>> PTR_TO_MEM registers.
> >>
> >> It would be nice to have some explanation of what the test does to
> >> recognize the spilling of the PTR_TO_MEM registers in the commit
> >> log as well.
> >>
> >> Would it be possible to augment an existing test_progs
> >> program like tools/testing/selftests/bpf/progs/test_ringbuf.c to test
> >> this functionality?
>
> How would you guarantee that LLVM generates the spill/fill, via inline asm?

Yeah, I guess there is no sure-shot way to do it and, adding inline asm would
just be doing the same thing as this verifier test. You can ignore me
on this one :)

It would, however, be nice to have a better description about what the test is
actually doing./


>
> > It may be possible, but from what I understood from Daniel's comment here
> >
> > https://lore.kernel.org/bpf/17629073-4fab-a922-ecc3-25b019960f44@iogearbox.net/
> >
> > the test should be a part of the verifier tests (which is reasonable
> > to me since it is
> > a verifier bugfix)
>
> Yeah, the test_verifier case as you have is definitely the most straight
> forward way to add coverage in this case.

\
 
 \ /
  Last update: 2021-01-12 17:41    [W:0.064 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site