diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-04-27 00:24:05 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-05-02 15:43:32 +0000 |
commit | d6b42ed7ed1b0c4584097f0d76798cff74c96379 (patch) | |
tree | 21d95f9b4e551c279d55fddb1bdb020a30262770 | |
parent | 832fbc6e32012fe29f1a6c67ddc90facb43ebeee (diff) | |
download | edk2-d6b42ed7ed1b0c4584097f0d76798cff74c96379.tar.gz edk2-d6b42ed7ed1b0c4584097f0d76798cff74c96379.tar.bz2 edk2-d6b42ed7ed1b0c4584097f0d76798cff74c96379.zip |
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@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
-rw-r--r-- | SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c index 51f4359128..d2b79a2740 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;
}
/**
|