From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.2462.1628213599172978967 for ; Thu, 05 Aug 2021 18:33:19 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=bL48q0hC; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id D53CF20B36EA; Thu, 5 Aug 2021 18:33:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D53CF20B36EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1628213598; bh=jSWpZoa1uaJmkZwhhtusHtxhSndtLRX+QnZH01z+6Sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL48q0hCqR9wa5SOlx/MC0c9dnvjWLJ7Mf8h2TRN9ASCXKlRYB4+7s8fdRI73R0Io WauAgo25mcJaLKxJNrH24xxYCJgPVaAsGo3PyNGdz+Lf1v5LsRjJAXT9U5Jm43Xf42 1p9oySsQQLRGC53WYXzhHN0LBATjoTiJw+UXqxF0= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-platforms][PATCH v2 2/5] MinPlatformPkg/TestPointCheckLib: Set required size field in protocol Date: Thu, 5 Aug 2021 21:32:47 -0400 Message-Id: <20210806013250.2928-3-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210806013250.2928-1-mikuback@linux.microsoft.com> References: <20210806013250.2928-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3518 Per the protocol definition, the caller must allocate the input structure and set the size field. TestPointCheckTcgTrustedBoot() does not do this which can result in an EFI_BUFFER_TOO_SMALL error. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcg= TrustedBoot.c | 3 +++ Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoin= tCheckLib.inf | 1 + 2 files changed, 4 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib= /DxeCheckTcgTrustedBoot.c b/Platform/Intel/MinPlatformPkg/Test/Library/Te= stPointCheckLib/DxeCheckTcgTrustedBoot.c index 2a04f86fedac..5ec32fd2e875 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeChe= ckTcgTrustedBoot.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeChe= ckTcgTrustedBoot.c @@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include #include @@ -41,6 +42,8 @@ TestPointCheckTcgTrustedBoot ( goto Done; } =20 + ZeroMem ((VOID *) &ProtocolCapability, sizeof (ProtocolCapability)); + ProtocolCapability.Size =3D (UINT8) sizeof (ProtocolCapability); Status =3D Tcg2->GetCapability (Tcg2, &ProtocolCapability); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Tcg2->GetCapability - %r\n", Status)); diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib= /DxeTestPointCheckLib.inf b/Platform/Intel/MinPlatformPkg/Test/Library/Te= stPointCheckLib/DxeTestPointCheckLib.inf index 54b4015d6767..195729e0ff5b 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTes= tPointCheckLib.inf +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTes= tPointCheckLib.inf @@ -18,6 +18,7 @@ [Defines] =20 [LibraryClasses] BaseLib + BaseMemoryLib DebugLib DxeServicesTableLib UefiBootServicesTableLib --=20 2.28.0.windows.1