[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/5] ehci: fix queue->dev null ptr dereference
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 5/5] ehci: fix queue->dev null ptr dereference |
Date: |
Thu, 22 Aug 2019 08:52:42 +0200 |
In case we don't have a device for an active queue, just skip
processing the queue (same we do for inactive queues) and log
a guest bug.
Reported-by: Guenter Roeck <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Tested-by: Guenter Roeck <address@hidden>
Message-id: address@hidden
---
hw/usb/hcd-ehci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 9ca7b87a8001..56ab2f457f4c 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1838,6 +1838,9 @@ static int ehci_state_fetchqtd(EHCIQueue *q)
ehci_set_state(q->ehci, q->async, EST_EXECUTING);
break;
}
+ } else if (q->dev == NULL) {
+ ehci_trace_guest_bug(q->ehci, "no device attached to queue");
+ ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);
} else {
p = ehci_alloc_packet(q);
p->qtdaddr = q->qtdaddr;
--
2.18.1
- [Qemu-devel] [PULL 0/5] Usb 20190822 patches, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 3/5] xhci: Add No Op Command, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 5/5] ehci: fix queue->dev null ptr dereference,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 2/5] usb-redir: merge interrupt packets, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 1/5] usbredir: fix buffer-overflow on vmload, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 4/5] usb: reword -usb command-line option and mention xHCI, Gerd Hoffmann, 2019/08/22
- Re: [Qemu-devel] [PULL 0/5] Usb 20190822 patches, Peter Maydell, 2019/08/22