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: <CAEf4Bzb7ag=bdhuAuDHuxk_+jQj7ZudU3Bd2zk3OPz8GSYVFtA@mail.gmail.com>
Date:   Tue, 1 Oct 2019 20:17:49 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Brian Vazquez <brianvv@...gle.com>
Cc:     Brian Vazquez <brianvv.kernel@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        "David S . Miller" <davem@...emloft.net>,
        Stanislav Fomichev <sdf@...gle.com>,
        open list <linux-kernel@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf 1/2] selftests/bpf: test_progs: don't leak server_fd
 in tcp_rtt

On Tue, Oct 1, 2019 at 10:39 AM Brian Vazquez <brianvv@...gle.com> wrote:
>
> server_fd needs to be closed if pthread can't be created.
>
> Fixes: 8a03222f508b ("selftests/bpf: test_progs: fix client/server race
> in tcp_rtt")

Fixes tag hast to be on single line, no wrapping. Besides that:

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

> Cc: Stanislav Fomichev <sdf@...gle.com>
>
> Signed-off-by: Brian Vazquez <brianvv@...gle.com>
> ---
>  tools/testing/selftests/bpf/prog_tests/tcp_rtt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/tcp_rtt.c b/tools/testing/selftests/bpf/prog_tests/tcp_rtt.c
> index a82da555b1b02..f4cd60d6fba2e 100644
> --- a/tools/testing/selftests/bpf/prog_tests/tcp_rtt.c
> +++ b/tools/testing/selftests/bpf/prog_tests/tcp_rtt.c
> @@ -260,13 +260,14 @@ void test_tcp_rtt(void)
>
>         if (CHECK_FAIL(pthread_create(&tid, NULL, server_thread,
>                                       (void *)&server_fd)))
> -               goto close_cgroup_fd;
> +               goto close_server_fd;
>
>         pthread_mutex_lock(&server_started_mtx);
>         pthread_cond_wait(&server_started, &server_started_mtx);
>         pthread_mutex_unlock(&server_started_mtx);
>
>         CHECK_FAIL(run_test(cgroup_fd, server_fd));
> +close_server_fd:
>         close(server_fd);
>  close_cgroup_fd:
>         close(cgroup_fd);
> --
> 2.23.0.444.g18eeb5a265-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ