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:   Mon, 21 Sep 2020 16:21:13 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andriin@...com>,
        John Fastabend <john.fastabend@...il.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Eelco Chaudron <echaudro@...hat.com>,
        KP Singh <kpsingh@...omium.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next v7 08/10] selftests: add test for multiple
 attachments of freplace program

On Sat, Sep 19, 2020 at 4:50 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> From: Toke Høiland-Jørgensen <toke@...hat.com>
>
> This adds a selftest for attaching an freplace program to multiple targets
> simultaneously.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> ---
>  .../selftests/bpf/prog_tests/fexit_bpf2bpf.c       |  157 ++++++++++++++++----
>  .../selftests/bpf/progs/freplace_get_constant.c    |   15 ++
>  2 files changed, 140 insertions(+), 32 deletions(-)
>  create mode 100644 tools/testing/selftests/bpf/progs/freplace_get_constant.c
>

LGTM.

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

> +       err = bpf_prog_test_run(tgt_fd, 1, &pkt_v6, sizeof(pkt_v6),
> +                               NULL, NULL, &retval, &duration);
> +       if (CHECK(err || retval, "ipv6",
> +                 "err %d errno %d retval %d duration %d\n",
> +                 err, errno, retval, duration))
> +               goto out;
> +
> +       err = check_data_map(obj, 1, true);
> +       if (err)
> +               goto out;
> +
> +out:
> +       if (!IS_ERR_OR_NULL(link))
> +               bpf_link__destroy(link);

fyi, you don't need to check ERR_OR_NULL anymore, all destructors are
now handling that implicitly

> +       bpf_object__close(tgt_obj);
> +       return err;
> +}
> +

[...]

Powered by blists - more mailing lists