audk/MdeModulePkg
Ard Biesheuvel 5920a9d16b MdeModulePkg/MemoryProtection: split protect and unprotect paths
Currently, the PE/COFF image memory protection code uses the same code
paths for protecting and unprotecting an image. This is strange, since
unprotecting an image involves a single call into the CPU arch protocol
to clear the permission attributes of the entire range, and there is no
need to parse the PE/COFF headers again.

So let's store the ImageRecord entries in a linked list, so we can find
it again at unprotect time, and simply clear the permissions.

Note that this fixes a DEBUG hang on an ASSERT() that occurs when the
PE/COFF image fails to load, which causes UnprotectUefiImage() to be
invoked before the image is fully loaded.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-03-21 21:29:26 +00:00
..
Application MdeModulePkg CapsuleApp: Add -NR (no-reset) option support 2017-03-21 14:48:10 +08:00
Bus MdeModulePkg/NvmExpressDxe: Memory leak fix in async code flow 2017-03-21 10:01:44 +08:00
Core MdeModulePkg/MemoryProtection: split protect and unprotect paths 2017-03-21 21:29:26 +00:00
Include MdeModulePkg/SmiHandlerProfile: Add Context support in Unregister 2017-03-13 16:04:12 +08:00
Library MdeModulePkg/DxeCapsuleLibFmp: Fix build failure 2017-03-20 10:26:59 +08:00
Logo MdeModulePkg/LogoDxe: Add missing dependency gEfiHiiImageExProtocolGuid 2017-03-17 12:25:14 +08:00
Universal MdeModulePkg/BootGraphicsResourceTableDxe: don't allocate below 4 GB 2017-03-21 07:10:39 +00:00
Contributions.txt
License.txt
MdeModulePkg.dec MdeModulePkg: Add PROMPT&HELP string of pcd to UNI file 2017-03-07 21:47:19 +08:00
MdeModulePkg.dsc MdeModulePkg/dsc: add SmiHandlerProfile to dsc. 2017-02-22 15:28:20 +08:00
MdeModulePkg.uni MdeModulePkg: Add PROMPT&HELP string of pcd to UNI file 2017-03-07 21:47:19 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00