[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] tpm: Make sure new locality passed to tpm_tis_p
From: |
Stefan Berger |
Subject: |
[Qemu-devel] [PATCH 3/4] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid |
Date: |
Mon, 21 Jan 2019 12:07:30 -0500 |
From: Stefan Berger <address@hidden>
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 <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
hw/tpm/tpm_tis.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index d9322692ee..9a795ce96c 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -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 */
/*
--
2.17.2
- [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 4/4] tpm: Make sure the locality received from backend is valid, Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 3/4] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid,
Stefan Berger <=
- [Qemu-devel] [PATCH 2/4] tpm: use loop iterator to set sts data field, Stefan Berger, 2019/01/21
- [Qemu-devel] [PATCH 1/4] tpm: Zero-init structure to avoid uninitialized variables in valgrind log, Stefan Berger, 2019/01/21
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31
- Re: [Qemu-devel] [PATCH 0/4] TPM patches for stable-3.0.0 (v3.0.1), no-reply, 2019/01/31