lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 3 Oct 2022 17:03:18 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        jbenc@...hat.com
Subject: Re: [PATCH bpf-next] selftests/bpf: make libbpf_probe_prog_types
 testcase aware of kernel configuration

On Sun, Oct 2, 2022 at 11:56 PM Artem Savkov <asavkov@...hat.com> wrote:
>
> On Fri, Sep 30, 2022 at 04:06:41PM -0700, Andrii Nakryiko wrote:
> > On Fri, Sep 30, 2022 at 4:09 AM Artem Savkov <asavkov@...hat.com> wrote:
> > >
> > > At the moment libbpf_probe_prog_types test iterates over all available
> > > BPF_PROG_TYPE regardless of kernel configuration which can exclude some
> > > of those. Unfortunately there is no direct way to tell which types are
> > > available, but we can look at struct bpf_ctx_onvert to tell which ones
> > > are available.
> > >
> > > Signed-off-by: Artem Savkov <asavkov@...hat.com>
> > > ---
> >
> > Many selftests assume correct kernel configuration which is encoded in
> > config and config.<arch> files. So it seems fair to assume that all
> > defined program types are available on kernel-under-test.
>
> Ok. Wasn't sure if this is the assumption being made.
>
> > If someone is running selftests under custom more minimal kernel they
> > can use denylist to ignore specific prog type subtests?
>
> Thanks for the suggestion. Denylist is a bit too broad in this case as
> it means we'll be disabling the whole libbpf_probe_prog_types test while
> only a single type is a problem. Looks like we'll have to live with a
> downstream-only patch in this case.

Allow/deny lists allow to specify subtests as well, so you can have
very granular control. E.g.,

[vmuser@...hvm bpf]$ sudo ./test_progs -a 'libbpf_probe_prog_types/*SK*'
Failed to load bpf_testmod.ko into the kernel: -22
WARNING! Selftests relying on bpf_testmod.ko will be skipped.
#96/8    libbpf_probe_prog_types/BPF_PROG_TYPE_CGROUP_SKB:OK
#96/14   libbpf_probe_prog_types/BPF_PROG_TYPE_SK_SKB:OK
#96/16   libbpf_probe_prog_types/BPF_PROG_TYPE_SK_MSG:OK
#96/21   libbpf_probe_prog_types/BPF_PROG_TYPE_SK_REUSEPORT:OK
#96/30   libbpf_probe_prog_types/BPF_PROG_TYPE_SK_LOOKUP:OK
#96      libbpf_probe_prog_types:OK
Summary: 1/5 PASSED, 0 SKIPPED, 0 FAILED


As you can see each program type is a subtest, so you can pick and
choose which ones to run.

>
> --
>  Artem
>

Powered by blists - more mailing lists