Skip to content

Commit 48900cb

Browse files
jasowangdavem330
authored andcommitted
virtio-net: drop NETIF_F_FRAGLIST
virtio declares support for NETIF_F_FRAGLIST, but assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist. A longer fraglist in the skb will make the call to skb_to_sgvec overflow the sg array, leading to memory corruption. Drop NETIF_F_FRAGLIST so we only get what we can handle. Cc: Michael S. Tsirkin <[email protected]> Signed-off-by: Jason Wang <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4f7eb70 commit 48900cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/virtio_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,9 +1756,9 @@ static int virtnet_probe(struct virtio_device *vdev)
17561756
/* Do we support "hardware" checksums? */
17571757
if (virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) {
17581758
/* This opens up the world of extra features. */
1759-
dev->hw_features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
1759+
dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_SG;
17601760
if (csum)
1761-
dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
1761+
dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
17621762

17631763
if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
17641764
dev->hw_features |= NETIF_F_TSO | NETIF_F_UFO

0 commit comments

Comments
 (0)