audk/MdeModulePkg/Core/Dxe/Misc
Jian J Wang c44218e5f4 MdeModulePkg/Core: Fix heap guard issues
Three issues addressed here:

a. Make NX memory protection and heap guard to be compatible
The solution is to check PcdDxeNxMemoryProtectionPolicy in Heap Guard to
see if the free memory should be set to NX, and set the Guard page to NX
before it's freed back to memory pool. This can solve the issue which NX
setting would be overwritten by Heap Guard feature in certain
configuration.

b. Returned pool address was not 8-byte aligned sometimes
This happened only when BIT7 is not set in PcdHeapGuardPropertyMask. Since
8-byte alignment is UEFI spec required, letting allocated pool adjacent to
tail guard page cannot be guaranteed.

c. NULL address handling due to allocation failure
When allocation failure, normally a NULL will be returned. But Heap Guard
code will still try to adjust the starting address of it, which will cause
a non-NULL pointer returned.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-12-26 18:07:27 +08:00
..
DebugImageInfo.c MdeModulePkg: Refine casting expression result to bigger size 2017-03-06 14:33:20 +08:00
InstallConfigurationTable.c MdeModulePkg: Fix use-after-free error in InstallConfigurationTable() 2017-06-20 16:55:10 +08:00
MemoryAttributesTable.c MdeModulePkg/DxeCore: switch to MdePkg allocation granularity macros 2017-03-06 11:29:20 +01:00
MemoryProtection.c MdeModulePkg/Core: Fix heap guard issues 2017-12-26 18:07:27 +08:00
PropertiesTable.c MdeModulePkg/Core: Fix incorrect memory map generated in a rare case 2017-12-19 15:19:46 +08:00
SetWatchdogTimer.c Update the copyright notice format 2010-04-24 09:49:11 +00:00
Stall.c MdeModulePkg/Stall: Refine to compare 2 values with the same type 2017-01-12 21:26:27 +08:00