coreboot/src
Julius Werner 6813d561b2 cbfs: Make sure all cases of single file header corruption are isolated
The new CBFS stack was written to try to isolate cases of single file
corruption as far as possible and still make other files avaialble (at
least as long as verification is disabled and they can still be found at
all). For most cases of header corruption, it will just continue trying
to parse the next file. However, in cases where parts of the file extend
beyond the end of the rdev, we have been relying on the range checking
of the rdev API rather than doing it explicitly.

This is fine in general, but it causes the problem that these errors
cannot be distinguished from I/O errors, and I/O errors always make the
whole cbfs_walk() fail. That means we will not return a successful
result from cbfs_mcache_build(), and leads to an odd discrepancy in how
certain kinds of corrupted CBFSes are treated with and without mcache.
This patch adds an explicit range check to make the behavior consistent.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ice2b6960284bd0c19be35b0607e5e32791e7a64c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57271
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
2021-09-01 23:57:14 +00:00
..
acpi acpi: Fill fadt->century based on Kconfig 2021-08-19 18:16:04 +00:00
arch arch/x86: Implement cpu_info in C code 2021-08-31 15:58:58 +00:00
commonlib cbfs: Make sure all cases of single file header corruption are isolated 2021-09-01 23:57:14 +00:00
console console/hw-debug_sink: Update for fast/slow console distinction 2021-08-04 15:15:45 +00:00
cpu AGESA f15tn: Hook up IDS options to Kconfig 2021-08-22 22:17:02 +00:00
device device/mipi: Move to drivers/mipi 2021-08-26 15:18:45 +00:00
drivers drivers/intel/fsp1_1/romstage.c: Remove MCU update 2021-09-01 00:53:20 +00:00
ec ec/google/chromeec: Add code for KEY_MICMUTE and KEY_KBD_BKLIGHT_TOGGLE 2021-08-06 16:26:51 +00:00
include device/mipi: Move to drivers/mipi 2021-08-26 15:18:45 +00:00
lib Move post_codes.h to commonlib/console/ 2021-08-04 15:15:51 +00:00
mainboard mb/goog/brya: Add probed fw_configs to SMBIOS OEM strings 2021-09-01 19:32:43 +00:00
northbridge nb/intel/haswell: Move MRC glue code into a subfolder 2021-08-02 14:59:45 +00:00
security vboot/secdata_tpm: Add WRITE_STCLEAR attr to RW ARB spaces 2021-07-26 07:27:48 +00:00
soc soc/amd/cezanne: Increase the FSP_M_SIZE configuration 2021-09-01 19:36:20 +00:00
southbridge acpi: Fill fadt->century based on Kconfig 2021-08-19 18:16:04 +00:00
superio superio/nuvoton/nct6776: Correct the definition of NCT6776_GPIOBASE 2021-08-29 16:41:12 +00:00
vendorcode AGESA f15tn: Fix building IDS tracing support 2021-08-22 22:17:32 +00:00
Kconfig option: Allow mainboards to implement the API 2021-05-28 11:37:25 +00:00