From patchwork Fri Nov 20 00:17:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403393 Return-Path: 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.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccZY06M8z9sVH for ; Fri, 20 Nov 2020 11:17:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6971E203F8; Fri, 20 Nov 2020 00:17:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e8CAsjztwp3a; Fri, 20 Nov 2020 00:17:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id CF7E9203FC; Fri, 20 Nov 2020 00:17:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A0384C1DA7; Fri, 20 Nov 2020 00:17:50 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BC84EC0891 for ; Fri, 20 Nov 2020 00:17:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A91AF8475A for ; Fri, 20 Nov 2020 00:17:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kEjm4OWp+ws1 for ; Fri, 20 Nov 2020 00:17:47 +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 whitealder.osuosl.org (Postfix) with ESMTPS id 68D3982462 for ; Fri, 20 Nov 2020 00:17:47 +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 218CA240005; Fri, 20 Nov 2020 00:17:44 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:11 +0100 Message-Id: <20201120001724.2424494-2-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 Subject: [ovs-dev] [PATCH ovn 01/14] northd: Fix leaks of strings while formatting ecmp flows. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Result of 'normalize_v46_prefix()' should be freed and all dynamic strings should be destroyed. Fixes: 4fdca656857d ("Add ECMP symmetric replies.") Signed-off-by: Ilya Maximets --- northd/ovn-northd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 148d2a051..1d41aacc6 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -7971,6 +7971,7 @@ add_ecmp_symmetric_reply_flows(struct hmap *lflows, IN6_IS_ADDR_V4MAPPED(&route->prefix) ? "4" : "6", route->is_src_route ? "dst" : "src", cidr); + free(cidr); ovn_lflow_add_with_hint(lflows, od, S_ROUTER_IN_DEFRAG, 100, ds_cstr(&match), "ct_next;", &st_route->header_); @@ -8022,6 +8023,10 @@ add_ecmp_symmetric_reply_flows(struct hmap *lflows, ovn_lflow_add_with_hint(lflows, od, S_ROUTER_IN_ARP_RESOLVE, 200, ds_cstr(&ecmp_reply), action, &st_route->header_); + + ds_destroy(&match); + ds_destroy(&actions); + ds_destroy(&ecmp_reply); } static void From patchwork Fri Nov 20 00:17:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403394 Return-Path: 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccZY1rDGz9sVJ for ; Fri, 20 Nov 2020 11:17:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A5BD786BFE; Fri, 20 Nov 2020 00:17:55 +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 L6IYkXdsf39h; Fri, 20 Nov 2020 00:17:55 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 26FE4869D0; Fri, 20 Nov 2020 00:17:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0DCC2C1825; Fri, 20 Nov 2020 00:17:55 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3A1E7C1825 for ; Fri, 20 Nov 2020 00:17:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1909A83FA2 for ; Fri, 20 Nov 2020 00:17:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4lpDHevnb-eG for ; Fri, 20 Nov 2020 00:17:50 +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 whitealder.osuosl.org (Postfix) with ESMTPS id 86D1C86EC1 for ; Fri, 20 Nov 2020 00:17:50 +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 1D6F3240006; Fri, 20 Nov 2020 00:17:47 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:12 +0100 Message-Id: <20201120001724.2424494-3-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 Subject: [ovs-dev] [PATCH ovn 02/14] test-ovn: Fix expression leak. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" No need to clone when assigning to the same variable. Fixes: 024500aeab9a ("expr: Evaluate the condition expression in a separate step.") Signed-off-by: Ilya Maximets --- tests/test-ovn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-ovn.c b/tests/test-ovn.c index 74b5a3384..18c675303 100644 --- a/tests/test-ovn.c +++ b/tests/test-ovn.c @@ -919,7 +919,7 @@ test_tree_shape_exhaustively(struct expr *expr, struct shash *symtab, } else if (operation >= OP_SIMPLIFY) { modified = expr_simplify(expr_clone(expr)); modified = expr_evaluate_condition( - expr_clone(modified), tree_shape_is_chassis_resident_cb, + modified, tree_shape_is_chassis_resident_cb, NULL, NULL); ovs_assert(expr_honors_invariants(modified)); From patchwork Fri Nov 20 00:17:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403395 Return-Path: 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccZc3ff9z9sVJ for ; Fri, 20 Nov 2020 11:17:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BC24782462; Fri, 20 Nov 2020 00:17:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qbJ3Knet-gSc; Fri, 20 Nov 2020 00:17:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id E7D9186EB5; Fri, 20 Nov 2020 00:17:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD3C1C1825; Fri, 20 Nov 2020 00:17:56 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3A28AC1825 for ; Fri, 20 Nov 2020 00:17:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 29B8887524 for ; Fri, 20 Nov 2020 00:17:55 +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 slrJaXh0N5M2 for ; Fri, 20 Nov 2020 00:17:54 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 0B3C98751F for ; Fri, 20 Nov 2020 00:17:53 +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 3200E240007; Fri, 20 Nov 2020 00:17:51 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:13 +0100 Message-Id: <20201120001724.2424494-4-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: Manoj Sharma , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 03/14] actions: Fix leak of child ports in fwd group. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 'child_port_list' is an array of pointers that should be freed too. Direct leak of 30 byte(s) in 6 object(s) allocated from: #0 0x501fff in malloc (/tests/ovstest+0x501fff) #1 0x6227e6 in xmalloc /lib/util.c:138:15 #2 0x6228b8 in xmemdup0 /lib/util.c:168:15 #3 0x8183d6 in parse_fwd_group_action /lib/actions.c:3374:30 #4 0x814b6e in parse_action /lib/actions.c:3610:9 #5 0x8139ef in parse_actions /lib/actions.c:3637:14 #6 0x8136a3 in ovnacts_parse /lib/actions.c:3672:9 #7 0x813c80 in ovnacts_parse_string /lib/actions.c:3699:5 #8 0x53a979 in test_parse_actions /tests/test-ovn.c:1372:21 #9 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17 #10 0x537c75 in test_ovn_main /tests/test-ovn.c:1630:5 #11 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17 #12 0x537359 in main /tests/ovstest.c:133:9 #13 0x7f06978f21a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) CC: Manoj Sharma Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection") Signed-off-by: Ilya Maximets --- lib/actions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/actions.c b/lib/actions.c index 6300fef2c..d98af0f91 100644 --- a/lib/actions.c +++ b/lib/actions.c @@ -3366,6 +3366,9 @@ parse_fwd_group_action(struct action_context *ctx) lexer_syntax_error(ctx->lexer, "expecting logical switch port"); if (child_port_list) { + for (int i = 0; i < n_child_ports; i++) { + free(child_port_list[i]); + } free(child_port_list); } return; @@ -3471,6 +3474,9 @@ encode_FWD_GROUP(const struct ovnact_fwd_group *fwd_group, static void ovnact_fwd_group_free(struct ovnact_fwd_group *fwd_group) { + for (int i = 0; i < fwd_group->n_child_ports; i++) { + free(fwd_group->child_ports[i]); + } free(fwd_group->child_ports); } From patchwork Fri Nov 20 00:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403396 Return-Path: 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=) 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 4CccZg6cJ5z9sTL for ; Fri, 20 Nov 2020 11:18:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 66BD687537; Fri, 20 Nov 2020 00:18:00 +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 Z4QkygJzxF1t; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id B8F5787539; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D5FEC1825; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id AD532C1DA8 for ; Fri, 20 Nov 2020 00:17:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 973D5874FD for ; Fri, 20 Nov 2020 00:17:57 +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 yrUgH8XQyeBR for ; Fri, 20 Nov 2020 00:17:56 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 95CC487535 for ; Fri, 20 Nov 2020 00:17:56 +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 003FB240006; Fri, 20 Nov 2020 00:17:53 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:14 +0100 Message-Id: <20201120001724.2424494-5-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: Han Zhou , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 04/14] actions: Fix leak of select group members. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 'dsts' should be freed in case of any error. Direct leak of 4 byte(s) in 1 object(s) allocated from: #0 0x502378 in realloc (/tests/ovstest+0x502378) #1 0x622826 in xrealloc /lib/util.c:149:9 #2 0x8194f4 in parse_select_action /lib/actions.c:1185:20 #3 0x814f49 in parse_set_action /lib/actions.c:3499:13 #4 0x814341 in parse_action /lib/actions.c:3554:9 #5 0x8139ef in parse_actions /lib/actions.c:3643:14 #6 0x8136a3 in ovnacts_parse /lib/actions.c:3678:9 #7 0x813c80 in ovnacts_parse_string /lib/actions.c:3705:5 #8 0x53a4e8 in test_parse_actions /tests/test-ovn.c:1321:17 #9 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17 #10 0x537c75 in test_ovn_main /tests/test-ovn.c:1630:5 #11 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17 #12 0x537359 in main /tests/ovstest.c:133:9 #13 0x7f9ce05ba1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) CC: Han Zhou Fixes: 85b3544aabb2 ("ovn-controller: A new action "select".") Signed-off-by: Ilya Maximets --- lib/actions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/actions.c b/lib/actions.c index d98af0f91..ea949e1bd 100644 --- a/lib/actions.c +++ b/lib/actions.c @@ -1188,6 +1188,7 @@ parse_select_action(struct action_context *ctx, struct expr_field *res_field) } if (n_dsts <= 1) { lexer_syntax_error(ctx->lexer, "expecting at least 2 group members"); + free(dsts); return; } From patchwork Fri Nov 20 00:17:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403397 Return-Path: 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=) 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 ; 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 ; 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 ; 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 ; 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 ; 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 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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" '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 Fixes: c25094b3884d ("ovn: OVN Support QoS meter") Signed-off-by: Ilya Maximets --- controller/ofctrl.c | 1 + 1 file changed, 1 insertion(+) 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); From patchwork Fri Nov 20 00:17:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403403 Return-Path: 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.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccbP4lVpz9sTL for ; Fri, 20 Nov 2020 11:18:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2E49D2D63B; Fri, 20 Nov 2020 00:18:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZTMMRjevaK+i; Fri, 20 Nov 2020 00:18:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 458C82E0D7; Fri, 20 Nov 2020 00:18:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1D921C1825; Fri, 20 Nov 2020 00:18:05 +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 E0060C0891 for ; Fri, 20 Nov 2020 00:18:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CD46986D22 for ; Fri, 20 Nov 2020 00:18:03 +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 p9P02VdhDlPB for ; Fri, 20 Nov 2020 00:18:02 +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 C0D8985C9D for ; Fri, 20 Nov 2020 00:18:01 +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 7CB3B240006; Fri, 20 Nov 2020 00:17:59 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:16 +0100 Message-Id: <20201120001724.2424494-7-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 Subject: [ovs-dev] [PATCH ovn 06/14] pinctrl: Fix leak of DNS cache records. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 'smap_clear()' doesn't free allocated memory, but 'smap_clone()' re-initializes hash map clearing internal pointers and leaking this memory. 'smap_destroy()' should be used instead. Also, all the records and array of datapaths should be freed on destruction of a cache entry. Direct leak of 16 byte(s) in 2 object(s) allocated from: #0 0x5211c7 in calloc (/controller/ovn-controller+0x5211c7) #1 0x752364 in xcalloc /lib/util.c:121:31 #2 0x576e76 in sync_dns_cache /controller/pinctrl.c:2517:25 #3 0x5758fb in pinctrl_run /controller/pinctrl.c:3158:5 #4 0x59b06c in main /controller/ovn-controller.c:2642:25 #5 0x7fb570fc11a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) Indirect leak of 26 byte(s) in 2 object(s) allocated from: #0 0x52100f in malloc (/controller/ovn-controller+0x52100f) #1 0x7523d6 in xmalloc /lib/util.c:138:15 #2 0x7524a8 in xmemdup0 /lib/util.c:168:15 #3 0x73d8fc in smap_clone /lib/smap.c:314:45 #4 0x576e2f in sync_dns_cache /controller/pinctrl.c:2513:13 #5 0x5758fb in pinctrl_run /controller/pinctrl.c:3158:5 #6 0x59b06c in main /controller/ovn-controller.c:2642:25 #7 0x7fb570fc11a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) Fixes: 6b72068202f1 ("ovn-controller: Add a new thread in pinctrl module to handle packet-ins.") Signed-off-by: Ilya Maximets --- controller/pinctrl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index a5236564b..2012ba65a 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -2509,7 +2509,7 @@ sync_dns_cache(const struct sbrec_dns_table *dns_table) dns_data->delete = false; if (!smap_equal(&dns_data->records, &sbrec_dns->records)) { - smap_clear(&dns_data->records); + smap_destroy(&dns_data->records); smap_clone(&dns_data->records, &sbrec_dns->records); } @@ -2525,6 +2525,8 @@ sync_dns_cache(const struct sbrec_dns_table *dns_table) struct dns_data *d = iter->data; if (d->delete) { shash_delete(&dns_cache, iter); + smap_destroy(&d->records); + free(d->dps); free(d); } } @@ -2537,6 +2539,8 @@ destroy_dns_cache(void) SHASH_FOR_EACH_SAFE (iter, next, &dns_cache) { struct dns_data *d = iter->data; shash_delete(&dns_cache, iter); + smap_destroy(&d->records); + free(d->dps); free(d); } } From patchwork Fri Nov 20 00:17:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403398 Return-Path: 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccZz2Bd0z9sVH for ; Fri, 20 Nov 2020 11:18:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D219686EC1; Fri, 20 Nov 2020 00:18:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2lLAgw8WQR87; Fri, 20 Nov 2020 00:18:14 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 29A998700D; Fri, 20 Nov 2020 00:18:09 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0EF5FC1D9F; Fri, 20 Nov 2020 00:18:09 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 44DD8C1825 for ; Fri, 20 Nov 2020 00:18:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 21FD38754A for ; Fri, 20 Nov 2020 00:18:08 +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 ehGELwc5MPKg for ; Fri, 20 Nov 2020 00:18:05 +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 hemlock.osuosl.org (Postfix) with ESMTPS id AB53987534 for ; Fri, 20 Nov 2020 00:18:04 +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 D314D24000A; Fri, 20 Nov 2020 00:18:01 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:17 +0100 Message-Id: <20201120001724.2424494-8-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: xu rong , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 07/14] ovn-controller: Fix leak of pending ct zones. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" shash contains pointers to the data that should be freed. Direct leak of 32 byte(s) in 2 object(s) allocated from: #0 0x52100f in malloc (/controller/ovn-controller+0x52100f) #1 0x752436 in xmalloc /lib/util.c:138:15 #2 0x5a2f0b in add_pending_ct_zone_entry /controller/ovn-controller.c:548:45 #3 0x5a2d1d in update_ct_zones /controller/ovn-controller.c:668:9 #4 0x59d8c6 in en_ct_zones_run /controller/ovn-controller.c:1495:5 #5 0x5dade4 in engine_run /lib/inc-proc-eng.c:377:9 #6 0x59adf4 in main /controller/ovn-controller.c #7 0x7f0799ef41a2 in __libc_start_main (/lib64/libc.so.6+0x271a2) CC: xu rong Fixes: 252e1642fb59 ("ovn-controller: pending_ct_zones should be destroyed") Signed-off-by: Ilya Maximets --- controller/ovn-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 70a193bb2..7b915ed6a 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -1512,7 +1512,7 @@ en_ct_zones_cleanup(void *data) struct ed_type_ct_zones *ct_zones_data = data; simap_destroy(&ct_zones_data->current); - shash_destroy(&ct_zones_data->pending); + shash_destroy_free_data(&ct_zones_data->pending); } static void From patchwork Fri Nov 20 00:17:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403399 Return-Path: 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cccb564Kmz9sVH for ; Fri, 20 Nov 2020 11:18:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 289F186D22; Fri, 20 Nov 2020 00:18:24 +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 zhLcc7-NvIcQ; Fri, 20 Nov 2020 00:18:22 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 001F686D6C; Fri, 20 Nov 2020 00:18:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D3468C1DA0; Fri, 20 Nov 2020 00:18:14 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6A0EAC0891 for ; Fri, 20 Nov 2020 00:18:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 66A8586FBE for ; Fri, 20 Nov 2020 00:18:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jPr2gTcDNj0I for ; Fri, 20 Nov 2020 00:18:10 +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 whitealder.osuosl.org (Postfix) with ESMTPS id D287786ED5 for ; Fri, 20 Nov 2020 00:18:06 +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 87CD8240006; Fri, 20 Nov 2020 00:18:04 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:18 +0100 Message-Id: <20201120001724.2424494-9-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 Subject: [ovs-dev] [PATCH ovn 08/14] ovn-nbctl: Fix error leak on duplicated switch port. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Error is allocated from heap and should be freed. Fixes: 738295605b44 ("ovn: Detect and prevent duplicate address assignments.") Signed-off-by: Ilya Maximets --- utilities/ovn-nbctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index b5633c725..fb6766839 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -1683,6 +1683,7 @@ nbctl_lsp_set_addresses(struct ctl_context *ctx) error = lsp_contains_duplicates(ls, lsp, ctx->argv[i]); if (error) { ctl_error(ctx, "%s", error); + free(error); return; } } From patchwork Fri Nov 20 00:17:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403402 Return-Path: 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccbG4bg1z9sVJ for ; Fri, 20 Nov 2020 11:18:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0912586CE7; Fri, 20 Nov 2020 00:18:33 +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 up2s2BgpSGqn; Fri, 20 Nov 2020 00:18:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7A3E486DD3; Fri, 20 Nov 2020 00:18:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4475DC1DA9; Fri, 20 Nov 2020 00:18:22 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E7E04C1825 for ; Fri, 20 Nov 2020 00:18:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D435B87019 for ; Fri, 20 Nov 2020 00:18:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IdtUNO20nQFv for ; Fri, 20 Nov 2020 00:18:17 +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 whitealder.osuosl.org (Postfix) with ESMTPS id 6D25C8701A for ; Fri, 20 Nov 2020 00:18:09 +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 C82D2240008; Fri, 20 Nov 2020 00:18:06 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:19 +0100 Message-Id: <20201120001724.2424494-10-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: Manoj Sharma , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 09/14] northd: Fix leak of dynamic string for fwd group ports. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 'group_ports' never destroyed and re-created on each iteration. CC: Manoj Sharma Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection") Signed-off-by: Ilya Maximets --- northd/ovn-northd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 1d41aacc6..474333e68 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -6138,6 +6138,7 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct hmap *lflows) if (!(!od->nbs || !od->nbs->n_forwarding_groups)) { struct ds match = DS_EMPTY_INITIALIZER; struct ds actions = DS_EMPTY_INITIALIZER; + struct ds group_ports = DS_EMPTY_INITIALIZER; for (int i = 0; i < od->nbs->n_forwarding_groups; ++i) { const struct nbrec_forwarding_group *fwd_group = NULL; @@ -6171,7 +6172,7 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct hmap *lflows) ds_put_format(&match, "eth.dst == %s", fwd_group->vmac); /* Create a comma separated string of child ports */ - struct ds group_ports = DS_EMPTY_INITIALIZER; + ds_clear(&group_ports); if (fwd_group->liveness) { ds_put_cstr(&group_ports, "liveness=\"true\","); } @@ -6192,6 +6193,7 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct hmap *lflows) ds_destroy(&match); ds_destroy(&actions); + ds_destroy(&group_ports); } } From patchwork Fri Nov 20 00:17:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403400 Return-Path: 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CccbB34qbz9sVH for ; Fri, 20 Nov 2020 11:18:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DCC4B86652; Fri, 20 Nov 2020 00:18:28 +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 j_JCUbraj1xT; Fri, 20 Nov 2020 00:18:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2C39586D5C; Fri, 20 Nov 2020 00:18:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0DD44C1DA0; Fri, 20 Nov 2020 00:18:21 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A86FCC0891 for ; Fri, 20 Nov 2020 00:18:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5A2518753A for ; Fri, 20 Nov 2020 00:18:19 +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 adoTgsYE76i6 for ; Fri, 20 Nov 2020 00:18:12 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 2BB8B87564 for ; Fri, 20 Nov 2020 00:18:11 +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 73925240004; Fri, 20 Nov 2020 00:18:09 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:20 +0100 Message-Id: <20201120001724.2424494-11-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: Manoj Sharma , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 10/14] actions: Fix leak of dynamic string on fwd group encoding failure. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" CC: Manoj Sharma Fixes: edb240081518 ("Forwarding group to load balance l2 traffic with liveness detection") Signed-off-by: Ilya Maximets --- lib/actions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/actions.c b/lib/actions.c index ea949e1bd..99ce04197 100644 --- a/lib/actions.c +++ b/lib/actions.c @@ -3446,6 +3446,7 @@ encode_FWD_GROUP(const struct ovnact_fwd_group *fwd_group, if (fwd_group->liveness) { /* Find the openflow port number of the tunnel port */ if (!ep->tunnel_ofport(ep->aux, port_name, &ofport)) { + ds_destroy(&ds); return; } From patchwork Fri Nov 20 00:17:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403401 Return-Path: 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=) 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 4CccbG2RfMz9sVH for ; Fri, 20 Nov 2020 11:18:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A47A087569; Fri, 20 Nov 2020 00:18:32 +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 gh38XmEe9Xd7; Fri, 20 Nov 2020 00:18:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 093B787560; Fri, 20 Nov 2020 00:18:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D5131C1D9F; Fri, 20 Nov 2020 00:18:25 +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 6EAEDC0891 for ; Fri, 20 Nov 2020 00:18:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 51B4886D8F for ; Fri, 20 Nov 2020 00:18:24 +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 995-iMaqa-zB for ; Fri, 20 Nov 2020 00:18:20 +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 3C83086D2E for ; Fri, 20 Nov 2020 00:18:14 +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 B2225240005; Fri, 20 Nov 2020 00:18:11 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:21 +0100 Message-Id: <20201120001724.2424494-12-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 Subject: [ovs-dev] [PATCH ovn 11/14] ovn-nbctl: Fix leak of IPs while configuring NAT. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" CC: Ankur Sharma Fixes: 20bc58a67f39 ("External IP based NAT: Add Columns and CLI") Signed-off-by: Ilya Maximets Acked-by: Ankur Sharma --- utilities/ovn-nbctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index fb6766839..89537edf0 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -4601,8 +4601,11 @@ nbctl_lr_nat_set_ext_ips(struct ctl_context *ctx) } else { nbrec_nat_set_allowed_ext_ips(nat, addr_set); } + free(nat_ip); + free(old_ip); return; } + free(old_ip); } if (!nat_found) { From patchwork Fri Nov 20 00:17:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403406 Return-Path: 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CcccR4Hwsz9sRR for ; Fri, 20 Nov 2020 11:19:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CB7D68626F; Fri, 20 Nov 2020 00:19:33 +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 KpRVVJh-Xre2; Fri, 20 Nov 2020 00:19:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 48A75861AF; Fri, 20 Nov 2020 00:19:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2D7F3C1825; Fri, 20 Nov 2020 00:19:32 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 00F84C0891 for ; Fri, 20 Nov 2020 00:19:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C93EC276D4 for ; Fri, 20 Nov 2020 00:19:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MWQNmYSRVBkp for ; Fri, 20 Nov 2020 00:19:25 +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 silver.osuosl.org (Postfix) with ESMTPS id 9E8552E0FA for ; Fri, 20 Nov 2020 00:18:16 +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 143AA240004; Fri, 20 Nov 2020 00:18:13 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:22 +0100 Message-Id: <20201120001724.2424494-13-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 Subject: [ovs-dev] [PATCH ovn 12/14] ovn-nbctl: Fix IP leak on router NAT addition failure. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Cleanup needed instead of direct return. Fixes: 43f42ecb3a5a ("Use normalized IP addreses in `ovn-nbctl lr-nat-add`") Signed-off-by: Ilya Maximets --- utilities/ovn-nbctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 89537edf0..526dbf86c 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -4311,7 +4311,7 @@ nbctl_lr_nat_add(struct ctl_context *ctx) if (strcmp(nat_type, "dnat_and_snat") && stateless) { ctl_error(ctx, "stateless is not applicable to dnat or snat types"); - return; + goto cleanup; } int is_snat = !strcmp("snat", nat_type); From patchwork Fri Nov 20 00:17:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403404 Return-Path: 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cccbq6W1Vz9sTL for ; Fri, 20 Nov 2020 11:19:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 46BD88701C; Fri, 20 Nov 2020 00:19:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M9-VYokQBf17; Fri, 20 Nov 2020 00:18:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 4B0498707C; Fri, 20 Nov 2020 00:18:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 27726C1D9F; Fri, 20 Nov 2020 00:18:28 +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 DFDA5C1D9F for ; Fri, 20 Nov 2020 00:18:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C74DC86DAD for ; Fri, 20 Nov 2020 00:18:26 +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 yw8GS2c1eBfY for ; Fri, 20 Nov 2020 00:18:26 +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 9CC8F86CDD for ; Fri, 20 Nov 2020 00:18:18 +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 4EE99240005; Fri, 20 Nov 2020 00:18:16 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:23 +0100 Message-Id: <20201120001724.2424494-14-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 Subject: [ovs-dev] [PATCH ovn 13/14] ovn-nbctl: Fix IP leak on failure of lr policy addition. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Fixes: 742474bad730 ("ovn-nbctl: Enhance lr-policy-add to set the options.") Signed-off-by: Ilya Maximets --- utilities/ovn-nbctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 526dbf86c..448c86f42 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -3689,6 +3689,7 @@ nbctl_lr_policy_add(struct ctl_context *ctx) } else { ctl_error(ctx, "No value specified for the option : %s", key); free(key); + free(next_hop); return; } free(key); From patchwork Fri Nov 20 00:17:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1403405 Return-Path: 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cccc05DLnz9sTL for ; Fri, 20 Nov 2020 11:19:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4B60086ED2; Fri, 20 Nov 2020 00:19:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MzyoQR-Bzgxm; Fri, 20 Nov 2020 00:19:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 840BA870B9; Fri, 20 Nov 2020 00:18:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6AE42C1D9F; Fri, 20 Nov 2020 00:18:33 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 05F56C0891 for ; Fri, 20 Nov 2020 00:18:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E0A9D8755F for ; Fri, 20 Nov 2020 00:18:31 +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 CIfcYzmF3rk0 for ; Fri, 20 Nov 2020 00:18:28 +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 hemlock.osuosl.org (Postfix) with ESMTPS id 2A26E87569 for ; Fri, 20 Nov 2020 00:18:21 +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 F3647240004; Fri, 20 Nov 2020 00:18:18 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 20 Nov 2020 01:17:24 +0100 Message-Id: <20201120001724.2424494-15-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: Tao YunXiang , Ilya Maximets Subject: [ovs-dev] [PATCH ovn 14/14] ovn-nbctl: Fix leak of array of new policies. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" CC: Tao YunXiang Fixes: 5820502a5507 ("ovn-nbctl.c: Fix lr-policy-del command") Signed-off-by: Ilya Maximets --- utilities/ovn-nbctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 448c86f42..fa1522152 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -3758,6 +3758,7 @@ nbctl_lr_policy_del(struct ctl_context *ctx) if (!shash_find(&ctx->options, "--if-exists")) { ctl_error(ctx, "Logical router policy uuid is not found."); } + free(new_policies); return; }