lkml.org 
[lkml]   [2014]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] macvtap: advance iov iterator when needed in macvtap_put_user()
On Thu, Nov 20, 2014 at 04:34:26PM +0800, Herbert Xu wrote:
> On Thu, Nov 20, 2014 at 04:31:05PM +0800, Jason Wang wrote:
> > When mergeable buffer is used, vnet_hdr_sz is greater than sizeof struct
> > virtio_net_hdr. So we need advance the iov iterators in this case.
> >
> > Fixes 6c36d2e26cda1ad3e2c4b90dd843825fc62fe5b4 ("macvtap: Use iovec iterators")
> > Cc: Herbert Xu <herbert@gondor.apana.org.au>
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

I'm not sure it's a good behaviour, actually - should we just leave an
unmodified gap in userland buffer there, with whatever garbage it might
have contained?

I do realize that this is what we used to do, but it might end up a source
of hard to debug userland bugs... Perhaps that iov_iter_advance(iter, size)
would better be replaced with iov_iter_zero(size, iter)?


\
 
 \ /
  Last update: 2014-11-20 10:21    [W:0.037 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site