]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
MdeModulePkg/Variable: Fix VarErrorFlag RT cache offset calculation
authorMichael Kubacki <michael.a.kubacki@intel.com>
Mon, 13 Jan 2020 22:44:50 +0000 (14:44 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 17 Jan 2020 02:51:42 +0000 (02:51 +0000)
commit302eb57b18d9ac70270c18a9a2a2630cba98f8ab
tree2828907eae440721b6d98e6b00d78368dc3ae251
parent63653ff8c83e732d8bb3087db09ca8e7ca11a57a
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: aab3b9b9a1e5e1f3fa966fb1667fc3e6c47e7706
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>
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c