net: vmxnet: initialise local tx descriptor
PATCH 1/1 net: vmxnet: initialise local tx descriptor
From: Li Qiang <[email protected]>
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.
--- hw/net/vmxnet3.c | 1 + 1 file changed, 1 insertion(+)
hw/net/vmxnet3.c +1 -0
@@ -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);
Signature · 1 line
2.5.5
Quoted 30 lines · P J P
From: Li Qiang <[email protected]>
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 <[email protected]>Signed-off-by Prasad J Pandit <[email protected]>---
hw/net/vmxnet3.c| 1 +1 file changed, 1 insertion(+)hw/net/vmxnet3.c +1
-0@@ -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);Signature · 1 line
2.5.5
Hello Jason,
+-- On Thu, 11 Aug 2016, Dmitry Fleytman wrote --+ | Reviewed-by: Dmitry Fleytman <[email protected]> | | > @@ -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
Quoted 12 lines · P J P
Hello Jason,
+-- On Thu, 11 Aug 2016, Dmitry Fleytman wrote --+ | Reviewed-by: Dmitry Fleytman <[email protected]> | | > @@ -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;
Quoted 2 lines
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
Quoted 6 lines
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F