linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jarkko.sakkinen@linux.intel.com (Jarkko Sakkinen)
To: linux-security-module@vger.kernel.org
Subject: [PATCH 3/5 V2] tpm2: add longer timeouts for creation commands.
Date: Sat, 10 Mar 2018 13:21:16 +0200	[thread overview]
Message-ID: <d00187b102355c74b5efc2f7923c441785a6390c.camel@linux.intel.com> (raw)
In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9422F4C1@hasmsx108.ger.corp.intel.com>

On Tue, 2018-03-06 at 15:19 +0000, Winkler, Tomas wrote:
> > On Tue, 2018-03-06 at 11:25 +0200, Tomas Winkler wrote:
> > > TPM2_CC_Create(0x153) and TPM2_CC_CreatePrimary (0x131) involve
> > > generation of crypto keys which can be a computationally intensive task.
> > > The timeout is set to 3min.
> > > Rather than increasing default timeout a new constant is added, to not
> > > stall for too long on regular commands failures.
> > > 
> > > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > 
> > Why are you radically chaging the default timeout? The commit message
> > does not tell anything about that change.
> > 
> 
> Let me, recheck but it should be same value just converted to msecs.
>  
> > Why couldn't we just have two timeouts: one default and one long that
> > would be at least as long as the longest timeout defined in the spec?
> 
> I've tried to explain it in the commit message but apparently has failed. 
> 
> We have a default or undefined which should be the same as it was unless I did
> some silly mistake in conversion to msecs (will check), ass all others are in
> msecs.
> It was 2 min = 2 * 60 * HZ (in jiffies) which would be msecs_to_jiffies(2 * 60
> * 1000 = 120000) 
> TPM2_DURATION_DEFAULT   = 120000

Aah, of course :-) The problem was that I had somehow a blid spot with
seeing the msec_to_jiffies() conversion.

TPM_NUM_DURATIONS would a better name than TPM_DURATION_MAX because
TPM_DURATION_MAX is easy to confuse with TPM_DURATION_* constants.

/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-03-10 11:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  9:24 [PATCH 0/5 V2] tpm: timeouts revamp Tomas Winkler
2018-03-06  9:24 ` [PATCH 1/5 V2] tpm: sort objects in the Makefile Tomas Winkler
2018-03-06  9:25 ` [PATCH 2/5 V2] tpm: factor out tpm 1.2 duration calculation to tpm1-cmd.c Tomas Winkler
2018-03-06  9:25 ` [PATCH 3/5 V2] tpm2: add longer timeouts for creation commands Tomas Winkler
2018-03-06 12:23   ` Jarkko Sakkinen
2018-03-06 15:19     ` Winkler, Tomas
2018-03-10 11:21       ` Jarkko Sakkinen [this message]
2018-03-06  9:25 ` [PATCH 4/5 V2] tpm2: add new tpm2 commands according to TCG 1.36 Tomas Winkler
2018-03-06  9:25 ` [PATCH 5/5 V2] tmp: factor out tpm_get_timeouts Tomas Winkler
2018-03-06 12:17 ` [PATCH 0/5 V2] tpm: timeouts revamp Jarkko Sakkinen
2018-03-06 12:39   ` Javier Martinez Canillas
2018-03-06 14:02     ` Jarkko Sakkinen
2018-03-06 15:05       ` Winkler, Tomas
2018-03-06 15:01     ` Winkler, Tomas
2018-04-08 20:01   ` 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=d00187b102355c74b5efc2f7923c441785a6390c.camel@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).