audk/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe
Hao A Wu e36d5ac7d1 MdeModulePkg/SdMmcPciHcDxe: Fix double PciIo Unmap in TRB creation (CVE-2019-14587)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1989

The commit will avoid unmapping the same resource in error handling logic
for function BuildAdmaDescTable() and SdMmcCreateTrb().

For the error handling in BuildAdmaDescTable():
The error is directly related with the corresponding Map() operation
(mapped address beyond 4G, which is not supported in ADMA), so the Unmap()
operation is done in the error handling logic, and then setting
'Trb->AdmaMap' to NULL to avoid double Unmap.

For the error handling in SdMmcCreateTrb():
The error is not directly related with the corresponding Map() operation,
so the commit will update the code to left SdMmcFreeTrb() for the Unmap
operation to avoid double Unmap.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2020-02-18 05:03:49 +00:00
..
ComponentName.c MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
EmmcDevice.c MdeModulePkg/SdMmcPciHcDxe: Hook SwitchClockFreq after SD clock start 2020-01-06 06:07:30 +00:00
SdDevice.c MdeModulePkg/SdMmcPciHcDxe: Add function to start SD clock 2020-01-06 06:07:30 +00:00
SdMmcPciHcDxe.c MdeModulePkg/SdMmcPciHcDxe: Add retries for async commands 2020-01-19 01:58:00 +00:00
SdMmcPciHcDxe.h MdeModulePkg/SdMmcPciHcDxe: Add retries for sync commands 2020-01-19 01:58:00 +00:00
SdMmcPciHcDxe.inf MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
SdMmcPciHcDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
SdMmcPciHcDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
SdMmcPciHci.c MdeModulePkg/SdMmcPciHcDxe: Fix double PciIo Unmap in TRB creation (CVE-2019-14587) 2020-02-18 05:03:49 +00:00
SdMmcPciHci.h MdeModulePkg/SdMmcPciHcDxe: Fix unknown doxygen tag error 2020-01-13 01:24:13 +00:00