summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-05-19 01:33:25 +0000
committerlzeng14 <lzeng14@Edk2>2015-05-19 01:33:25 +0000
commitc7b897519e710487e82e08e37516a7cf73647c69 (patch)
tree0c0271e6f810b2439de20d21b3357c0b4597ec55
parentd3460bcbdce5fddbbc64ae6fa9d80b2c55cdee14 (diff)
downloadedk2-c7b897519e710487e82e08e37516a7cf73647c69.tar.gz
edk2-c7b897519e710487e82e08e37516a7cf73647c69.tar.bz2
edk2-c7b897519e710487e82e08e37516a7cf73647c69.zip
SecurityPkg Variable: Prevent BS variable update in legacy OS runtime.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17468 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
index be5c935a88..e87e12fc99 100644
--- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -1019,6 +1019,7 @@ VariableSmmRuntimeInitialize (
VOID *SmmVariableWriteRegistration;
EFI_EVENT OnReadyToBootEvent;
EFI_EVENT ExitBootServiceEvent;
+ EFI_EVENT LegacyBootEvent;
EfiInitializeLock (&mVariableServicesLock, TPL_NOTIFY);
@@ -1087,6 +1088,17 @@ VariableSmmRuntimeInitialize (
);
//
+ // Register the event to inform SMM variable that it is at runtime for legacy boot.
+ // Reuse OnExitBootServices() here.
+ //
+ EfiCreateEventLegacyBootEx(
+ TPL_NOTIFY,
+ OnExitBootServices,
+ NULL,
+ &LegacyBootEvent
+ );
+
+ //
// Register the event to convert the pointer for runtime.
//
gBS->CreateEventEx (