coreboot/src
Julius Werner 682cb3b564 fmap: Die immediately on verification failure
A recent security audit has exposed a TOCTOU risk in the FMAP
verification code: if the flash returns a tampered FMAP during the first
setup_preram_cache(), we will abort generating the cache but only after
already filling the persistent CAR/SRAM region with the tampered
version. Then we will fall back into the direct access path, which could
succeed if the flash now returns the original valid FMAP. In later
stages, we will just use the data from the persistent CAR/SRAM region as
long as it looks like an FMAP without verifying the hash again (because
the hash is only linked into the initial stage).

This patch fixes the issue by just calling die() immediately if FMAP
hash verification fails. When the verification fails, there's no
recourse anyway -- if we're not dying here we would be dying in
cbfs_get_boot_device() instead. There is no legitimate scenario where
it would still be possible to continue booting after this hash
verification fails.

Change-Id: I59ec91c3e5a59fdd960b0ba54ae5f15ddb850480
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78903
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-11-07 22:30:02 +00:00
..
acpi acpi/acpigen: Allow general namestring in write mutex functions 2023-10-16 07:59:21 +00:00
arch arch/arm64/arch_timer: Fix possible overflow in multiplication 2023-11-04 17:09:00 +00:00
commonlib commonlib: Add GCD function 2023-11-04 17:05:28 +00:00
console console.c: Enable gdb support in bootblock 2023-11-07 17:23:32 +00:00
cpu Revert "Kconfig: Bring HEAP_SIZE to a common, large value" 2023-11-07 17:35:39 +00:00
device device/dram/ddr3.c: Check SPD byte before using as a divisor 2023-10-25 14:07:16 +00:00
drivers console/spkmodem: Make it work for bootblock 2023-11-07 17:23:02 +00:00
ec ec/starlabs/merlin/ite: Adjust the mirror flag handling 2023-10-24 15:39:47 +00:00
include console.c: Enable gdb support in bootblock 2023-11-07 17:23:32 +00:00
lib fmap: Die immediately on verification failure 2023-11-07 22:30:02 +00:00
mainboard mb/google/rex/variants/deku: Add USB configuration 2023-11-07 20:17:41 +00:00
northbridge Revert "Kconfig: Bring HEAP_SIZE to a common, large value" 2023-11-07 17:35:39 +00:00
sbom
security Revert "vboot: Add catchall recovery reason for unspecified phase 4 errors" 2023-11-01 01:08:05 +00:00
soc soc/amd/common,stoneyridge: drop invalid hda_soc_ssdt_quirks 2023-11-07 19:20:18 +00:00
southbridge sb/intel/bd82x6x/pcie: Drop register write 2023-10-12 12:41:17 +00:00
superio superio/smsc/sch5545/acpi/superio.asl: Clear PME status bits on SCI 2023-10-19 07:45:02 +00:00
vendorcode vc/amd/opensil/genoa_poc/openSIL: Add openSIL code as submodule 2023-11-07 08:37:42 +00:00
Kconfig Revert "Kconfig: Bring HEAP_SIZE to a common, large value" 2023-11-07 17:35:39 +00:00