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-15 12:16:04 +0000
commit9082d13a642049aae3002850296b5fc53d6b687f (patch)
tree92941c7138d27c1a502aae7f5f6dfd1494e3e7b5
parenta7545e09ba991d563bd59aa6daa235ff414e9b5a (diff)
downloadvboot-9082d13a642049aae3002850296b5fc53d6b687f.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 Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: If0ef6fdda879b45de0444cdaeb423d01ce109e2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4327074 Reviewed-by: Andrey Pronin <apronin@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;