From patchwork Thu Jul 4 08:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13723471 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03FA2156679; Thu, 4 Jul 2024 09:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720083638; cv=none; b=gwb6Gap314VFrIlnNc66cZGZUyL/ZUNfxkSWCuk1QyeQd6u/Hdld5e3M/8cPQfgKWlSWu2hejjC51dEmmuhcYJQceNHkivpJCosKyT2v3jIU7XUpQSEpIeTVPa69BKOSO6EHNw0pST6LOY740jHde2dkkoNiLsTXdLghkGLIzpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720083638; c=relaxed/simple; bh=JAWAcKR7zBXRC50szWd1XFpZsq7hHNsF3ZdFSJ3411U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CwIilaNX5qFGxyMsLn3DR1db0Ymx0ksEnqddfG9f7SVMaKnl5Ga3KxnmCs7QS9RcSFOW3A1D7Yd88XVAn43kJ6IsAV1+7ZblW0UKBrg86vsKAXXpQuQkXFpQ8D1e3c3uz8jCB6/vEsi64Pf5LUl1m1cLw9z4N5A8iSOSu7UnnXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wy182bbP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wy182bbP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D4C8C3277B; Thu, 4 Jul 2024 09:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720083637; bh=JAWAcKR7zBXRC50szWd1XFpZsq7hHNsF3ZdFSJ3411U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wy182bbPQ7a51xlnDxYIrYjZLWBRqz9x8Xefvqt4IHchquH+PFypnfoBy1tElBEKC DSvWkDKp1ACt7rWacpDKHeGbrAjuk4cXl4RSaXPh/ZQW88YXM+QgNAjGEZlMfsmt+7 hJWmVFzTlRIHh8zjM+9xPyDtN1/pvID3GYw1blBIH/6eCFZR6iXiGLFyq1U8yKW8MJ zb/F2QGacMliiAWLirwwBsrZgOWczmICCZiUIfeTKX5vGHgvA+6D5smjcCeAoZ1fKc CP4oQRVfZ0rGuUejhqFzKH1AErscUMrMNCNAEl7OfV3V58gBXEsFzWMM4a7LREyWy1 ancnm9xSMO0hw== From: Geliang Tang To: Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf-next v7 5/9] selftests/bpf: Close fd in error path in drop_on_reuseport Date: Thu, 4 Jul 2024 16:59:42 +0800 Message-ID: <8f05f5acdf4871454ab052ab39dac22fe6e5d1fe.1720083019.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Geliang Tang Server 1 fd should be closed in the error path when update_lookup_map() fails. This patch fixes it by goto "close_srv1" instead of "detach" lable in that case. Acked-by: Eduard Zingerman Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c index 597d0467a926..de2466547efe 100644 --- a/tools/testing/selftests/bpf/prog_tests/sk_lookup.c +++ b/tools/testing/selftests/bpf/prog_tests/sk_lookup.c @@ -994,7 +994,7 @@ static void drop_on_reuseport(const struct test *t) err = update_lookup_map(t->sock_map, SERVER_A, server1); if (err) - goto detach; + goto close_srv1; /* second server on destination address we should never reach */ server2 = make_server(t->sotype, t->connect_to.ip, t->connect_to.port,