summaryrefslogtreecommitdiff
path: root/SecurityPkg/VariableAuthenticated
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-06-11 10:23:44 +0000
committerlzeng14 <lzeng14@Edk2>2015-06-11 10:23:44 +0000
commitfe9dfae5149af20c08127fb5849dbb0ae44c71ae (patch)
tree0c5f2ffe5bbb4891347f5e39efd0e2af3898a29f /SecurityPkg/VariableAuthenticated
parentfe32096778cf248e36d6d00cd958d73fb903126f (diff)
downloadedk2-platforms-fe9dfae5149af20c08127fb5849dbb0ae44c71ae.tar.xz
SecurityPkg Variable: Move VariableLock install into SmmVariableReady().
VariableLock in VariableSmmRuntimeDxe.c is installed in EntryPoint now. It works based on SMM variable handler by SMM communication with payload buffer. But the payload buffer and SMM variable handler will be not ready in EntryPoint before SmmVariableReady() call back. VarCheck in VariableSmmRuntimeDxe.c has the same issue, so move VarCheck install into SmmVariableReady() also. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17625 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/VariableAuthenticated')
-rw-r--r--SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
index 94b60bf5cf..ffa0b078b2 100644
--- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -961,6 +961,26 @@ SmmVariableReady (
NULL
);
ASSERT_EFI_ERROR (Status);
+
+ mVariableLock.RequestToLock = VariableLockRequestToLock;
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mHandle,
+ &gEdkiiVariableLockProtocolGuid,
+ &mVariableLock,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ mVarCheck.RegisterSetVariableCheckHandler = VarCheckRegisterSetVariableCheckHandler;
+ mVarCheck.VariablePropertySet = VarCheckVariablePropertySet;
+ mVarCheck.VariablePropertyGet = VarCheckVariablePropertyGet;
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mHandle,
+ &gEdkiiVarCheckProtocolGuid,
+ &mVarCheck,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
}
@@ -1018,7 +1038,6 @@ VariableSmmRuntimeInitialize (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
VOID *SmmVariableRegistration;
VOID *SmmVariableWriteRegistration;
EFI_EVENT OnReadyToBootEvent;
@@ -1027,26 +1046,6 @@ VariableSmmRuntimeInitialize (
EfiInitializeLock (&mVariableServicesLock, TPL_NOTIFY);
- mVariableLock.RequestToLock = VariableLockRequestToLock;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mHandle,
- &gEdkiiVariableLockProtocolGuid,
- &mVariableLock,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- mVarCheck.RegisterSetVariableCheckHandler = VarCheckRegisterSetVariableCheckHandler;
- mVarCheck.VariablePropertySet = VarCheckVariablePropertySet;
- mVarCheck.VariablePropertyGet = VarCheckVariablePropertyGet;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mHandle,
- &gEdkiiVarCheckProtocolGuid,
- &mVarCheck,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
//
// Smm variable service is ready
//