From f9c47c9a848fdfb619928327d90ae9867a7b8239 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Wed, 17 Feb 2016 12:43:56 -0200 Subject: [PATCH] ofproto-dpif-xlate: Fix crash when using multicast snooping. 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. Signed-off-by: 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: Ben Pfaff --- AUTHORS | 1 + ofproto/ofproto-dpif-xlate.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index a915e19ed..ace39c741 100644 --- a/AUTHORS +++ b/AUTHORS @@ -407,6 +407,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 9ec57097d..8f49d8c3c 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -2406,7 +2406,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); } @@ -2438,7 +2438,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); } -- 2.20.1