From patchwork Tue Mar 17 23:12:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1257010 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=PP4Gw97R; 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 48hpr95Pvyz9sNg for ; Wed, 18 Mar 2020 10:13:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D579D875FA; Tue, 17 Mar 2020 23:13:25 +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 BVOt8duR-swf; Tue, 17 Mar 2020 23:13:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8BE308756C; Tue, 17 Mar 2020 23:13:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 629B7C18DA; Tue, 17 Mar 2020 23:13:24 +0000 (UTC) X-Original-To: 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 53FA3C013E for ; Tue, 17 Mar 2020 23:13:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3D4B887572 for ; Tue, 17 Mar 2020 23:13:22 +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 JHNl2H0FRgTo for ; Tue, 17 Mar 2020 23:13:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CC0FD8756C for ; Tue, 17 Mar 2020 23:13:21 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id y30so12542265pga.13 for ; Tue, 17 Mar 2020 16:13:21 -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=GASmE62X9+/jf453vA/KU3xA46D6H0aLCnSqk2s2mzw=; b=PP4Gw97RiM7FWW5YMTimGO7X7D0x7w4mtOBRicVtMGzLYJDYrzUdWfsktDJBVimxsQ jSRqrzAsctc7wH1lw62IH8I1GxZhDR6x46GWnnhPcUZN7f0KGmD+j8Aeh6cVEcrbhAXx kd9PKotvJAEcc1eM+Q8SvgbUgZBTMQM+cQJzb3E2agxck+uJytA7oEImnL0IQk54XKtk KhrdviH0f+XyuXHo7c0PczU5dUUaW6l3AI+tflxntbUHxTbZZTj06h1P72IOxHAU7y38 yFYMTmi9/1W5P2+DAL7MW/iqzPdKN5HuXc7mTCF37hPk3xhAEGhBl3p8CK2I8U8cS8yv lg5w== 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=GASmE62X9+/jf453vA/KU3xA46D6H0aLCnSqk2s2mzw=; b=KcTGGRsszAOet2vmGzVY7O0Tp62/EMY8LpQGjsox9g3RNty7G8PE7d1R9WmoB55aTL BGhBxLZHUrVCE7Lpd7p7OQBeSM1V/dAIg0jrnSnCijp/wG7T1g6jyiXJF67oafmuSpfA 4O93ZbQsuY6IWGPBS1cQVQPFqBT8BTGH7xkrfHn2OhZXikMIxt14x2Hcs0VZQifv+3Mw OPgAjHeqE4EBwAA4HvSi+hPYiTrW08EDklca++byTChwUIK0BRxo/wh2NWXn4wzcGjAJ 0Z+HoQ9Ym/Ut/qLFx1r5Q74jQ+mHxy7YZczp+yKeK3UBx3SzYjaZYajxJZ5TsPf8eboH l3OA== X-Gm-Message-State: ANhLgQ2SKPY0ZVswZzGQqzax1LC+IaWap8chlX3EsWJmsiN2VJnzyKa/ EJzioQY2i3LDjjyaOzukCrPgtBi4 X-Google-Smtp-Source: ADFU+vvzsGv0UpDTuqJODjwDKsmaq8GwI5OS6nlZwCPL94Pd2vlTN+vg1vMWDlb69L2MBc/ODPh5lw== X-Received: by 2002:aa7:9511:: with SMTP id b17mr1176507pfp.243.1584486796296; Tue, 17 Mar 2020 16:13:16 -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 c83sm4236009pfb.44.2020.03.17.16.12.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2020 16:12:59 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Tue, 17 Mar 2020 16:12:21 -0700 Message-Id: <1584486741-79152-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] conntrack: Fix NULL pointer dereference. 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 CID 279957 reports NULL pointer derefence when 'conn' is NULL and calling ct_print_conn_info. Cc: Usman Ansari Signed-off-by: William Tu Acked-by: Dumitru Ceara --- lib/conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index ff5a89457c0a..001a37ff6aff 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -1302,7 +1302,7 @@ process_one(struct conntrack *ct, struct dp_packet *pkt, if (!conn) { pkt->md.ct_state |= CS_TRACKED | CS_INVALID; char *log_msg = xasprintf("Missing master conn %p", rev_conn); - ct_print_conn_info(conn, log_msg, VLL_INFO, true, true); + ct_print_conn_info(rev_conn, log_msg, VLL_INFO, true, true); free(log_msg); return; }