public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leahy, Leroy P" <leroy.p.leahy@intel.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size
Date: Tue, 10 Jan 2017 20:03:54 +0000	[thread overview]
Message-ID: <FAED2E9371717D498934AEE360823DE66B0E701F@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <1484072204-35608-3-git-send-email-michael.d.kinney@intel.com>

Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>

-----Original Message-----
From: Kinney, Michael D 
Sent: Tuesday, January 10, 2017 10:17 AM
To: edk2-devel@lists.01.org
Cc: Steele, Kelly <kelly.steele@intel.com>; Leahy, Leroy P <leroy.p.leahy@intel.com>
Subject: [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size

https://bugzilla.tianocore.org/show_bug.cgi?id=336

When the Tpm12SubmitCommand() detects a response packet that is the same size as a TPM_RSP_COMMAND_HDR, it returns EFI_SUCCESS without reading any additional 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 when this specific condition is detected.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Lee Leahy <leroy.p.leahy@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c b/QuarkPlatformPkg/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 (
 
   TpmOutSize = SwapBytes32 (ReadUnaligned32 (&ResponseHeader->paramSize));
   if (TpmOutSize == sizeof (TPM_RSP_COMMAND_HDR)) {
+    *OutputParameterBlockSize = TpmOutSize;
     Status = EFI_SUCCESS;
     goto Done;
   }
--
2.6.3.windows.1



  reply	other threads:[~2017-01-10 20:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 18:16 [Patch 0/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix TPM issues Michael Kinney
2017-01-10 18:16 ` [Patch 1/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Remove PP Check Michael Kinney
2017-01-10 20:03   ` Leahy, Leroy P
2017-01-10 18:16 ` [Patch 2/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix SubmitCommand() out size Michael Kinney
2017-01-10 20:03   ` Leahy, Leroy P [this message]
2017-01-10 18:16 ` [Patch 3/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Fix GCC build issues Michael Kinney
2017-01-10 20:04   ` Leahy, Leroy P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FAED2E9371717D498934AEE360823DE66B0E701F@ORSMSX113.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox