audk/MdeModulePkg/Core/PiSmmCore
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
..
Dependency.c MdeModulePkg/Core: Fix typos in comments 2016-10-27 09:11:17 +08:00
Dispatcher.c MdeModulePkg: Update PiSmmCore to set correct ImageAddress into LoadedImage 2017-04-25 09:48:22 +08:00
Handle.c MdeModulePkg: Enhance the debug message for InstallProtocolInterface 2017-06-23 14:46:41 +08:00
HeapGuard.c MdeModulePkg/Core: Fix heap guard issues 2017-12-26 18:07:27 +08:00
HeapGuard.h MdeModulePkg/PiSmmCore: Fix issues in Heap Guard 2017-12-13 11:42:57 +08:00
InstallConfigurationTable.c MdeModulePkg: Fix use-after-free error in InstallConfigurationTable() 2017-06-20 16:55:10 +08:00
Locate.c MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL 2017-06-21 21:37:34 +08:00
MemoryAttributesTable.c MdeModulePkg/Core: Fix incorrect memory map generated in a rare case 2017-12-19 15:19:46 +08:00
Notify.c
Page.c MdeModulePkg: Fix unix style of EOL 2017-11-21 20:24:37 +08:00
PiSmmCore.c MdeModulePkg PiSmmCore: Use SxDispatch in SmmEndOfDxeHandler() 2017-12-15 10:38:11 +08:00
PiSmmCore.h MdeModulePkg PiSmmCore: Only install EndOfS3Resume during S3 resume 2017-12-12 18:30:06 +08:00
PiSmmCore.inf MdeModulePkg PiSmmCore: Only install EndOfS3Resume during S3 resume 2017-12-12 18:30:06 +08:00
PiSmmCore.uni
PiSmmCoreExtra.uni
PiSmmCorePrivateData.h
PiSmmIpl.c MdeModulePkg PiSmmIpl: Add missing update to the prototype 2017-12-12 18:20:03 +08:00
PiSmmIpl.inf
PiSmmIpl.uni
PiSmmIplExtra.uni
Pool.c MdeModulePkg: Fix unix style of EOL 2017-11-21 20:24:37 +08:00
Smi.c MdeModulePkg/PiSmmCore: Add SmiHandlerProfile support. 2017-02-22 15:28:18 +08:00
SmiHandlerProfile.c MdeModulePkg SmiHandlerProfile: Use fixed data type in data structure 2017-05-24 15:27:34 +08:00
SmramProfileRecord.c MdeModulePkg PiSmmCore: Remove unreferenced symbol for SMRAM profile 2017-03-15 16:47:10 +08:00