Shadow Stack Protection for Ring Transition Security

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computer systems are vulnerable to control flow subversion attacks, particularly Return-Oriented Programming (ROP) attacks, due to the mixing of data and control information on the same stack and the lack of effective protection mechanisms during ring transitions.

Innovation Solution

The implementation of shadow stacks that are separate from the data stack and are writeable only by specific instructions, such as CALL and FAR CALL, to protect control information during ring transitions and prevent unauthorized stack modifications.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If data and control information are stored on the same stack, then device complexity is reduced, but security vulnerability increases due to control flow subversion attacks

Engineering Contradiction:
Improvestack structureVSAvoidcontrol flow subversion attacks
Core Design Contradiction:
Device complexityVSObject-affected harmful factors

Solution Approach 1:

The patent divides the traditional single stack into two separate stacks: a data stack for storing general data and a shadow stack for storing control information (return addresses). This segmentation isolates control flow data from data operations, preventing attackers from corrupting control flow through data stack manipulation while maintaining the simplicity of using separate stacks for different purposes.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The shadow stack acts as an intermediary protection layer between the data stack and the control flow execution path. By introducing this intermediate structure that stores validated return addresses, the patent creates a buffer that prevents direct attacks on control flow while allowing legitimate control transfers to proceed normally.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If shadow stacks are implemented to protect control information, then security against ROP attacks is improved, but device complexity increases

Engineering Contradiction:
Improvesecurity against ROP attacksVSAvoidstack management structure
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The shadow stack is designed to work with existing call and return instructions without requiring new instruction types. The same CALL, FAR CALL, and RET instructions that operate on the data stack also automatically interact with the shadow stack, providing universal protection across all control transfer operations while avoiding the need for complex new instruction sets or specialized hardware components.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The shadow stack automatically manages its own contents through the existing call and return instruction mechanisms. When a CALL instruction pushes a return address to the data stack, it simultaneously pushes to the shadow stack. When a RET instruction pops from the data stack, it validates and pops from the shadow stack. This self-service approach eliminates the need for separate management logic while maintaining security.

Inventive Principle:
Principle #25Self-service

3Reliability

If shadow stacks are made writeable only by specific instructions, then protection against unauthorized modifications is improved, but ease of operation decreases

Engineering Contradiction:
Improveprotection against unauthorized stack modificationsVSAvoidstack accessibility
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The shadow stack implements dynamic accessibility based on instruction type and execution context. Standard data operations (MOV, PUSH, POP) are dynamically blocked from accessing the shadow stack, while control transfer instructions (CALL, FAR CALL, RET) are dynamically enabled to access it. This dynamic behavior provides automatic protection without requiring programmers to manually manage accessibility, as the protection is enforced by the instruction semantics themselves.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20250053641A1Processor extensions to protect stacks during ring transitions
Publication Date: 2025.02.13 INTEL CORP
  • US20250053641A1 patent drawing
  • US20250053641A1 patent drawing
  • US20250053641A1 patent drawing

AI summary

A processor implementing techniques for processor extensions to protect stacks during ring transitions is provided. In one embodiment, the processor includes a plurality of registers and a processor core, operatively coupled to the plurality of registers. The plurality of registers is used to store data used in privilege level transitions. Each register of the plurality of registers is associated with a privilege level. An indicator to change a first privilege level of a currently active application to a second privilege level is received. In view of the second privilege level, a shadow stack pointer (SSP) stored in a register of the plurality of registers is selected. The register is associated with the second privilege level. By using the SSP, a shadow stack for use by the processor at the second privilege level is identified.