Speculative Execution Security
Speculative execution security concerns observations left by instructions that never retire. A defensive model must state which microarchitectural effects cross a trust boundary.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 3
- Reading time
- 1 min
In this article3 chapters
Retirement and observation are different boundaries
Processors may perform work before a branch or permission decision is resolved. When the prediction is discarded, the architecture rolls back visible register and memory effects. Internal resource use may still affect later performance observations. Spectre is a family of failures of this separation involving speculation across intended software checks. Meltdown concerns certain implementations where transient processing can proceed before a privilege fault takes effect. The architectural guarantees and the relevant implementation behavior have to be analyzed together.
Branch prediction explains why a pipeline can begin work before a branch resolves. An information-flow specification makes the protection claim depend on exactly which effects a reader is allowed to observe.
State the security property in terms of an observer
Let \(s,s'\) be two states with the same public information and different protected data. Let \(O\) denote the observations an untrusted component can make under the model. A noninterference goal can be written as
\[ \mathrm{pub}(s)=\mathrm{pub}(s') \;\Longrightarrow\; \mathcal L(O(s))=\mathcal L(O(s')) . \]
The law includes any modeled nondeterminism or randomization. Equality of retired outputs alone is insufficient when the observation model includes timing or resource contention. A proof can partition the observable state or show that it evolves independently of protected inputs.
Different defenses change different assumptions
Page-table isolation reduces mappings shared across protection domains. Processor-supported speculation controls can restrict the effects of transitions between trust domains. A mitigation review should identify which isolation property a control establishes and how the operating system and hardware enforce it. Resource sharing can remain relevant even when memory accesses are correctly authorized. Compare capability architecture, memory ordering, and the threat model of confidential computing.[1][2]