summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c')
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
index 2184634f35..1e359bde4f 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
@@ -537,6 +537,12 @@ SmmVariableHandler (
goto EXIT;
}
+ //
+ // The MemoryLoadFence() call here is to ensure the previous range/content
+ // checks for the CommBuffer have been completed before the subsequent
+ // consumption of the CommBuffer content.
+ //
+ MemoryLoadFence ();
if (SmmVariableHeader->NameSize < sizeof (CHAR16) || SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L'\0') {
//
// Make sure VariableName is A Null-terminated string.
@@ -631,6 +637,12 @@ SmmVariableHandler (
goto EXIT;
}
+ //
+ // The MemoryLoadFence() call here is to ensure the previous range/content
+ // checks for the CommBuffer have been completed before the subsequent
+ // consumption of the CommBuffer content.
+ //
+ MemoryLoadFence ();
if (SmmVariableHeader->NameSize < sizeof (CHAR16) || SmmVariableHeader->Name[SmmVariableHeader->NameSize/sizeof (CHAR16) - 1] != L'\0') {
//
// Make sure VariableName is A Null-terminated string.
@@ -765,6 +777,12 @@ SmmVariableHandler (
goto EXIT;
}
+ //
+ // The MemoryLoadFence() call here is to ensure the previous range/content
+ // checks for the CommBuffer have been completed before the subsequent
+ // consumption of the CommBuffer content.
+ //
+ MemoryLoadFence ();
if (CommVariableProperty->NameSize < sizeof (CHAR16) || CommVariableProperty->Name[CommVariableProperty->NameSize/sizeof (CHAR16) - 1] != L'\0') {
//
// Make sure VariableName is A Null-terminated string.