From patchwork Tue Mar 17 21:39:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1256980 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CEWnnCox; dkim-atps=neutral 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 48hmmw50Bhz9sP7 for ; Wed, 18 Mar 2020 08:40:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D173C86DF8; Tue, 17 Mar 2020 21:40:30 +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 FaL4fv64MYIa; Tue, 17 Mar 2020 21:40:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4D87D86DDA; Tue, 17 Mar 2020 21:40:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 33F86C1D74; Tue, 17 Mar 2020 21:40:30 +0000 (UTC) X-Original-To: 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 32C35C013E for ; Tue, 17 Mar 2020 21:40:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 20FCD887C8 for ; Tue, 17 Mar 2020 21:40:28 +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 m-6zGw3BU0y5 for ; Tue, 17 Mar 2020 21:40:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id ADA7E887BF for ; Tue, 17 Mar 2020 21:40:27 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id u68so12683997pfb.2 for ; Tue, 17 Mar 2020 14:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WbAN6o8I7SZ2yeXuwNYLAKnzR7ryWmRWPnM6j3rucC4=; b=CEWnnCoxf6FCl7M5r9J95+GG2G2JHVrsqzi5Lzq96PHDYakHGrV8PYAS8Ri9mrqr3J 0R8NG8UexxDV2nvhTzpnO6x5qhmVRIf5R6Kq+Ql0SVT3S56f8mmJjACFlOYHuQFlvHUz Gttz3hhkc3IWzu5wMSYiqCt1kS/tb96xsEquNeqzaiQq9kcorwSlGVqOm/7b5eswqurT 2ki8bnyyb7UJ6Z7MQ47Eszc7zInBUe0tRyK14OqxnzoLtS8H3JJST6liubZ1irvtnNeo ZTpZb5dNsI/fbZX8jwkkb0ALKPbLBOzKyoGTUNvibrzGShby31pGw3bmB1NZ+Q/bOXpK tIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WbAN6o8I7SZ2yeXuwNYLAKnzR7ryWmRWPnM6j3rucC4=; b=Rv6gz6b9CAwBaEjtWNg66xjq5MMh+Tl30rXUST86/JARZIppiBs0D1+1Owkvw+WmPu 7x64R5SoggkfcxUs/mOBAfyR/OZeEFdw/z8tpO3o4+7RN2EUW9Lk5JX2KY03Vzo4G078 a6tkrpWSfSwl7pojEdJ+E5+wObJ8se26UySLsPhZ4DSalvE+EJvrBosp2HL6X/U8ii8w D85qbe8g+9cxLxOC28m2QqUflbl9gb9IEeFuA9eMDQWxysn5df3T7Za2TuvQB9ZKNAwP 1zuKAuCN7TIxz/a2bjy76wOpWaHSD9mfQ9eDJZfTZDRisyDC++QeEw1f7AcErhXVXv8/ T8ng== X-Gm-Message-State: ANhLgQ2pjzk06QQ0W+67r9IWKyHa7yQu4Jju0IF8T40iVdaAX6LlVtlq Y2M4U8mQ8un0wfKCR60GnDD//89F X-Google-Smtp-Source: ADFU+vuuF+z6Qu3sbd+UJuqjBmyoAbCvhsHuDDN2wYZ3tvFEtXvf8pwdk93Iqn7YtUZ1Mq4jfD7eTw== X-Received: by 2002:aa7:9abb:: with SMTP id x27mr863261pfi.212.1584481226502; Tue, 17 Mar 2020 14:40:26 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id 72sm3568746pgd.86.2020.03.17.14.40.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2020 14:40:25 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Tue, 17 Mar 2020 14:39:40 -0700 Message-Id: <1584481180-73404-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] classifier: Fix use of uninitialized value. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Coverity reports use of uninitialized value of cursor. This happens in cls_cursor_start(), when rule is false, cursor.subtable is uninitialized. CID 279324. Signed-off-by: William Tu Reviewed-by: Greg Rose --- lib/classifier.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/classifier.c b/lib/classifier.c index 0fad953213e4..a22f9fb957ea 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -1370,6 +1370,7 @@ cls_cursor_start(const struct classifier *cls, const struct cls_rule *target, struct cls_cursor cursor; struct cls_subtable *subtable; + memset(&cursor, 0x0, sizeof cursor); cursor.cls = cls; cursor.target = target && !cls_rule_is_catchall(target) ? target : NULL; cursor.version = version;