virtio-net: don't do header check for dodgy gso packets
Subsystems (4)
PATCH v2 1/1 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.
---
Changes from V1:
- typo fixes
--- drivers/net/virtio_net.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/virtio_net.c +2 -0
@@ -1761,6 +1761,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() */
Signature · 1 line
1.9.1
From: Jason Wang <[email protected]>
Date: Wed, 24 Dec 2014 11:03:52 +0800
Quoted 8 lines
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_ROBUSTfor virtio-net to skip the check.
Quoted 7 lines
Cc Rusty Russell <[email protected]>Cc Michael S. Tsirkin <[email protected]>Signed-off-by Jason Wang <[email protected]>---
Changes from V1:
- typo fixes
Applied.