Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4451831pxj; Tue, 25 May 2021 08:18:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7Pxr58Uwjb9n2p+7OQyiYh0PPk4yvAekJDZ96tU43d5rkYx3RmS5lFi0bbyF2Ik8zHDom X-Received: by 2002:aa7:d9d0:: with SMTP id v16mr32702508eds.293.1621955891904; Tue, 25 May 2021 08:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621955891; cv=none; d=google.com; s=arc-20160816; b=PbVHbUaNgbdYVQ4Q5ktjG2Dqqaxl+eD2Z+YArpItfz4VlwkjKKfm9jVKFPZgDQQHzg /bzi6niQUK+epK+A75WUQRKY92QrC2FZndkCZ9r3wT78agwLfobD0SbBnRD0Nf/MZm0J OdXZnEiQSlV6LWGdR+Nt6np7wbPxzmOJq7LoPxM0SYzJyegMvszm9+/Z3wHL8V3dhFAV numDd+zqGMDoiSkgtwt6q5NxMKQYva17oEFN8AefTMIgiMcpI9z8UXX1zVUZ2+4SMhlY 34Af14K9aiLlsFCpnH/5qAFNLJFPH96Ii/nk3C6qmyr1top+7ZImcuPa3U6rEGmb49Ix azxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=R+VWjY1FcU7di01U/wRH59ZrWTpIebzdyv/A4My/N+A=; b=hAx6nBuyqEusbc4BZKzXwRM6YoqVZa30SrJHRFiB8hweZxGWZVIJZ3IzUq+Th79hHJ 3zEORpm+i6YYxSm/oGM76Ssgvd31T8MTVYgTuH0m0WJjQTQO9nU3ExlDOyRBVlGmL5bv LUabkDu2KGF+tnwzVyDCAoBs1KjnyAEKN7Ka3IeOXFvna6ycAYHrDgXh0A68mNEY84zO 231raT6DjohsljZKY0U7obzxynrsDC5rMouLHOpx98q6oLJmgZluibw08jlYqIj2g2ej GYIlZk7AqMzZgBDWODFYfShZofCHYlrbv+mCgh0D7WgG2deLLuatXtRF3Wnl5TLrM8W0 gssA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg40si15599124ejc.465.2021.05.25.08.17.49; Tue, 25 May 2021 08:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhEYLPZ (ORCPT + 99 others); Tue, 25 May 2021 07:15:25 -0400 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:60798 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230239AbhEYLPW (ORCPT ); Tue, 25 May 2021 07:15:22 -0400 Received: from taln60.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id 14PBDeeH004244; Tue, 25 May 2021 14:13:40 +0300 Received: by taln60.nuvoton.co.il (Postfix, from userid 10140) id 4195763A1B; Tue, 25 May 2021 14:13:47 +0300 (IDT) From: amirmizi6@gmail.com To: Eyal.Cohen@nuvoton.com, jarkko@kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, Dan.Morav@nuvoton.com, oren.tanami@nuvoton.com, shmulik.hager@nuvoton.com, amir.mizinski@nuvoton.com, Amir Mizinski Subject: [PATCH v4] tpm2: add longer timeout for verify signature command Date: Tue, 25 May 2021 14:13:25 +0300 Message-Id: <20210525111325.158790-2-amirmizi6@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20210525111325.158790-1-amirmizi6@gmail.com> References: <20210525111325.158790-1-amirmizi6@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amir Mizinski 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 --- 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