coreboot-kgpe-d16/payloads/libpayload/drivers/usb
Julius Werner 182fea717e libpayload: usbmsc: Skip zero-length packets at end of data
Some broken USB mass storage devices send another zero-length packet at
the end of the data part of a transfer if the amount of data was evenly
divisible by the packet size (which is pretty much always the case for
block reads). This packet will get interpreted as the CSW and screw up
the MSC state machine.

This patch works around this issue by retrying the CSW transfer when it
was received as exactly 0 bytes. This is the same mitigation the Linux
kernel uses and harmless for correctly behaving devices. Also tighten
validation of the CSW a little, making sure we verify the length before
we read any fields and checking the signature in addition to the tag.

Change-Id: I24f183f27b2c4f0142ba6c4b35b490c5798d0d21
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34485
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-08-22 10:36:48 +00:00
..
Kconfig
TODO
dwc2.c libpayload/usb: fix DWC2 driver 2019-07-09 13:05:53 +00:00
dwc2.h
dwc2_private.h
dwc2_rh.c
ehci.c libpayload/usb: Increase USB request timeout to 5 s 2019-07-02 17:42:18 +00:00
ehci.h
ehci_private.h
ehci_rh.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
generic_hub.c libpayload/generic_hub: Detect port disconnect after reset 2018-07-17 20:38:46 +00:00
generic_hub.h
ohci.c libpayload/usb: Increase USB request timeout to 5 s 2019-07-02 17:42:18 +00:00
ohci.h
ohci_private.h
ohci_rh.c
quirks.c
uhci.c libpayload/usb: Increase USB request timeout to 5 s 2019-07-02 17:42:18 +00:00
uhci.h
uhci_private.h
uhci_rh.c
usb.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
usb_dev.c libpayload/drivers/usb: Fix leaks 2018-10-01 16:58:29 +00:00
usbhid.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
usbhub.c
usbinit.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
usbmsc.c libpayload: usbmsc: Skip zero-length packets at end of data 2019-08-22 10:36:48 +00:00
xhci.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
xhci.h
xhci_commands.c
xhci_debug.c
xhci_devconf.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
xhci_events.c libpayload/usb: Increase USB request timeout to 5 s 2019-07-02 17:42:18 +00:00
xhci_private.h libpayload/xhci: Document struct offsets on xhci_t 2018-07-16 07:43:50 +00:00
xhci_rh.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00