audk/MdeModulePkg/Universal
Hao Wu 68099b52b0 MdeModulePkg/UdfDxe: Avoid possible use of already-freed data
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1255

For function ReadFile():

If the line

  Status = GetAedAdsData (
   ...
   );

is reached multiple times during the 'for' loop, freeing the data pointed
by variable 'Data' may potentially lead to variable 'Ad' referencing the
already-freed data.

After calling function GetAllocationDescriptor(), 'Data' and 'Ad' may
point to the same memory (with some possible offset). Hence, this commit
will move the FreePool() call backwards to ensure the data will no longer
be used.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Acked-by: Star Zeng <star.zeng@intel.com>
2018-10-23 14:25:04 +08:00
..
Acpi MdeModulePkg/FirmwarePerformanceDataTableDxe: Remove an unused PCD 2018-09-29 17:49:03 +08:00
BdsDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
BootManagerPolicyDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
CapsulePei MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
CapsuleRuntimeDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Console MdeModulePkg: Avoid key notification called more than once 2018-09-14 10:18:31 +08:00
DebugPortDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
DebugSupportDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
DevicePathDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Disk MdeModulePkg/UdfDxe: Avoid possible use of already-freed data 2018-10-23 14:25:04 +08:00
DisplayEngineDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
DriverHealthManagerDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
DriverSampleDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
EbcDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
EsrtDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
EsrtFmpDxe MdeModulePkg: Remove trailing white space 2018-09-06 09:17:03 +08:00
FaultTolerantWriteDxe MdeModulePkg/FaultTolerantWrite:[CVE-2017-5753]Fix bounds check bypass 2018-09-30 13:06:42 +08:00
FaultTolerantWritePei MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
FileExplorerDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
FvSimpleFileSystemDxe MdeModulePkg FvSimpleFileSystemDxe: Fix memory leak in Read function 2018-07-27 08:54:40 +08:00
HiiDatabaseDxe MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox 2018-10-09 22:20:08 +08:00
HiiResourcesSampleDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
LegacyRegion2Dxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
LoadFileOnFv2 MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
LockBox/SmmLockBox MdeModulePkg/SmmLockBox: [CVE-2017-5753] Fix bounds check bypass 2018-09-30 13:06:42 +08:00
MemoryTest MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Metronome MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
MonotonicCounterRuntimeDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Network MdeModulePkg/Tcp4Dxe: Remove the trailing white space in one line. 2018-10-09 08:43:28 +08:00
PCD MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set 2018-10-15 14:11:31 +08:00
PcatSingleSegmentPciCfg2Pei MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
PlatformDriOverrideDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
PrintDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
PropertiesTableAttributesDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
RegularExpressionDxe MdeModulePkg/RegularExpressionDxe: Add null pointer check 2018-10-16 15:24:23 +08:00
ReportStatusCodeRouter MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
ResetSystemPei MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
ResetSystemRuntimeDxe MdeModulePkg: Remove redundant library classes and GUIDs 2018-08-20 14:53:45 +08:00
SectionExtractionDxe MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
SectionExtractionPei MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
SecurityStubDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
SerialDxe MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
SetupBrowserDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
SmbiosDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
SmbiosMeasurementDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
SmmCommunicationBufferDxe MdeModulePkg: Remove redundant library classes and GUIDs 2018-08-20 14:53:45 +08:00
StatusCodeHandler MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
TimestampDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Variable MdeModulePkg Variable: Fix Timestamp zeroing issue on APPEND_WRITE 2018-10-17 11:24:44 +08:00
WatchdogTimerDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00