From c324fbfb6d37aa62b0e6e2f22dae7c949896ddef Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 4 Mar 2011 12:19:25 -0800 Subject: [PATCH] Only advance kernel version when the booted partition has a valid key block Change-Id: I879c18cc139f8a02bcaa6eb80437eaf836a5e851 BUG=chrome-os-partner:2597 TEST=manual install pvt-signed image flip dev switch on and boot install dev-signed firmware reboot reboot sudo bash stop tcsd tpmc read 0x1008 0x0d bytes 6-10 should be 1 0 1 0, not FF FF FF FF Review URL: http://codereview.chromium.org/6626020 --- firmware/include/bmpblk_header.h | 2 +- firmware/include/load_firmware_fw.h | 2 +- firmware/include/load_kernel_fw.h | 2 +- firmware/include/tlcl_stub.h | 2 +- firmware/include/tss_constants.h | 2 +- firmware/include/vboot_struct.h | 2 +- firmware/lib/cgptlib/cgptlib.c | 2 +- firmware/lib/cgptlib/include/cgptlib_internal.h | 2 +- firmware/lib/cgptlib/include/gpt.h | 2 +- firmware/lib/rollback_index.c | 2 +- firmware/lib/tpm_lite/tlcl.c | 2 +- firmware/lib/vboot_firmware.c | 2 +- firmware/lib/vboot_kernel.c | 4 ++-- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/firmware/include/bmpblk_header.h b/firmware/include/bmpblk_header.h index 0c609dd2bb..ad697b7aab 100644 --- a/firmware/include/bmpblk_header.h +++ b/firmware/include/bmpblk_header.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/include/load_firmware_fw.h b/firmware/include/load_firmware_fw.h index 2a895e0bcc..271063d7de 100644 --- a/firmware/include/load_firmware_fw.h +++ b/firmware/include/load_firmware_fw.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/include/load_kernel_fw.h b/firmware/include/load_kernel_fw.h index 191ebe2a22..45d18e2c35 100644 --- a/firmware/include/load_kernel_fw.h +++ b/firmware/include/load_kernel_fw.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/include/tlcl_stub.h b/firmware/include/tlcl_stub.h index b9a1f9abdb..ea7d96a317 100644 --- a/firmware/include/tlcl_stub.h +++ b/firmware/include/tlcl_stub.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/firmware/include/tss_constants.h b/firmware/include/tss_constants.h index b35f7613bf..42de46f35f 100644 --- a/firmware/include/tss_constants.h +++ b/firmware/include/tss_constants.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h index 975d6f6de8..ed83f3e7e5 100644 --- a/firmware/include/vboot_struct.h +++ b/firmware/include/vboot_struct.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c index 6590e80b25..e1da7f441c 100644 --- a/firmware/lib/cgptlib/cgptlib.c +++ b/firmware/lib/cgptlib/cgptlib.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h index ccd719c98f..a4e7d9bd61 100644 --- a/firmware/lib/cgptlib/include/cgptlib_internal.h +++ b/firmware/lib/cgptlib/include/cgptlib_internal.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/firmware/lib/cgptlib/include/gpt.h b/firmware/lib/cgptlib/include/gpt.h index b13b221099..14a79852ea 100644 --- a/firmware/lib/cgptlib/include/gpt.h +++ b/firmware/lib/cgptlib/include/gpt.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c index efbc87be88..0d9dc8c757 100644 --- a/firmware/lib/rollback_index.c +++ b/firmware/lib/rollback_index.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c index 99cc165afd..12742d8eb3 100644 --- a/firmware/lib/tpm_lite/tlcl.c +++ b/firmware/lib/tpm_lite/tlcl.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c index 036441fb7f..bbae095287 100644 --- a/firmware/lib/vboot_firmware.c +++ b/firmware/lib/vboot_firmware.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 87ed8747ce..ea39f7b1bf 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -457,7 +457,7 @@ int LoadKernel(LoadKernelParams* params) { VBDEBUG(("Good_partition >= 0\n")); /* See if we need to update the TPM */ - if (kBootRecovery != boot_mode) { + if (kBootRecovery != boot_mode && good_partition_key_block_valid) { /* We only update the TPM in normal and developer boot modes. In * developer mode, we only advanced lowest_version for kernels with valid * key blocks, and didn't count self-signed key blocks. In recovery