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  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:   Tue, 8 Sep 2020 16:11:21 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Yonghong Song <yhs@...com>
Cc:     bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next v3 2/2] selftests/bpf: add test for map_ptr arithmetic

On Tue, Sep 8, 2020 at 10:58 AM Yonghong Song <yhs@...com> wrote:
>
> Change selftest map_ptr_kern.c with disabling inlining for
> one of subtests, which will fail the test without previous
> verifier change. Also added to verifier test for both
> "map_ptr += scalar" and "scalar += map_ptr" arithmetic.
>
> Signed-off-by: Yonghong Song <yhs@...com>
> ---

Acked-by: Andrii Nakryiko <andriin@...com>

>  .../selftests/bpf/progs/map_ptr_kern.c        | 10 +++++-
>  .../testing/selftests/bpf/verifier/map_ptr.c  | 32 +++++++++++++++++++
>  2 files changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/progs/map_ptr_kern.c b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> index 982a2d8aa844..0b754106407d 100644
> --- a/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> +++ b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> @@ -82,6 +82,14 @@ static inline int check_default(struct bpf_map *indirect,
>         return 1;
>  }
>
> +static __attribute__ ((noinline)) int

just fyi: there is now __noinline defined in bpf_helpers.h, saving a
bunch of typing

> +check_default_noinline(struct bpf_map *indirect, struct bpf_map *direct)
> +{
> +       VERIFY(check(indirect, direct, sizeof(__u32), sizeof(__u32),
> +                    MAX_ENTRIES));
> +       return 1;
> +}
> +
>  typedef struct {
>         int counter;
>  } atomic_t;

[...]

Powered by blists - more mailing lists