tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size
commit683c4b775355cc7acd301e8efe7d4c1c9acdafd8
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Mon, 6 Nov 2017 00:31:43 +0000 (5 19:31 -0500)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 15 Dec 2017 04:39:15 +0000 (14 23:39 -0500)
tree8929b2430d666dba389dbdb1d9e11ebdfa9b431b
parent9375c44fdfc07c0fef3052a3f25a13197a528902
tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size

If the requested buffer size of the frontend is smaller than the fixed
buffer size of the host's TPM, fail the startup_tpm() interface function,
which will make the device unusable. We fail it because the backend TPM
could produce larger packets than what the frontend could pass to the OS.

The current combination of TIS frontend and either passthrough or emulator
backend will not lead to this case since the TIS can support any size of
buffer.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
hw/tpm/tpm_passthrough.c