summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2023-02-02 17:04:14 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-02-04 12:30:47 +0000
commitff8485179c1cb847bff17725fd95043976108a54 (patch)
tree69e5a8e8e0d3b7b1a3e3095da667a41053180841 /SecurityPkg
parentcc18c503e03e64860e3587f7aa54b6beccd41fb2 (diff)
downloadedk2-ff8485179c1cb847bff17725fd95043976108a54.tar.gz
edk2-ff8485179c1cb847bff17725fd95043976108a54.tar.bz2
edk2-ff8485179c1cb847bff17725fd95043976108a54.zip
SecurityPkg/TdTcg2Dxe: td-guest shall halt when CcMeasurement install fail
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4335 CcMeasurement protocol is installed when it is supported in a td-guest. If the installation of the protocol failed, the guest shall go into CpuDeadLoop. Because the measurement feature is crucial to a td-guest and it shall stop running immediately at this situation. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r--SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
index 59341a8c02..b34da724ac 100644
--- a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
+++ b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
@@ -2510,6 +2510,12 @@ DriverEntry (
//
// Create event callback to install CC EventLog ACPI Table
EfiCreateProtocolNotifyEvent (&gEfiAcpiTableProtocolGuid, TPL_CALLBACK, InstallAcpiTable, NULL, &Registration);
+ } else {
+ //
+ // Cc measurement feature is crucial to a td-guest and it shall stop running immediately
+ // when it is failed to be installed.
+ DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __FUNCTION__, Status));
+ CpuDeadLoop ();
}
return Status;