Bill XIE has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
security/vboot: Boot to Recovery Mode if no RW slot present
Currently, even if there is no RW slot present, vboot will still try to find one to boot, result in an infinite boot loop.
This change explicitly allows a coreboot build with vboot but without RW slot to make use of vboot only for measured boot, by performing "Recovery mode" boot, with stages and payloads in the RO slot.
Change-Id: Ica98afd6aeb5328515df0c11e974cc9b3e8cdde1 Signed-off-by: Bill XIE persmule@hardenedlinux.org --- M src/security/vboot/vboot_logic.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/34977/1
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 7f00df5..48fd6db 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -347,7 +347,9 @@ "Initializing measured boot mode failed!"); }
- if (get_recovery_mode_switch()) { + /* Boot to Recovery Mode if no RW slot present */ + if (!CONFIG(VBOOT_SLOTS_RW_A) || + get_recovery_mode_switch()) { ctx.flags |= VB2_CONTEXT_FORCE_RECOVERY_MODE; if (CONFIG(VBOOT_DISABLE_DEV_ON_RECOVERY)) ctx.flags |= VB2_CONTEXT_DISABLE_DEVELOPER_MODE;
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Patch Set 1: Code-Review-1
I don't think you should do this. Running vboot when you not actually want to verify anything doesn't make any sense. We should rather try to decouple measured boot from verified boot and make them two fully independent options. It really doesn't have anything to do with vboot other than reusing crypto routines and relying on TPM initialization. We should change security/vboot/Makefile.inc so that the vboot library is still built and linked even if CONFIG_VBOOT is false (so you can use the crypto routines for other purposes), and we should tie the CRTM init to something other than vboot_logic_executed() (would probably do it in ramstage after init_tpm_dev() then... or if that's too late, maybe move that non-vboot TPM init into romstage somehow). There's no point in even having a verstage if you're never running verification.
On the other hand, if you *would* like to have verification but you just don't want to have more than one CBFS copy, we should implement a way to only have a single "RW" CBFS with no support for recovery mode or A/B updates, as discussed in CB:31662.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Duplicate of https://review.coreboot.org/c/coreboot/+/31662/
https://review.coreboot.org/c/coreboot/+/34977/1/src/security/vboot/vboot_lo... File src/security/vboot/vboot_logic.c:
https://review.coreboot.org/c/coreboot/+/34977/1/src/security/vboot/vboot_lo... PS1, Line 350: /* Boot to Recovery Mode if no RW slot present */ duplicate of https://review.coreboot.org/c/coreboot/+/31662/
Bill XIE has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Patch Set 1: Code-Review+2
Bill XIE has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Removed Code-Review+2 by Bill XIE persmule@hardenedlinux.org
Bill XIE has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Patch Set 1: Code-Review-1
Okay. I will retain this change a period of time, before I finish decoupling measured boot from verified boot.
Bill XIE has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34977 )
Change subject: security/vboot: Boot to Recovery Mode if no RW slot present ......................................................................
Abandoned
Replaced by CB:35077