Open polarina opened 4 months ago
TPM reference code (not very helpful here):
TRANSIENT_LAST = TRANSIENT_FIRST + MAX_LOADED_OBJECTS - 1
= 0x80000000 + 3 - 1
Spec:
A similar approach is used for transient objects with the first assigned handle at the bottom of the range defined by TPM_HT_TRANSIENT and the top of the range determined by the implementation-dependent value of MAX_LOADED_OBJECTS.
I guess we need to look for the next handle range which starts at TPM_HT_PERSISTENT = 0x81000000
, so I think you are right.
The value of
TPM2_TRANSIENT_LAST
is defined as0x80fffffe
intss2/tss2_tpm2_types.h
. The defined value should be0x80ffffff
.The Linux kernel's TPM2 resource manager assigns transient handles counting from
0x80ffffff
downwards: https://github.com/torvalds/linux/blob/v6.10/drivers/char/tpm/tpm2-space.c#L374Here is a program I wrote that asserts whether the TPM2 handle of a transient key (as created by
Esys_CreatePrimary
) falls within the range of a transient handle.The program crashes with an assertion failure: