aboutsummaryrefslogtreecommitdiff
path: root/module-common.c
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2024-10-16 13:51:29 -0400
committerStefan Berger <stefanb@linux.ibm.com>2024-10-18 07:55:08 -0400
commitd2bcaacc17c4427bdb2d959cd91a42425fcca3c9 (patch)
tree57d99aae28bb19059cceb50d4fb65898c4627697 /module-common.c
parent312c5404011f6a80d1467a19abd916fd203dd7d4 (diff)
downloadqemu-d2bcaacc17c4427bdb2d959cd91a42425fcca3c9.zip
qemu-d2bcaacc17c4427bdb2d959cd91a42425fcca3c9.tar.gz
qemu-d2bcaacc17c4427bdb2d959cd91a42425fcca3c9.tar.bz2
tpm_emulator: Read control channel response in 2 passes
Error responses from swtpm are typically only 4 bytes long with the exception of a few commands that return more bytes. Therefore, read the entire response in 2 steps and stop if the first few bytes indicate an error response with no subsequent bytes readable. Read the rest in a 2nd step, if needed. This avoids getting stuck while waiting for too many bytes in case of an error. The 'getting stuck' condition has not been observed in practice so far, though. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2615 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Diffstat (limited to 'module-common.c')
0 files changed, 0 insertions, 0 deletions