audk/MdeModulePkg/Core/Dxe
Jian J Wang a6a0a59756 MdeModulePkg/Core: fix feature conflict between NX and heap guard
Considering following scenario (both NX memory protection and heap guard
are enabled):

   1. Allocate 3 pages. The attributes of adjacent memory pages will be

      |NOT-PRESENT|  present  |  present  |  present  |NOT-PRESENT|

   2. Free the middle page. The attributes of adjacent memory pages should be

      |NOT-PRESENT|  present  |NOT-PRESENT|  present  |NOT-PRESENT|

      But the NX feature will overwrite the attributes of middle page. So it
      looks still like below, which is wrong.

      |NOT-PRESENT|  present  |  PRESENT  |  present  |NOT-PRESENT|

The solution is checking the first and/or last page of a memory block to be
marked as NX, and skipping them if they are Guard pages.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2018-02-02 09:50:16 +08:00
..
Dispatcher MdeModulePkg DxeCore: Support USED_SIZE FV_EXT_TYPE 2017-12-01 09:36:59 +08:00
DxeMain MdeModulePkg/Core/Dxe: Call new API InitializeCpuExceptionHandlersEx instead 2017-12-08 14:38:51 +08:00
Event MdeModulePkg/Tpl: Fix negative value left shift 2017-09-29 16:14:17 +08:00
FwVol MdeModulePkg Core: Propagate PEI-phase FV authentication status to DXE 2017-10-10 20:54:42 +08:00
FwVolBlock MdeModulePkg Core: Propagate PEI-phase FV authentication status to DXE 2017-10-10 20:54:42 +08:00
Gcd MdeModulePkg: Update DxeCore to consume PI EfiGcdMemoryTypePersistent 2017-10-10 14:19:18 +08:00
Hand MdeModulePkg/DxeCore: Add comments for the ASSERT to check NULL ptr 2017-10-09 10:45:31 +08:00
Image MdeModulePkg/Core/Dxe: Remove extra connects for UEFI Applications 2017-11-13 09:56:49 -08:00
Library
Mem MdeModulePkg/Core: fix feature conflict between NX and heap guard 2018-02-02 09:50:16 +08:00
Misc MdeModulePkg/Core: fix feature conflict between NX and heap guard 2018-02-02 09:50:16 +08:00
SectionExtraction MdeModulePkg DxeCore: Only free ScratchBuffer when it is not NULL 2017-06-26 13:17:16 +08:00
DxeCore.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeCoreExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeMain.h MdeModulePkg/Core: Merge memory map after filtering paging capability 2017-11-28 09:25:32 +08:00
DxeMain.inf MdeModulePkg/Core: Add missing header files into inf 2017-11-24 08:35:29 +08:00