All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] add longer timeout for verify signature command
@ 2021-05-25 11:13 amirmizi6
  2021-05-25 11:13 ` [PATCH v4] tpm2: " amirmizi6
  0 siblings, 1 reply; 4+ messages in thread
From: amirmizi6 @ 2021-05-25 11:13 UTC (permalink / raw)
  To: Eyal.Cohen, jarkko, peterhuewe, jgg
  Cc: linux-kernel, linux-integrity, Dan.Morav, oren.tanami,
	shmulik.hager, amir.mizinski, Amir Mizinski

From: Amir Mizinski <amirmizi6@gmail.com>

while testing TPM2_CC_VERIFY_SIGNATURE with usage of RSA 3072-bit keys i
encountered a timeout error. it seems current values do not support this case
as described in ptp 1.05 6.5.1.3:
https://trustedcomputinggroup.org/wp-content/uploads/PC_Client_Specific-Platform_TPM_Profile_for-PTP_2p0-v1p05p_r14_pub.pdf

The patch was tested on Raspberry-Pie 3, using Nuvoton NPCT75X TPM.

Changes since version 1:
-"tpm2: add longer timout for verify signature command"
                - Fixed and extended commit description.
Addressed comments from:
 - Jarkko Sakkinen: https://lore.kernel.org/patchwork/patch/1424664/

Changes since version 2:
-"tpm2: add longer timout for verify signature command"
                - Fixed commit description.
Addressed comments from:
 - Jarkko Sakkinen: https://lore.kernel.org/patchwork/patch/1431866/
Changes since version 3:
-"tpm2: add longer timout for verify signature command"
                - Fixed Link tag in commit description.
Addressed comments from:
 - Jarkko Sakkinen: https://lore.kernel.org/patchwork/patch/1434828/


Amir Mizinski (1):
  tpm2: add longer timeout for verify signature command

 drivers/char/tpm/tpm2-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] tpm2: add longer timeout for verify signature command
  2021-05-25 11:13 [PATCH v4] add longer timeout for verify signature command amirmizi6
@ 2021-05-25 11:13 ` amirmizi6
  2021-05-26  4:50   ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: amirmizi6 @ 2021-05-25 11:13 UTC (permalink / raw)
  To: Eyal.Cohen, jarkko, peterhuewe, jgg
  Cc: linux-kernel, linux-integrity, Dan.Morav, oren.tanami,
	shmulik.hager, amir.mizinski, Amir Mizinski

From: Amir Mizinski <amirmizi6@gmail.com>

While running a TPM2_CC_VERIFY_SIGNATURE operation with RSA 3072-bit
keys the TPM driver fails with the following error:

"kernel: [ 2416.187522] tpm tpm0: Operation Timed out"

Since the TPM PC Client specification does not specify a number for
verify signature operation timeout, and the duration of
TPM2_CC_VERIFY_SIGNATURE with RSA 3072-bit keys exceeds the current timeout
of TPM_LONG (2 seconds), it is preferable to pick the longest timeout
possible.

Therefore, set the duration for TPM2_CC_VERIFY_SIGNATUE to TPM_LONG_LONG
(5 minutes).

Link: https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/
Signed-off-by: Amir Mizinski <amirmizi6@gmail.com>
---
 drivers/char/tpm/tpm2-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 7603295..e71154b 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -87,7 +87,7 @@ static u8 tpm2_ordinal_duration_index(u32 ordinal)
 		return TPM_MEDIUM;
 
 	case TPM2_CC_VERIFY_SIGNATURE:        /* 177 */
-		return TPM_LONG;
+		return TPM_LONG_LONG;
 
 	case TPM2_CC_PCR_EXTEND:              /* 182 */
 		return TPM_MEDIUM;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] tpm2: add longer timeout for verify signature command
  2021-05-25 11:13 ` [PATCH v4] tpm2: " amirmizi6
@ 2021-05-26  4:50   ` Jarkko Sakkinen
  2021-05-26  4:56     ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2021-05-26  4:50 UTC (permalink / raw)
  To: amirmizi6
  Cc: Eyal.Cohen, peterhuewe, jgg, linux-kernel, linux-integrity,
	Dan.Morav, oren.tanami, shmulik.hager, amir.mizinski

On Tue, May 25, 2021 at 02:13:25PM +0300, amirmizi6@gmail.com wrote:
> From: Amir Mizinski <amirmizi6@gmail.com>
> 
> While running a TPM2_CC_VERIFY_SIGNATURE operation with RSA 3072-bit
> keys the TPM driver fails with the following error:
> 
> "kernel: [ 2416.187522] tpm tpm0: Operation Timed out"
> 
> Since the TPM PC Client specification does not specify a number for
> verify signature operation timeout, and the duration of
> TPM2_CC_VERIFY_SIGNATURE with RSA 3072-bit keys exceeds the current timeout
> of TPM_LONG (2 seconds), it is preferable to pick the longest timeout
> possible.
> 
> Therefore, set the duration for TPM2_CC_VERIFY_SIGNATUE to TPM_LONG_LONG
> (5 minutes).
> 
> Link: https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/
> Signed-off-by: Amir Mizinski <amirmizi6@gmail.com>
> ---

Thank you.

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>

/Jarkko


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] tpm2: add longer timeout for verify signature command
  2021-05-26  4:50   ` Jarkko Sakkinen
@ 2021-05-26  4:56     ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2021-05-26  4:56 UTC (permalink / raw)
  To: amirmizi6
  Cc: Eyal.Cohen, peterhuewe, jgg, linux-kernel, linux-integrity,
	Dan.Morav, oren.tanami, shmulik.hager, amir.mizinski

On Wed, May 26, 2021 at 07:50:43AM +0300, Jarkko Sakkinen wrote:
> On Tue, May 25, 2021 at 02:13:25PM +0300, amirmizi6@gmail.com wrote:
> > From: Amir Mizinski <amirmizi6@gmail.com>
> > 
> > While running a TPM2_CC_VERIFY_SIGNATURE operation with RSA 3072-bit
> > keys the TPM driver fails with the following error:
> > 
> > "kernel: [ 2416.187522] tpm tpm0: Operation Timed out"
> > 
> > Since the TPM PC Client specification does not specify a number for
> > verify signature operation timeout, and the duration of
> > TPM2_CC_VERIFY_SIGNATURE with RSA 3072-bit keys exceeds the current timeout
> > of TPM_LONG (2 seconds), it is preferable to pick the longest timeout
> > possible.
> > 
> > Therefore, set the duration for TPM2_CC_VERIFY_SIGNATUE to TPM_LONG_LONG
> > (5 minutes).
> > 
> > Link: https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/
> > Signed-off-by: Amir Mizinski <amirmizi6@gmail.com>
> > ---
> 
> Thank you.
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>

I mean @kernel.org.

I mangled the short summary as 

"tpm: add longer timeout for TPM2_CC_VERIFY_SIGNATURE"

given that 

1. The subsystem tag was wrong.
2. Always to talk about the *exact thing*. I.e. in this case it's
   preferable to just write the command name, as"verify time signature
   command" does not have any formal menaing.

It's now applied, thanks.

/Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-26  4:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 11:13 [PATCH v4] add longer timeout for verify signature command amirmizi6
2021-05-25 11:13 ` [PATCH v4] tpm2: " amirmizi6
2021-05-26  4:50   ` Jarkko Sakkinen
2021-05-26  4:56     ` Jarkko Sakkinen

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.