diff --git a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/AArch64/PagingAuditProcessor.c b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/AArch64/PagingAuditProcessor.c index 5723dbd47e..72b61211fa 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/AArch64/PagingAuditProcessor.c +++ b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/AArch64/PagingAuditProcessor.c @@ -242,7 +242,7 @@ DumpProcessorSpecificHandlers ( } /** - Dumps platorm info required to correctly parse the pages (architecture, + Dumps platform info required to correctly parse the pages (architecture, execution level, etc.) **/ VOID diff --git a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/PagingAuditCommon.h b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/PagingAuditCommon.h index c0e7deeb48..1400de68e5 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/PagingAuditCommon.h +++ b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/PagingAuditCommon.h @@ -191,7 +191,7 @@ FlushAndClearMemoryInfoDatabase ( ); /** - Dumps platorm info required to correctly parse the pages (architecture, + Dumps platform info required to correctly parse the pages (architecture, execution level, etc.) **/ VOID diff --git a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/X64/PagingAuditProcessor.c b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/X64/PagingAuditProcessor.c index fe3b106cd6..be29d246ef 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/UEFI/X64/PagingAuditProcessor.c +++ b/UefiTestingPkg/AuditTests/PagingAudit/UEFI/X64/PagingAuditProcessor.c @@ -738,7 +738,7 @@ DumpProcessorSpecificHandlers ( } /** - Dumps platorm info required to correctly parse the pages (architecture, + Dumps platform info required to correctly parse the pages (architecture, execution level, etc.) **/ VOID diff --git a/UefiTestingPkg/AuditTests/PagingAudit/Windows/BinaryParsing.py b/UefiTestingPkg/AuditTests/PagingAudit/Windows/BinaryParsing.py index 4444cd9239..5da39edde1 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/Windows/BinaryParsing.py +++ b/UefiTestingPkg/AuditTests/PagingAudit/Windows/BinaryParsing.py @@ -87,14 +87,14 @@ def Parse4kPages(fileName): AccessFlag = ((ByteArray[byteZeroIndex + 1] & 0x4) >> 2) IsTable = ((ByteArray[byteZeroIndex + 0] & 0x2) >> 1) AccessPermisions = (((ByteArray[byteZeroIndex + 0] & 0xC0) >> 6)) - Sharability = ((ByteArray[byteZeroIndex + 1] & 0x3)) - Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) - Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) + Shareability = ((ByteArray[byteZeroIndex + 1] & 0x3)) + Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) + Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) PageTableBaseAddress = (int.from_bytes(ByteArray[byteZeroIndex: byteZeroIndex + 8], 'little')) & (0xFFFFFFFFF << 12) - logging.debug("4KB Page: 0x%s. Access Flag: %d. AccessPermissions: %d. Sharability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, AccessPermisions, Sharability, Pxn, Uxn, hex(PageTableBaseAddress))) + logging.debug("4KB Page: 0x%s. Access Flag: %d. AccessPermissions: %d. Shareability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, AccessPermisions, Shareability, Pxn, Uxn, hex(PageTableBaseAddress))) byteZeroIndex += 8 num += 1 - pages.append(MemoryRange("TTEntry", "4k", AccessFlag, (AccessPermisions & 0x2) >> 1, Sharability, Pxn, Uxn, PageTableBaseAddress, IsTable)) + pages.append(MemoryRange("TTEntry", "4k", AccessFlag, (AccessPermisions & 0x2) >> 1, Shareability, Pxn, Uxn, PageTableBaseAddress, IsTable)) logging.debug("%d entries found in file %s" % (num, fileName)) return pages @@ -131,14 +131,14 @@ def Parse2mPages(fileName): AccessFlag = ((ByteArray[byteZeroIndex + 1] & 0x4) >> 2) IsTable = ((ByteArray[byteZeroIndex + 0] & 0x2) >> 1) AccessPermisions = (((ByteArray[byteZeroIndex + 0] & 0xC0) >> 6)) - Sharability = ((ByteArray[byteZeroIndex + 1] & 0x3)) - Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) - Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) + Shareability = ((ByteArray[byteZeroIndex + 1] & 0x3)) + Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) + Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) PageTableBaseAddress = (int.from_bytes(ByteArray[byteZeroIndex: byteZeroIndex + 8], 'little')) & (0xFFFFFFFFF << 12) - logging.debug("2MB Page: 0x%s. Access Flag: %d. IsTable: %d AccessPermissions: %d. Sharability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, IsTable, AccessPermisions, Sharability, Pxn, Uxn, hex(PageTableBaseAddress))) + logging.debug("2MB Page: 0x%s. Access Flag: %d. IsTable: %d AccessPermissions: %d. Shareability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, IsTable, AccessPermisions, Shareability, Pxn, Uxn, hex(PageTableBaseAddress))) byteZeroIndex += 8 num += 1 - pages.append(MemoryRange("TTEntry", "2m", AccessFlag, (AccessPermisions & 0x2) >> 1, Sharability, Pxn, Uxn, PageTableBaseAddress, IsTable)) + pages.append(MemoryRange("TTEntry", "2m", AccessFlag, (AccessPermisions & 0x2) >> 1, Shareability, Pxn, Uxn, PageTableBaseAddress, IsTable)) logging.debug("%d entries found in file %s" % (num, fileName)) return pages @@ -175,14 +175,14 @@ def Parse1gPages(fileName): AccessFlag = ((ByteArray[byteZeroIndex + 1] & 0x4) >> 2) IsTable = ((ByteArray[byteZeroIndex + 0] & 0x2) >> 1) AccessPermisions = (((ByteArray[byteZeroIndex + 0] & 0xC0) >> 6)) - Sharability = ((ByteArray[byteZeroIndex + 1] & 0x3)) - Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) - Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) + Shareability = ((ByteArray[byteZeroIndex + 1] & 0x3)) + Pxn = ((ByteArray[byteZeroIndex + 6] & 0x20) >> 5) + Uxn = ((ByteArray[byteZeroIndex + 6] & 0x40) >> 6) PageTableBaseAddress = (int.from_bytes(ByteArray[byteZeroIndex: byteZeroIndex + 8], 'little')) & (0xFFFFFFFFF << 12) - logging.debug("1GB Page: 0x%s. Access Flag: %d. IsTable: %d AccessPermissions: %d. Sharability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, IsTable, AccessPermisions, Sharability, Pxn, Uxn, hex(PageTableBaseAddress))) + logging.debug("1GB Page: 0x%s. Access Flag: %d. IsTable: %d AccessPermissions: %d. Shareability: %d. Pxn: %d. Uxn: %d. PageTableBaseAddress: %s" % (BytesToHexString(ByteArray[byteZeroIndex : byteZeroIndex + 8]), AccessFlag, IsTable, AccessPermisions, Shareability, Pxn, Uxn, hex(PageTableBaseAddress))) byteZeroIndex += 8 num += 1 - pages.append(MemoryRange("TTEntry", "1g", AccessFlag, (AccessPermisions & 0x2) >> 1, Sharability, Pxn, Uxn, PageTableBaseAddress, IsTable)) + pages.append(MemoryRange("TTEntry", "1g", AccessFlag, (AccessPermisions & 0x2) >> 1, Shareability, Pxn, Uxn, PageTableBaseAddress, IsTable)) logging.debug("%d entries found in file %s" % (num, fileName)) return pages diff --git a/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py b/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py index 59d30d84a3..a8eba76413 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py +++ b/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py @@ -252,11 +252,11 @@ def GuardPageInit(self, VA): self.Nx = 0 self.Present = 0 - def TteInit(self, PageSize, AccessFlag, ReadWrite, Sharability, Pxn, Uxn, VA, IsTable): + def TteInit(self, PageSize, AccessFlag, ReadWrite, Shareability, Pxn, Uxn, VA, IsTable): self.PageSize = PageSize self.AccessFlag = AccessFlag self.ReadWrite = 0 if (ReadWrite == 1) else 1 - self.Sharability = Sharability + self.Shareability = Shareability self.Px = 0 if (Pxn == 1) else 1 self.Ux = 0 if (Uxn == 1) else 1 self.PhysicalStart = VA