diff options
| author | Michael D Kinney <michael.d.kinney@intel.com> | 2025-10-30 20:49:23 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-10-30 22:23:44 +0300 |
| commit | aba2b4e221c49aa60f76c2552967329b1097219e (patch) | |
| tree | 36995a0dd1e5c41cc48c24f3c65b5d3e60e97416 /BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | |
| parent | 2509b4be74d0f89f202f59a61a7b7467cd69e18b (diff) | |
| download | edk2-aba2b4e221c49aa60f76c2552967329b1097219e.tar.xz | |
EmulatorPkg/Win/Host: Fix loaded DLL page protections
The current algorithm evaluates page protection in
sections of a PE/COFF image at DWORD granularity and
it skips the evaluation of the first DWORD of the
PE/COFF image.
If a PE/COFF section has a VirtualSize that is ends
in first 4 bytes of a 4KB page, then the PE/COFF
section protection attributes for that section are
not applied to that page due to the DWORD stride.
For example, a .text section with a VirtualSize of
0x1001, 0x1002, 0x1003, or 0x1004 followed by non
.text section will not apply the PAGE_EXECUTE_READ
attribute to the second page of the .text section
and execution of code at the end of that .text
section generates an access violation exception.
The fix is to change the stride for evaluating page
protection attributes from DWORD to BYTE.
The loop is also updated to include evaluation of
the first DWORD of the PE/COFF image.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/ModuleAutoGen.py')
0 files changed, 0 insertions, 0 deletions
