Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp407799ybn; Tue, 1 Oct 2019 23:32:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9ngsdKJiPSV23+TNf91oj9d5WCLgp66ocmwsQPk8ujP3EBEGDD4yH/RJrrjWewdfkOmv7 X-Received: by 2002:a17:906:164d:: with SMTP id n13mr1643105ejd.75.1569997959546; Tue, 01 Oct 2019 23:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569997959; cv=none; d=google.com; s=arc-20160816; b=RAqIp2awxqCDJau6253BlD6mK3OAqhiFw/7Py70aDYaCbEfbVkr9LhRytBNfygC2D2 tSO9sTmhmD8IiDepvHV0FoGVhu0JwArBVe4uAglQDua3C7p0pXhwH3MtPZkK0CLA2K1W phkI7nfzq3ZL322cBcTmrrqa0tH3+FBq7waR+IAwMSCfIkCBcz6gVAvIneLJfqHTfQZ+ YfRDaggyOz9lJ4y+rSsNAnfinH8lFtmWfG7q69LfEkziCSMUQQWt/mA5cL9XhRKX2TMi YcZxPEQ29qpuC+5QmiyVCK/G8Lhue/OFWj6Olx+qqDLoXB67e+9G9yuPF0Sz0M+26EAW 2ZOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DkfOxbgDr7IYTTOG7aOBpzhIL2nlLLSARJt6E+jjVXU=; b=M93o2qTr1EW4bACkXqGmaW9/O19pg6mBih+lSsOHiT70kLv+dkdYzLRhLn+ogWMIFe AQ1JzDHCL/V009n6CUvmVJC7wCohubrmBLkxlp2mW023U8Mvd7XEcn6SdZMaep288/Xb i7EYveTCgEoSX1fcMI01HdUO5nzvjX660ZJ56bs29KL6KJKkBcJR2FTE0dXhqQ54UiEn oSLjMybD8FNZDR8MiCJzXWiVhO+bgRKL/4yj8ah+jRf0HipUthNgCrmuSbUfYQbljJAr WP2CyQN22QS5q1zUuNnBk32pGp9H2+jDQm8yjGbRtTwpsl8Do5Ux7NY3OHD5EHnEeMsI fRQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IhspJJTC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f45si11672360eda.345.2019.10.01.23.32.15; Tue, 01 Oct 2019 23:32:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IhspJJTC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729020AbfJBDSC (ORCPT + 99 others); Tue, 1 Oct 2019 23:18:02 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:36570 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbfJBDSC (ORCPT ); Tue, 1 Oct 2019 23:18:02 -0400 Received: by mail-qt1-f194.google.com with SMTP id o12so24558994qtf.3; Tue, 01 Oct 2019 20:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DkfOxbgDr7IYTTOG7aOBpzhIL2nlLLSARJt6E+jjVXU=; b=IhspJJTCUMExojADiKr2W/9JHFM0sVu94fB83wkgQSgbKLnWmSlRyg7OBZ2wEQ6zFV yQRvkabi8UL5SqFLiyi6m1SPuhofDVvoaLHj2L0C5sx0uSySug1ibL7hNfGwvie86GJZ NPDitckoC0vaohlnMQmYOv3L4Gzsz5OKIx1/tNUWeRcIkDPLdjAYtuaq5ZnE6QFg6YmW b/ZHkclTCiwtvPp0BZ9CKTdn7ZAX02ne0DRLfidO2AcVv8LtvDpS+06BS7nGcH+8xBzy hX8Um03GcW04FPtVizP/47K82r2th84FqA7j86y5kLcTI9+J/FmtI6oDhKZ47QCYRd6j 1uUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DkfOxbgDr7IYTTOG7aOBpzhIL2nlLLSARJt6E+jjVXU=; b=k8/+Nuij7PdJh+FT1554aeGnvu1e0FUYGRpJejN6MVLrH8wAhMM+VilQcA94S7Ydj0 ++eCCbw0aItGuCT8cuoqLLIwbLcithTsKBz46XF1soHZ5K4VD102ktbHyp1/vUt33UXK D7VOX6XvBvSseVVPbVqmCVAp4wRtYpRxVGQfF0L4HJV52yejlOTVUXiaVw86FmBBqca6 CdWYMwe2Ac8voOHHcuqT0IfSC4jBUJzbWTQAPzDhrQYAX1PxOF6tJHOFtKCxAWNrtbx/ 5UckLgHmwAEOXyCzRX2bDAc/QEkDeRFyaVauscvdVQyOFFgyy5prtRXUbbiI3Mkde6fl WgJg== X-Gm-Message-State: APjAAAUY42veVtfPMZQsiJ/6OdarslG9yOBcJ9wTSkbl0jG8Fe+cnI8G p+UYUeTeMS+Uc5XwPGT5yCN/75xdG8bAx3MY/Nw= X-Received: by 2002:a0c:88f0:: with SMTP id 45mr1215730qvo.78.1569986280629; Tue, 01 Oct 2019 20:18:00 -0700 (PDT) MIME-Version: 1.0 References: <20191001173728.149786-1-brianvv@google.com> <20191001173728.149786-2-brianvv@google.com> In-Reply-To: <20191001173728.149786-2-brianvv@google.com> From: Andrii Nakryiko Date: Tue, 1 Oct 2019 20:17:49 -0700 Message-ID: Subject: Re: [PATCH bpf 1/2] selftests/bpf: test_progs: don't leak server_fd in tcp_rtt To: Brian Vazquez Cc: Brian Vazquez , Alexei Starovoitov , Daniel Borkmann , "David S . Miller" , Stanislav Fomichev , open list , Networking , bpf Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 1, 2019 at 10:39 AM Brian Vazquez 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 > Cc: Stanislav Fomichev > > Signed-off-by: Brian Vazquez > --- > 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 >