[tpm2] Re: tpm2_flushcontext stuck

Tadeusz Struk <tstruk at gmail.com>
Newsgroups dev.linux.lists.tpm2
Message-ID <[email protected]>
On 12/19/21 04:17, Juergen Repp wrote:
> Am 18.12.21 um 20:34 schrieb Han:
>> I probably missed it,  how can I specify to make sure /dev/tpm0 is used, and not /dev/tpmrm0 ?  Is it in some configurations?
>>
> You can use the TPM without resource manager with:
> 
> tpm2_createprimary  -Tdevice:/dev/tpm0 -C o -g sha256 -G ecc -c primary.ctx
> tpm2_getcap handles-transient -Tdevice:/dev/tpm0
> tpm2_flushcontext -Tdevice:/dev/tpm0 0x80000000

The problem is that when /dev/tpm0 is used it just sends a request straight to
the tpm and the tpm responds with a valid error message, which it then passed 
back to tcti. In case of /dev/tpmrm0 the RM tries to first load the none 
existing object 0x80000000 from its cash, but since it cannot find it just
returns an error code -22 (EINVAL) and nothing gets send to the tpm.
The tpm_dev_async_work() handler needs to be modified to handle such error cases
as well. I will send a fix for this.

Thanks,
--
Tadeusz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.