coreboot/src/commonlib/bsd
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
..
include/commonlib/bsd elog: Define constant for RW region name 2021-08-26 18:50:56 +00:00
cbfs_mcache.c cbfs: mcache: Fix size calculation for perfectly full cache 2021-04-10 00:00:34 +00:00
cbfs_private.c cbfs: Make sure all cases of single file header corruption are isolated 2021-09-01 23:57:14 +00:00
elog.c elog: move functionality to commonlib/bsd 2021-08-26 18:50:29 +00:00
lz4.c.inc lz4: Fix out-of-bounds reads 2020-03-02 15:03:03 +00:00
lz4_wrapper.c commonlib/lz4_wrapper.c: do not use bitfields 2021-06-11 07:41:41 +00:00