[edk2-devel] [PATCH 2/2] SecurityPkg: add TIS sanity check (tpm12)
Yao, Jiewen
jiewen.yao at intel.com
Thu Apr 27 14:36:57 UTC 2023
Reviewed-by: Jiewen Yao <Jiewen.yao at intel.com>
> -----Original Message-----
> From: Gerd Hoffmann <kraxel at redhat.com>
> Sent: Thursday, April 27, 2023 12:24 AM
> To: devel at edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang at intel.com>; Pawel Polawski
> <ppolawsk at redhat.com>; Oliver Steffen <osteffen at redhat.com>; Yao,
> Jiewen <jiewen.yao at intel.com>; Gerd Hoffmann <kraxel at redhat.com>
> Subject: [PATCH 2/2] SecurityPkg: add TIS sanity check (tpm12)
>
> The code blindly assumes a TIS interface is present in case both CRB and
> FIFO checks fail. Check the InterfaceType for TIS instead and only
> return PtpInterfaceTis in case it matches, PtpInterfaceMax otherwise.
>
> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> ---
> SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> index 51f43591287a..d2b79a274084 100644
> --- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> +++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
> @@ -91,7 +91,11 @@ Tpm12GetPtpInterface (
> return PtpInterfaceFifo;
> }
>
> - return PtpInterfaceTis;
> + if (InterfaceId.Bits.InterfaceType ==
> PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) {
> + return PtpInterfaceTis;
> + }
> +
> + return PtpInterfaceMax;
> }
>
> /**
> --
> 2.40.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103715): https://edk2.groups.io/g/devel/message/103715
Mute This Topic: https://groups.io/mt/98518602/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