-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tpm2_createpolicy keeps dangling loaded session #3427
Comments
yes tpm2_flushcontext is needed here. Autoflush (-R) is only implemented for key objects. |
Ok, thanks and also thanks for fast response 😊 |
I found one strange behaviour. Compare the following:
This happens in the |
Clevis cleans the context regurarly from transient objects by invoking `tpm2_flushcontext -t`, but there is one case which Clevis omits. The `tpm2_createpolicy` command loads new session and this needs to be cleaned by a call to `tpm2_flushcontext -l`, see [1]. This is usually not an issue when resource manager is used (i.e. with `/dev/tpmrm0` device), but when raw TPM device `/dev/tpm0` or software TPM (swtpm) without resource manager is used, the usage of clevis ends with the following error: ``` WARNING:esys:src/tss2-esys/api/Esys_StartAuthSession.c:390:Esys_StartAuthSession_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_StartAuthSession.c:136:Esys_StartAuthSession() Esys Finish ErrorCode (0x00000903) ERROR: Esys_StartAuthSession(0x903) - tpm:warn(2.0): out of memory for session contexts ``` [1] tpm2-software/tpm2-tools#3427 Signed-off-by: Oldřich Jedlička <[email protected]>
@oldium yes you are right it makes no sense keep the session which is just used to compute the policy digest. I will create a PR which flushes the session in this case. And I think also an option to save the session context should be added if |
Clevis cleans the context regurarly from transient objects by invoking `tpm2_flushcontext -t`, but there is one case which Clevis omits. The `tpm2_createpolicy` command loads new session and this needs to be cleaned by a call to `tpm2_flushcontext -l`, see [1]. This is usually not an issue when resource manager is used (i.e. with `/dev/tpmrm0` device), but when raw TPM device `/dev/tpm0` or software TPM (swtpm) without resource manager is used, the usage of clevis ends with the following error: ``` WARNING:esys:src/tss2-esys/api/Esys_StartAuthSession.c:390:Esys_StartAuthSession_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_StartAuthSession.c:136:Esys_StartAuthSession() Esys Finish ErrorCode (0x00000903) ERROR: Esys_StartAuthSession(0x903) - tpm:warn(2.0): out of memory for session contexts ``` [1] tpm2-software/tpm2-tools#3427 Signed-off-by: Oldřich Jedlička <[email protected]>
Clevis cleans the context regurarly from transient objects by invoking `tpm2_flushcontext -t`, but there is one case which Clevis omits. The `tpm2_createpolicy` command loads new session and this needs to be cleaned by a call to `tpm2_flushcontext -l`, see [1]. This is usually not an issue when resource manager is used (i.e. with `/dev/tpmrm0` device), but when raw TPM device `/dev/tpm0` or software TPM (swtpm) without resource manager is used, the usage of clevis ends with the following error: ``` WARNING:esys:src/tss2-esys/api/Esys_StartAuthSession.c:390:Esys_StartAuthSession_Finish() Received TPM Error ERROR:esys:src/tss2-esys/api/Esys_StartAuthSession.c:136:Esys_StartAuthSession() Esys Finish ErrorCode (0x00000903) ERROR: Esys_StartAuthSession(0x903) - tpm:warn(2.0): out of memory for session contexts ``` [1] tpm2-software/tpm2-tools#3427 Signed-off-by: Oldřich Jedlička <[email protected]>
The created session is flushed if a trial policy is only used to compute the policy digest. Fixes: tpm2-software#3427 Signed-off-by: Juergen Repp <[email protected]>
The created session is flushed if a trial policy is only used to compute the policy digest. Fixes: tpm2-software#3427 Signed-off-by: Juergen Repp <[email protected]>
The created session is flushed if a trial policy is only used to compute the policy digest. Fixes: tpm2-software#3427 Signed-off-by: Juergen Repp <[email protected]>
When
tpm2_createpolicy
is called with--policy-pcr
, it requires an output file (policy) being specified, but at the same time it creates and keeps a loaded session of typeTPM2_SE_TRIAL
.Reproduction:
When called multiple times, the call fails on:
Is this intentional? Is it required to call
tpm2_flushcontext -l
every time thetpm2_createpolicy
is called on raw TPM device or on software-emulated TPM (swtpm)? This does not happen on/dev/tpmrm0
, though (as expected).The text was updated successfully, but these errors were encountered: