diff options
author | Jason Wang <jasowang@redhat.com> | 2014-12-24 06:03:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-31 02:53:20 +0300 |
commit | 41f2f1273caee29ce9e2854c9aba996b56303b4a (patch) | |
tree | eee0c03d8475947a8e1002abf175e2240f1cfd72 /drivers/net/virtio_net.c | |
parent | dd450777990baae668c1143064f2f234dbab1b9b (diff) | |
download | linux-41f2f1273caee29ce9e2854c9aba996b56303b4a.tar.xz |
virtio-net: don't do header check for dodgy gso packets
There's no need to do header check for virtio-net since:
- Host sets dodgy for all gso packets from guest and check the header.
- Host should be prepared for all kinds of evil packets from guest, since
malicious guest can send any kinds of packet.
So this patch sets NETIF_F_GSO_ROBUST for virtio-net to skip the check.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5ca97713bfb3..11e2e8131359 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1759,6 +1759,8 @@ static int virtnet_probe(struct virtio_device *vdev) if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) dev->hw_features |= NETIF_F_TSO_ECN; + dev->features |= NETIF_F_GSO_ROBUST; + if (gso) dev->features |= dev->hw_features & NETIF_F_ALL_TSO; /* (!csum && gso) case will be fixed by register_netdev() */ |