summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2011-03-15 16:29:06 -0700
committerStefan Reinauer <reinauer@chromium.org>2011-03-15 16:29:06 -0700
commitf92c2311ecfc01d70a1bee93adbecd4cf63e165d (patch)
tree92c31383be8353bfddcab6222750a3959609dd3f
parent4a16d08b03181c749e3bd64e2eb3caa036a54474 (diff)
downloadvboot-f92c2311ecfc01d70a1bee93adbecd4cf63e165d.tar.gz
only update tpm if version if not default value
Change-Id: I697de80aa2f0454164cd3651e5a53d06e60a837e BUG=2782 TEST=boot tested Review URL: http://codereview.chromium.org/6677067 (cherry picked from commit 55db6a67176a4933427d2ee556180f6e814f60d9) Review URL: http://codereview.chromium.org/6673067
-rw-r--r--firmware/lib/vboot_kernel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index ee2890cf..3d082679 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -18,6 +18,7 @@
#include "vboot_common.h"
#define KBUF_SIZE 65536 /* Bytes to read at start of kernel partition */
+#define LOWEST_TPM_VERSION 0xffffffff
typedef enum BootMode {
kBootNormal, /* Normal firmware */
@@ -132,7 +133,7 @@ int LoadKernel(LoadKernelParams* params) {
int good_partition = -1;
int good_partition_key_block_valid = 0;
uint32_t tpm_version = 0;
- uint64_t lowest_version = 0xFFFFFFFF;
+ uint64_t lowest_version = LOWEST_TPM_VERSION;
int rec_switch, dev_switch;
BootMode boot_mode;
uint32_t status;
@@ -356,6 +357,10 @@ int LoadKernel(LoadKernelParams* params) {
/* Check for lowest version from a valid header. */
if (key_block_valid && lowest_version > combined_version)
lowest_version = combined_version;
+ else {
+ VBDEBUG(("Key block valid: %d\n", key_block_valid));
+ VBDEBUG(("Combined version: %" PRIu64 "\n", combined_version));
+ }
/* If we already have a good kernel, no need to read another
* one; we only needed to look at the versions to check for
@@ -482,7 +487,9 @@ int LoadKernel(LoadKernelParams* params) {
* mode, the TPM stays PP-unlocked, so anything we write gets blown away
* by the firmware when we go back to normal mode. */
VBDEBUG(("Boot_flags = not recovery\n"));
- if (lowest_version > tpm_version) {
+
+ if ((lowest_version > tpm_version) &&
+ (lowest_version != LOWEST_TPM_VERSION)) {
status = RollbackKernelWrite((uint32_t)lowest_version);
if (0 != status) {
VBDEBUG(("Error writing kernel versions to TPM.\n"));