mirror of https://github.com/acidanthera/audk.git
MdeModulePkg VariableSmm: Do not need check CommBufferSize buffer
Current code in SmmVariableHandler() checks CommBufferSize buffer to make sure it points to outside SMRAM in "case SMM_VARIABLE_FUNCTION_GET_STATISTICS". But aftereaae7b33b1
, CommBufferSize buffer points to SMRAM that was used by SMM core to cache CommSize from SmmCommunication protocol, then the check will fail definitely and GET_STATISTICS feature breaks. In fact, do not need check CommBufferSize buffer at all even beforeeaae7b33b1
. Beforeeaae7b33b1
, CommBufferSize buffer pointed to gSmmCorePrivate->BufferSize that is outside SMRAM, the check will success definitely; aftereaae7b33b1
, CommBufferSize buffer points to local variable BufferSize (in SMRAM) in SmmEntryPoint(), the check is not needed definitely. The patch is to remove the check. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
8b78de74dc
commit
62016c1e89
|
@ -695,11 +695,10 @@ SmmVariableHandler (
|
|||
// It is covered by previous CommBuffer check
|
||||
//
|
||||
|
||||
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)CommBufferSize, sizeof(UINTN))) {
|
||||
DEBUG ((EFI_D_ERROR, "GetStatistics: SMM communication buffer in SMRAM!\n"));
|
||||
Status = EFI_ACCESS_DENIED;
|
||||
goto EXIT;
|
||||
}
|
||||
//
|
||||
// Do not need to check CommBufferSize buffer as it should point to SMRAM
|
||||
// that was used by SMM core to cache CommSize from SmmCommunication protocol.
|
||||
//
|
||||
|
||||
Status = SmmVariableGetStatistics (VariableInfo, &InfoSize);
|
||||
*CommBufferSize = InfoSize + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE;
|
||||
|
|
Loading…
Reference in New Issue