From patchwork Wed Feb 17 14:43:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 584170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 96DF61401DE for ; Thu, 18 Feb 2016 01:44:10 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 77D8610754; Wed, 17 Feb 2016 06:44:09 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 0D9EF10277 for ; Wed, 17 Feb 2016 06:44:08 -0800 (PST) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 8D8D51E0445 for ; Wed, 17 Feb 2016 07:44:07 -0700 (MST) X-ASG-Debug-ID: 1455720246-09eadd7d12246c40001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id eDW8MPsgJHYvuu8M (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2016 07:44:06 -0700 (MST) X-Barracuda-Envelope-From: cascardo@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 17 Feb 2016 14:44:06 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1D3247EBA9; Wed, 17 Feb 2016 14:44:05 +0000 (UTC) Received: from indiana.gru.redhat.com (ovpn-113-89.phx2.redhat.com [10.3.113.89]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HEi3R7023836; Wed, 17 Feb 2016 09:44:04 -0500 X-CudaMail-Envelope-Sender: cascardo@redhat.com From: Thadeu Lima de Souza Cascardo To: yby.developer@yahoo.com X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-216023405 X-CudaMail-DTE: 021716 X-CudaMail-Originating-IP: 209.132.183.28 Date: Wed, 17 Feb 2016 12:43:56 -0200 X-ASG-Orig-Subj: [##CM-E1-216023405##][PATCH] ofproto-dpif-xlate: fix crash when using multicast snooping Message-Id: <1455720236-31510-1-git-send-email-cascardo@redhat.com> In-Reply-To: <1671348120.1827767.1454007490014.JavaMail.yahoo@mail.yahoo.com> References: <1671348120.1827767.1454007490014.JavaMail.yahoo@mail.yahoo.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1455720246 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: dev@openvswitch.org Subject: [ovs-dev] [PATCH] ofproto-dpif-xlate: fix crash when using multicast snooping 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" The revalidator thread may set may_learn and call xlate_actions with no packet data. If the revalidated flow is IGMPv3 or MLD, vswitchd will crash when trying to access the NULL packet. Only process IGMP and MLD flows when there is a packet. This is a similar behavior than what we have for other special packets. Not-Signed-off-yet: Thadeu Lima de Souza Cascardo Reported-by: Yi Ba Reported-at: http://openvswitch.org/pipermail/discuss/2016-January/020023.html Fixes: 06994f879c9d ("mcast-snooping: Add Multicast Listener Discovery support") Signed-off-by: Thadeu Lima de Souza Cascardo --- Hi, Yi Ba. Can you test this patch for your mcast_snooping bug? Remember to enable OVS_ENABLE_SG_FIREWALL_MULTICAST again. In order to verify it's working, you can run ovs-vsctl get bridge br-ex mcast_snooping_enable. Thanks. Cascardo. --- AUTHORS | 1 + ofproto/ofproto-dpif-xlate.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 936394d..366b72f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -412,6 +412,7 @@ Vishal Swarankar vishal.swarnkar@gmail.com Vjekoslav Brajkovic balkan@cs.washington.edu Voravit T. voravit@kth.se Yeming Zhao zhaoyeming@gmail.com +Yi Ba yby.developer@yahoo.com Ying Chen yingchen@vmware.com Yongqiang Liu liuyq7809@gmail.com ZHANG Zhiming zhangzhiming@yunshan.net.cn diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index a6ea067..7195d45 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -2409,7 +2409,7 @@ xlate_normal(struct xlate_ctx *ctx) if (is_igmp(flow)) { if (mcast_snooping_is_membership(flow->tp_src) || mcast_snooping_is_query(flow->tp_src)) { - if (ctx->xin->may_learn) { + if (ctx->xin->may_learn && ctx->xin->packet) { update_mcast_snooping_table(ctx->xbridge, flow, vlan, in_xbundle, ctx->xin->packet); } @@ -2441,7 +2441,7 @@ xlate_normal(struct xlate_ctx *ctx) return; } else if (is_mld(flow)) { ctx->xout->slow |= SLOW_ACTION; - if (ctx->xin->may_learn) { + if (ctx->xin->may_learn && ctx->xin->packet) { update_mcast_snooping_table(ctx->xbridge, flow, vlan, in_xbundle, ctx->xin->packet); }