tpm2-tools icon indicating copy to clipboard operation
tpm2-tools copied to clipboard

TPM 2.0 module disappears after trying to delete key in VirtualBox

Open TByte007 opened this issue 1 year ago • 4 comments

Debian 12.5 guest under Windows 10 host, VirtualBox 7.0.14

After executing tpm2_evictcontrol -C o -c 0x81000000 (trying to remove a key) the driver returns:

ERROR:tcti:src/tss2-tcti/tcti-device.c:198:tcti_device_receive() Failed to get response size fd 3, got errno 14: Bad address
ERROR:esys:src/tss2-esys/api/Esys_EvictControl.c:334:Esys_EvictControl_Finish() Received a non-TPM Error
ERROR:esys:src/tss2-esys/api/Esys_EvictControl.c:114:Esys_EvictControl() Esys Finish ErrorCode (0x000a000a)
ERROR: Esys_EvictControl(0xA000A) - tcti:IO failure

And after that I have to reboot to get the TPM module to respond to anything again. If I try any other command before rebooting I just get a timeout: ERROR:tcti:src/tss2-tcti/tcti-device.c:503:Tss2_Tcti_Device_Init() timeout waiting for response from fd 3

I receive few kernel messages with the last one going on every 10 sec:

[   54.861019] tpm tpm0: tpm2_save_context: failed with a TPM error 0x0101
[   54.862081] tpm tpm0: A TPM error (257) occurred flushing context
[   54.863673] tpm tpm0: A TPM error (257) occurred flushing context
[   54.863683] tpm tpm0: tpm2_commit_space: error -14
[   54.865291] tpm tpm0: A TPM error (257) occurred flushing context
[   64.528914] tpm tpm0: A TPM error (257) occurred attempting get random
[   74.758385] tpm tpm0: A TPM error (257) occurred attempting get random
[   85.003438] tpm tpm0: A TPM error (257) occurred attempting get random
[   95.256208] tpm tpm0: A TPM error (257) occurred attempting get random
...


Is this somehow a normal behavior or the virtual TPM module is crashing ?

Thanks.

TByte007 avatar Mar 20 '24 15:03 TByte007

hi i have the same problem, did i find where it comes from ?

khalibro avatar Apr 04 '24 11:04 khalibro

hi i have the same problem, did i find where it comes from ?

Not yet.

TByte007 avatar Apr 11 '24 13:04 TByte007

Sounds like a VirtualBox problem, rather than our problem. There is no command or anything that should allow a userspace program (such as tpm2-tools) to make the TPM disappear...

AndreasFuchsTPM avatar May 08 '24 12:05 AndreasFuchsTPM

I'm having the same problem on my NixOS server and just decided to turn it off altogether. I know that doesn't really solve the issue in your case, did you figure out a solution?

aidengage avatar Jun 17 '24 02:06 aidengage

tpm2_save_context: failed with a TPM error 0x0101

0x101 means TPM_RC_FAILURE, which occurs if the TPMs self tests fail. You should contact your TPM vendor, which in this case is VirtualBox first and foremost.

I'll close the report here now, because there is literally nothing we can help with.

AndreasFuchsTPM avatar Jul 25 '24 08:07 AndreasFuchsTPM