[tpm2] Re: tpm2_flushcontext stuck

Kenneth Goldman <kgoldman at us.ibm.com>
Newsgroups dev.linux.lists.tpm2
Message-ID <BN8PR15MB27535DD955DE01A1D14B0036F2789@BN8PR15MB2753.namprd15.prod.outlook.com>
In general, pick one or the other.

rm0 is the multi-user device, which is normally used
0 is the single user device and will hold a lock on the TPM, not normally used except for standalone debug

In addition, running everything as root is risky.  It's safer to put yourself in the tss group or something similar.

From: Han <keepsimple(a)gmail.com>
Sent: Friday, December 17, 2021 3:04 PM
To: Roberts, William C <william.c.roberts(a)intel.com>
Cc: tpm2(a)lists.01.org
Subject: [EXTERNAL] [tpm2] Re: tpm2_flushcontext stuck

It seems stuck in a call of `poll()` at fd 3, which is /dev/tpmrm0 based on the log (see below).  The kernel version is 5.10.63.  Yes, I am using /dev/tpm0 and /dev/tpmrm0.

$ sudo strace tpm2_flushcontext 0x80000000

I'm using tpm2-tools 5.0 in Debian 11 Bullseye based Raspberry Pi OS.  I'm trying to run tpm2_flushcontext but the command got stuck and it's not showing anything. Is the data in TPM corrupted?  How can I check?

$ sudo tpm2_flushcontext 0x80000000
< no output at all and stuck here >
attachment.htm (text/html, 3.8 KB)
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle37
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">In general, pick one or the other.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">rm0 is the multi-user device, which is normally used<o:p></o:p></p>
<p class="MsoNormal">0 is the single user device and will hold a lock on the TPM, not normally used except for standalone debug<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">In addition, running everything as root is risky.&nbsp; It's safer to put yourself in the tss group or something similar.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Han &lt;[email protected]&gt; <br>
<b>Sent:</b> Friday, December 17, 2021 3:04 PM<br>
<b>To:</b> Roberts, William C &lt;[email protected]&gt;<br>
<b>Cc:</b> [email protected]<br>
<b>Subject:</b> [EXTERNAL] [tpm2] Re: tpm2_flushcontext stuck<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">It seems stuck in a call of `poll()` at fd 3, which is /dev/tpmrm0&nbsp;based on the log (see below).&nbsp; The kernel version is&nbsp;5.10.63.&nbsp; Yes, I am using /dev/tpm0 and /dev/tpmrm0.&nbsp;&nbsp;<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">$ sudo strace tpm2_flushcontext 0x80000000<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<div>
<p class="MsoNormal">I'm using tpm2-tools 5.0 in Debian 11 Bullseye based Raspberry Pi OS.&nbsp; I'm trying to run&nbsp;tpm2_flushcontext but the command got stuck and it's not showing anything. Is the data in TPM corrupted?&nbsp; How can I check?&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">$ sudo tpm2_flushcontext 0x80000000<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&lt; no output at all and stuck here &gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>
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.