coreboot-kgpe-d16/payloads/libpayload/drivers
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
..
i8042 libpayload/i8042/keyboard: Log errors during initialization 2019-06-14 18:13:41 +00:00
serial libpayload/serial/qcs405: Mark uart console as such 2019-07-26 08:41:38 +00:00
storage libpayload: ahci: Prevent memory leaks when failing on init 2019-05-15 17:54:02 +00:00
timer mediatek: Use the 64-bit timer 2019-04-17 04:32:26 +00:00
udc payloads: Add whitespace around '<<' 2017-06-28 00:23:18 +00:00
usb libpayload: usbmsc: Skip zero-length packets at end of data 2019-08-22 10:36:48 +00:00
video libpayload: cbgfx: Allow rotation of the display 2019-08-08 03:20:06 +00:00
Makefile.inc libpayload: Add UART for qcs405 2019-06-04 14:14:58 +00:00
cbmem_console.c Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
hid.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
mouse_cursor.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
nvram.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
options.c libpayload/option table: Don't pad string entries with garbage 2019-04-11 12:03:07 +00:00
pci.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
speaker.c