qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] tpm: Resolve potential blocking forever issue
@ 2024-10-11 22:35 Stefan Berger
  2024-10-11 22:35 ` [PATCH 1/2] tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY Stefan Berger
  2024-10-11 22:35 ` [PATCH 2/2] tpm_emulator: Read control channel response in 2 passes Stefan Berger
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Berger @ 2024-10-11 22:35 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 only return 4 bytes. However, some of the commands expect a response
with more bytes and QEMU would get stuck in qemu_chr_fe_read_all() waiting
for bytes following the error code. Therefore, read the response in 2
passes stopping if an error code is received in the first 4 bytes to avoid
getting stuck.

   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 | 39 +++++++++++++++++++++++++++++--------
 backends/tpm/tpm_ioctl.h    | 13 ++++++++++++-
 backends/tpm/trace-events   |  2 +-
 3 files changed, 44 insertions(+), 10 deletions(-)

-- 
2.46.2



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

end of thread, other threads:[~2024-10-14 13:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 22:35 [PATCH 0/2] tpm: Resolve potential blocking forever issue Stefan Berger
2024-10-11 22:35 ` [PATCH 1/2] tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY Stefan Berger
2024-10-11 22:35 ` [PATCH 2/2] tpm_emulator: Read control channel response in 2 passes Stefan Berger
2024-10-14 13:27   ` Stefan Berger

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