qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor
@ 2016-08-10 19:12 P J P
  2016-08-11  7:57 ` Dmitry Fleytman
  0 siblings, 1 reply; 4+ messages in thread
From: P J P @ 2016-08-10 19:12 UTC (permalink / raw)
  To: Qemu Developers; +Cc: Li Qiang, Dmitry Fleytman, Jason Wang

From: Li Qiang <liqiang6-s@360.cn>

In Vmxnet3 device emulator while processing transmit(tx) queue,
when it reaches end of packet, it calls vmxnet3_complete_packet.
In that local 'txcq_descr' object is not initialised, which could
leak host memory bytes a guest.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 hw/net/vmxnet3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 90f6943..92f6af9 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -531,6 +531,7 @@ static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
 
     VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
 
+    memset(&txcq_descr, 0, sizeof(txcq_descr));
     txcq_descr.txdIdx = tx_ridx;
     txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_descr[qidx].comp_ring);
 
-- 
2.5.5

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

* Re: [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor
  2016-08-10 19:12 [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor P J P
@ 2016-08-11  7:57 ` Dmitry Fleytman
  2016-10-18 19:35   ` P J P
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Fleytman @ 2016-08-11  7:57 UTC (permalink / raw)
  To: P J P; +Cc: Qemu Developers, Li Qiang, Jason Wang

Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>

> On 10 Aug 2016, at 22:12 PM, P J P <ppandit@redhat.com> wrote:
> 
> From: Li Qiang <liqiang6-s@360.cn>
> 
> In Vmxnet3 device emulator while processing transmit(tx) queue,
> when it reaches end of packet, it calls vmxnet3_complete_packet.
> In that local 'txcq_descr' object is not initialised, which could
> leak host memory bytes a guest.
> 
> Reported-by: Li Qiang <liqiang6-s@360.cn>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
> hw/net/vmxnet3.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> index 90f6943..92f6af9 100644
> --- a/hw/net/vmxnet3.c
> +++ b/hw/net/vmxnet3.c
> @@ -531,6 +531,7 @@ static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
> 
>     VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
> 
> +    memset(&txcq_descr, 0, sizeof(txcq_descr));
>     txcq_descr.txdIdx = tx_ridx;
>     txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_descr[qidx].comp_ring);
> 
> -- 
> 2.5.5
> 

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

* Re: [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor
  2016-08-11  7:57 ` Dmitry Fleytman
@ 2016-10-18 19:35   ` P J P
  2016-10-21  2:03     ` Jason Wang
  0 siblings, 1 reply; 4+ messages in thread
From: P J P @ 2016-10-18 19:35 UTC (permalink / raw)
  To: Jason Wang; +Cc: Qemu Developers, Dmitry Fleytman

  Hello Jason,

+-- On Thu, 11 Aug 2016, Dmitry Fleytman wrote --+
| Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
| 
| > @@ -531,6 +531,7 @@ static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
| > 
| >     VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
| > 
| > +    memset(&txcq_descr, 0, sizeof(txcq_descr));
| >     txcq_descr.txdIdx = tx_ridx;

 It seems this one is not pulled upstream yet? There is another one like it. 
(just checking)

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

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

* Re: [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor
  2016-10-18 19:35   ` P J P
@ 2016-10-21  2:03     ` Jason Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2016-10-21  2:03 UTC (permalink / raw)
  To: P J P; +Cc: Dmitry Fleytman, Qemu Developers



On 2016年10月19日 03:35, P J P wrote:
>    Hello Jason,
>
> +-- On Thu, 11 Aug 2016, Dmitry Fleytman wrote --+
> | Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
> |
> | > @@ -531,6 +531,7 @@ static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
> | >
> | >     VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
> | >
> | > +    memset(&txcq_descr, 0, sizeof(txcq_descr));
> | >     txcq_descr.txdIdx = tx_ridx;
>
>   It seems this one is not pulled upstream yet? There is another one like it.
> (just checking)

My bad, this patch was missed for some reason. I've queued this in my tree.

Thanks

>
> Thank you.
> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
>

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

end of thread, other threads:[~2016-10-21  2:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-10 19:12 [Qemu-devel] [PATCH] net: vmxnet: initialise local tx descriptor P J P
2016-08-11  7:57 ` Dmitry Fleytman
2016-10-18 19:35   ` P J P
2016-10-21  2:03     ` Jason Wang

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).