]>
Commit | Line | Data |
---|---|---|
fa55523a GKH |
1 | From foo@baz Thu Dec 14 11:45:40 CET 2017 |
2 | From: "Gustavo A. R. Silva" <garsilva@embeddedor.com> | |
3 | Date: Sat, 25 Nov 2017 13:14:40 -0600 | |
4 | Subject: net: openvswitch: datapath: fix data type in queue_gso_packets | |
5 | ||
6 | From: "Gustavo A. R. Silva" <garsilva@embeddedor.com> | |
7 | ||
8 | ||
9 | [ Upstream commit 2734166e89639c973c6e125ac8bcfc2d9db72b70 ] | |
10 | ||
11 | gso_type is being used in binary AND operations together with SKB_GSO_UDP. | |
12 | The issue is that variable gso_type is of type unsigned short and | |
13 | SKB_GSO_UDP expands to more than 16 bits: | |
14 | ||
15 | SKB_GSO_UDP = 1 << 16 | |
16 | ||
17 | this makes any binary AND operation between gso_type and SKB_GSO_UDP to | |
18 | be always zero, hence making some code unreachable and likely causing | |
19 | undesired behavior. | |
20 | ||
21 | Fix this by changing the data type of variable gso_type to unsigned int. | |
22 | ||
23 | Addresses-Coverity-ID: 1462223 | |
24 | Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet") | |
25 | Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> | |
26 | Acked-by: Willem de Bruijn <willemb@google.com> | |
27 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
28 | Signed-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; |