From patchwork Sat Aug 20 01:06:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramu Ramamurthy X-Patchwork-Id: 661079 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3sGMB45Wr8z9sR9 for ; Sat, 20 Aug 2016 11:07:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=OvOVtuVH; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B198310622; Fri, 19 Aug 2016 18:07:05 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id F31391061D for ; Fri, 19 Aug 2016 18:07:04 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 6BDC7420339 for ; Fri, 19 Aug 2016 19:07:04 -0600 (MDT) X-ASG-Debug-ID: 1471655223-09eadd61b1bf070001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar5.cudamail.com with ESMTP id yOGuPU6BzhoFnnAN (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Aug 2016 19:07:03 -0600 (MDT) X-Barracuda-Envelope-From: ramu.ramamurthy@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-io0-f193.google.com) (209.85.223.193) by mx3-pf3.cudamail.com with ESMTPS (AES128-SHA encrypted); 20 Aug 2016 01:07:03 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _netblocks.google.com designates 209.85.223.193 as permitted sender) X-Barracuda-RBL-Trusted-Forwarder: 209.85.223.193 Received: by mail-io0-f193.google.com with SMTP id q83so5664032iod.2 for ; Fri, 19 Aug 2016 18:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=FbAW9za0SUGGJKafYHqW/E+Tj4vH1ClFqWMN2oakV4A=; b=OvOVtuVHztDO7ECz3oVcpfHSY4f/SEWbeDnAJlMmh735DRwSXc3upyMxbd9Ycm25Jh eBcU6FQ9Vom8+ZlXtfFqtTlV2IZg1mrHSQes0N7zU3qIsk1NykBvQG3OE4Htr+cZc3nq 7Sgfj184l1ZWsXa716bpZ4uSlVbRbVEVwCLNn0pM6E3VYRqU/Wl8N5f8ubSkqM3kF7wj zex/qQEJ0CdEKDQwlmWCSGOmwR3itaIiA8IoAlLoOlzoS8G0fux4QDvobTEhV17JTeBo RjXFkkceQolMwI73j7327Ml+RVlk8GDuuFXrk6lGkj68+ZG9SeC2M7pOk89+Ir4njyQY 6sHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FbAW9za0SUGGJKafYHqW/E+Tj4vH1ClFqWMN2oakV4A=; b=eu6Z+rOyfTy6TNW/kLWkEvO49anF2O0ACB7WPtgOF3+lUpDbuVEDAaFjViV6UgJiiT Cy9GB4IUkztzEKczRA6zQYiHO8r9oBoOFxVDiOLdSLK2KSHoLGPMgxIV6NumUXkRws0Y 2mBTVMoiEh86Fd8I8u2qPUsTL76BVxB9D8L0MYBl6aiqAm/boQsHpkCrk4HRNJ2nt1cS buYrMo6g3cifFYIyEqZkZau4UiIhBrUsaxamcH9s0CFTA0qGJVa3+X0TgPDZCRCvGk36 OwsZKyb9EYykwywQmQEWtiqEsXmtlnP6FABUf9gvmQD63S1TWRQRYeCDRfK4xMHU6GIG B/8g== X-Gm-Message-State: AEkoouusq/VGbsRUwEsLcaWywc4HgQY0/Rlk0QFKVT9b4VWt/dLt5BgjPraFfaEUvNdWsQ== X-Received: by 10.107.178.129 with SMTP id b123mr13089051iof.83.1471655222203; Fri, 19 Aug 2016 18:07:02 -0700 (PDT) Received: from controller-01.node.os ([32.97.110.54]) by smtp.gmail.com with ESMTPSA id 63sm4502540iov.21.2016.08.19.18.07.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 18:07:01 -0700 (PDT) X-CudaMail-Envelope-Sender: ramu.ramamurthy@gmail.com X-Barracuda-Apparent-Source-IP: 32.97.110.54 From: Ramu Ramamurthy To: dev@openvswitch.org X-CudaMail-MID: CM-V3-818048703 X-CudaMail-DTE: 081916 X-CudaMail-Originating-IP: 209.85.223.193 Date: Sat, 20 Aug 2016 01:06:50 +0000 X-ASG-Orig-Subj: [##CM-V3-818048703##][PATCH] ovn: fix ovn-northd leaks in build_acl Message-Id: <1471655210-2514-1-git-send-email-ramu.ramamurthy@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-GBUdb-Analysis: 0, 209.85.223.193, Ugly c=0.38014 p=-0.2 Source Normal X-MessageSniffer-Rules: 0-0-0-7132-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1471655223 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32164 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Ramu Ramamurthy Subject: [ovs-dev] [PATCH] ovn: fix ovn-northd leaks in build_acl X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" From: Ramu Ramamurthy The following leaks are due to missing ds_destroy in a few places in build_acl. 5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93 at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x449507: xrealloc (util.c:123) by 0x42CC73: ds_reserve (dynamic-string.c:63) by 0x42D08F: ds_put_format_valist (dynamic-string.c:161) by 0x42D176: ds_put_format (dynamic-string.c:142) by 0x40D380: build_acls (ovn-northd.c:2320) by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472) by 0x4072D9: build_lflows (ovn-northd.c:3845) by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971) by 0x4072D9: main (ovn-northd.c:4375) 9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93 at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x449507: xrealloc (util.c:123) by 0x42CC73: ds_reserve (dynamic-string.c:63) by 0x42D08F: ds_put_format_valist (dynamic-string.c:161) by 0x42D176: ds_put_format (dynamic-string.c:142) by 0x40D505: build_acls (ovn-northd.c:2346) by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472) by 0x4072D9: build_lflows (ovn-northd.c:3845) by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971) by 0x4072D9: main (ovn-northd.c:4375) Acked-by: Ryan Moats --- ovn/northd/ovn-northd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 625937d..756d188 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2324,6 +2324,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows) ovn_lflow_add( lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(&match), actions); + ds_destroy(&match); } } @@ -2350,6 +2351,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows) ovn_lflow_add( lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(&match), actions); + ds_destroy(&match); } } }