Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3624032pxb; Mon, 24 Jan 2022 13:46:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1X35fWlB2X4zPpNU8tr9xCoMI9VdyNt4FJF6aYi4UC7Oiveo8sKjEHfvR0q9lPuux1fbg X-Received: by 2002:a63:520c:: with SMTP id g12mr2322092pgb.117.1643060812146; Mon, 24 Jan 2022 13:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060812; cv=none; d=google.com; s=arc-20160816; b=qdR7FEcQqvpLodImzH4fPylf6bspikvoaijIt+gu7295bri4mA/wBCXXWUDjXPeKZ4 2Fo76HH3u3PqzwpSZF+zV4qNEqJtH2K4pVk0e/oRCM4QpwLMXGHKgaKH2zd6ueyyxSWi v+8gPJq8L89qhCnchMHtBE0dnSgT9Um1hQeF+Nx5PpF6ZxttW44elzyYg1tKPQRQ60Ci vcH2+BZtgX9uEkA2Z94XgFLvST9Usa7wjusVfeh7A9q7uBZWKjkg/2NaThN1Lx4Zkxlx PTaM5W8hLxvi9zV+KxAHGF/vLR7PWvLhd1rgzaPykLRPrE8pvFmiE35CDvA4El6ybiu6 yGXg== 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=W+MJcqkt/9lMMFVCrdYbL11ZLaZFpaVKNKo5XXegR5c=; b=kJFz+ygtBP7HTPFbHnUA5eoPFG24H78rFP2qVK5EU2p0zvyzy8KsSa82KHgtRZE8id ko8M+wR5WoZLQDNPnAfxXlwK3/kqqRCH4J3OP7PCVJYa2fFxzeIxAYa3KV+h4hlHSTlD Y5/NsE62plND/StP9HZMMk8OMfDdux8L3a9ztIVJnQpQ2lz7jZZ80TcK2o5v0H70iSjp LdqU9NyYccqz/yYDnwJtUaTGtoKX4/mUobu910JbtnpNfzuVveqRlO0/H6RkYRmEs79l RNO7JsQcyBtSy3nXmcFflun8m7JPtGi77Kt+4Cr15f2G8R3NvN6a8i1xVI/qsHimyIgx 3X3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=goF2PXxf; 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 b6si373020pjo.182.2022.01.24.13.46.40; Mon, 24 Jan 2022 13:46:52 -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=goF2PXxf; 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 S1359288AbiAXV2M (ORCPT + 99 others); Mon, 24 Jan 2022 16:28:12 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:53796 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444606AbiAXVBL (ORCPT ); Mon, 24 Jan 2022 16:01:11 -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 C473761317; Mon, 24 Jan 2022 21:01:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F689C340E5; Mon, 24 Jan 2022 21:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058070; bh=KXzbmPA767ltcjzNwVWOMCdu5eyCPYs7gRedD1yhhm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=goF2PXxf7QSRK3TAK5FKer4ODLEQKuYej9nnsrgE2oEP8WFqRpqzL6sMnVlA3H7VI RhwFTRZZAEZvZCU2gxsfL1Fr7ikWiEVCw8sifHCnn2AtXm0iauczy8qh4UGPny9Lll K2mXTdfivGbmAogrDqNO3Ct5TaooZHOlOMyrCWXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.16 0172/1039] libbpf: Fix glob_syms memory leak in bpf_linker Date: Mon, 24 Jan 2022 19:32:41 +0100 Message-Id: <20220124184131.023971255@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 8cb125566c40b7141d8842c534f0ea5820ee3d5c ] glob_syms array wasn't freed on bpf_link__free(). Fix that. Fixes: a46349227cd8 ("libbpf: Add linker extern resolution support for functions and global variables") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-6-andrii@kernel.org Signed-off-by: Sasha Levin --- tools/lib/bpf/linker.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index f677dccdeae44..94bdd97859285 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -210,6 +210,7 @@ void bpf_linker__free(struct bpf_linker *linker) } free(linker->secs); + free(linker->glob_syms); free(linker); } -- 2.34.1