mirror of https://github.com/acidanthera/audk.git
SecurityPkg Variable: Add the check for PcdFlashNvStorageVariableSize <= PcdFlashNvStorageFtwSpareSize.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14464 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2c4b18e095
commit
41982ebbc5
|
@ -3,7 +3,7 @@
|
|||
and volatile storage space and install variable architecture protocol.
|
||||
|
||||
Copyright (C) 2013, Red Hat, Inc.
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -337,6 +337,7 @@ FtwNotificationEvent (
|
|||
UINT64 Length;
|
||||
EFI_PHYSICAL_ADDRESS VariableStoreBase;
|
||||
UINT64 VariableStoreLength;
|
||||
UINTN FtwMaxBlockSize;
|
||||
|
||||
//
|
||||
// Ensure FTW protocol is installed.
|
||||
|
@ -346,6 +347,11 @@ FtwNotificationEvent (
|
|||
return ;
|
||||
}
|
||||
|
||||
Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize);
|
||||
}
|
||||
|
||||
//
|
||||
// Find the proper FVB protocol for variable.
|
||||
//
|
||||
|
|
|
@ -797,6 +797,7 @@ SmmFtwNotificationEvent (
|
|||
EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbProtocol;
|
||||
EFI_SMM_FAULT_TOLERANT_WRITE_PROTOCOL *FtwProtocol;
|
||||
EFI_PHYSICAL_ADDRESS NvStorageVariableBase;
|
||||
UINTN FtwMaxBlockSize;
|
||||
|
||||
if (mVariableModuleGlobal->FvbInstance != NULL) {
|
||||
return EFI_SUCCESS;
|
||||
|
@ -810,6 +811,11 @@ SmmFtwNotificationEvent (
|
|||
return Status;
|
||||
}
|
||||
|
||||
Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize);
|
||||
}
|
||||
|
||||
//
|
||||
// Find the proper FVB protocol for variable.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue