mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
MdeModulePkg/VarCheckPolicyLib: Update buffer valid check func name
In the MdeModulePkg/VarCheckPolicyLib, the Primary Buffer (CommBuffer) check function has been updated to match the buffer validation behavior. For SMM, the SMM Handlers is to validate the buffer outside MMRAM. For MM, the MM Handlers do not need to validate the buffer if it is the CommBuffer passed from MmCore through the MmiHandler() parameter. Return TRUE directly in this case. Existing code is incorrect for the MM check. This will be fixed in the following patch. There is no function impact. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
This commit is contained in:
parent
67d3be644f
commit
c0021d31f8
@ -2,6 +2,7 @@
|
||||
This is a NULL library instance that leverages the VarCheck interface
|
||||
and the business logic behind the VariablePolicy code to make its decisions.
|
||||
|
||||
Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@ -105,13 +106,15 @@ VarCheckPolicyLibMmiHandler (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Make sure that the buffer does not overlap SMM.
|
||||
//
|
||||
// Make sure that the buffer is valid.
|
||||
// This should be covered by the SmiManage infrastructure, but just to be safe...
|
||||
//
|
||||
InternalCommBufferSize = *CommBufferSize;
|
||||
if ((InternalCommBufferSize > VAR_CHECK_POLICY_MM_COMM_BUFFER_SIZE) ||
|
||||
!VarCheckPolicyIsBufferOutsideValid ((UINTN)CommBuffer, (UINT64)InternalCommBufferSize))
|
||||
!VarCheckPolicyIsPrimaryBufferValid ((UINTN)CommBuffer, (UINT64)InternalCommBufferSize))
|
||||
{
|
||||
DEBUG ((DEBUG_ERROR, "%a - Invalid CommBuffer supplied! 0x%016lX[0x%016lX]\n", __func__, CommBuffer, InternalCommBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "%a - Invalid Primary Buffer (CommBuffer) supplied! 0x%016lX[0x%016lX]\n", __func__, CommBuffer, InternalCommBufferSize));
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
This internal header file defines the common interface of constructor for
|
||||
VarCheckPolicyLib.
|
||||
|
||||
Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@ -24,17 +25,17 @@ VarCheckPolicyLibCommonConstructor (
|
||||
);
|
||||
|
||||
/**
|
||||
This function is wrapper function to validate the buffer.
|
||||
This function is wrapper function to validate the Primary Buffer (CommBuffer).
|
||||
|
||||
@param Buffer The buffer start address to be checked.
|
||||
@param Length The buffer length to be checked.
|
||||
|
||||
@retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM/MMRAM.
|
||||
@retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM/MMRAM.
|
||||
@retval TRUE This buffer is valid.
|
||||
@retval FALSE This buffer is not valid.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
VarCheckPolicyIsBufferOutsideValid (
|
||||
VarCheckPolicyIsPrimaryBufferValid (
|
||||
IN EFI_PHYSICAL_ADDRESS Buffer,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
@ -1,6 +1,7 @@
|
||||
/** @file -- VarCheckPolicyLibStandaloneMm.c
|
||||
This is an instance of a VarCheck lib constructor for Standalone MM.
|
||||
|
||||
Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@ -31,17 +32,17 @@ VarCheckPolicyLibStandaloneConstructor (
|
||||
}
|
||||
|
||||
/**
|
||||
This function is wrapper function to validate the buffer.
|
||||
This function is wrapper function to validate the Primary Buffer (CommBuffer).
|
||||
|
||||
@param Buffer The buffer start address to be checked.
|
||||
@param Length The buffer length to be checked.
|
||||
|
||||
@retval TRUE This buffer is valid per processor architectureand not overlap with MMRAM.
|
||||
@retval FALSE This buffer is not valid per processor architecture or overlap with MMRAM.
|
||||
@retval TRUE This buffer is valid.
|
||||
@retval FALSE This buffer is not valid.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
VarCheckPolicyIsBufferOutsideValid (
|
||||
VarCheckPolicyIsPrimaryBufferValid (
|
||||
IN EFI_PHYSICAL_ADDRESS Buffer,
|
||||
IN UINT64 Length
|
||||
)
|
||||
|
@ -1,6 +1,7 @@
|
||||
/** @file -- VarCheckPolicyLibTraditional.c
|
||||
This is an instance of a VarCheck lib constructor for traditional SMM.
|
||||
|
||||
Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@ -31,7 +32,7 @@ VarCheckPolicyLibTraditionalConstructor (
|
||||
}
|
||||
|
||||
/**
|
||||
This function is wrapper function to validate the buffer.
|
||||
This function is wrapper function to validate the Primary Buffer (CommBuffer).
|
||||
|
||||
@param Buffer The buffer start address to be checked.
|
||||
@param Length The buffer length to be checked.
|
||||
@ -41,7 +42,7 @@ VarCheckPolicyLibTraditionalConstructor (
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
VarCheckPolicyIsBufferOutsideValid (
|
||||
VarCheckPolicyIsPrimaryBufferValid (
|
||||
IN EFI_PHYSICAL_ADDRESS Buffer,
|
||||
IN UINT64 Length
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user