Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3383953pxb; Mon, 17 Jan 2022 19:13:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVYOMUzH7+uEoAXaLOibFk9Q6CWMXvTAFnLfDTkAHR5HZahBopvT58x0gXYjbZJWUhtImV X-Received: by 2002:a63:3ec6:: with SMTP id l189mr21285177pga.256.1642475599671; Mon, 17 Jan 2022 19:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475599; cv=none; d=google.com; s=arc-20160816; b=ooSSa8bDkTERt3JWZme/L/A52KRyInqpkJmSfj7ENOrJkzqchxESurBkqL7/GpSvkA K/sgjhAZub8Oyeo6L/a4DBhQlMSGRR+ZLdLYQh+fHp8owWas1b2QyWqAqgcrhA4XntWc kpkT4i4KXieUFNdOOa6DL33kH4j8WQJ+5i+C3RjMxrPJjBITbfaSg5evnwq3+gkWIjfB XAFGyMYwkIm+0q8HhKAfaAvawCH6nU3qxB/13z6Cu2xi6UdGMYwwnjXfrTi7B+TY2VE/ G7flI7/opkTcYavOXEpddguZu+XRFoUB9MlA4ljv+O0tJSMAxNT1cgTixp+sXw9umMR0 5ssw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pNqdY73YqRWUECUEzE0fX7J4eVwH2VVkgbv7wtMQhbE=; b=Hez2sowdM15C6KfbLgUuXgpEBr3FoSprM83SdYqRPnc9qzE0M2N8Xk4bk4F1r+s9W7 y8FqPB3ukzLrObQwMPedyEOoBW+HjiN/gbAZitEL8w9jOnJsCAT+DojHbQqy+qBN9MYS i/9Yb+53otmWAXXiiBqled20vDRBO/RIlDlyYON79qzJEU1zGJrfd3jzXiKd/6Ew55TC bJjqIPrYLv7SD4Bh79ZDd0dGQX/pLLBE/qQ37HXLv3WtP3Y6kw6SN3u1C89GOzRde9Aw qYPU60but9KIUBjMdGLaLYmj79iEvBllg39OUjhBvMKF7Lyy6LO6aveZtYJgxFctyw4f 1tDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VRjsISKW; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si1165445pjl.64.2022.01.17.19.13.07; Mon, 17 Jan 2022 19:13:19 -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=@kernel.org header.s=k20201202 header.b=VRjsISKW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244482AbiARCUl (ORCPT + 99 others); Mon, 17 Jan 2022 21:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244610AbiARCUS (ORCPT ); Mon, 17 Jan 2022 21:20:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE4CFC061769; Mon, 17 Jan 2022 18:20:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 72781612CE; Tue, 18 Jan 2022 02:20:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AAD6C36AE3; Tue, 18 Jan 2022 02:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472413; bh=/EAeO4xUnZVlE4J3vuK3DNqUta/S6QmR1xXciBHU+t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRjsISKW9FsKmQjto0PAeweRHNs9RFU04pLSubdHv6wLDajEj/XoldmB8oYCW5sCN 68pWutTlPAk/7B5zTaxhX1FLZ+/ruQJoboWUdncqeIgtCaLq1vrw0LGOItWNRJCuCo g6UVBv9lM72BI+UVSIm6WhbkIlrp4SB4JaidZP8chQtkFU5+OlOIHAEnEgJbRMTkTj OKmnvY8fzddC0JIYzsb/WpqovFg3+lYI+7e6NUBs8iJlXn/KVUYEx5odHYiLRpgQio Q4lcUF3d9HPmFGBhJenHVxvtdyr13lw350x/zfHqWc43Fv28hwKPL3aWrptxobzSpn BlYN0X22IJG5Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrii Nakryiko , Alexei Starovoitov , Hengqi Chen , Sasha Levin , shuah@kernel.org, daniel@iogearbox.net, kuniyu@amazon.co.jp, sunyucong@gmail.com, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 013/217] selftests/bpf: Destroy XDP link correctly Date: Mon, 17 Jan 2022 21:16:16 -0500 Message-Id: <20220118021940.1942199-13-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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