mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-24 02:18:54 +00:00
tun: Fix GSO meta-data handling in tun_get_user
When we write the GSO meta-data in tun_get_user we end up advancing
the IO vector twice, thus exhausting the user buffer before we can
finish writing the packet.
Fixes: f5ff53b4d9
("{macvtap,tun}_get_user(): switch to iov_iter")
Reported-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cbc24658ba
commit
d8febb77b5
@ -1052,7 +1052,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
|
||||
|
||||
if (gso.hdr_len > len)
|
||||
return -EINVAL;
|
||||
iov_iter_advance(from, tun->vnet_hdr_sz);
|
||||
iov_iter_advance(from, tun->vnet_hdr_sz - sizeof(gso));
|
||||
}
|
||||
|
||||
if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
|
||||
|
Loading…
Reference in New Issue
Block a user