Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3707992pxb; Mon, 24 Jan 2022 15:58:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyln5HPDuWmlw0nvsKNop/Mw6ijb9dEKCA3hBbIGSnvhuJqp01Dhd/eiulfPc0EfjDgo6o X-Received: by 2002:a17:90b:4a4f:: with SMTP id lb15mr726350pjb.213.1643068734947; Mon, 24 Jan 2022 15:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068734; cv=none; d=google.com; s=arc-20160816; b=Rj1uAjAcGZ5VbbPkd6CSfDoNZa3wvJTI8stw36Yj5LtkF97zl5qkNiacLew/mD85f1 9TAuTkIEtFZ8D2htOH5dpZMmEBFGev2qxsrUbev7dDfqiSiMeSEjqT8X7lQT0w0x07s+ 48BdhQeuKV5a/7oV4x+m8zGdrIILVbU6Px3ciigag6freBEdGIuZqWMVtqFIxhsu3Ji/ a0Irnhv5RHfKlUtx3O530YO84hYdyVcazIfWJonBzw+QMiyrfOk7Q9ZW7VDeqQKt3YC9 AUW5FM4ol6e/HNIs9eYkeL4x3tV/SNriaC54dODfY6HT64VqWCfhhL31Q7qFw0oDAE0O G2dw== 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=pNqdY73YqRWUECUEzE0fX7J4eVwH2VVkgbv7wtMQhbE=; b=qoO0NKWdT0qVsXWJflhDdrPOs7SwOwRh2SkM3oTbQad+yU02ImuFadc+HbvpWyxZVq n3UxHChorbDxv/4NeGBzk2vFU5fKdX7Z1kweIgZ1NPCcaEhzEyunyxHfmZwOmp5InN9K iDrNEiCMOYhlKMJf2gr2CTpGTQG+kkjF8pYf7rk3HmTxIVU3FU4OSBFmXmd5CARrTaU4 uRn6w+7+r8W3oXOaLPf3P9t6QLiBBU7aW1/7bGuvPSTJd7ll114kgtByecXAhbCbZtQJ N4ekUdl2quAeySTxhTYu7f8Vov3CSPicN3x1s7h/PrzqhFGhGAIgBKc16YP0eWb0a5N2 4M6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KaKw1anU; 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 a19si12442114pgd.350.2022.01.24.15.58.43; Mon, 24 Jan 2022 15:58:54 -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=KaKw1anU; 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 S2366698AbiAXXxV (ORCPT + 99 others); Mon, 24 Jan 2022 18:53:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846025AbiAXXOO (ORCPT ); Mon, 24 Jan 2022 18:14:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CBFC067A7D; Mon, 24 Jan 2022 13:22:24 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 3A357B81188; Mon, 24 Jan 2022 21:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE63C340E4; Mon, 24 Jan 2022 21:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059343; bh=/EAeO4xUnZVlE4J3vuK3DNqUta/S6QmR1xXciBHU+t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KaKw1anUg42BQFWn47k6WcIxzJi+pTM0JetW//CMyPMcOsqZ0h3rz4Lqie6Mc8TNq kJPLZ8DRmmh7h4HfqRX+PQANvSc7j1ZbnDZC1I/3TQtL7lOpIkfs0QGfplB+bH72PW gxuXJAdG/g6La8BLEoVRWN1jfI0zQqA+JPHFj25w= 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.16 0551/1039] selftests/bpf: Destroy XDP link correctly Date: Mon, 24 Jan 2022 19:39:00 +0100 Message-Id: <20220124184143.806005676@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 7589c03fd26be..eb2feaac81fe2 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