summaryrefslogtreecommitdiff
path: root/firmware/2lib/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2015-05-12 16:39:01 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-21 03:44:13 +0000
commit2d25e837ccc1c4f3123fedc056a396b3e6e3aa5f (patch)
tree54ce9bede8f2b3cc08e2304e3acb90d4d61972f0 /firmware/2lib/include
parentea71df260e9041dd5260425dae3d6f5412516b9b (diff)
downloadvboot-2d25e837ccc1c4f3123fedc056a396b3e6e3aa5f.tar.gz
vboot2: Add routine to verify kernel preamble
This also checks that the bootloader and vmlinuz headers, if present, are within the signed part of the kernel blob; the vboot1 routines didn't do that. That wasn't harmful at firmware boot time because the vboot1 routines would only load as much data as was signed, but in vboot2 loading the kernel data is the responsibility of the caller so we need to check. BUG=chromium:487699 BRANCH=none TEST=make -j runtests Change-Id: I73eb4831e5d3d7a642b6cb85cb55857d87fcc0af Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270797
Diffstat (limited to 'firmware/2lib/include')
-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 cd8cc270..671e3d27 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -341,6 +341,12 @@ enum vb2_return_code {
/* Hash is signed */
VB2_ERROR_PREAMBLE_HASH_SIGNED,
+ /* Bootloader outside signed portion of body */
+ VB2_ERROR_PREAMBLE_BOOTLOADER_OUTSIDE,
+
+ /* Vmlinuz header outside signed portion of body */
+ VB2_ERROR_PREAMBLE_VMLINUZ_HEADER_OUTSIDE,
+
/**********************************************************************
* Misc higher-level code errors
*/