Skip to content

[Feature]: Reject Memory Attribute Changes With No Access Attributes Set #116

Description

@os-d

Feature Overview

A common issue seen in DXE drivers is setting a caching attribute without setting a memory access attribute (XP,RO,XP) which ends up clearing any access attributes set on the memory region and leaving it unprotected.

This is a pattern that is allowed to exist on the C codebase, but the Rust codebase is an opportunity to enforce that access attributes must always be set on every valid page.

Solution Overview

From DXE core, reject any attribute update that does not pass in an access attribute.

From any component setting memory attributes either:

  • Set the access attribute that the driver knows it should be (i.e. an MMIO range should be XP)
  • Read the current memory descriptor, take the current access attributes and or on the new caching attribute

Alternatives Considered

No response

Urgency

None

Are you going to implement the feature request?

None

Do you need maintainer feedback?

None

Anything else?

No response

Activity

  1. self-assigned this
    on Oct 18, 2024
  2. os-d commented on Apr 1, 2025

    @os-d
    ContributorAuthor

    This work has not started yet and is not required for the major release. Removing milestone and parent item but leaving issue open.

  3. makubacki commented on May 13, 2025

    @makubacki
    Collaborator

    @os-d, can you please update?

  4. os-d commented on May 13, 2025

    @os-d
    ContributorAuthor

    @cfernald , this is more or less taken care of with your API changes, right?

  5. cfernald commented on May 13, 2025

    @cfernald
    Contributor

    @os-d only for the rust consumers, the C API would still need to account for this.

  6. moved this to Backlog in Patinaon May 15, 2025
  7. added
    state:backlog
    type:feature-request
    on Jun 19, 2025
  8. added this to the Backlog milestone on Jul 31, 2025
  9. added
    urgency:low
    on Jul 31, 2025
  10. added a commit that references this issue on Sep 23, 2025
  11. os-d commented on Feb 23, 2026

    @os-d
    ContributorAuthor

    I'm going to close this as completed since the Patina API is correct. The C API unfortunately needs to stay open for a few reasons:

    • Drivers will expect to call with no access or cache attributes set to be able to set virtual attributes (which could be inspected)
    • Compatibility mode will flip us into allocating everything as RWX
    • Many C drivers don't set attributes correctly. We want to catch this, but the paging audit is our best bet at the moment.
  12. moved this from Backlog to Done in Patinaon Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

state:backlogtype:feature-requesturgency:low

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions