[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest |
Date: |
Tue, 13 Jun 2017 20:39:04 -0700 |
From: Li Qiang <address@hidden>
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 <address@hidden>
---
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