qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] tpm: Resolve potential blocking-forever issue
@ 2024-10-16 17:51 Stefan Berger
  2024-10-16 17:51 ` [PATCH v4 1/2] tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY Stefan Berger
  2024-10-16 17:51 ` [PATCH v4 2/2] tpm_emulator: Read control channel response in 2 passes Stefan Berger
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Berger @ 2024-10-16 17:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, marcandre.lureau, Stefan Berger

In case swtpm was to return a control channel message with an error code it
would often return less bytes than the full response. In some cases the
current reading of the returned bytes would get stuck since more bytes are
expected. Therefore, pass a separate parameter indicating how many bytes to
expect in case of an error and read that many bytes in a first step. Check
for an error code in the first 4 bytes and return if there is an error.
Read the rest in a 2nd step, if needed.

   Stefan


Stefan Berger (2):
  tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY
  tpm_emulator: Read control channel response in 2 passes

 backends/tpm/tpm_emulator.c | 73 ++++++++++++++++++++++++++-----------
 backends/tpm/tpm_ioctl.h    | 13 ++++++-
 backends/tpm/trace-events   |  2 +-
 3 files changed, 65 insertions(+), 23 deletions(-)

-- 
2.47.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-17  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16 17:51 [PATCH v4 0/2] tpm: Resolve potential blocking-forever issue Stefan Berger
2024-10-16 17:51 ` [PATCH v4 1/2] tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY Stefan Berger
2024-10-17  9:48   ` Daniel P. Berrangé
2024-10-16 17:51 ` [PATCH v4 2/2] tpm_emulator: Read control channel response in 2 passes Stefan Berger
2024-10-17  9:50   ` Daniel P. Berrangé

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).