]> git.baikalelectronics.ru Git - kernel.git/commit
net: openvswitch: datapath: fix data type in queue_gso_packets
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Sat, 25 Nov 2017 19:14:40 +0000 (13:14 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Nov 2017 17:15:33 +0000 (02:15 +0900)
commit628518ede74e494bab6cc08330a1c8498c1d3117
tree8a45c79aa484e895deb2e413981f08c7b277178a
parent1ea7d94062e3f207b2e7feb54731d99bf6e6c8f6
net: openvswitch: datapath: fix data type in queue_gso_packets

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: 787cbe12c0b5 ("net: accept UFO datagrams from tuntap and packet")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/datapath.c