[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 44/56] xhci: fix segfault
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 44/56] xhci: fix segfault |
Date: |
Tue, 13 Aug 2013 10:11:08 -0500 |
From: Gerd Hoffmann <address@hidden>
Guest trying to reset a endpoint of a disconnected device resulted in
xhci trying to dereference uport while being NULL, thereby crashing
qemu. Fix that by adding a check. Drop unused dev variable while
touching that code bit.
Cc: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
(cherry picked from commit 75cc1c1fcba1987bdf3979c4289ab756c2b15742)
Signed-off-by: Michael Roth <address@hidden>
---
hw/usb/hcd-xhci.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 632ede8..d88c1ae 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1395,7 +1395,6 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned
int slotid,
{
XHCISlot *slot;
XHCIEPContext *epctx;
- USBDevice *dev;
trace_usb_xhci_ep_reset(slotid, epid);
assert(slotid >= 1 && slotid <= xhci->numslots);
@@ -1431,8 +1430,8 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned
int slotid,
ep |= 0x80;
}
- dev = xhci->slots[slotid-1].uport->dev;
- if (!dev) {
+ if (!xhci->slots[slotid-1].uport ||
+ !xhci->slots[slotid-1].uport->dev) {
return CC_USB_TRANSACTION_ERROR;
}
--
1.7.9.5
- [Qemu-devel] [PATCH 26/56] seccomp: add the asynchronous I/O syscalls to the whitelist, (continued)
- [Qemu-devel] [PATCH 26/56] seccomp: add the asynchronous I/O syscalls to the whitelist, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 31/56] iscsi: assert that sectors are aligned to LUN blocksize, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 35/56] megasas: Legacy command line handling fix, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 39/56] xhci: handle USB_RET_IOERROR, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 34/56] cpus: Let vm_stop[_force_state]() always flush block devices, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 42/56] virtio-console: Use exitfn for virtserialport, too, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 40/56] qemu-char: Register ring buffer driver with correct name "ringbuf", Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 41/56] qapi: Rename ChardevBackend member "memory" to "ringbuf", Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 43/56] pci-bridge: update mappings for migration/restore, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 45/56] chardev: fix CHR_EVENT_OPENED events for mux chardevs, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 44/56] xhci: fix segfault,
Michael Roth <=
- [Qemu-devel] [PATCH 48/56] iov: handle EOF in iov_send_recv, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 49/56] target-i386: Fix X86CPU error handling, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 46/56] seccomp: add arch_prctl() to the syscall whitelist, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 47/56] seccomp: add additional asynchronous I/O syscalls, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 50/56] ignore SIGPIPE in qemu-img and qemu-io, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 51/56] semaphore: fix a hangup problem under load on NetBSD hosts., Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 52/56] Bugfix for loading multiboot kernels, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 53/56] i82801b11: Fix i82801b11 PCI host bridge config space, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 56/56] vhost: clear signalled_used_valid on vhost stop, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 54/56] dataplane: sync virtio.c and vring.c virtqueue state, Michael Roth, 2013/08/13