]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.7/net-openvswitch-datapath-fix-data-type-in-queue_gso_packets.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.7 / net-openvswitch-datapath-fix-data-type-in-queue_gso_packets.patch
CommitLineData
fa55523a
GKH
1From foo@baz Thu Dec 14 11:45:40 CET 2017
2From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
3Date: Sat, 25 Nov 2017 13:14:40 -0600
4Subject: net: openvswitch: datapath: fix data type in queue_gso_packets
5
6From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
7
8
9[ Upstream commit 2734166e89639c973c6e125ac8bcfc2d9db72b70 ]
10
11gso_type is being used in binary AND operations together with SKB_GSO_UDP.
12The issue is that variable gso_type is of type unsigned short and
13SKB_GSO_UDP expands to more than 16 bits:
14
15SKB_GSO_UDP = 1 << 16
16
17this makes any binary AND operation between gso_type and SKB_GSO_UDP to
18be always zero, hence making some code unreachable and likely causing
19undesired behavior.
20
21Fix this by changing the data type of variable gso_type to unsigned int.
22
23Addresses-Coverity-ID: 1462223
24Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet")
25Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
26Acked-by: Willem de Bruijn <willemb@google.com>
27Signed-off-by: David S. Miller <davem@davemloft.net>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 net/openvswitch/datapath.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33--- a/net/openvswitch/datapath.c
34+++ b/net/openvswitch/datapath.c
35@@ -335,7 +335,7 @@ static int queue_gso_packets(struct data
36 const struct dp_upcall_info *upcall_info,
37 uint32_t cutlen)
38 {
39- unsigned short gso_type = skb_shinfo(skb)->gso_type;
40+ unsigned int gso_type = skb_shinfo(skb)->gso_type;
41 struct sw_flow_key later_key;
42 struct sk_buff *segs, *nskb;
43 int err;