diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h index 23e950aaed..e7bd4c9706 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h @@ -123,7 +123,7 @@ MmVariableServiceInitialize ( ); /** - This function checks if the communication buffer is valid. + This function checks if the Primary Buffer (CommBuffer) is valid. @param Buffer The buffer start address to be checked. @param Length The buffer length to be checked. @@ -150,7 +150,7 @@ VariableSmmIsPrimaryBufferValid ( with SMRAM. **/ BOOLEAN -VariableSmmIsBufferOutsideSmmValid ( +VariableSmmIsNonPrimaryBufferValid ( IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length ); diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index 189880c817..12b76a9746 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -864,7 +864,7 @@ SmmVariableHandler ( // Verify runtime buffers do not overlap with SMRAM ranges. // if ((RuntimeVariableCacheContext->RuntimeHobCache != NULL) && - !VariableSmmIsBufferOutsideSmmValid ( + !VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->RuntimeHobCache, (UINTN)RuntimeVariableCacheContext->RuntimeHobCache->Size )) @@ -874,7 +874,7 @@ SmmVariableHandler ( goto EXIT; } - if (!VariableSmmIsBufferOutsideSmmValid ( + if (!VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache, (UINTN)RuntimeVariableCacheContext->RuntimeVolatileCache->Size )) @@ -884,7 +884,7 @@ SmmVariableHandler ( goto EXIT; } - if (!VariableSmmIsBufferOutsideSmmValid ( + if (!VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->RuntimeNvCache, (UINTN)RuntimeVariableCacheContext->RuntimeNvCache->Size )) @@ -894,7 +894,7 @@ SmmVariableHandler ( goto EXIT; } - if (!VariableSmmIsBufferOutsideSmmValid ( + if (!VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->PendingUpdate, sizeof (*(RuntimeVariableCacheContext->PendingUpdate)) )) @@ -904,7 +904,7 @@ SmmVariableHandler ( goto EXIT; } - if (!VariableSmmIsBufferOutsideSmmValid ( + if (!VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->ReadLock, sizeof (*(RuntimeVariableCacheContext->ReadLock)) )) @@ -914,7 +914,7 @@ SmmVariableHandler ( goto EXIT; } - if (!VariableSmmIsBufferOutsideSmmValid ( + if (!VariableSmmIsNonPrimaryBufferValid ( (UINTN)RuntimeVariableCacheContext->HobFlushComplete, sizeof (*(RuntimeVariableCacheContext->HobFlushComplete)) )) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c index 1e1e933405..1b9cf6dfd9 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c @@ -7,7 +7,7 @@ Copyright (c) 2018, Linaro, Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ - +#include #include "Variable.h" /** @@ -41,12 +41,12 @@ VariableSmmIsPrimaryBufferValid ( with SMRAM. **/ BOOLEAN -VariableSmmIsBufferOutsideSmmValid ( +VariableSmmIsNonPrimaryBufferValid ( IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length ) { - return TRUE; + return MmIsBufferOutsideMmValid (Buffer, Length); } /** diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf index f09bed40cf..c4185718aa 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -18,7 +18,7 @@ # may not be modified without authorization. If platform fails to protect these resources, # the authentication service provided in this driver will be broken, and the behavior is undefined. # -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
# Copyright (c) 2018, Linaro, Ltd. All rights reserved.
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -71,6 +71,7 @@ BaseMemoryLib DebugLib HobLib + MemLib MemoryAllocationLib MmServicesTableLib SafeIntLib diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c index 35f6f4b04f..7247f7574d 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c @@ -43,7 +43,7 @@ VariableSmmIsPrimaryBufferValid ( with SMRAM. **/ BOOLEAN -VariableSmmIsBufferOutsideSmmValid ( +VariableSmmIsNonPrimaryBufferValid ( IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length )