Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2722689pxj; Sun, 23 May 2021 08:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsaxud0MAhP95N3+yjMHsC15X43CNr46LhdPsUCF3cz+QzcVNtNW53PTj5u3k1SqrxEQa+ X-Received: by 2002:a17:906:a0d3:: with SMTP id bh19mr19564740ejb.205.1621784958961; Sun, 23 May 2021 08:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621784958; cv=none; d=google.com; s=arc-20160816; b=DWM2Z3NN3+O2U2x2Ht26PxV0VRl5pyslHjHt9joRzwcA04RVZQhvqyqZc3hNngJcvO A/CR+F4IOtGIJZul1S0Bz+9/br3pJJxSooFWvBaYhJliFy0y4YM6sJy2Vr4h7JHChKXC 5dHFR/RVxoYdH6lhGuSxPZe/NOutMpVkSinYITvYMCI065vquw/4tre1o68PJCkykkX0 7v1MKeeUzlo6Gw/vrezKbqutCllcfSLVb8YbuBOHu6qnlk4oL+VOIRC6sqGYURZIZ5uO 8WwDCKJSJGgctWRo6ugCoY+K39FCRy2i/+uohsIuJxq1DdXalwqfSLnt1/NeM3WvCgbF VcAw== 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=9eLfYT09He4DgLjReo0TOyXRCTkcp92DWcXBhsO70H0=; b=LloxadVNcufVOmFFPYcMH/JB2LCdBMwojb0S2WiMTe4pZJwq4Ub2r7Fupwp7Fz/6L9 VDTUGioSkyq15MoiiXvodjEw0eXE2HczUDLGEax9Bpt2IOd7qckOQ8nqn+isuxbO0JNI 51vuBPC4QNFTKc5CeHHAhuHdOJwTRPhKrz2nXK5eEoKQWMDJg22MYyx3/quUBkm+EAkG Fmo04/prmh6Jydqt9uyKS9m0gT8GvlSE3+DXCHlD/mA8DRo50vYxhTKUqw7T0nxxJUQ7 HrYk3qINbNlx05dkDq7Uyr1q5PqiLBJHPYGcqUD+oXHjPcw5a6j4ffVG6D4Jo2k3Fmn2 n3Jg== 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 w21si7825934ejy.240.2021.05.23.08.48.54; Sun, 23 May 2021 08:49:18 -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 S231853AbhEWPh4 (ORCPT + 99 others); Sun, 23 May 2021 11:37:56 -0400 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:60495 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231820AbhEWPhy (ORCPT ); Sun, 23 May 2021 11:37:54 -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 14NFaEPb020104; Sun, 23 May 2021 18:36:14 +0300 Received: by taln60.nuvoton.co.il (Postfix, from userid 10140) id DE39E63A1B; Sun, 23 May 2021 18:36:20 +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 v3] tpm2: add longer timeout for verify signature command Date: Sun, 23 May 2021 18:36:10 +0300 Message-Id: <20210523153610.86927-2-amirmizi6@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20210523153610.86927-1-amirmizi6@gmail.com> References: <20210523153610.86927-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 3070-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