Skip to content

Commit

Permalink
Paging Audit: Fix SMM Paging Audit Data Collection and Parsing
Browse files Browse the repository at this point in the history
The SMM paging audit needed to be updated to match the improvements
made to the DXE audit.

This change:

1. Reformats the SMM HTML template
2. Fixes the parsing of GDT and IDT entries
3. Adds the platform info data collection

- [x] Impacts functionality?
  - **Functionality** - Does the change ultimately impact how firmware functions?
  - Examples: Add a new library, publish a new PPI, update an algorithm, ...
- [ ] Impacts security?
  - **Security** - Does the change have a direct security impact on an application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
  - **Breaking change** - Will anyone consuming this change experience a break
    in build or boot behavior?
  - Examples: Add a new library class, move a module to a different repo, call
    a function in a new library class in a pre-existing module, ...
- [x] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
  - **Documentation** - Does the change contain explicit documentation additions
    outside direct code modifications (and comments)?
  - Examples: Update readme file, add feature readme file, link to documentation
    on an a separate Web page, ...

How This Was Tested

Tested on Q35 and SBSA by running the paging audit with various
memory protection profiles.

Tested on an SMM-enabled Surface device.

Integration Instructions

N/A
  • Loading branch information
TaylorBeebe committed Mar 18, 2024
1 parent 91cb9cc commit c6617fb
Show file tree
Hide file tree
Showing 3 changed files with 317 additions and 234 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ SmmPagingAuditTestAppEntryPoint (
{
UINTN StringLength;

DumpPlatforminfo ();
DumpProcessorSpecificHandlers (TRUE, &StringLength);
AllocateMemoryMapBuffer ();
MemoryMapDumpHandler (TRUE, &StringLength);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,11 @@ def toDictionary(self):
if self.ImageName == None:
section_type = "Not Tracked"
else:
# if an image range can't be read or executed, this is almost certainly
# an error.
if self.Nx == 1 and self.ReadWrite == 0:
section_type = "ERROR"
if ("GDT" in self.ImageName or "IDT" in self.ImageName):
section_type = "Descriptor Table"
else:
section_type = "ERROR"
elif self.Nx == 1:
section_type = "DATA"
elif self.ReadWrite == 0:
Expand Down
Loading

0 comments on commit c6617fb

Please sign in to comment.