tpm2-tss: tcti-device not working with swtpm-cuse (Updated by maintainer; see later posts)

Hey all,

I had upgraded the tpm2-tss package from 2.4.1 to 3.0.1 to use FAPI. Fapi_Initialize internally calls Esys_GetCapability but im facing issues while getting capabilities. I did some analysis on the code and enabled few debugs to narrow down the root cause. From the excerpt of the output given below… Few scenarios can be observed

  1. when Tss2_MU_TPMS_CAPABILITY_DATA_Unmarshal is called Tss2_MU_UINT32_Unmarshal is getting called. Not sure why this happens and I could only find the declaration of Tss2_MU_TPMS_CAPABILITY_DATA_Unmarshal in tss2_mu.h but couldnt find its definition.
  2. Though the Tss2_MU_UINT32_Unmarshal function returns success, when its returned in Tss2_Sys_GetCapability_Complete the value changes to 0x900b
  3. Additionally though the size of TPMS_CAPABILITY_DATA is 1032… since Tss2_MU_UINT32_Unmarshal is called, the size of the type there is 4 due to UINT32

Tpm2-tss - 3.0.1

./tools/tpm2_getcap handles-nv-index
…
…
ERROR:marshal:src/tss2-mu/base-types.c:172:Tss2_MU_UINT8_Unmarshal() size of type: 1 
ERROR:marshal:src/tss2-mu/base-types.c:172:Tss2_MU_UINT8_Unmarshal() offset non-NULL, initial value: 10 
ERROR:marshal:src/tss2-mu/base-types.c:172:Tss2_MU_UINT8_Unmarshal() Unmarshaling UINT8 from 0x5591dd669e70 to buffer 0x7ffd9ea9abbf at index 0xa 
ERROR:marshal:src/tss2-mu/base-types.c:172:Tss2_MU_UINT8_Unmarshal() offset parameter non-NULL, updated to 11 
ERROR:marshal:src/tss2-mu/base-types.c:172:Tss2_MU_UINT8_Unmarshal() Going to return success 0 
ERROR:pranav:src/tss2-sys/api/Tss2_Sys_GetCapability.c:79:Tss2_Sys_GetCapability_Complete() Tss2_MU_UINT8_Unmarshal success 0

ERROR:pranav:src/tss2-sys/api/Tss2_Sys_GetCapability.c:80:Tss2_Sys_GetCapability_Complete() cap size 1032
 
ERROR:marshal:src/tss2-mu/base-types.c:176:Tss2_MU_UINT32_Unmarshal() size of type: 4 
ERROR:marshal:src/tss2-mu/base-types.c:176:Tss2_MU_UINT32_Unmarshal() offset non-NULL, initial value: 11 
ERROR:marshal:src/tss2-mu/base-types.c:176:Tss2_MU_UINT32_Unmarshal() Unmarshaling UINT32 from 0x5591dd669e70 to buffer 0x5591dd679d30 at index 0xb 
ERROR:marshal:src/tss2-mu/base-types.c:176:Tss2_MU_UINT32_Unmarshal() offset parameter non-NULL, updated to 15 
ERROR:marshal:src/tss2-mu/base-types.c:176:Tss2_MU_UINT32_Unmarshal() Going to return success 0 
ERROR:pranav:src/tss2-sys/api/Tss2_Sys_GetCapability.c:85:Tss2_Sys_GetCapability_Complete() Tss2_MU_TPMS_CAPABILITY_DATA_Unmarshal returned 9000b
 
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:329:Esys_GetCapability_Finish() Received error from SAPI unmarshaling ErrorCode (0x0009000b) 
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:107:Esys_GetCapability() Esys Finish ErrorCode (0x0009000b) 
ERROR: Esys_GetCapability(0x9000B) - mu:A parameter has a bad value
ERROR: Unable to run ./tools/tpm2_getcap

Let me know if additional information is required.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (10 by maintainers)

Commits related to this issue

Most upvoted comments

swtpm-cuse is the right vtpm to use.

I would NOT use swtm-cuse anymore. I would do the following instead:

modprobe tpm_vtpm_proxy
swtpm chardev --vtpm-proxy --tpmstate dir=... --tpm2 ...