Repository navigation
Description
Feature Overview
The present implementation of patina uses the stack constructed for it by whatever agent loaded the patina core. The location of the stack thus allocated is reported to the core as part of the HOB list.
Once Patina is up and running, it should allocate its own stack (with desirable properties like configurable size and guard pages, etc.) and switch to that stack instead of the one provided by the loader.
Solution Overview
- Patina core initialization through
init_memorywould continue to use the stack provided by the loader. - Once memory services are available in Patina, it should allocate and initialize a new stack and switch to using that stack for the rest of the UEFI lifetime.
- The new stack should have desirable security properties (guard page to detect stack overrun, NX mapping).
Some additional desirable elements:
- We should try and use an existing crate (e.g. PSM https://crates.io/crates/psm, or perhaps extending our current corosensei fork).
- We should try to converge our stack construction so that it is architecturally consistent between construction of the patina core stack and construction of individual stacks for module execution.
Alternatives Considered
Do nothing: present core works well on the loader stack for the most part. But drawbacks include having portions of security story bound up in loader design choices (for example, loader may not add guard page or mark stack as NX).
Urgency
High
Are you going to implement the feature request?
Someone else needs to implement the feature
Do you need maintainer feedback?
No maintainer feedback needed
Anything else?
Marked as high urgency because it may have implications for core API (e.g. start() might need to be divergent) that we should consider sooner rather than later.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
makubacki commentedon May 27, 2026
@joschock, do you have any updates or thoughts for this issue? I'm auditing potentially stale issues.
joschock commentedon May 27, 2026
I don't have any updates. I'd be open to feedback from the team on whether this is actually necessary or desirable. I can think of a couple potential ways to implement, but I noted those in the description.
One element that has been implemented is that we do apply security features to the stack (Guard Page and Stack marked NX). This is part of the motivation for this change, and now that it is implemented independently, it may lessen the motivation or urgency for this feature.
os-d commentedon May 27, 2026
I generically think this is a nice to have, but I don't think it is urgent. We have higher priority (while still being lower priority overall) items in the "don't trust what came before", like using PAT instead of MTRRs for cache attrs on x64