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]
Message-ID: <CAJ8uoz2rWff3EwyRJ=6JOG_9phWVigq3FHzE6mUhCt_YmePdTw@mail.gmail.com>
Date:   Mon, 13 Jun 2022 11:48:56 +0200
From:   Magnus Karlsson <magnus.karlsson@...il.com>
To:     Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Network Development <netdev@...r.kernel.org>,
        "Karlsson, Magnus" <magnus.karlsson@...el.com>,
        Björn Töpel <bjorn@...nel.org>
Subject: Re: [PATCH bpf-next 05/10] selftests: xsk: add missing close() on
 netns fd

On Fri, Jun 10, 2022 at 5:15 PM Maciej Fijalkowski
<maciej.fijalkowski@...el.com> wrote:
>
> Commit 1034b03e54ac ("selftests: xsk: Simplify cleanup of ifobjects") removed
> close on netns fd, which is not correct, so let us restore it.

Acked-by: Magnus Karlsson <magnus.karlsson@...el.com>

> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> ---
>  tools/testing/selftests/bpf/xdpxceiver.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c
> index da8098f1b655..2499075fad82 100644
> --- a/tools/testing/selftests/bpf/xdpxceiver.c
> +++ b/tools/testing/selftests/bpf/xdpxceiver.c
> @@ -1591,6 +1591,8 @@ static struct ifobject *ifobject_create(void)
>         if (!ifobj->umem)
>                 goto out_umem;
>
> +       ifobj->ns_fd = -1;
> +
>         return ifobj;
>
>  out_umem:
> @@ -1602,6 +1604,8 @@ static struct ifobject *ifobject_create(void)
>
>  static void ifobject_delete(struct ifobject *ifobj)
>  {
> +       if (ifobj->ns_fd != -1)
> +               close(ifobj->ns_fd);
>         free(ifobj->umem);
>         free(ifobj->xsk_arr);
>         free(ifobj);
> --
> 2.27.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ