diff options
author | Li Qiang <liqiang6-s@360.cn> | 2016-08-11 00:42:20 +0530 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2016-10-26 09:57:59 +0800 |
commit | fdda170e50b8af062cf5741e12c4fb5e57a2eacf (patch) | |
tree | c46973e17fddecce869b2bad01f12dfc3dd101f0 /hw/net | |
parent | c89d416a2b0fb6a21224186b10af4c4a3feee31b (diff) | |
download | qemu-fdda170e50b8af062cf5741e12c4fb5e57a2eacf.tar.gz qemu-fdda170e50b8af062cf5741e12c4fb5e57a2eacf.tar.bz2 qemu-fdda170e50b8af062cf5741e12c4fb5e57a2eacf.zip |
net: vmxnet: initialise local tx descriptor
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>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/vmxnet3.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 90f6943668..92f6af9620 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); |