Attention is currently required from: Christian Walter. Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59134 )
Change subject: security/tpm/tcg-2.0: Handle TPM_RC_NV_RANGE return code ......................................................................
security/tpm/tcg-2.0: Handle TPM_RC_NV_RANGE return code
As per the TPM spec, if offset and the size field of data add to a value that is greater than the dataSize field of the NV Index referenced by nvIndex, the TPM shall return an error (TPM_RC_NV_RANGE). When TPM returns this error, no data is read from the concerned NV Index. Handle the error and map it to an appropriate vboot error.
BUG=None TEST=Build and boot to OS in Guybrush.
Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com Change-Id: I8b403e2f33cc1368065cc21f73df1102695f73eb --- M src/security/tpm/tss/tcg-2.0/tss.c M src/security/tpm/tss/tcg-2.0/tss_structures.h 2 files changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/59134/1
diff --git a/src/security/tpm/tss/tcg-2.0/tss.c b/src/security/tpm/tss/tcg-2.0/tss.c index cfa533b..8404d25 100644 --- a/src/security/tpm/tss/tcg-2.0/tss.c +++ b/src/security/tpm/tss/tcg-2.0/tss.c @@ -242,6 +242,9 @@ case TPM_RC_CR50_NV_UNDEFINED: return TPM_E_BADINDEX;
+ case TPM_RC_NV_RANGE: + return TPM_E_READ_EMPTY; + default: return TPM_E_READ_FAILURE; } diff --git a/src/security/tpm/tss/tcg-2.0/tss_structures.h b/src/security/tpm/tss/tcg-2.0/tss_structures.h index cb8b4f9..c0e354d 100644 --- a/src/security/tpm/tss/tcg-2.0/tss_structures.h +++ b/src/security/tpm/tss/tcg-2.0/tss_structures.h @@ -144,6 +144,7 @@ /* Values copied from tpm2/tpm_types.h */ #define RC_VER1 0x100 #define TPM_RC_INITIALIZE ((TPM_RC)(RC_VER1 + 0x000)) +#define TPM_RC_NV_RANGE ((TPM_RC)(RC_VER1 + 0x046)) #define TPM_RC_NV_UNINITIALIZED ((TPM_RC)(RC_VER1 + 0x04A))
/*