TPM 2.0 module disappears after trying to delete key.

Discussions about using Linux guests in VirtualBox.
Post Reply
tbyte
Posts: 11
Joined: 24. Jun 2022, 00:17
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: FreeBSD, Linux, Windows

TPM 2.0 module disappears after trying to delete key.

Post by tbyte »

It's a 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 ?
Is there a way to reset / clear the VirtualBox's TPM "module" ?

Thanks.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: TPM 2.0 module disappears after trying to delete key.

Post by fth0 »

As a general idea, you could try removing and re-adding the virtual TPM device, and you could look at the VBoxManage modifynvram commands.
tbyte
Posts: 11
Joined: 24. Jun 2022, 00:17
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: FreeBSD, Linux, Windows

Re: TPM 2.0 module disappears after trying to delete key.

Post by tbyte »

fth0 wrote: 21. Mar 2024, 00:25 As a general idea, you could try removing and re-adding the virtual TPM device, and you could look at the VBoxManage modifynvram commands.
Turns out after many experiments (and crashing of the module?) to delete the keys you just have to delete the contents of the TpmEmuTpms (permall file) which is inside the .nvram archive.
Post Reply