Files
Chiu, Chasel cbc8e420ac MinPlatformPkg/SaveMemoryConfig: Variable may not be locked.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3829

Fixed the bug that existing variable will not be locked when it is
identical with hob data by creating LockLargeVariable function, also
switched to VariablePolicyProtocol for locking variables.

Failing to lock variable could be security vulnerability, so the
LargeVariableWriteLib functions will return EFI_ABORTED if locking
was failed and SaveMemoryConfig driver will delete variable to
prevent from using unlocked variable.

This patch also modified SaveMemoryConfig driver to be unloaded after
execution because it does not produce any service protocol. To achieve
this goal the DxeRuntimeVariableWriteLib should close registered
ExitBootService events in its DESTRUCTOR.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-02-18 09:19:56 +08:00
..