From: Gustavo A. R. Silva Date: Sat, 25 Nov 2017 19:14:40 +0000 (-0600) Subject: net: openvswitch: datapath: fix data type in queue_gso_packets X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=87ff3fb30de11a64d25a4a22f23def1ce77cf840;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git net: openvswitch: datapath: fix data type in queue_gso_packets [ Upstream commit 2734166e89639c973c6e125ac8bcfc2d9db72b70 ] gso_type is being used in binary AND operations together with SKB_GSO_UDP. The issue is that variable gso_type is of type unsigned short and SKB_GSO_UDP expands to more than 16 bits: SKB_GSO_UDP = 1 << 16 this makes any binary AND operation between gso_type and SKB_GSO_UDP to be always zero, hence making some code unreachable and likely causing undesired behavior. Fix this by changing the data type of variable gso_type to unsigned int. Addresses-Coverity-ID: 1462223 Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet") Signed-off-by: Gustavo A. R. Silva Acked-by: Willem de Bruijn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 294444bb075c..363dd904733d 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -335,7 +335,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb, const struct dp_upcall_info *upcall_info, uint32_t cutlen) { - unsigned short gso_type = skb_shinfo(skb)->gso_type; + unsigned int gso_type = skb_shinfo(skb)->gso_type; struct sw_flow_key later_key; struct sk_buff *segs, *nskb; int err;