qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest
@ 2017-06-14  3:39 Li Qiang
  2017-06-14  3:47 ` no-reply
  2017-06-14  6:30 ` Gerd Hoffmann
  0 siblings, 2 replies; 7+ messages in thread
From: Li Qiang @ 2017-06-14  3:39 UTC (permalink / raw)
  To: qemu-devel, kraxel; +Cc: liqiang6-s, ppandit, Li Qiang

From: Li Qiang <liq3ea@gmail.com>

In 'xhci_write_event' function, the 'ev_trb' is not full initialized.
This will lead an info leak issue. This patch avoid this.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
 hw/usb/hcd-xhci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index a0c7960..537997e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -646,6 +646,7 @@ static void xhci_write_event(XHCIState *xhci, XHCIEvent *event, int v)
     XHCITRB ev_trb;
     dma_addr_t addr;
 
+    memset(&ev_trb, 0, sizeof(ev_trb));
     ev_trb.parameter = cpu_to_le64(event->ptr);
     ev_trb.status = cpu_to_le32(event->length | (event->ccode << 24));
     ev_trb.control = (event->slotid << 24) | (event->epid << 16) |
-- 
2.7.4

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

end of thread, other threads:[~2017-06-14 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14  3:39 [Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest Li Qiang
2017-06-14  3:47 ` no-reply
2017-06-14  4:20   ` Li Qiang
2017-06-14  6:23     ` Gerd Hoffmann
2017-06-14 11:16       ` Juan Quintela
2017-06-14  6:30 ` Gerd Hoffmann
2017-06-14  6:36   ` Li Qiang

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