qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 69958d: usb: hcd-dwc2: change assert()s to qe


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 69958d: usb: hcd-dwc2: change assert()s to qemu_log_mask(L...
Date: Mon, 19 Oct 2020 06:39:22 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 69958d8a3d9535f43a457044b2b277c3c6a5ef3d
      
https://github.com/qemu/qemu/commit/69958d8a3d9535f43a457044b2b277c3c6a5ef3d
  Author: Paul Zimmerman <pauldzim@gmail.com>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M hw/usb/hcd-dwc2.c

  Log Message:
  -----------
  usb: hcd-dwc2: change assert()s to qemu_log_mask(LOG_GUEST_ERROR...)

Change several assert()s to qemu_log_mask(LOG_GUEST_ERROR...),
to prevent the guest from causing Qemu to assert. Also fix up
several existing qemu_log_mask()s to include the function name in
the message.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Zimmerman <pauldzim@gmail.com>
Message-id: 20200920021449.830-1-pauldzim@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: ccee80c68db14b3e965582a19393992b5c2b97f4
      
https://github.com/qemu/qemu/commit/ccee80c68db14b3e965582a19393992b5c2b97f4
  Author: Anthony PERARD <anthony.perard@citrix.com>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  usb/hcd-ehci: Fix error handling on missing device for iTD

The EHCI Host Controller emulation attempt to locate the device
associated with a periodic isochronous transfer description (iTD) and
when this fail the host controller is reset.

But according the EHCI spec 1.0 section 5.15.2.4 Host System
Error, the host controller is supposed to reset itself only when it
failed to communicate with the Host (Operating System), like when
there's an error on the PCI bus. If a transaction fails, there's
nothing in the spec that say to reset the host controller.

This patch rework the error path so that the host controller can keep
working when the OS setup a bogus transaction, it also revert to the
behavior of the EHCI emulation to before commits:
e94682f1fe ("ehci: check device is not NULL before calling usb_ep_get()")
7011baece2 ("usb: remove unnecessary NULL device check from usb_ep_get()")

The issue has been found while trying to passthrough a USB device to a
Windows Server 2012 Xen guest via "usb-ehci", which prevent the USB
device from working in Windows. ("usb-ehci" alone works, windows only
setup this weird periodic iTD to device 127 endpoint 15 when the USB
device is passthrough.)

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-id: 20201014104106.2962640-1-anthony.perard@citrix.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: bea2a9e3e00b275dc40cfa09c760c715b8753e03
      
https://github.com/qemu/qemu/commit/bea2a9e3e00b275dc40cfa09c760c715b8753e03
  Author: Mauro Matteo Cascella <mcascell@redhat.com>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M hw/usb/hcd-dwc2.c

  Log Message:
  -----------
  hw/usb/hcd-dwc2: fix divide-by-zero in dwc2_handle_packet()

Check the value of mps to avoid potential divide-by-zero later in the function.
Since HCCHAR_MPS is guest controllable, this prevents a malicious/buggy guest
from crashing the QEMU process on the host.

Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Paul Zimmerman <pauldzim@gmail.com>
Reported-by: Gaoning Pan <gaoning.pgn@antgroup.com>
Reported-by: Xingwei Lin <linyi.lxw@antfin.com>
Message-id: 20201015075957.268823-1-mcascell@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: 000f5b8f46f9a9f0a0d5304b605d89808ad92d4e
      
https://github.com/qemu/qemu/commit/000f5b8f46f9a9f0a0d5304b605d89808ad92d4e
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-10-19 (Mon, 19 Oct 2020)

  Changed paths:
    M hw/usb/hcd-dwc2.c
    M hw/usb/hcd-ehci.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kraxel/tags/usb-20201019-pull-request' 
into staging

usb: fixes for dwc2 + ehci.

# gpg: Signature made Mon 19 Oct 2020 13:33:16 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20201019-pull-request:
  hw/usb/hcd-dwc2: fix divide-by-zero in dwc2_handle_packet()
  usb/hcd-ehci: Fix error handling on missing device for iTD
  usb: hcd-dwc2: change assert()s to qemu_log_mask(LOG_GUEST_ERROR...)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/ba2a9a9e6318...000f5b8f46f9



reply via email to

[Prev in Thread] Current Thread [Next in Thread]