aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3f0cdc14be82..8d82511aa1bc 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -565,6 +565,10 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun,
565 if (memcpy_fromiovecend((void *)&gso, iv, offset, sizeof(gso))) 565 if (memcpy_fromiovecend((void *)&gso, iv, offset, sizeof(gso)))
566 return -EFAULT; 566 return -EFAULT;
567 567
568 if ((gso.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
569 gso.csum_start + gso.csum_offset + 2 > gso.hdr_len)
570 gso.hdr_len = gso.csum_start + gso.csum_offset + 2;
571
568 if (gso.hdr_len > len) 572 if (gso.hdr_len > len)
569 return -EINVAL; 573 return -EINVAL;
570 offset += sizeof(pi); 574 offset += sizeof(pi);