Skip to contentSkip to conversation

ehci: Fix crash with isoc usb packets

PATCH In review Hans de Goede 4 participants 4 messages Sep 9, 2013 – Sep 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ehci: Fix crash with isoc usb packets

The isoc packet path in the ehci code has a bad qobject cast, causing an abort, this patch fixes this.

Note this problem is backported in 1.6.0 too, and this patch should be backported to the 1.6.0 stable tree.

---
 hw/usb/hcd-ehci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/usb/hcd-ehci.c +2 -1
index 010a0d0..77c4872 100644
@@ -1486,7 +1486,8 @@ static int ehci_process_itd(EHCIState *ehci,
                 return -1;
             }
 
-            qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as);
+            qemu_sglist_init(&ehci->isgl, BUS(&ehci->bus)->parent,
+                             2, ehci->as);
             if (off + len > 4096) {
                 /* transfer crosses page border */
                 uint32_t len2 = off + len - 4096;
Signature · 1 line
1.8.3.1
#1 lore raw

Il 09/09/2013 10:20, Hans de Goede ha scritto:

Quoted 17 lines

The isoc packet path in the ehci code has a bad qobject cast, causing an abort, this patch fixes this.

Note this problem is backported in 1.6.0 too, and this patch should be backported to the 1.6.0 stable tree.

---
 hw/usb/hcd-ehci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/usb/hcd-ehci.c +0 -0
index 010a0d0..77c4872 100644

hw/usb/hcd-ehci.c static int ehci_process_itd(EHCIState *ehci, · line 1493

Quoted 9 lines
hw/usb/hcd-ehci.c +2 -1
@@ -1486,7 +1486,8 @@ static int ehci_process_itd(EHCIState *ehci,
                 return -1;
             }
 
-            qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as);
+            qemu_sglist_init(&ehci->isgl, BUS(&ehci->bus)->parent,
+                             2, ehci->as);
             if (off + len > 4096) {
                 /* transfer crosses page border */
                 uint32_t len2 = off + len - 4096;

... then qemu-stable should be CCed.

Paolo

#2 lore raw
In reply to Hans de Goede
Quoted 26 lines · Hans de Goede

The isoc packet path in the ehci code has a bad qobject cast, causing an abort, this patch fixes this.

Note this problem is backported in 1.6.0 too, and this patch should be backported to the 1.6.0 stable tree.

---
 hw/usb/hcd-ehci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/usb/hcd-ehci.c +2 -2
index 010a0d0..77c4872 100644
@@ -1486,7 +1486,8 @@ static int ehci_process_itd(EHCIState *ehci,
                 return -1;
             }
 
-            qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as);
+            qemu_sglist_init(&ehci->isgl, BUS(&ehci->bus)->parent,
+                             2, ehci->as);
             if (off + len > 4096) {
                 /* transfer crosses page border */
                 uint32_t len2 = off + len - 4096;
--
Quoted 3 lines

1.8.3.1

Ping. Don't see this in master (and as such its missing from mdroth's 1.6.1 patch set).

Signature · 1 line
Doug Goldstein
#3 lore raw

Hi,

Quoted 2 lines

Ping. Don't see this in master (and as such its missing from mdroth's 1.6.1 patch set).

Different patch is in master: adbecc89731cf3e0ae656d50ea9fa58c589c4bdc Yes, that one should be cherry-picked into stable.

thanks,
Gerd