diff --git a/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_AArch64.html b/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_AArch64.html index 5f80639c79..bcc16617d2 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_AArch64.html +++ b/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_AArch64.html @@ -57,8 +57,8 @@

Test Results

- UX Attribute - + Execute Attribute +

@@ -66,11 +66,6 @@

Test Results

-
- PX Attribute - -
-

@@ -121,8 +116,7 @@

Test Results

# of Pages Access Flag Read/Write - UX - PX + Execute UEFI Memory Type GCD Memory Type Section Type @@ -299,35 +293,31 @@

External Licenses

"targets": [5], }, { - "data": "UX", + "data": "Execute", "targets": [6], }, - { - "data": "PX", - "targets": [7], - }, { "data": "Memory Type", - "targets": [8], + "targets": [7], "defaultContent": "None" }, { "data": "GCD Memory Type", - "targets": [9], + "targets": [8], "defaultContent": "None" }, { "data": "Section Type", - "targets": [10] + "targets": [9] }, { "data": "System Memory", - "targets": [11], + "targets": [10], "defaultContent": "SYSTEM" }, { "data": "Memory Contents", - "targets": [12], + "targets": [11], "defaultContent": "Nothing Found" } ], //end of column def @@ -350,7 +340,7 @@

External Licenses

this.api().column(6).every( function() { var column = this; - var select = $("#UxFilter").on( 'change', function () { + var select = $("#ExecuteFilter").on( 'change', function () { //var SelectedValues = $(this).val() || []; var SearchRegex = CreateRegexForSearchMultiselect($(this).val());  column @@ -399,19 +389,7 @@

External Licenses

                }); }); //column 5 - RW attribute - this.api().column(7).every( function() { - var column = this; - var select = $("#PxFilter").on( 'change', function () { - var SearchRegex = CreateRegexForSearchMultiselect($(this).val()); - column.search(SearchRegex, true, false).draw(); - }); // on change - - column.data().unique().sort().each( function ( d, j ) { -                     select.append( '' ) -                 }); - }); //column 7 - Privilege (User / Supervisor) - - this.api().column(10).every( function() { + this.api().column(9).every( function() { var column = this; var select = $("#SectionFilter").on( 'change', function () { var SearchRegex = CreateRegexForSearchMultiselect($(this).val()); @@ -423,7 +401,7 @@

External Licenses

                }); }); //column 10 - Section Type for code/data sections - this.api().column(8).every( function() { + this.api().column(7).every( function() { var column = this; var select = $("#MemoryTypeFilter").on( 'change', function () { var SearchRegex = CreateRegexForSearchMultiselect($(this).val()); @@ -438,7 +416,7 @@

External Licenses

                }); }); //column 8 - Memory Type - this.api().column(9).every( function() { + this.api().column(8).every( function() { var column = this; var select = $("#MemorySpaceTypeFilter").on( 'change', function () { var SearchRegex = CreateRegexForSearchMultiselect($(this).val()); @@ -453,7 +431,7 @@

External Licenses

                }); }); //column 9 - GCD Memory Type - this.api().column(11).every( function() { + this.api().column(10).every( function() { var column = this; var select = $("#SpecialMemoryRegionsFilter").on( 'change', function () { //var SelectedValues = $(this).val() || []; @@ -471,7 +449,7 @@

External Licenses

}); //column 11 - special Memory Type - this.api().column(12).every( function() { + this.api().column(11).every( function() { var column = this; var select = $("#MemoryContentsFilter").on( 'change', function () { //var SelectedValues = $(this).val() || []; @@ -497,8 +475,7 @@

External Licenses

{"Page Size": "4k", "Present": "Yes", "Read/Write": "Enabled", - "Execute": "Disabled", - "Privilege": "User" + "Execute": "UX/PX", "Start": "0x0000058000", "End": "0x0000058FFF", "Number of Entries": 1, @@ -513,42 +490,39 @@

External Licenses

var SavedFilters = []; SavedFilters.push({"Name": "RW+X", "Description": "No memory range should have page attributes that allow read, write, and execute", "Filter": function(mrObject) { - if( (mrObject["UX"] === "Enabled") && (mrObject["Read/Write"] === "Enabled") && (mrObject["Access Flag"] === "Yes")) { + if( (mrObject["Execute"] !== "Disabled") && (mrObject["Read/Write"] === "Enabled") && (mrObject["Access Flag"] === "Yes") && (mrObject["GCD Memory Type"] !== "EfiGcdMemoryTypeNonExistent")) { return true; } return false; }, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("UxFilter", ["Enabled"])) - { - return false - } - if(!SetMultiselectTo("AccessFlagFilter", ["Yes"])) - { - return false - } - return SetMultiselectTo("RWFilter", ["Enabled"]); + SetMultiselectTo("ExecuteFilter", ["UX", "PX", "UX/PX"]) + SetMultiselectTo("AccessFlagFilter", ["Yes"]) + SetMultiselectTo("RWFilter", ["Enabled"]) + SetMultiselectTo("MemorySpaceTypeFilter", + ["EfiGcdMemoryTypeReserved", + "EfiGcdMemoryTypeSystemMemory", + "EfiGcdMemoryTypeMemoryMappedIo", + "EfiGcdMemoryTypePersistent", + "EfiGcdMemoryTypePersistentMemory", + "EfiGcdMemoryTypeMoreReliable", + "EfiGcdMemoryTypeMaximum"]) + return true; } //end of configuring filter inputs }); SavedFilters.push({"Name": "Data Sections are No-Execute", "Description": "Image data sections should be no-execute", "Filter": function(mrObject) { - if((mrObject["UX"] === "Enabled") && (mrObject["Section Type"] === "DATA")) { + if((mrObject["Execute"] !== "Disabled") && (mrObject["Section Type"] === "DATA")) { return true; } return false; }, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("UxFilter", ["Disabled"])) - { - return false; - } - if(!SetMultiselectTo("SectionFilter", ["DATA"])) - { - return false; - } - return SetMultiselectTo("MemoryTypeFilter", ["EfiRuntimeServicesCode"]); + SetMultiselectTo("ExecuteFilter", ["UX", "PX", "UX/PX"]) + SetMultiselectTo("SectionFilter", ["DATA"]) + return true; } //end of configuring filter inputs }); @@ -560,14 +534,8 @@

External Licenses

}, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("RWFilter", ["Enabled"])) - { - return false; - } - if(!SetMultiselectTo("SectionFilter", ["CODE"])) - { - return false; - } + SetMultiselectTo("RWFilter", ["Enabled"]) + SetMultiselectTo("SectionFilter", ["CODE"]) return true; } //end of configuring filter inputs }); diff --git a/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_X64.html b/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_X64.html index 6612a72a3b..f74b9e077e 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_X64.html +++ b/UefiTestingPkg/AuditTests/PagingAudit/Windows/DxePaging_template_X64.html @@ -513,22 +513,25 @@

External Licenses

var SavedFilters = []; SavedFilters.push({"Name": "RW+X", "Description": "No memory range should have page attributes that allow read, write, and execute", "Filter": function(mrObject) { - if( (mrObject["Execute"] === "Enabled") && (mrObject["Read/Write"] === "Enabled") && (mrObject["Present"] === "Yes")) { + if( (mrObject["Execute"] === "Enabled") && (mrObject["Read/Write"] === "Enabled") && (mrObject["Present"] === "Yes") && (mrObject["GCD Memory Type"] !== "EfiGcdMemoryTypeNonExistent")) { return true; } return false; }, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("ExecuteFilter", ["Enabled"])) - { - return false - } - if(!SetMultiselectTo("PresentFilter", ["Yes"])) - { - return false - } - return SetMultiselectTo("RWFilter", ["Enabled"]); + SetMultiselectTo("ExecuteFilter", ["Enabled"]) + SetMultiselectTo("PresentFilter", ["Yes"]) + SetMultiselectTo("RWFilter", ["Enabled"]) + SetMultiselectTo("MemorySpaceTypeFilter", + ["EfiGcdMemoryTypeReserved", + "EfiGcdMemoryTypeSystemMemory", + "EfiGcdMemoryTypeMemoryMappedIo", + "EfiGcdMemoryTypePersistent", + "EfiGcdMemoryTypePersistentMemory", + "EfiGcdMemoryTypeMoreReliable", + "EfiGcdMemoryTypeMaximum"]) + return true; } //end of configuring filter inputs }); @@ -540,15 +543,9 @@

External Licenses

}, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("ExecuteFilter", ["Disabled"])) - { - return false; - } - if(!SetMultiselectTo("SectionFilter", ["DATA"])) - { - return false; - } - return SetMultiselectTo("MemoryTypeFilter", ["EfiRuntimeServicesCode"]); + SetMultiselectTo("ExecuteFilter", ["Disabled"]) + SetMultiselectTo("SectionFilter", ["DATA"]) + return true; } //end of configuring filter inputs }); @@ -560,14 +557,8 @@

External Licenses

}, //end of Filter function "ConfigureFilter":function() { $("button#ClearAllFilter").click(); //clear the filters - if(!SetMultiselectTo("RWFilter", ["Enabled"])) - { - return false; - } - if(!SetMultiselectTo("SectionFilter", ["CODE"])) - { - return false; - } + SetMultiselectTo("RWFilter", ["Enabled"]) + SetMultiselectTo("SectionFilter", ["CODE"]) return true; } //end of configuring filter inputs }); diff --git a/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py b/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py index 5c55ab292f..3928341d1e 100644 --- a/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py +++ b/UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py @@ -361,12 +361,20 @@ def toDictionary(self, architecture): else: section_type = "UNKNOWN" + # Check the execution setting + ExecuteString = "Disabled" + if (self.Ux and self.Px): + ExecuteString = "UX/PX" + elif (self.Ux): + ExecuteString = "UX" + elif (self.Px): + ExecuteString = "PX" + return { "Page Size" : self.getPageSizeStr(), "Access Flag" : "Yes" if (self.AccessFlag == 1) else "No", "Read/Write" : "Enabled" if (self.ReadWrite == 1) else "Disabled", - "UX" : "Enabled" if (self.Ux == 1) else "Disabled", - "PX" : "Enabled" if (self.Px == 1) else "Disabled", + "Execute" : ExecuteString, "Start" : "0x{0:010X}".format(self.PhysicalStart), "End" : "0x{0:010X}".format(self.PhysicalEnd), "Number of Entries" : self.NumberOfEntries if (not self.PageSplit) else str(self.NumberOfEntries) + " (p)" ,