summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2return_codes.h
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-01-11 19:16:18 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 02:06:22 -0700
commitdccea9ae88059c8cb7dff76d2682835184fc8338 (patch)
treeeeb9768deb8c25ea2158b6977a938a23388bb9cb /firmware/2lib/include/2return_codes.h
parent351c005eddd763ba89997ebc08ad0e19d2d1c3a0 (diff)
downloadvboot-dccea9ae88059c8cb7dff76d2682835184fc8338.tar.gz
vboot: add magic and version to vb2_shared_data
In order for vb2_shared_data to cross application boundaries, it needs magic and version fields. These can be initialized in vb2_init_context, which is called implicitly via vb2api_fw_phase1 and vb2api_fail. On re-init, check fields for validity. BUG=b:124141368, b:124192753 TEST=make clean && make runtests BRANCH=none Change-Id: I90005833836f13f60813bdf82f0e4dbb8d9afecd Reviewed-on: https://chromium-review.googlesource.com/1521406 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2return_codes.h')
-rw-r--r--firmware/2lib/include/2return_codes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 92e4eb1c..5992806d 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -497,6 +497,12 @@ enum vb2_return_code {
/* Expected and image hashes are different size in ec_sync_phase1() */
VB2_ERROR_EC_HASH_SIZE,
+ /* Incompatible version for vb2_shared_data structure being loaded */
+ VB2_ERROR_SHARED_DATA_VERSION,
+
+ /* Bad magic number in vb2_shared_data structure */
+ VB2_ERROR_SHARED_DATA_MAGIC,
+
/**********************************************************************
* API-level errors
*/