From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B23988197E for ; Tue, 10 Jan 2017 12:03:55 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 10 Jan 2017 12:03:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="921033669" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga003.jf.intel.com with ESMTP; 10 Jan 2017 12:03:55 -0800 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 10 Jan 2017 12:03:55 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.184]) by ORSMSX111.amr.corp.intel.com ([10.22.240.12]) with mapi id 14.03.0248.002; Tue, 10 Jan 2017 12:03:55 -0800 From: "Leahy, Leroy P" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" Thread-Topic: [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size Thread-Index: AQHSa23BTkmUnqrXPU+2hHraw50fu6EyImBw Date: Tue, 10 Jan 2017 20:03:54 +0000 Message-ID: References: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com> <1484072204-35608-3-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1484072204-35608-3-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTIzZTU0MTctNzUxYS00OTk3LWI5N2EtNWMwMTE5NjI1N2IyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkZreWpXTnU5a2M4Y2dRTDZkeVwvTVcwT1o1WGR6aWZ5NzRVUzJVbXg4MTlVPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:03:55 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Lee Leahy -----Original Message----- From: Kinney, Michael D=20 Sent: Tuesday, January 10, 2017 10:17 AM To: edk2-devel@lists.01.org Cc: Steele, Kelly ; Leahy, Leroy P Subject: [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCom= mand() out size https://bugzilla.tianocore.org/show_bug.cgi?id=3D336 When the Tpm12SubmitCommand() detects a response packet that is the same si= ze as a TPM_RSP_COMMAND_HDR, it returns EFI_SUCCESS without reading any add= itional response packet information from the TPM. In that case, the return= parameter OutputParameterBlockSize is not be updated, so the size of that = OutputParameterBlock returned is the value passed in which could be larger = than what is actually returned from the TPM. Set the OutputParameterBlockSize to the size of the TPM_RSP_COMMAND_HDR whe= n this specific condition is detected. Cc: Kelly Steele Cc: Lee Leahy Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c b/Quar= kPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c index 08a005f..3aab530 100644 --- a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c +++ b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c @@ -355,6 +355,7 @@ Tpm12SubmitCommand ( =20 TpmOutSize =3D SwapBytes32 (ReadUnaligned32 (&ResponseHeader->paramSize)= ); if (TpmOutSize =3D=3D sizeof (TPM_RSP_COMMAND_HDR)) { + *OutputParameterBlockSize =3D TpmOutSize; Status =3D EFI_SUCCESS; goto Done; } -- 2.6.3.windows.1