coreboot-kgpe-d16/payloads
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
..
bayou payloads: Remove/fix trailing whitespace 2018-09-04 12:38:40 +00:00
coreinfo Makefile.inc, payloads: Enable -Wvla 2019-08-20 20:57:01 +00:00
external payloads/tianocore: Enable UEFIPayload 2019-08-21 09:34:27 +00:00
libpayload libpayload: usbmsc: Skip zero-length packets at end of data 2019-08-22 10:36:48 +00:00
linuxcheck Makefile.inc, payloads: Enable -Wvla 2019-08-20 20:57:01 +00:00
nvramcui Makefile.inc, payloads: Enable -Wvla 2019-08-20 20:57:01 +00:00
Kconfig arch/riscv: Enable FIT support 2019-08-08 13:03:59 +00:00
Makefile.inc payloads/external: Add yabits payload 2018-09-16 13:10:17 +00:00