From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUCj4-0007MA-GE for qemu-devel@nongnu.org; Tue, 04 Dec 2018 10:35:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUCiz-0001Vf-Cn for qemu-devel@nongnu.org; Tue, 04 Dec 2018 10:35:06 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3205 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUCiz-0001UV-3h for qemu-devel@nongnu.org; Tue, 04 Dec 2018 10:35:01 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB4FV0IG014586 for ; Tue, 4 Dec 2018 10:34:59 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2p5v9pr6yr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 04 Dec 2018 10:34:59 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Dec 2018 15:34:57 -0000 From: Stefan Berger Date: Tue, 4 Dec 2018 10:34:47 -0500 In-Reply-To: <20181204153447.2462189-1-stefanb@linux.vnet.ibm.com> References: <20181204153447.2462189-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <20181204153447.2462189-4-stefanb@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 3/3] tpm: Make sure the locality received from backend is valid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Stefan Berger , Stefan Berger Make sure that the locality passed from the backend to tpm_tis_request_completed() is valid. Signed-off-by: Stefan Berger Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/tpm/tpm_tis.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 04e4ad9212..2563d7501f 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -295,6 +295,8 @@ static void tpm_tis_request_completed(TPMIf *ti, int = ret) uint8_t locty =3D s->cmd.locty; uint8_t l; =20 + assert(TPM_TIS_IS_VALID_LOCTY(locty)); + if (s->cmd.selftest_done) { for (l =3D 0; l < TPM_TIS_NUM_LOCALITIES; l++) { s->loc[l].sts |=3D TPM_TIS_STS_SELFTEST_DONE; --=20 2.17.1