Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: firmware/lib/rollback_index.c

Issue 3847005: Leave bGlobalLock unlocked in normal recovery mode. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Just call SetupTPM() Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 * 4 *
5 * Functions for querying, manipulating and locking rollback indices 5 * Functions for querying, manipulating and locking rollback indices
6 * stored in the TPM NVRAM. 6 * stored in the TPM NVRAM.
7 */ 7 */
8 8
9 #include "rollback_index.h" 9 #include "rollback_index.h"
10 10
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 rsf.fw_versions = version; 373 rsf.fw_versions = version;
374 return WriteSpaceFirmware(&rsf); 374 return WriteSpaceFirmware(&rsf);
375 } 375 }
376 376
377 uint32_t RollbackFirmwareLock(void) { 377 uint32_t RollbackFirmwareLock(void) {
378 return TlclSetGlobalLock(); 378 return TlclSetGlobalLock();
379 } 379 }
380 380
381 uint32_t RollbackKernelRecovery(int developer_mode) { 381 uint32_t RollbackKernelRecovery(int developer_mode) {
382 RollbackSpaceFirmware rsf; 382 RollbackSpaceFirmware rsf;
383 uint32_t result = SetupTPM(1, developer_mode, &rsf); 383
384 /* In recovery mode we ignore TPM malfunctions or corruptions, and leave the 384 /* In recovery mode we ignore TPM malfunctions or corruptions, and *
385 * TPM completely unlocked if and only if the dev mode switch is ON. The 385 * leave the TPM complelely unlocked; we call neither
386 * recovery kernel will fix the TPM (if needed) and lock it ASAP. We leave 386 * TlclSetGlobalLock() nor TlclLockPhysicalPresence(). The recovery
387 * kernel will fix the TPM (if needed) and lock it ASAP. We leave
387 * Physical Presence on in either case. */ 388 * Physical Presence on in either case. */
388 if (!developer_mode) { 389 return SetupTPM(1, developer_mode, &rsf);
389 RETURN_ON_FAILURE(TlclSetGlobalLock());
390 }
391 /* We still return the result of SetupTPM even though we expect the caller to
392 * ignore it. It's useful in unit testing. */
393 return result;
394 } 390 }
395 391
396 uint32_t RollbackKernelRead(uint32_t* version) { 392 uint32_t RollbackKernelRead(uint32_t* version) {
397 if (g_rollback_recovery_mode) { 393 if (g_rollback_recovery_mode) {
398 *version = 0; 394 *version = 0;
399 } else { 395 } else {
400 RollbackSpaceKernel rsk; 396 RollbackSpaceKernel rsk;
401 uint32_t perms; 397 uint32_t perms;
402 398
403 /* Read the kernel space and verify its permissions. If the kernel 399 /* Read the kernel space and verify its permissions. If the kernel
(...skipping 28 matching lines...) Expand all
432 428
433 uint32_t RollbackKernelLock(void) { 429 uint32_t RollbackKernelLock(void) {
434 if (g_rollback_recovery_mode) { 430 if (g_rollback_recovery_mode) {
435 return TPM_SUCCESS; 431 return TPM_SUCCESS;
436 } else { 432 } else {
437 return TlclLockPhysicalPresence(); 433 return TlclLockPhysicalPresence();
438 } 434 }
439 } 435 }
440 436
441 #endif // DISABLE_ROLLBACK_TPM 437 #endif // DISABLE_ROLLBACK_TPM
OLDNEW
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698