SecurityPkg Variable: Support the new introduced PcdMaxAuthVariableSize.
1. If PcdMaxAuthVariableSize is set to 0, keep current behavior as is and PcdMaxVariableSize used. 2. If PcdMaxAuthVariableSize is set to non 0, it will work on authenticated variables. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17610 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -59,6 +59,10 @@ EFI_LOCK mVariableServicesLock;
|
||||
EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock;
|
||||
EDKII_VAR_CHECK_PROTOCOL mVarCheck;
|
||||
|
||||
#define MAX_NV_VARIABLE_SIZE (MAX (MAX (PcdGet32 (PcdMaxVariableSize), \
|
||||
PcdGet32 (PcdMaxAuthVariableSize)), \
|
||||
PcdGet32 (PcdMaxHardwareErrorVariableSize)))
|
||||
|
||||
/**
|
||||
SecureBoot Hook for SetVariable.
|
||||
|
||||
@@ -931,7 +935,7 @@ SmmVariableReady (
|
||||
//
|
||||
// Allocate memory for variable communicate buffer.
|
||||
//
|
||||
mVariableBufferPayloadSize = MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxHardwareErrorVariableSize)) +
|
||||
mVariableBufferPayloadSize = MAX_NV_VARIABLE_SIZE +
|
||||
OFFSET_OF (SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) - sizeof (VARIABLE_HEADER);
|
||||
mVariableBufferSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + mVariableBufferPayloadSize;
|
||||
mVariableBuffer = AllocateRuntimePool (mVariableBufferSize);
|
||||
|
Reference in New Issue
Block a user