From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: William Roberts <bill.c.roberts@gmail.com>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>,
Ken Goldman <kgold@linux.ibm.com>,
linux-integrity@vger.kernel.org
Subject: Re: Seal/Unseal trusted keys against PCR policy
Date: Wed, 11 Jan 2023 09:42:04 -0500 [thread overview]
Message-ID: <9f1ddfbf6838e1fa29de3ebd8e447cddc88f875f.camel@HansenPartnership.com> (raw)
In-Reply-To: <CAFftDdpus-TyHg4iOHFH9Ph4bkD5rW8zUtjaXoc6SbvwS+6JgA@mail.gmail.com>
On Wed, 2023-01-11 at 07:50 -0600, William Roberts wrote:
> On Wed, Jan 11, 2023 at 6:31 AM James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > On Wed, 2023-01-11 at 17:49 +0530, Sughosh Ganu wrote:
[...]
> >
> > > [ 217.219048] tpm tpm0: A TPM error (2328) occurred unsealing
> >
> > Error 2328 is TPM_RC_REFERENCE_S0 - the 1st authorization session
> > handle references a session that is not loaded
> >
> > So it looks like the session is still context saved, pointing to an
> > error in the toolkit.
> >
>
> Yes, this jogged my memory that we talked about implementing this
> between Imran (The other main developer) and I. If we don't context
> save in the tool, both tpm2-abrmd and in-kernel will flush the
> handle.
>
> I think the cleanest option would be to add a --wait-for-sighup
> option where the tool sleeps until sighup is delivered. For scripts,
> folks could just lunch it in the background, grab the handle output
> and then kill -s sighuhp %1 or whatever.
I don't think that would work: The in-kernel resource manager will
context save the session while the userspace program isn't using the
TPM (so that's while a TPM device read/write is active), so even if you
hold the process running or even the /dev/tpmrm0 fd open, the session
won't be in a state to pass into the kernel. What you really have to
do to get this to work is to bypass the resource manager because you're
trying to share a session between two otherwise separately managed uses
of the TPM.
Using a session constructed elsewhere is a security problem anyway
because you can't share nonces, so the policy patches that stalled a
year or so ago fixed this by allowing the kernel itself to construct
the policy session, so you didn't have to pass in the handle:
https://lore.kernel.org/linux-integrity/20210521004401.4167-1-James.Bottomley@HansenPartnership.com/
James
next prev parent reply other threads:[~2023-01-11 14:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-27 4:14 Seal/Unseal trusted keys against PCR policy Sughosh Ganu
2022-12-27 15:40 ` James Bottomley
2022-12-28 20:40 ` Sughosh Ganu
2022-12-28 22:48 ` James Bottomley
2022-12-29 8:42 ` Sughosh Ganu
2023-01-06 21:52 ` Ken Goldman
2023-01-06 22:23 ` William Roberts
2023-01-06 23:07 ` James Bottomley
[not found] ` <CAFftDdrnoc7zsxqLGuGDVK9fh1xh3E3dT2+9rKm7BPr114ZjFA@mail.gmail.com>
2023-01-11 12:19 ` Sughosh Ganu
2023-01-11 12:31 ` James Bottomley
2023-01-11 13:50 ` William Roberts
2023-01-11 14:42 ` James Bottomley [this message]
2023-01-06 23:17 ` Ken Goldman
2023-01-07 0:38 ` William Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f1ddfbf6838e1fa29de3ebd8e447cddc88f875f.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=bill.c.roberts@gmail.com \
--cc=kgold@linux.ibm.com \
--cc=linux-integrity@vger.kernel.org \
--cc=sughosh.ganu@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox