diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-03-21 13:49:08 +0000 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-03-21 21:29:26 +0000 |
commit | 5920a9d16b1ab887c2858224316a98e961d71b05 (patch) | |
tree | d599b373bfdd5ef356680ef4345eb8382b202802 /BaseTools/Source/Python/Common/DscClassObject.py | |
parent | 5d5a19028a55a1fb42c9e4304fc84108d3206296 (diff) | |
download | edk2-5920a9d16b1ab887c2858224316a98e961d71b05.tar.gz edk2-5920a9d16b1ab887c2858224316a98e961d71b05.tar.bz2 edk2-5920a9d16b1ab887c2858224316a98e961d71b05.zip |
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>
Diffstat (limited to 'BaseTools/Source/Python/Common/DscClassObject.py')
0 files changed, 0 insertions, 0 deletions