audk/MdeModulePkg
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
..
Application MdeModulePkg: Fix misuses of AllocateCopyPool 2017-11-08 17:13:03 +08:00
Bus MdeModulePkg/Ps2Kb: ReadKeyStrokeEx always return key state 2018-02-01 14:04:02 +08:00
Core MdeModulePkg/Core: fix feature conflict between NX and heap guard 2018-02-02 09:50:16 +08:00
Include MdeModulePkg: introduce SD/MMC override protocol 2018-01-30 09:25:13 +00:00
Library MdeModulePkg/UefiBootManagerLib: Skip the DNS device path node check. 2018-01-25 13:36:56 +08:00
Logo MdeModulePkg/LogoDxe: Return error if HII Package not present 2017-05-22 16:30:11 -07:00
Universal MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key state 2018-02-01 14:03:53 +08:00
MdeModulePkg.dec MdeModulePkg: introduce SD/MMC override protocol 2018-01-30 09:25:13 +00:00
MdeModulePkg.dsc MdeModulePkg: Update package version to 0.98 2018-01-22 19:09:36 +08:00
MdeModulePkg.uni MdeModulePkg/MdeModulePkg.uni: clarify Heap Guard usage 2018-01-10 09:52:39 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00