linux/drivers/firmware/google
Hung-Te Lin 4b708b7b1a firmware: google: check if size is valid when decoding VPD data
The VPD implementation from Chromium Vital Product Data project used to
parse data from untrusted input without checking if the meta data is
invalid or corrupted. For example, the size from decoded content may
be negative value, or larger than whole input buffer. Such invalid data
may cause buffer overflow.

To fix that, the size parameters passed to vpd_decode functions should
be changed to unsigned integer (u32) type, and the parsing of entry
header should be refactored so every size field is correctly verified
before starting to decode.

Fixes: ad2ac9d5c5 ("firmware: Google VPD: import lib_vpd source files")
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190830022402.214442-1-hungte@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-04 13:31:28 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile firmware: coreboot: Collapse platform drivers into bus core 2018-09-14 15:37:23 +02:00
coreboot_table.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
coreboot_table.h Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
framebuffer-coreboot.c Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
gsmi.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
memconsole-coreboot.c Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
memconsole-x86-legacy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
memconsole.c Merge 5.2-rc4 into char-misc-next 2019-06-09 09:11:21 +02:00
memconsole.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
vpd.c firmware: google: check if size is valid when decoding VPD data 2019-09-04 13:31:28 +02:00
vpd_decode.c firmware: google: check if size is valid when decoding VPD data 2019-09-04 13:31:28 +02:00
vpd_decode.h firmware: google: check if size is valid when decoding VPD data 2019-09-04 13:31:28 +02:00