Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: James.Bottomley@HansenPartnership.com
Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org
Subject: Re: about context gap
Date: Mon, 18 Sep 2017 21:02:50 +0300	[thread overview]
Message-ID: <20170918180250.6db5ti4gpinqr5jz@linux.intel.com> (raw)
In-Reply-To: <20170916153540.w5lpsqz3cwpd3enx@linux.intel.com>

On Sat, Sep 16, 2017 at 08:36:29AM -0700, Jarkko Sakkinen wrote:
> Hi
> 
> While sitting at the airport I started to think a bit about the context
> gap issue.
> 
> I think first thing that would make sense would be to have a 64-bit
> shadow count for every TPM space i.e.
> 
> atomic_long_t tpm2_ctx_cnt;
> 
> struct tpm2_space {
> 	/* ... */
> 	u64 ctx_cnt;
> };
> 
> For every create and load of a session you will read the global count
> and increase it. This way we have get a well defined order.
> 
> With this organization we could for example put tpm spaces to a
> red-black tree and refresh the oldest tpm space (just first thought
> that came to mind).
> 
> PS. While doing LPC and LSS slides I found error from the TPM 2.0
> commands specification. TPM2_ContextSave can never emit
> TPM2_RC_CONTEXT_GAP albeit the specification says so.
> 
> /Jarkko

Other than context gap it would probably make sense to estimate TPM
capacity in order to make implementation more intelligent. We could
measure memory capacity of a TPM in the driver initialization by filling
it with fixed size dummy objects.

TPM2_GetCapability gives stuff that cannot be really trusted as spec
compliant TPM HW could just return always '1' for max.

/Jarkko

  reply	other threads:[~2017-09-18 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16 15:36 about context gap Jarkko Sakkinen
2017-09-18 18:02 ` Jarkko Sakkinen [this message]
2017-09-26 18:46   ` Ken Goldman
2017-09-26 19:10 ` Ken Goldman

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=20170918180250.6db5ti4gpinqr5jz@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.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