All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "linux-integrity@vger.kernel.org" <linux-integrity@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] tpm: add retry logic
Date: Thu, 22 Mar 2018 17:14:02 +0200	[thread overview]
Message-ID: <a220d693c2fc2de660223de76e2279ef2080192b.camel@linux.intel.com> (raw)
In-Reply-To: <1521657828.6397.19.camel@HansenPartnership.com>

On Wed, 2018-03-21 at 11:43 -0700, James Bottomley wrote:
> TPM2 can return TPM2_RC_RETRY to any command and when it does we get
> unexpected failures inside the kernel that surprise users (this is
> mostly observed in the trusted key handling code).  The UEFI 2.6 spec
> has advice on how to handle this:
> 
>     The firmware SHALL not return TPM2_RC_RETRY prior to the completion
>     of the call to ExitBootServices().
> 
>     Implementer's Note: the implementation of this function should check
>     the return value in the TPM response and, if it is TPM2_RC_RETRY,
>     resend the command. The implementation may abort if a sufficient
>     number of retries has been done.
> 
> So we follow that advice in our tpm_transmit() code using
> TPM2_DURATION_SHORT as the initial wait duration and
> TPM2_DURATION_LONG as the maximum wait time.  This should fix all the
> in-kernel use cases and also means that user space TSS implementations
> don't have to have their own retry handling.
> 
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

  reply	other threads:[~2018-03-22 15:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 18:42 [PATCH v2 0/2] retry handling and intermittent self test failure fix James Bottomley
2018-03-21 18:43 ` [PATCH v2 1/2] tpm: add retry logic James Bottomley
2018-03-22 15:14   ` Jarkko Sakkinen [this message]
2018-03-22 16:13   ` Nayna Jain
2018-03-22 16:31     ` James Bottomley
2018-03-26 14:11       ` Nayna Jain
2018-03-26 14:28         ` James Bottomley
2018-03-26 16:14           ` Mimi Zohar
2018-03-27 15:39             ` James Bottomley
2018-03-27 17:47               ` Mimi Zohar
2018-03-21 18:45 ` [PATCH v2 2/2] tpm: fix intermittent failure with self tests James Bottomley

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=a220d693c2fc2de660223de76e2279ef2080192b.camel@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-integrity@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 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.