]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath: Fix exposing OVS_TUNNEL_KEY_ATTR_GTPU_OPTS to kernel module.
authorIlya Maximets <i.maximets@ovn.org>
Thu, 8 Oct 2020 13:53:43 +0000 (15:53 +0200)
committerIlya Maximets <i.maximets@ovn.org>
Thu, 8 Oct 2020 16:04:59 +0000 (18:04 +0200)
Kernel module doesn't know about GTPU and it should return correct
out-of-range error in case this tunnel attribute passed there for
any reason.  Current out-of-tree module will pass the range check
and will try to access ovs_tunnel_key_lens[] array by index
OVS_TUNNEL_KEY_ATTR_GTPU_OPTS.  Even though it might not produce
issues in current code, this is not a good thing to do since
ovs_tunnel_key_lens[] array is not explicitly initialized for
OVS_TUNNEL_KEY_ATTR_GTPU_OPTS and we will likely have misleading
error about incorrect attribute length in the end.

Fixes: 3c6d05a02e0f ("userspace: Add GTP-U support.")
Acked-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
datapath/linux/compat/include/linux/openvswitch.h

index cc41bbea439d3715ab4fd03fe564d940211862c3..2d884312fede0d1f6f629e10a14d20850d2663b8 100644 (file)
@@ -405,7 +405,10 @@ enum ovs_tunnel_key_attr {
        OVS_TUNNEL_KEY_ATTR_IPV6_DST,           /* struct in6_addr dst IPv6 address. */
        OVS_TUNNEL_KEY_ATTR_PAD,
        OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,        /* struct erspan_metadata */
+#ifndef __KERNEL__
+       /* Only used within userspace data path. */
        OVS_TUNNEL_KEY_ATTR_GTPU_OPTS,          /* struct gtpu_metadata */
+#endif
        __OVS_TUNNEL_KEY_ATTR_MAX
 };