Message ID | 20201120001724.2424494-6-i.maximets@ovn.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <ovs-dev-bounces@openvswitch.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccZk0GLgz9sTL for <incoming@patchwork.ozlabs.org>; Fri, 20 Nov 2020 11:18:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 268848752C; Fri, 20 Nov 2020 00:18:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3RMvJEmtOjOX; Fri, 20 Nov 2020 00:18:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 3145C87501; Fri, 20 Nov 2020 00:18:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 092BBC1DA1; Fri, 20 Nov 2020 00:18:02 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id EFCD9C1836 for <ovs-dev@openvswitch.org>; Fri, 20 Nov 2020 00:18:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E26E186CDF for <ovs-dev@openvswitch.org>; Fri, 20 Nov 2020 00:18:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8VC1uldZLw-8 for <ovs-dev@openvswitch.org>; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6D92E86CA0 for <ovs-dev@openvswitch.org>; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) X-Originating-IP: 78.45.89.65 Received: from im-t490s.redhat.com (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A6079240005; Fri, 20 Nov 2020 00:17:56 +0000 (UTC) From: Ilya Maximets <i.maximets@ovn.org> To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:15 +0100 Message-Id: <20201120001724.2424494-6-i.maximets@ovn.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201120001724.2424494-1-i.maximets@ovn.org> References: <20201120001724.2424494-1-i.maximets@ovn.org> MIME-Version: 1.0 Cc: Ilya Maximets <i.maximets@ovn.org> Subject: [ovs-dev] [PATCH ovn 05/14] ofctrl: Fix leak of meter mod bands. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <ovs-dev.openvswitch.org> List-Unsubscribe: <https://mail.openvswitch.org/mailman/options/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://mail.openvswitch.org/pipermail/ovs-dev/> List-Post: <mailto:ovs-dev@openvswitch.org> List-Help: <mailto:ovs-dev-request@openvswitch.org?subject=help> List-Subscribe: <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" <ovs-dev-bounces@openvswitch.org> |
Series |
Pack of fixes for memory leaks.
|
expand
|
diff --git a/controller/ofctrl.c b/controller/ofctrl.c index 79529d13c..c1bbc589e 100644 --- a/controller/ofctrl.c +++ b/controller/ofctrl.c @@ -1675,6 +1675,7 @@ add_meter_string(struct ovn_extend_table_info *m_desired, &usable_protocols); if (!error) { add_meter_mod(&mm, msgs); + free(mm.meter.bands); } else { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); VLOG_ERR_RL(&rl, "new meter %s %s", error, meter_string);
'parse_ofp_meter_mod_str' allocates space for meter.bands that should be freed. Direct leak of 448 byte(s) in 7 object(s) allocated from: #0 0x52100f in malloc (/controller/ovn-controller+0x52100f) #1 0x7523a6 in xmalloc /lib/util.c:138:15 #2 0x6fd079 in ofpbuf_init /lib/ofpbuf.c:123:26 #3 0x6cba27 in parse_ofp_meter_mod_str /lib/ofp-meter.c:779:5 #4 0x5705b8 in add_meter_string /controller/ofctrl.c:1674:19 #5 0x56f736 in ofctrl_put /controller/ofctrl.c:2105:13 #6 0x59aebb in main /controller/ovn-controller.c:2627:25 #7 0x7f07873251a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) CC: Guoshuai Li <ligs@dtdream.com> Fixes: c25094b3884d ("ovn: OVN Support QoS meter") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- controller/ofctrl.c | 1 + 1 file changed, 1 insertion(+)