diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2012-04-25 01:02:31 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-04-24 23:38:31 -0700 |
commit | 916cf1e977f02f54dff6ab8f25c03a94c9657ef0 (patch) | |
tree | 5812b5c97b378a92daa543282c9b29664855ca54 | |
parent | fcec9e7c4b2b4a041c0a85b6d999c618ec595c57 (diff) | |
download | vboot-916cf1e977f02f54dff6ab8f25c03a94c9657ef0.tar.gz |
Omit body load address check
Omit this check because this check is not really necessary and it is
dealing more harms than goods to ARM boards.
While body load address is configurable, it is not quite possible to fix
all the build scripts and runtime scripts to carry this address; so in
reality all scripts use the default body load address.
The problem is, this default address is not friendly to ARM boards, and
it virtually makes this check fails on ARM boards.
BUG=chromium-os:28077
TEST=emerge-{daisy,x86-alex} vboot_reference
TEST=load_kernel_test -b 1 chromiumos_image.bin
TEST=run verified boot on Daisy
Change-Id: I1a1cc0aedf254e2a2b680046812ab7154f26dea7
Reviewed-on: https://gerrit.chromium.org/gerrit/20947
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
-rw-r--r-- | firmware/include/load_kernel_fw.h | 3 | ||||
-rw-r--r-- | firmware/include/vboot_struct.h | 2 | ||||
-rw-r--r-- | firmware/lib/vboot_kernel.c | 8 | ||||
-rw-r--r-- | utility/load_kernel_test.c | 4 |
4 files changed, 4 insertions, 13 deletions
diff --git a/firmware/include/load_kernel_fw.h b/firmware/include/load_kernel_fw.h index 406691ff..0040e56d 100644 --- a/firmware/include/load_kernel_fw.h +++ b/firmware/include/load_kernel_fw.h @@ -20,7 +20,8 @@ #define BOOT_FLAG_DEVELOPER UINT64_C(0x01) /* In recovery mode */ #define BOOT_FLAG_RECOVERY UINT64_C(0x02) -/* Skip check of kernel buffer address */ +/* Skip check of kernel buffer address. Since body load address check is + * omitted; this flag is deprecated and not used anywhere in the codebase. */ #define BOOT_FLAG_SKIP_ADDR_CHECK UINT64_C(0x04) typedef struct LoadKernelParams { diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h index 3374d4cc..48a4f6b1 100644 --- a/firmware/include/vboot_struct.h +++ b/firmware/include/vboot_struct.h @@ -232,6 +232,8 @@ typedef struct VbKernelPreambleHeader { #define VBSD_LKP_CHECK_VERIFY_PREAMBLE 9 #define VBSD_LKP_CHECK_KERNEL_ROLLBACK 10 #define VBSD_LKP_CHECK_PREAMBLE_VALID 11 +/* Body load address check is omitted; this result code is deprecated and not + * used anywhere in the codebase. */ #define VBSD_LKP_CHECK_BODY_ADDRESS 12 #define VBSD_LKP_CHECK_BODY_OFFSET 13 #define VBSD_LKP_CHECK_SELF_SIGNED 14 diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 8a138242..9573e6ec 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -401,14 +401,6 @@ VbError_t LoadKernel(LoadKernelParams* params) { if (-1 != good_partition) continue; - /* Verify body load address matches what we expect */ - if ((preamble->body_load_address != (size_t)params->kernel_buffer) && - !(params->boot_flags & BOOT_FLAG_SKIP_ADDR_CHECK)) { - VBDEBUG(("Wrong body load address.\n")); - shpart->check_result = VBSD_LKP_CHECK_BODY_ADDRESS; - goto bad_kernel; - } - /* Verify kernel body starts at a multiple of the sector size. */ body_offset = key_block->key_block_size + preamble->preamble_size; if (0 != body_offset % blba) { diff --git a/utility/load_kernel_test.c b/utility/load_kernel_test.c index c36c3357..f5585c38 100644 --- a/utility/load_kernel_test.c +++ b/utility/load_kernel_test.c @@ -190,10 +190,6 @@ int main(int argc, char* argv[]) { /* Free the key blob, now that we're done with it */ free(key_blob); - /* Needs to skip the address check, since we're putting it somewhere on the - * heap instead of its actual target address in the firmware. */ - lkp.boot_flags |= BOOT_FLAG_SKIP_ADDR_CHECK; - printf("bootflags = %" PRIu64 "\n", lkp.boot_flags); /* Get image size */ |