Merge tpm 2018/12/04 v1
-----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJcBpyAAAoJEHWtZYAqC0IRFugH/RxVUA48nJjOW2xVgxeSbBhn LrkkNPtRp24Nr1dBpmcNRiOyFS5xmkAL6G6KdkZ21To5m7UBx7Lr+X1InSK2ePHS jfTTuEA0w5yWHv95tNgJs0u6x2m58TKLiUoNWS5nAeOizgQ7k7s/Y6QEVdDrlHoO CCaUxvDtuU9sYEUO8ccYx72GlK+Ak3BSYyFsiCIC6bT2aYa+RA74vlovmKP0RB5w utjUuI3OOfS5MRAxBJ9OUiD55aufJQL7454wGb0tXWAurCnCAzTjNSCTD3psmEsg xAInKFUVxYvnx+qEeOMgnf2dKuaPCJyYud6gztmIikEmJPXyZWiP3lViWxCIPEQ= =9Br9 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-12-04-1' into staging Merge tpm 2018/12/04 v1 # gpg: Signature made Tue 04 Dec 2018 15:25:52 GMT # gpg: using RSA key 75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2018-12-04-1: tpm: Make sure the locality received from backend is valid tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid tpm: Remove unused locty parameter from tpm_tis_abort() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
41d8452d6b
|
@ -233,7 +233,7 @@ static void tpm_tis_new_active_locality(TPMState *s, uint8_t new_active_locty)
|
|||
}
|
||||
|
||||
/* abort -- this function switches the locality */
|
||||
static void tpm_tis_abort(TPMState *s, uint8_t locty)
|
||||
static void tpm_tis_abort(TPMState *s)
|
||||
{
|
||||
s->rw_offset = 0;
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
/*
|
||||
|
@ -281,7 +283,7 @@ static void tpm_tis_prep_abort(TPMState *s, uint8_t locty, uint8_t newlocty)
|
|||
}
|
||||
}
|
||||
|
||||
tpm_tis_abort(s, locty);
|
||||
tpm_tis_abort(s);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -293,6 +295,8 @@ static void tpm_tis_request_completed(TPMIf *ti, int ret)
|
|||
uint8_t locty = s->cmd.locty;
|
||||
uint8_t l;
|
||||
|
||||
assert(TPM_TIS_IS_VALID_LOCTY(locty));
|
||||
|
||||
if (s->cmd.selftest_done) {
|
||||
for (l = 0; l < TPM_TIS_NUM_LOCALITIES; l++) {
|
||||
s->loc[l].sts |= TPM_TIS_STS_SELFTEST_DONE;
|
||||
|
@ -311,7 +315,7 @@ static void tpm_tis_request_completed(TPMIf *ti, int ret)
|
|||
}
|
||||
|
||||
if (TPM_TIS_IS_VALID_LOCTY(s->next_locty)) {
|
||||
tpm_tis_abort(s, locty);
|
||||
tpm_tis_abort(s);
|
||||
}
|
||||
|
||||
tpm_tis_raise_irq(s, locty,
|
||||
|
|
Loading…
Reference in a new issue