From ba50e4885fd68579ec76a149d28b0b9605381d7e Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Mon, 10 Jun 2019 17:37:37 +0800 Subject: vboot: recovery path should finalize work context Recovery path should finalize work context, and trim vboot_working_data buffer_size. Otherwise, depthcharge ingests the full 12 KB workbuf in recovery path. BUG=chromium:972528, b:134893812 TEST=Build with vboot_reference CL:1584488. Check that USB disks are properly verified in recovery path. BRANCH=none Change-Id: Icf2600d2eb5d846a26aec35a153946dd2f7f128c Signed-off-by: Joel Kitching Reviewed-on: https://review.coreboot.org/c/coreboot/+/33358 Tested-by: build bot (Jenkins) Reviewed-by: Hung-Te Lin Reviewed-by: Julius Werner --- src/security/vboot/vboot_logic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 626310010c..7b98be28e4 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -364,8 +364,7 @@ void verstage_main(void) printk(BIOS_INFO, "Recovery requested (%x)\n", rv); save_if_needed(&ctx); extend_pcrs(&ctx); /* ignore failures */ - timestamp_add_now(TS_END_VBOOT); - return; + goto verstage_main_exit; } printk(BIOS_INFO, "Reboot requested (%x)\n", rv); @@ -447,6 +446,8 @@ void verstage_main(void) printk(BIOS_INFO, "Slot %c is selected\n", is_slot_a(&ctx) ? 'A' : 'B'); vboot_set_selected_region(region_device_region(&fw_main)); + + verstage_main_exit: vboot_finalize_work_context(&ctx); timestamp_add_now(TS_END_VBOOT); } -- cgit v1.2.3