summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@google.com>2022-08-08 11:12:38 -0400
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-17 14:30:49 +0000
commit73bc2a9a0af97915b351a1ced0d6d16a0c369559 (patch)
tree1f9bbc35ba6a698a46c2c330734e869cc08251da /Makefile
parentba30719672b5cbd5510e5dcf98937dbe387838f9 (diff)
downloadvboot-73bc2a9a0af97915b351a1ced0d6d16a0c369559.tar.gz
2misc: Abort before using GBB if gbb_offset is not initialized
In vb2_get_gbb, abort if gbb_offset is zero. This ensures that functions like vb2api_gbb_get_flags won't try to read garbage GBB data if the context hasn't been properly initialized. Some additional changes made to fix tests: 1. In vb2_set_boot_mode, don't access GBB unless needed. 2. In vb2api_get_dev_default_boot_target, use vb2api_gbb_get_flags instead of vb2_get_gbb to make it easier to mock. This is needed for depthcharge tests. 3. Make vb2api_get_debug_info tolerant of GBB not being set. This is needed for depthcharge tests. BUG=b:237093169 BRANCH=none TEST=make && make runtests Cq-Depend: chromium:3820402 Change-Id: I921d6cc4a5d91c8114c5e46748b4576a1e7716d0 Signed-off-by: Nicholas Bishop <nicholasbishop@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3817941 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index df906a2f..95d14239 100644
--- a/Makefile
+++ b/Makefile
@@ -738,6 +738,7 @@ TEST2X_NAMES = \
tests/vb2_crypto_tests \
tests/vb2_ec_sync_tests \
tests/vb2_firmware_tests \
+ tests/vb2_gbb_init_tests \
tests/vb2_gbb_tests \
tests/vb2_host_flashrom_tests \
tests/vb2_host_key_tests \
@@ -1294,6 +1295,7 @@ run2tests: install_for_test
${RUNTEST} ${BUILD_RUN}/tests/vb2_crypto_tests
${RUNTEST} ${BUILD_RUN}/tests/vb2_ec_sync_tests
${RUNTEST} ${BUILD_RUN}/tests/vb2_firmware_tests
+ ${RUNTEST} ${BUILD_RUN}/tests/vb2_gbb_init_tests
${RUNTEST} ${BUILD_RUN}/tests/vb2_gbb_tests
${RUNTEST} ${BUILD_RUN}/tests/vb2_host_key_tests
${RUNTEST} ${BUILD_RUN}/tests/vb2_load_kernel_tests