Michal Kubeček acf8dd0a9d udp: only allow UFO for packets from SOCK_DGRAM sockets
If an over-MTU UDP datagram is sent through a SOCK_RAW socket to a
UFO-capable device, ip_ufo_append_data() sets skb->ip_summed to
CHECKSUM_PARTIAL unconditionally as all GSO code assumes transport layer
checksum is to be computed on segmentation. However, in this case,
skb->csum_start and skb->csum_offset are never set as raw socket
transmit path bypasses udp_send_skb() where they are usually set. As a
result, driver may access invalid memory when trying to calculate the
checksum and store the result (as observed in virtio_net driver).

Moreover, the very idea of modifying the userspace provided UDP header
is IMHO against raw socket semantics (I wasn't able to find a document
clearly stating this or the opposite, though). And while allowing
CHECKSUM_NONE in the UFO case would be more efficient, it would be a bit
too intrusive change just to handle a corner case like this. Therefore
disallowing UFO for packets from SOCK_DGRAM seems to be the best option.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-02 22:19:29 -05:00
..
2014-09-18 10:54:36 +02:00
2015-02-14 20:36:08 -08:00
2014-11-06 15:11:10 -05:00
2015-01-31 17:48:18 -08:00
2013-12-29 16:34:25 -05:00
2013-10-08 23:19:24 -04:00
2015-02-02 18:46:51 -08:00
2014-02-19 11:41:25 +01:00
2015-01-28 22:18:37 -08:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-11-05 23:52:33 -08:00
2014-09-01 18:12:45 -07:00
2015-01-28 22:18:37 -08:00
2014-09-01 18:12:45 -07:00
2015-01-28 22:18:37 -08:00
2015-01-28 22:18:37 -08:00
2015-01-05 22:44:46 -05:00
2014-05-23 16:28:53 -04:00
2013-05-31 17:19:05 -07:00