-
Notifications
You must be signed in to change notification settings - Fork 385
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_load fails (Load Object Failed ! ErrorCode: 0x902) when using the device TCTI #303
Comments
The maximum number of loaded handles at any given time is 3, defined in the sapi of TPM2.0-TSS. At a high level, the resourcemanager is responsible for maintaining all of your handles and swapping them in and out in order to avoid hitting TPM_RC_OBJECT_MEMORY. When you run this test without the resourcemanager, you become responsible for flushing the handles when you're done with them. |
@crogers1 ah, right. Thanks a lot for your explanation. I'll close this issue then since is the expected behavior, sorry for the noise. I think it would be nice to have a set of tests to run against the TPM device directly, but that's an unrelated conversation. |
For completeness, if someone faces the same issue and also forgets that the TPM can only load TPM_PT_HR_TRANSIENT_MIN transient objects, what I did was to use the new TPM2 in-kernel resource manager that just landed in Linux v4.12-rc1. With that, I was able to use the tpm2.0-tools commands with the device TCTI to load and unseal data:
|
The TPM2 in-kernel resource manager is available now, see: https://github.com/torvalds/linux/commits/master/drivers/char/tpm/tpmrm-dev.c |
@liuqun yes. As mentioned, I've been using it since v4.12-rc1 that's when the support landed in mainline. |
@martinezjavier If you know the answer to this, if the damage is already done, how to I clear NVRAM and get my TPM back in a working state? I've tried |
-t and -l and -s will only flush the transient, loaded and active sessions respectively. Did you make a bunch of persistent objects? Everything else would go away on TPM reboot (ie power off and on), thus I think the only way you could be in this state is if everything is persistent object. You can try to flush specific objects out by handle, flush everything reported by:
I'd be interested in the output of those commands before you run,
Note that on tip-of-master post ESAPI cange, transient objects need to be referred to by the context file provided by tpm2_load. Again, transient objects will go away on reboot, so they are not really of consequence. If this doesn't work, i'd look at your NV space and see if thats full and somehow fueling into this situation. |
I'm testing latest tpm2.0-tools on a Lenovo Thinkpad X1 Carbon (4th gen) and its Intel PTT firmware based TPM2.0. The test_tpm2_unseal.sh fails when using the device TCTI, the issue happens when trying to load an object into the TPM:
When decoding the error code, I see that is TPM_RC_OBJECT_MEMORY:
It works though when using the TPM2 Access Broker & Resource Manager TCTI instead:
I noticed the error comes from tss2_tcti_receive() called by Tss2_Sys_ExecuteFinish() in TPM2.0-TSS/blob/master/sysapi/sysapi/execute.c. The tss2_tcti_receive() function returns TSS2_RC_SUCCESS but SYS_CONTEXT->rsp_header.rsp_code is set to TPM_RC_OBJECT_MEMORY.
Tested with both the Fedora 26 tpm2-tss-1.0-3.fc26 package and building latest TPM2.0-TSS from source.
NOTE: I changed the test to use the endorsement hierarchy instead of the platform one, since I faced the same problem mentioned at issue #255.
The text was updated successfully, but these errors were encountered: