audk/MdeModulePkg/Universal/Variable/RuntimeDxe
Michael Kubacki 302eb57b18 MdeModulePkg/Variable: Fix VarErrorFlag RT cache offset calculation
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2457

This commit fixes an offset calculation that is used to write the
VarErrorFlag UEFI variable to the UEFI variable runtime cache.

Currently a physical address is used instead of an offset. This
commit changes the offset to zero with a length of the entire
non-volatile variable store so the entire non-volatile variable
store buffer in SMRAM (with the variable update modification) is
copied to the runtime variable cache. This follows the same pattern
used in other SynchronizeRuntimeVariableCache () calls for
consistency.

* Observable symptom: An exception in SMM will most likely occur
  due to the invalid memory reference when the VarErrorFlag variable
  is written. The variable is most commonly written when the UEFI
  variable store is full.

* The issue only occurs when the variable runtime cache is enabled
  by the following PCD being set to TRUE:
  gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache

Fixes: aab3b9b9a1

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Turner <michael.turner@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2020-01-17 02:51:42 +00:00
..
Measurement.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PrivilegePolymorphic.h MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
Reclaim.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
SpeculationBarrierDxe.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
SpeculationBarrierSmm.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
TcgMorLockDxe.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
TcgMorLockSmm.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VarCheck.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
Variable.c MdeModulePkg/Variable: Fix VarErrorFlag RT cache offset calculation 2020-01-17 02:51:42 +00:00
Variable.h MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableDxe.c MdeModulePkg: stop abusing EFI_EVENT for protocol notify registration 2019-10-09 09:40:09 +02:00
VariableExLib.c MdeModulePkg/Variable: Parameterize auth status in VariableParsing 2019-11-05 21:55:54 -08:00
VariableNonVolatile.c MdeModulePkg/Variable: Add a file for NV variable functions 2019-11-05 21:55:54 -08:00
VariableNonVolatile.h MdeModulePkg/Variable: Add a file for NV variable functions 2019-11-05 21:55:54 -08:00
VariableParsing.c MdeModulePkg/Variable: Initialize local variable "Variable" 2019-11-25 14:14:18 +00:00
VariableParsing.h MdeModulePkg/Variable: Parameterize auth status in VariableParsing 2019-11-05 21:55:54 -08:00
VariableRuntimeCache.c MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableRuntimeCache.h MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableRuntimeDxe.inf MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableRuntimeDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableRuntimeDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableSmm.c MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableSmm.inf MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableSmm.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableSmmExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableSmmRuntimeDxe.c MdeModulePkg/Variable: Initialize local variable "RtPtrTrack" 2019-11-25 14:14:18 +00:00
VariableSmmRuntimeDxe.inf MdeModulePkg/VariableSmmRuntimeDxe.inf: list local header "Variable.h" 2019-12-02 19:35:18 +00:00
VariableSmmRuntimeDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableSmmRuntimeDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableStandaloneMm.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
VariableStandaloneMm.inf MdeModulePkg/Variable: Add RT GetVariable() cache support 2019-11-05 21:55:54 -08:00
VariableTraditionalMm.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00