From: Liam Merwick Date: Fri, 15 Feb 2019 13:35:17 +0000 (+0000) Subject: tpm_tis: fix loop that cancels any seizure by a lower locality X-Git-Tag: qemu-xen-4.12.1^2~16 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7b8e8ff0092f90c8ad64934d5bcc01578ccee19c;p=qemu-xen.git tpm_tis: fix loop that cancels any seizure by a lower locality In tpm_tis_mmio_write() if the requesting locality is seizing access, any seizure by a lower locality is cancelled. However the loop doing the seizure had an off-by-one error and the locality immediately preceding the requesting locality was not being cleared. This is fixed by adjusting the test in the for loop to check the localities up to the requesting locality. Signed-off-by: Liam Merwick Reviewed-by: Stefan Berger Signed-off-by: Stefan Berger (cherry picked from commit 37b55d67c0f001b20b7831db3f9f24f1d453e1de) Signed-off-by: Michael Roth --- diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 1554026788..fb08b483bc 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -620,7 +620,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr, } /* cancel any seize by a lower locality */ - for (l = 0; l < locty - 1; l++) { + for (l = 0; l < locty; l++) { s->loc[l].access &= ~TPM_TIS_ACCESS_SEIZE; }