kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix unitialized offset in virtio-net receive_header
@ 2008-12-03 20:27 Anthony Liguori
  2008-12-04 12:06 ` Mark McLoughlin
  2008-12-05 17:39 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-12-03 20:27 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity, Mark McLoughlin, Anthony Liguori

If vnet support is not available on the tap device, offset is uninitialized and
badness ensues.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index b5d5f9e..4d7e6ad 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
@@ -219,7 +219,7 @@ static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt,
 			  const void *buf, int size, int hdr_len)
 {
     struct virtio_net_hdr *hdr = iov[0].iov_base;
-    int offset;
+    int offset = 0;
 
     hdr->flags = 0;
     hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix unitialized offset in virtio-net receive_header
  2008-12-03 20:27 [PATCH] Fix unitialized offset in virtio-net receive_header Anthony Liguori
@ 2008-12-04 12:06 ` Mark McLoughlin
  2008-12-04 15:10   ` Anthony Liguori
  2008-12-05 17:39 ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Mark McLoughlin @ 2008-12-04 12:06 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm, Avi Kivity

On Wed, 2008-12-03 at 14:27 -0600, Anthony Liguori wrote:
> If vnet support is not available on the tap device, offset is uninitialized and
> badness ensues.

Uggh, nasty. And no comiler warning ...

Cheers,
Mark.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix unitialized offset in virtio-net receive_header
  2008-12-04 12:06 ` Mark McLoughlin
@ 2008-12-04 15:10   ` Anthony Liguori
  0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-12-04 15:10 UTC (permalink / raw)
  To: Mark McLoughlin; +Cc: kvm, Avi Kivity

Mark McLoughlin wrote:
> On Wed, 2008-12-03 at 14:27 -0600, Anthony Liguori wrote:
>   
>> If vnet support is not available on the tap device, offset is uninitialized and
>> badness ensues.
>>     
>
> Uggh, nasty. And no comiler warning ...
>   

My gcc happens to throw a warning.  GCC is lame like that.

Regards,

Anthony Liguori

> Cheers,
> Mark.
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix unitialized offset in virtio-net receive_header
  2008-12-03 20:27 [PATCH] Fix unitialized offset in virtio-net receive_header Anthony Liguori
  2008-12-04 12:06 ` Mark McLoughlin
@ 2008-12-05 17:39 ` Avi Kivity
  1 sibling, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-12-05 17:39 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm, Mark McLoughlin

Anthony Liguori wrote:
> If vnet support is not available on the tap device, offset is uninitialized and
> badness ensues.
>
>   

Applied, thanks.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-05 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 20:27 [PATCH] Fix unitialized offset in virtio-net receive_header Anthony Liguori
2008-12-04 12:06 ` Mark McLoughlin
2008-12-04 15:10   ` Anthony Liguori
2008-12-05 17:39 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).