Skip to content

Commit

Permalink
tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid
Browse files Browse the repository at this point in the history
Make sure that the new locality passed to tpm_tis_prep_abort()
is valid.

Add a comment to aborting_locty that it may be any locality, including
TPM_TIS_NO_LOCALITY.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit e92b63e)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
stefanberger authored and mdroth committed Mar 28, 2019
1 parent 00d0932 commit 27b0c09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hw/tpm/tpm_tis.c
Expand Up @@ -263,7 +263,9 @@ static void tpm_tis_prep_abort(TPMState *s, uint8_t locty, uint8_t newlocty)
{
uint8_t busy_locty;

s->aborting_locty = locty;
assert(TPM_TIS_IS_VALID_LOCTY(newlocty));

s->aborting_locty = locty; /* may also be TPM_TIS_NO_LOCALITY */
s->next_locty = newlocty; /* locality after successful abort */

/*
Expand Down

0 comments on commit 27b0c09

Please sign in to comment.