summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2023-03-09 14:13:32 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-29 08:19:55 +0000
commita335a46a56c0400eb9828a6850fcd68da20373fb (patch)
tree92941c7138d27c1a502aae7f5f6dfd1494e3e7b5
parent261046a8ef60db39e1b8939857eeb48ffc761cb8 (diff)
downloadvboot-a335a46a56c0400eb9828a6850fcd68da20373fb.tar.gz
tpm2_lite: Treat NV_UNINITIALIZED error as BADINDEX for TPM 2.0
This patch ports the equivalent of CB:20299 to the vboot version of the TPM library. This should fix a problem that was observed where a created but not written FWMP space gets a device stuck in recovery mode. BRANCH=none BUG=b:272310645 TEST=none Change-Id: If0ef6fdda879b45de0444cdaeb423d01ce109e2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4327074 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4381009 Auto-Submit: Phoebe Wang <phoebewang@chromium.org> Tested-by: Phoebe Wang <phoebewang@chromium.org> Reviewed-by: Cheng Yueh <cyueh@chromium.org> Commit-Queue: Cheng Yueh <cyueh@chromium.org>
-rw-r--r--firmware/lib/tpm2_lite/tlcl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/lib/tpm2_lite/tlcl.c b/firmware/lib/tpm2_lite/tlcl.c
index e81eb509..954717fe 100644
--- a/firmware/lib/tpm2_lite/tlcl.c
+++ b/firmware/lib/tpm2_lite/tlcl.c
@@ -525,6 +525,11 @@ uint32_t TlclRead(uint32_t index, void* data, uint32_t length)
case TPM_SUCCESS:
break;
+ /*
+ * 0x14a = RC_NV_UNINITIALIZED (space created but not written)
+ * 0x28b = RC_HANDLE(2) ("unknown handle" = space does not exist)
+ */
+ case 0x14a:
case 0x28b:
return TPM_E_BADINDEX;