summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/QemuFwCfgLib
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Library/QemuFwCfgLib')
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
index 8b98208591..22077851a4 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxe.c
@@ -20,6 +20,7 @@
#include <Protocol/IoMmu.h>
#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
#include <Library/IoLib.h>
#include <Library/DebugLib.h>
#include <Library/QemuFwCfgLib.h>
@@ -189,6 +190,12 @@ AllocFwCfgDmaAccessBuffer (
}
//
+ // Avoid exposing stale data even temporarily: zero the area before mapping
+ // it.
+ //
+ ZeroMem (HostAddress, Size);
+
+ //
// Map the host buffer with BusMasterCommonBuffer64
//
Status = mIoMmuProtocol->Map (