From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Stefan Berger <stefanb@linux.ibm.com>
Subject: [Qemu-devel] [PULL v2 3/3] tpm: Make sure the locality received from backend is valid
Date: Tue, 11 Dec 2018 15:56:54 -0500 [thread overview]
Message-ID: <20181211205654.3550341-4-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20181211205654.3550341-1-stefanb@linux.vnet.ibm.com>
Make sure that the locality passed from the backend to
tpm_tis_request_completed() is valid.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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 = 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;
--
2.17.1
next prev parent reply other threads:[~2018-12-11 20:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 20:56 [Qemu-devel] [PULL v2 0/3] Merge tpm 2018/12/04 v1 Stefan Berger
2018-12-11 20:56 ` [Qemu-devel] [PULL v2 1/3] tpm: Remove unused locty parameter from tpm_tis_abort() Stefan Berger
2018-12-11 20:56 ` [Qemu-devel] [PULL v2 2/3] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid Stefan Berger
2018-12-11 20:56 ` Stefan Berger [this message]
2018-12-13 11:33 ` [Qemu-devel] [PULL v2 0/3] Merge tpm 2018/12/04 v1 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181211205654.3550341-4-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).