Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3608076pxb; Mon, 24 Jan 2022 13:24:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwB0Hh/42z7skH/kGxDXipMj/lb9Cl30JL9b7WJ72pHJpcM03hBDFvZv76UmPWDq/5jlt5m X-Received: by 2002:a63:b145:: with SMTP id g5mr13065703pgp.113.1643059498300; Mon, 24 Jan 2022 13:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059498; cv=none; d=google.com; s=arc-20160816; b=JotKxfNVNg47janTYmHQ3Z0Xcq6JxnKJwjOCrR4lJ1M0bKzXs47ypVs9xyT/HTY7a3 YrcT2sWmg2zA1Z0OOMVc5obbrki2/VD5C0EHnozPEB7dYe3peNHhFPYkmoEoNKvMUVQi 3QI8/tcy0FSDqWe2G9KWdjwwSDdzj/svm8EgjIQtYZVciQVKT/N3HfB14Ns4xuSwDFYf ExMsbHEmnVI9FV32eWdtDPodMPlzDotk4Y1WpcIcYv6oBdjKKOM93m7xH4PkQFcJ/BOp V3D+UIi2IZzN3tDyIG9ouevBhxkKaUh5z5sO9PoOWVdYNIzVt1ITwI67pYCu2E0k4e5q 7cOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9UISbiqIvLcRXzNUqp1Yef4lvTE+JTv8m6YWL8emnmw=; b=C9xFAKRqwEqg+z098j33hZf9ejoXiVUPsaifnnZktqx3024IJ7d8B3Sd0FtC0F2SDC QGWqC+uIdQh2wVQwmWQ7yFHhzGgcS91MVCygacW+FluJ9Q98aoxcqUoPCsfmdTz4Uh4a 2/DXTtlGFOIbVKA/JnFj1nm0SkdFuBWnVBEalNL4KktOnzey6ogTG3L9oovqrXxHA6Yo C/YKiJuLCpWFYIgzhC0jbzAZzKNkgr0CYsERuxbPupz5Ij6+LTHweLMtOBWC3afSKPa2 7G4F2Vu2rfFyhXWVUoDCfhqscCLKa0wBC2I+H18xLGMoan1eMtPguK6EliSTfwoMrtjM HOuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qpcn1vb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si10385713pfq.133.2022.01.24.13.24.46; Mon, 24 Jan 2022 13:24:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qpcn1vb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443501AbiAXU5I (ORCPT + 99 others); Mon, 24 Jan 2022 15:57:08 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:60122 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386157AbiAXUfO (ORCPT ); Mon, 24 Jan 2022 15:35:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C0421614EC; Mon, 24 Jan 2022 20:35:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD7A0C340E5; Mon, 24 Jan 2022 20:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056513; bh=2tE7hxKGMOMC5KAqc0el4iqpnPASZIZxwjjzSAZrSyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qpcn1vb+lppcwXAYOytUGjM5XuAkX14mbqsDVWrykDVY513ZQBw5LlezNiyj+sUex TxH+ZnFIqm4+xjIgolOeYEizI7ka4hltYwwFVub6DiywF8Co3D0//Fjc12cssM+J9P jHR0Nv2UiC77dHXQpD7ta4rKlI9ufilxfLlAEFH8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov , Hengqi Chen , Sasha Levin Subject: [PATCH 5.15 467/846] selftests/bpf: Destroy XDP link correctly Date: Mon, 24 Jan 2022 19:39:44 +0100 Message-Id: <20220124184117.088239073@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrii Nakryiko [ Upstream commit f91231eeeed752119f49eb6620cae44ec745a007 ] bpf_link__detach() was confused with bpf_link__destroy() and leaves leaked FD in the process. Fix the problem. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-9-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c b/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c index 59adb4715394f..3c85247f96f95 100644 --- a/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c +++ b/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c @@ -204,8 +204,8 @@ static int pass_ack(struct migrate_reuseport_test_case *test_case) { int err; - err = bpf_link__detach(test_case->link); - if (!ASSERT_OK(err, "bpf_link__detach")) + err = bpf_link__destroy(test_case->link); + if (!ASSERT_OK(err, "bpf_link__destroy")) return -1; test_case->link = NULL; -- 2.34.1