[edk2-devel] [edk2-platforms][PATCH v1 2/5] MinPlatformPkg/TestPointCheckLib: Set required size field in protocol

Nate DeSimone nathaniel.l.desimone at intel.com
Thu Aug 5 23:14:38 UTC 2021


Hi Michael,

Comments are inline.

Thanks,
Nate

> -----Original Message-----
> From: mikuback at linux.microsoft.com <mikuback at linux.microsoft.com>
> Sent: Thursday, August 5, 2021 7:57 AM
> To: devel at edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu at intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone at intel.com>; Liming Gao
> <gaoliming at byosoft.com.cn>; Dong, Eric <eric.dong at intel.com>
> Subject: [edk2-platforms][PATCH v1 2/5]
> MinPlatformPkg/TestPointCheckLib: Set required size field in protocol
> 
> From: Michael Kubacki <michael.kubacki at microsoft.com>
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3518
> 
> 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 <chasel.chiu at intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Eric Dong <eric.dong at intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki at microsoft.com>
> ---
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTc
> gTrustedBoot.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> TcgTrustedBoot.c
> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> TcgTrustedBoot.c
> index 2a04f86fedac..7a8e3fed22f9 100644
> ---
> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
> TcgTrustedBoot.c
> +++
> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
> +++ eckTcgTrustedBoot.c
> @@ -41,6 +41,7 @@ TestPointCheckTcgTrustedBoot (
>      goto Done;
>    }
> 
> +  ProtocolCapability.Size = (UINT8) sizeof (ProtocolCapability);

I think we should also have a ZeroMem ((VOID *) &ProtocolCapability, sizeof (ProtocolCapability)) before setting the size.

>    Status = Tcg2->GetCapability (Tcg2, &ProtocolCapability);
>    if (EFI_ERROR(Status)) {
>      DEBUG ((DEBUG_ERROR, "Tcg2->GetCapability - %r\n", Status));
> --
> 2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78760): https://edk2.groups.io/g/devel/message/78760
Mute This Topic: https://groups.io/mt/84686304/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list