From patchwork Mon Aug 29 17:13:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil McKee X-Patchwork-Id: 663743 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 3sNJC46KPWz9s9x for ; Tue, 30 Aug 2016 03:13:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=inmon-com.20150623.gappssmtp.com header.i=@inmon-com.20150623.gappssmtp.com header.b=sE+fs/Zs; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id ED7431030A; Mon, 29 Aug 2016 10:13:35 -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 119CF10306 for ; Mon, 29 Aug 2016 10:13:35 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 874EF42050D for ; Mon, 29 Aug 2016 11:13:34 -0600 (MDT) X-ASG-Debug-ID: 1472490813-09eadd216c0a9f0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id TbAC5DkGOWtqrOi9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Aug 2016 11:13:33 -0600 (MDT) X-Barracuda-Envelope-From: neil.mckee@inmon.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-yw0-f182.google.com) (209.85.161.182) by mx1-pf1.cudamail.com with ESMTPS (AES128-SHA encrypted); 29 Aug 2016 17:13:33 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.161.182 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.161.182 X-Barracuda-RBL-IP: 209.85.161.182 Received: by mail-yw0-f182.google.com with SMTP id u134so89921755ywg.3 for ; Mon, 29 Aug 2016 10:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inmon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=n8nckQC6jsKlkiV3n+M9XeA9X6lYNMe93YB3Pf1z8ko=; b=sE+fs/ZsDvLNTzq3BwIRvdLAE+46Alw5RpevhJeEe5IFsBaDE4n7h5oRGcLiP/InKF Dua0CCiO4B+KVrve3bOnJh9h9/iOko6OA+qL5XfSDx2QciMn6dLSPJsDeSKE9OxqeM5u LL1dTlCzaqTfb5vofpwUhRw4+hyVOm/JltV5wcpoUumKC/LZCGsoN2wjnK+X0yKusWWm FaM4LY1AiDO7XJ3B5I+n9KsgENqax/I7NZ9H5SfNekDF2JcdvUla4y/uD8mo21F0cdFk vWEdcmw9IO0TzJrAVs/k+b2B+DCb1pW9U7IUnIPuyRBBcr7am8OSDW5E80nTnfUUv+bD KfCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=n8nckQC6jsKlkiV3n+M9XeA9X6lYNMe93YB3Pf1z8ko=; b=B0/TNbXP4969g2Mraqkso2FuTgf2S616neBfkHBRs1YfymaacZ2FmbBe28Q8jwH++E mWHg5d4i12jGNTWCYvC3sKPl5Zu06bOkeioe7RJib8G9XWIjBfegdlZiIxVJ9a2mLvhu NzZ0XyzmsqanKdOtFcgG//A2dtKHKVZWTil5dBInvAzoAr8KvM4F06tw5GlWToaxGO88 7mH3wmLEsWyGAOibGuW8MLBBn1nhiv0vyDvA1L8U8W+wFB1wzG+4sCplqjTmegdTcJpE mNivg1fLYzJp+h3gwZF7y1FGEfk38Yw6aln8lBJ6ZbVa8MQWHxDZ91vYJDlrakRD/0Sa ZFmg== X-Gm-Message-State: AE9vXwPg+Zmxxqzux6YGAwwTah3D+rSpJdAqBB7VL60DQtIzirOikSzxObjSUcGf8zCjvdhp6irtfDbaF3JjSQ== X-Received: by 10.13.222.131 with SMTP id h125mr15702201ywe.6.1472490811539; Mon, 29 Aug 2016 10:13:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.163.131 with HTTP; Mon, 29 Aug 2016 10:13:11 -0700 (PDT) X-Originating-IP: [38.128.195.34] X-CudaMail-Envelope-Sender: neil.mckee@inmon.com From: Neil McKee Date: Mon, 29 Aug 2016 10:13:11 -0700 Message-ID: X-CudaMail-MID: CM-E1-828040170 X-CudaMail-DTE: 082916 X-CudaMail-Originating-IP: 209.85.161.182 To: "dev@openvswitch.org" X-ASG-Orig-Subj: [##CM-E1-828040170##][PATCH] Avoid segfault in sFlow when datapath input port for tunnel sample is unknown. X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1472490813 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32427 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 Subject: [ovs-dev] [PATCH] Avoid segfault in sFlow when datapath input port for tunnel sample is unknown. 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" This patch avoids a segfault that was found and documented here: http://openvswitch.org/pipermail/discuss/2016-August/022513.html I raised a pull-request on github. Signed-off-by: Neil McKee --- ofproto/ofproto-dpif-sflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) &tnlInElem.flowType.ipv4); diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index 1252d39..c3234ee 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -1287,7 +1287,7 @@ dpif_sflow_received(struct dpif_sflow *ds, const struct dp_packet *packet, if (flow->tunnel.ip_dst) { memset(&tnlInElem, 0, sizeof(tnlInElem)); tnlInElem.tag = SFLFLOW_EX_IPV4_TUNNEL_INGRESS; - tnlInProto = dpif_sflow_tunnel_proto(in_dsp->tunnel_type); + tnlInProto = in_dsp ? dpif_sflow_tunnel_proto(in_dsp->tunnel_type) : 0; dpif_sflow_tunnel_v4(tnlInProto, &flow->tunnel,