From nobody Mon May 6 01:26:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85039+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85039+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639709288; cv=none; d=zohomail.com; s=zohoarc; b=F3hkvj3b6glo84GEtdbV6diHoMJSygtXdtNd+DxGD1ZPg/+vfAywvIr1BCk47kBHudCOgcLdIS90Lmu+44QrWsjRFF8imSEOMb3kD4xam3+UR4EFAeNhnDhiX/GNYWCin8yHTs9oUFq6Q3L7uB29TpMVya5rCsQoHnoa4RfO0uU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639709288; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=pmlgr0IhdoJPYdVcay51bBCe/W8Ypty7ZbtJpcD1ZMQ=; b=eJoTTnU1K0Shd+Sl6hHij6s6yw7/Q/6iJKHFTlPKfqyqsOXqcluCJJSoxEZkMRGuuT2IsYxMS8n5SfhU3+WOdh6FdWUfDH3+A9TYJt3G2DmuzhJupcd5FUUOqXXCdDFVL0qHIZ2iR/Afc86M067k/cUfrihi1pWioPn/v2A8SoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85039+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1639709288080397.6728383947708; Thu, 16 Dec 2021 18:48:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id QbpRYY1788612xMsFuEczSHd; Thu, 16 Dec 2021 18:48:07 -0800 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.1613.1639709287104291869 for ; Thu, 16 Dec 2021 18:48:07 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10200"; a="325949795" X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="325949795" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 18:48:06 -0800 X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="568813138" X-Received: from fm73lab177-1.amr.corp.intel.com ([10.80.209.189]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 18:48:06 -0800 From: "Rodrigo Gonzalez del Cueto" To: devel@edk2.groups.io Cc: Rodrigo Gonzalez del Cueto , Jian J Wang , Jiewen Yao Subject: [edk2-devel] [PATCH] SecurityPkg: TPM must go to Idle state on CRB command completion Date: Thu, 16 Dec 2021 18:47:59 -0800 Message-Id: <20211217024759.653-1-rodrigo.gonzalez.del.cueto@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rodrigo.gonzalez.del.cueto@intel.com X-Gm-Message-State: fG2QYobFJDVyrSqNgNvXdMnKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639709287; bh=/LoTxRF2w6pS5YtN2zPtBIcJZkG/m5xgxtJmIlC/y9M=; h=Cc:Date:From:Reply-To:Subject:To; b=jPLmQNodipuA5KxaJnrsf3bAoq2qrO6vAmBoYCqGtavVArbeSCTihoSzWiPBleOqZ8g COd4DfZ+A9xIgeRI6k74TJBjnZkLx4+JAE7999OXhBpBHDrl0HiLy0yQVswSMJUVjwWX6 WKUTcYtmpoT/Lr6CPAUzCpdgTxUCn7p9pf8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639709290091100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3463 In V2: Fixed patch format and uncrustify cleanup In V1: To follow the TCG CRB protocol specification, on every CRB TPM command completion the TPM should return to Idle state, regardless of the CRB Idle Bypass capability reported by the TPM device. See: TCG PC Client Device Driver Design Principles for TPM 2.0, Version 1.0, Rev 0.27 Signed-off-by: Rodrigo Gonzalez del Cueto Cc: Jian J Wang Cc: Jiewen Yao --- SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c b/SecurityPkg/= Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c index 40ab998004..1d99beaa10 100644 --- a/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c +++ b/SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c @@ -1,7 +1,7 @@ /** @file PTP (Platform TPM Profile) CRB (Command Response Buffer) interface used = by dTPM2.0 library. =20 -Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
Copyright (c), Microsoft Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -320,7 +320,7 @@ PtpCrbTpmCommand ( // Command completed, but buffer is not enough // Status =3D EFI_BUFFER_TOO_SMALL; - goto GoReady_Exit; + goto GoIdle_Exit; } =20 *SizeOut =3D TpmOutSize; @@ -340,16 +340,6 @@ PtpCrbTpmCommand ( DEBUG ((DEBUG_VERBOSE, "\n")); DEBUG_CODE_END (); =20 -GoReady_Exit: - // - // Goto Ready State if command is completed successfully and TPM support= IdleBypass - // If not supported. flow down to GoIdle - // - if (GetCachedIdleByPass () =3D=3D 1) { - MmioWrite32 ((UINTN)&CrbReg->CrbControlRequest, PTP_CRB_CONTROL_AREA_R= EQUEST_COMMAND_READY); - return Status; - } - // // Do not wait for state transition for TIMEOUT_C // This function will try to wait 2 TIMEOUT_C at the beginning in next c= all. --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85039): https://edk2.groups.io/g/devel/message/85039 Mute This Topic: https://groups.io/mt/87782226/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-