audk/OvmfPkg/Library/QemuFwCfgLib
Laszlo Ersek d431d8339e OvmfPkg/QemuFwCfgDxeLib: SEV: zero FW_CFG_DMA_ACCESS before decrypting it
There's a small window between

- AllocFwCfgDmaAccessBuffer() mapping the new FW_CFG_DMA_ACCESS object for
  common buffer operation (i.e., decrypting it), and

- InternalQemuFwCfgDmaBytes() setting the fields of the object.

In this window, earlier garbage in the object is "leaked" to the
hypervisor. So zero the object before we decrypt it.

(This commit message references AMD SEV directly, because QemuFwCfgDxeLib
is not *generally* enabled for IOMMU operation just yet, unlike our goal
for the virtio infrastructure. Instead, QemuFwCfgDxeLib uses
MemEncryptSevLib explicitly to detect SEV, and then relies on IOMMU
protocol behavior that is specific to SEV. At this point, this is by
design.)

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
2017-08-29 22:44:33 +02:00
..
QemuFwCfgDxe.c OvmfPkg/QemuFwCfgDxeLib: SEV: zero FW_CFG_DMA_ACCESS before decrypting it 2017-08-29 22:44:33 +02:00
QemuFwCfgDxeLib.inf OvmfPkg/QemuFwCfgLib: Implement SEV internal function for Dxe phase 2017-07-10 21:17:28 -07:00
QemuFwCfgLib.c OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS 2017-08-05 02:54:33 +02:00
QemuFwCfgLibInternal.h OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS 2017-08-05 02:54:33 +02:00
QemuFwCfgPei.c OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS 2017-08-05 02:54:33 +02:00
QemuFwCfgPeiLib.inf OvmfPkg/QemuFwCfgLib: Implement SEV internal functions for PEI phase 2017-07-10 21:17:28 -07:00
QemuFwCfgSec.c OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS 2017-08-05 02:54:33 +02:00
QemuFwCfgSecLib.inf OvmfPkg: Modify QemuFwCfgLib to use new IoLib class library 2017-01-17 10:11:41 +08:00