From a87ab39817ce15ad88243ae3be830016a0f7d714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 11 Apr 2023 16:01:14 +0200 Subject: security/vboot: Add Kconfig option to clear recovery request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For ChromeOS platform the recovery reason is cleared in vb2api_kernel_phase2 which is probably not called by any non-ChromeOS system. It results in the platform being stuck in recovery mode, e.g. when RW firmware verification fails. Even if the RW partition is flashed with correctly signed image, the persistent non-zero recovery reason will prevent vboot from attempting the RW partition check. Use the newly exposed vb2api_clear_recovery and VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE Kconfig option to clear the recovery reason and save it immediately to the VBNV. The idea is to let non-ChromeOS coreboot platform to clear the recovery reason when needed. TEST=Clear the recovery reason in mainboard_final function right before payload jump when RW partition is corrupted and RW partition is valid. In case it is corrupted, the platform stays in recovery mode, when valid the platform boots from RW partition. Tested on MSI PRO Z690-A DDR4. Signed-off-by: Michał Żygowski Change-Id: I7ffaf3e8f61a28a68c9802c184961b1b9bf9d617 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74343 Reviewed-by: Julius Werner Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/security/vboot/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/security/vboot/Kconfig') diff --git a/src/security/vboot/Kconfig b/src/security/vboot/Kconfig index 2d5b20f50d..9d90d1ee92 100644 --- a/src/security/vboot/Kconfig +++ b/src/security/vboot/Kconfig @@ -256,6 +256,15 @@ config CBFS_MCACHE_RW_PERCENTAGE will automatically be 0 (meaning the whole MCACHE is used for RO). Do NOT change this value for vboot RW updates! +config VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE + bool "Clear the recovery request at the end of ramstage" + default n + help + If this option is enabled, the recovery request will be cleared and + saved to VBNV storage at the end of ramstage. This is useful for + platforms without vboot-integrated payloads, to avoid being stuck in + the recovery mode. + config VBOOT_ENABLE_CBFS_FALLBACK bool default n -- cgit v1.2.3