Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3384117pxb; Mon, 17 Jan 2022 19:13:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyP9xCm0ZYcz5m2qIXFjvwBa00VsQ7Z8MHq7fTM2V7FPqG1q88bkroG9qSVm9lI0+7KdfK X-Received: by 2002:a17:90a:46c6:: with SMTP id x6mr28265709pjg.156.1642475616577; Mon, 17 Jan 2022 19:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475616; cv=none; d=google.com; s=arc-20160816; b=EmF5ydUX+/IuZ4ZduRVlifXn6ZmKYp16IbCm9VeWCCP0WX8z2CeglRUnF3GdKiMMGS WGH9ntCcnOeETQqwCtU9rgus4eupw49hJUGei+DleqKLF8WfM9hF5q8ueyG8R83+R+Bk 9SI412YF3GLp485nGGmXNmg91Yt6Q/igfMgLTl1cC5I34XjrUQGHz1oi1xqFW199K9Wm lEoPeX0efnZV5LqKZwl7EDZmtJIX5BIyTo9x0zFnjl3AVtsL72IU2y2qL60dNulhNWKT 81xDvRe7zspTW4FYWQgPht8H9t8MzoBAAJAV9nIaBILWpRN0hsjP2aYOIW3DMHcPKvVh GzpQ== 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=/JNH1x1iSIxrwFFWHwDs1G5nBhc2RJ0Ic/lEnZCzO3Y=; b=wGPshm5tcDIWWRQcULQulCwHyIrlvyE4HuiMOkKXGilrTfL28m4aIE0C871Ab6n4Ux 9X/0zRMVEep7kvabqqPLCjLEsTC/xNoxKAUne19YjVB5v4l7gLrFqG1Oh7Tb3tORjgRQ /+TdQojcx7Jn8/wkQBVIGATOORVMlKDAVL0DznpYGHI6jyDEKTpXYMQvw2bJNm9e6GQ7 cDK6PVbVCmzK/ZuqI5yxvEby/ZxYzskGDy5ofXK4b+45YXBFsuKR2NSZlD/GYxiM+SvK etNMlyATYMUdQgwKfB+dwLSjCYv7XTYFcDvuvN1Rf5UvgJY5lTnA/pCOu4zxhqO27uox JemQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LV87UHiC; 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 n9si13901821plk.309.2022.01.17.19.13.24; Mon, 17 Jan 2022 19:13:36 -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=LV87UHiC; 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 S244655AbiARCVD (ORCPT + 99 others); Mon, 17 Jan 2022 21:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244694AbiARCUh (ORCPT ); Mon, 17 Jan 2022 21:20:37 -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 E098CC06176C; Mon, 17 Jan 2022 18:20:19 -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 9A151B8122C; Tue, 18 Jan 2022 02:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0723CC36AE3; Tue, 18 Jan 2022 02:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472417; bh=J5+2k5Vu9FXtz194cQpO41gLQP387GfoIjXIZAfACjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LV87UHiCG2UXCsqwqyG5kY61SZR/3CBBfta5OeDx6rgBR7yyYWmQL4dHnUHbEOQhd kKy5nwj9aoKV7I94tTNytHucVNMYr59Twzrn0mLqB/VeDaclWOZL8LHYy3m5u2ra4N gDm2TSJ0jng/QSOc6l2cCHvVLwlZYYA5ync+ICSDNSfY6mdSosTdl2eEMG3r4gdaWS R5Imo3hsKLMR/WFBT81XA3JDzFq0bacQLW5QSQqYHGpKHyI2EwsWSbUHi9rfJzJKJw s7pE7p6+NHBtCGBDBrhKV88AzFqwehqwYXx0ZBTfLgl3HMwB+QiYxX2XMhsCuIEfCX fFDfCUw+VW8zA== 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, vfedorenko@novek.ru, kafai@fb.com, john.fastabend@gmail.com, ntspring@fb.com, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 014/217] selftests/bpf: Fix bpf_object leak in skb_ctx selftest Date: Mon, 17 Jan 2022 21:16:17 -0500 Message-Id: <20220118021940.1942199-14-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 8c7a95520184b6677ca6075e12df9c208d57d088 ] skb_ctx selftest didn't close bpf_object implicitly allocated by bpf_prog_test_load() helper. Fix the problem by explicitly calling bpf_object__close() at the end of the test. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-10-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/prog_tests/skb_ctx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_tests/skb_ctx.c b/tools/testing/selftests/bpf/prog_tests/skb_ctx.c index c437e6ba8fe20..db4d72563aaeb 100644 --- a/tools/testing/selftests/bpf/prog_tests/skb_ctx.c +++ b/tools/testing/selftests/bpf/prog_tests/skb_ctx.c @@ -111,4 +111,6 @@ void test_skb_ctx(void) "ctx_out_mark", "skb->mark == %u, expected %d\n", skb.mark, 10); + + bpf_object__close(obj); } -- 2.34.1