From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, "Huacai Chen" <chenhuacai@kernel.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 13/13] usb/storage: clear csw on reset
Date: Mon, 15 Mar 2021 19:02:40 +0100 [thread overview]
Message-ID: <20210315180240.1597240-14-kraxel@redhat.com> (raw)
In-Reply-To: <20210315180240.1597240-1-kraxel@redhat.com>
Stale data in csw (specifically residue) can confuse the state machine
and allows the guest trigger an assert(). So clear csw on reset to
avoid this happening in case the guest resets the device in the middle
of a request.
Buglink: https://bugs.launchpad.net/qemu/+bug/1523811
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210312094954.796799-1-kraxel@redhat.com>
---
hw/usb/dev-storage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 7b587ad051ff..dca62d544fe9 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -313,6 +313,7 @@ void usb_msd_handle_reset(USBDevice *dev)
usb_msd_packet_complete(s);
}
+ memset(&s->csw, 0, sizeof(s->csw));
s->mode = USB_MSDM_CBW;
}
--
2.29.2
next prev parent reply other threads:[~2021-03-15 18:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 18:02 [PULL 00/13] Usb 20210315 patches Gerd Hoffmann
2021-03-15 18:02 ` [PULL 01/13] hw/usb/bus: Remove the "full-path" property Gerd Hoffmann
2021-03-15 18:02 ` [PULL 02/13] usb: remove support for -usbdevice parameters Gerd Hoffmann
2021-03-15 18:02 ` [PULL 03/13] usb: remove '-usbdevice u2f-key' Gerd Hoffmann
2021-03-15 18:02 ` [PULL 04/13] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Gerd Hoffmann
2021-03-15 18:02 ` [PULL 05/13] usb: Document the missing -usbdevice options Gerd Hoffmann
2021-03-15 18:02 ` [PULL 06/13] hw/southbridge: Add missing Kconfig dependency VT82C686 on USB_UHCI Gerd Hoffmann
2021-03-15 18:02 ` [PULL 07/13] hw/usb/hcd-uhci: Expose generic prototypes to local header Gerd Hoffmann
2021-03-15 18:02 ` [PULL 08/13] hw/usb: Extract VT82C686 UHCI PCI function into a new unit Gerd Hoffmann
2021-03-15 18:02 ` [PULL 09/13] usb/storage: move declarations to usb/msd.h header Gerd Hoffmann
2021-03-15 18:02 ` [PULL 10/13] usb/storage: move usb-bot device to separate source file Gerd Hoffmann
2021-03-15 18:02 ` [PULL 11/13] usb/storage move usb-storage " Gerd Hoffmann
2021-03-15 18:02 ` [PULL 12/13] usb/storage: add kconfig symbols Gerd Hoffmann
2021-03-15 18:02 ` Gerd Hoffmann [this message]
2021-03-16 21:07 ` [PULL 00/13] Usb 20210315 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315180240.1597240-14-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=chenhuacai@kernel.org \
--cc=f4bug@amsat.org \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).