coreboot/src/security
Yu-Ping Wu 4f1dda7447 security/vboot: Die if vb2api_reinit() failed
In vboot_get_context(), vb2api_reinit() is called to restore the vboot
context from the previous stage. We use assert() for the return value of
vb2api_reinit() because there shouldn't be runtime errors, except for
one edge case: vb2_shared_data struct version mismatch. More precisely,
when RW firmware's VB2_SHARED_DATA_VERSION_MINOR is greater than RO's,
vb2api_reinit() will return VB2_ERROR_SHARED_DATA_VERSION.

To avoid using an invalid vb2_context pointer (when FATAL_ASSERTS is
disabled), change assert() to die() on vb2api_reinit() failure. For the
vb2api_init() case the assertion is unchanged because there shouldn't be
any runtime error for that.

Also move the vb2api_init() call outside the assert() argument, as
assert() may be a no-op macro depending on the implementation.

Change-Id: I4ff5ef1202bba2384c71634ec5ba12db1b784607
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78808
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2023-11-13 14:20:30 +00:00
..
intel security/intel/stm: Remove check that can never be true 2023-10-27 17:20:09 +00:00
lockdown security/intel: Add option to enable SMM flash access only 2021-06-21 08:11:11 +00:00
memory commonlib,console,nb,sb,security: Add SPDX licenses to Makefiles 2023-08-14 15:14:45 +00:00
tpm security/tpm/: turn tis_{init,open} into tis_probe 2023-11-13 14:17:38 +00:00
vboot security/vboot: Die if vb2api_reinit() failed 2023-11-13 14:20:30 +00:00
Kconfig cbfs: Add verification for RO CBFS metadata hash 2020-12-03 00:11:08 +00:00
Makefile.inc commonlib,console,nb,sb,security: Add SPDX licenses to Makefiles 2023-08-14 15:14:45 +00:00