Skip to content

Commit

Permalink
Paging Audit: Update File Collection to Defer Free/Allocate Calls
Browse files Browse the repository at this point in the history
Description

While collecting platform paging and memory info, freeing and
allocating memory will potentially changed the memory
layout and corrupt the test results. Because allocating and
freeing memory only transitions memory type between
EfiConventionalMemory and EfiBootServicesMemory (which are required
to have the same memory protection policy), this nuance didn't matter
much. However, as the DXE core is updated to support more strict
protections on free memory, this nuance will matter.

This patch updates the data collection routines to calculate and
allocate all required memory before fetching the memory map and
collecting page table data.

- [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.

Integration Instructions

N/A
  • Loading branch information
TaylorBeebe committed Mar 12, 2024
1 parent 9bf9579 commit fce4a6c
Show file tree
Hide file tree
Showing 2 changed files with 818 additions and 519 deletions.
Loading

0 comments on commit fce4a6c

Please sign in to comment.