lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <546DAC0F.90206@redhat.com>
Date:	Thu, 20 Nov 2014 16:53:35 +0800
From:	Jason Wang <jasowang@...hat.com>
To:	Al Viro <viro@...IV.linux.org.uk>,
	Herbert Xu <herbert@...dor.apana.org.au>
CC:	davem@...emloft.net, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] macvtap: advance iov iterator when needed in
 macvtap_put_user()

On 11/20/2014 04:41 PM, Al Viro wrote:
> 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@...dor.apana.org.au>
>>> Signed-off-by: Jason Wang <jasowang@...hat.com>
>> Acked-by: Herbert Xu <herbert@...dor.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?

Anyway it's the users(qemu or vhost_net) responsibility to fill the gap
here.
> 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)?

Not sure, macvtap or tun behave like this in the past. It's easy to dump
the header in guest for debugging. Zero the gap probably only help the
case that the gap was forgot to be filled which looks rare.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ