From: Stefan Berger <stefanb@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: armenon@redhat.com, marcandre.lureau@gmail.com,
Stefan Berger <stefanb@linux.ibm.com>
Subject: [PATCH v3 00/10] Fix a couple of issues in TPM related code
Date: Fri, 2 Oct 2026 10:25:06 -0400 [thread overview]
Message-ID: <20261002142516.2063735-1-stefanb@linux.ibm.com> (raw)
This series of patches fixes various issues in TPM-related code, such as
memory leaks, potential integer underflows, clearing of buffers while they
are in use, and the proper handling of sizes of commands or responses.
Regards,
Stefan
v3:
- 6/10: Remove call to clearing of buffers
v2:
- Address issues pointed out by Marc-André
Stefan Berger (10):
tpm_util: Pass TPMVersion to function writing fatal error response
tpm_emulator: Reject TPM responses whose size is too small
tpm_emulator: Reject sending commands smaller than the request header
hw/tpm: tis: Only read from response buffer if rw_offset < len
hw/tpm: tis: Use uint32_t for len to avoid truncating size of command
hw/tpm: crb: Do not clear internal buffers when backend is busy
hw/tpm: crb: Avoid potential integer underflow
hw/tpm: crb: Implement tpm_ppi_uninit and use it in tpm_crb_unrealize
hw/tpm: crb: Consider response_buffer->len of received response
tests: Add tests with commands with bad length
backends/tpm/tpm_emulator.c | 12 ++++--
backends/tpm/tpm_passthrough.c | 2 +-
backends/tpm/tpm_util.c | 17 ++++++--
hw/tpm/tpm_crb.c | 21 +++++++---
hw/tpm/tpm_ppi.c | 10 +++++
hw/tpm/tpm_ppi.h | 10 +++++
hw/tpm/tpm_tis_common.c | 8 ++--
include/system/tpm_util.h | 3 +-
tests/qtest/tpm-crb-swtpm-test.c | 10 +++++
tests/qtest/tpm-tests.c | 56 +++++++++++++++++++++++++
tests/qtest/tpm-tests.h | 8 ++++
tests/qtest/tpm-tis-device-swtpm-test.c | 10 +++++
tests/qtest/tpm-tis-swtpm-test.c | 10 +++++
tests/qtest/tpm-util.c | 55 ++++++++++++++++++++++++
tests/qtest/tpm-util.h | 3 ++
15 files changed, 219 insertions(+), 16 deletions(-)
--
2.55.0
next reply other threads:[~2026-10-02 14:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 14:25 Stefan Berger [this message]
2026-10-02 14:25 ` [PATCH v3 01/10] tpm_util: Pass TPMVersion to function writing fatal error response Stefan Berger
2026-10-04 17:19 ` Arun Menon
2026-10-02 14:25 ` [PATCH v3 02/10] tpm_emulator: Reject TPM responses whose size is too small Stefan Berger
2026-10-02 14:25 ` [PATCH v3 03/10] tpm_emulator: Reject sending commands smaller than the request header Stefan Berger
2026-10-02 14:25 ` [PATCH v3 04/10] hw/tpm: tis: Only read from response buffer if rw_offset < len Stefan Berger
2026-10-02 14:25 ` [PATCH v3 05/10] hw/tpm: tis: Use uint32_t for len to avoid truncating size of command Stefan Berger
2026-10-02 14:25 ` [PATCH v3 06/10] hw/tpm: crb: Do not clear internal buffers when backend is busy Stefan Berger
2026-10-04 16:36 ` Arun Menon
2026-10-02 14:25 ` [PATCH v3 07/10] hw/tpm: crb: Avoid potential integer underflow Stefan Berger
2026-10-02 14:25 ` [PATCH v3 08/10] hw/tpm: crb: Implement tpm_ppi_uninit and use it in tpm_crb_unrealize Stefan Berger
2026-10-04 17:32 ` Arun Menon
2026-10-02 14:25 ` [PATCH v3 09/10] hw/tpm: crb: Consider response_buffer->len of received response Stefan Berger
2026-10-02 14:25 ` [PATCH v3 10/10] tests: Add tests with commands with bad length Stefan Berger
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=20261002142516.2063735-1-stefanb@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=armenon@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.