Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3708619pxb; Mon, 24 Jan 2022 16:00:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlGyN5w2eI3PFv8JdnV4pEGGdoBE1jtLCpwtALJh2HcuhT/KWoDjV8gjReO1MwBGRADwv+ X-Received: by 2002:a17:90a:1b0d:: with SMTP id q13mr760997pjq.14.1643068693056; Mon, 24 Jan 2022 15:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068693; cv=none; d=google.com; s=arc-20160816; b=Hp4eA2bSDoiyQaf5FfSacZfwmeDT/8OiUxZ0KfsJZcVWKwYeJOtt/rdkOCYZ3Vf6jp CYWxLq0rVHt8KTuwho1++qOP76GrY47nsDp8T5t5cNMWJgTSTu3Twiggmi9VW2c5vKSo RHc3rdvt4VjoZKGgWRKZAhsgpAhgJSU6Xyoeo8Bkap0ZS+E3HbOzA4Um15AWwEvNvCJJ qpg6cBRea2WwjwdrNbthoxitg6naaG+LApYvPVOQRG6u2+BgfP/Ns2h9p0F3MgVzMr2x ep19mvLdjRC5TcR5UQAKag7luXXYkD3BuiQ7iuYOJ//nWz9bmEmWEOCiFZx+m5Z9c60n b7/w== 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=/JNH1x1iSIxrwFFWHwDs1G5nBhc2RJ0Ic/lEnZCzO3Y=; b=p2Cm7KqLowBVLIEG15QxJvf/frJ9u01QBrjKLExCoKOOFP4N/Ih4Ywpd+tzcyyMAQu m1LExyQ7sLBWwrDWBZ6f1+Iln9/NhZ0w/8vkZiBjZ7zTiAUs/lAjjAur59spM1K02V/h YaX8pdrDmEFKn78MhsIITNUr8IVeqOYKOc4HbdryfhECbk2qlBOuoNn7Lwe6ixV3/rGq hvP8ekEhOtuggnXlWuPjZKb1VP4svMzNHVPyj2bsEmNkqW8A5y1XB6MHphODaUsPiO1l SLEv+C1iY68aexe2Xxa08VvFUaFBpUQ0QuaYk/Yu8Wn4meCWsQIhIul++nk4wBwS37zD yUhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ayq8Wpob; 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 y12si13727569plp.111.2022.01.24.15.58.01; Mon, 24 Jan 2022 15:58:13 -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=ayq8Wpob; 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 S2366680AbiAXXxS (ORCPT + 99 others); Mon, 24 Jan 2022 18:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846026AbiAXXOO (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 A1B47C067A7E; Mon, 24 Jan 2022 13:22:29 -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 66FD3B81188; Mon, 24 Jan 2022 21:22:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 908D4C340E4; Mon, 24 Jan 2022 21:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059347; bh=J5+2k5Vu9FXtz194cQpO41gLQP387GfoIjXIZAfACjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ayq8WpobEik83sUiuWRlQvbEjos2b1W1DBmgnuNyBuUUEK4nHgxQyZq/Q3zYZG97P XEeSi+hEEWOSxDpoMYD1cy5t2HxrB0JlXDuD+uJfNXYzb9PxQdUd5NWykIaFkpq7Ll N6sWOI8401q36BOzlXHLyXMg4qLQtlNzwYDbVax4= 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 0552/1039] selftests/bpf: Fix bpf_object leak in skb_ctx selftest Date: Mon, 24 Jan 2022 19:39:01 +0100 Message-Id: <20220124184143.846196058@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 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