All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Ken Goldman <kgoldman-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: TPM 2.0 RM flushcontext returning bad address
Date: Sat, 14 Jan 2017 10:32:30 -0800	[thread overview]
Message-ID: <1484418750.2424.13.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <o5dq32$b3s$1@blaine.gmane.org>

On Sat, 2017-01-14 at 13:19 -0500, Ken Goldman wrote:
> On 1/14/2017 11:45 AM, James Bottomley wrote:
> > 
> > Should fix all of this.  The code has to partially emulate
> > TPM2_FlushContext.  The emulation is
> > 
> >    1. If the handle type is not one we manage (transient, hmac or
> > policy)
> >       send the command on to the TPM
> >    2. next, if the handle isn't currently in the RM table,
> > manufacture a
> >       TPM_RC_HANDLE error and return it
> >    3. remove the handle from the RM table
> >    4. if the handle is transient, manufacture TPM_RC_SUCCESS and
> > return it
> >    5. otherwise it's a session handle: flush it and return success.
> 
> This sounds right, assuming:
> 
> 1 - The RM immediately context saves and then flushes any transient 
> object that's created or loaded onto the TPM.

Yes, that's how the space code operates.  It saves every handle (well,
every policy, hmac or transient handle) after a command completes and
reloads them all before the next one.

> If you want a list of commands that load transient objects, let me
> know.

I think for simplicity, unless there's a severe performance impact, we
should stick with loading and saving everything for every command
rather than trying to be selective about  whether the command might
actually use any saved contexts.

> 2 - Step 3 also implies deleting the saved context.

Yes, that's what I meant by "remove" the function in the patch is tpm2
-space.c:tpm2_forget_session() It removes both the handle and the saved
context information for the now flushed session.

James


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi

  reply	other threads:[~2017-01-14 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 20:01 TPM 2.0 RM flushcontext Ken Goldman
2017-01-10 20:08 ` Jason Gunthorpe
     [not found]   ` <20170110200803.GB5102-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-10 22:31     ` TPM 2.0 RM flushcontext returning bad address Ken Goldman
2017-01-10 22:42       ` Jason Gunthorpe
     [not found]         ` <20170110224225.GA5451-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-11 11:38           ` Jarkko Sakkinen
2017-01-11 19:43           ` Ken Goldman
2017-01-11 19:56             ` James Bottomley
     [not found]               ` <1484164614.2509.31.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2017-01-11 20:29                 ` Ken Goldman
2017-01-14 16:45                 ` James Bottomley
     [not found]                   ` <1484412351.2424.7.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2017-01-14 18:19                     ` Ken Goldman
2017-01-14 18:32                       ` James Bottomley [this message]
2017-01-11 21:55             ` Jason Gunthorpe

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=1484418750.2424.13.camel@linux.vnet.ibm.com \
    --to=jejb-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=kgoldman-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.