With Linux kernel that does not have HAVE_UDP_OFFLOAD_ARG_UOFF macro
detected,
struct vxlan_sock *vs will be NULL, which will make kernel crash when
receiving
VXLAN packet that have RCO flag turn on or even invalid packet that is
destined
to VXLAN port which have the bit on in the RCO flag position.

Signed-off-by: Zhang Dongya <[email protected]>
---
 datapath/linux/compat/vxlan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index d5dbe8d..3abcab1 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -320,7 +320,7 @@ static struct sk_buff **vxlan_gro_receive(struct
sk_buff **head,

  flags = vh->vx_flags;

- if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) {
+ if ((flags & VXLAN_HF_RCO) && vs && (vs->flags & VXLAN_F_REMCSUM_RX)) {
  vh = vxlan_gro_remcsum(skb, off_vx, vh, sizeof(struct vxlanhdr),
        vh->vx_vni, &grc,
        !!(vs->flags &
-- 
1.7.10.4
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to