Return Address Authentication for Secure Subroutine Epilogues

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Malicious programmers exploit return-oriented programming (ROP) and jump-oriented programming (JOP) attacks by modifying return addresses in the stack, bypassing Data Execution Prevention (DEP) techniques, leading to unauthorized control flow manipulation and potential data breaches.

Innovation Solution

A processor system implements a decode unit that identifies indirect control transfer instructions, generates cryptographic signatures for return addresses using secure keys, and authenticates them before allowing instruction commit, ensuring secure handling of subroutine epilogues by comparing signatures from a return address stack and memory stack.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If cryptographic signature generation and authentication is implemented for return addresses, then security against ROP and JOP attacks is improved, but processor complexity increases

Engineering Contradiction:
ImprovesecurityVSAvoidprocessor complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system generates cryptographic signatures for return addresses in advance during subroutine call execution and stores them in a return address stack (RAS). When the subroutine returns, the pre-generated signature is quickly retrieved and verified against the actual return address, eliminating the need for time-consuming signature generation at the point of authentication and reducing critical path delay.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A dedicated return address stack (RAS) is introduced as an intermediary data structure to store pre-generated cryptographic signatures alongside return addresses. This separate storage mechanism allows the authentication logic to efficiently retrieve and verify signatures without complicating the main instruction execution path, isolating the security functionality from the core processor architecture.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If signature verification is performed before instruction commit, then security is improved, but instruction execution time increases

Engineering Contradiction:
ImprovesecurityVSAvoidinstruction execution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

Cryptographic signatures are generated and stored in the RAS during the subroutine call execution, before the return instruction is encountered. This preliminary generation allows the return instruction to simply retrieve and verify the pre-computed signature, significantly reducing the authentication time at the critical return point.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system maintains continuous instruction execution flow by allowing non-critical instructions to proceed while the cryptographic authentication occurs in parallel or is quickly resolved through the pre-generated signature verification. The in-order commit requirement is satisfied without stalling the entire pipeline because the verification uses pre-computed data.

Inventive Principle:
Principle #20Continuity of useful action

3Reliability

If return addresses are authenticated using cryptographic signatures, then control flow integrity is improved, but processing overhead increases

Engineering Contradiction:
Improvecontrol flow integrityVSAvoidprocessing throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The cryptographic signature generation is performed in advance during the subroutine call, allowing the return instruction to use a simple retrieval and verification operation. This shifts the computational burden to a non-critical time point and enables faster return instruction execution, maintaining higher processing throughput.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates and stores a copy of the return address along with its cryptographic signature in the RAS during the subroutine call. This copying mechanism allows the original return address in memory to remain unchanged while the authenticated copy is used for verification, enabling parallel execution paths and reducing processing overhead.

Inventive Principle:
Principle #26Copying

4Reliability

If the processor waits for authentication completion before committing instructions, then security is improved, but pipeline efficiency decreases

Engineering Contradiction:
ImprovesecurityVSAvoidpipeline efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

By pre-generating and storing cryptographic signatures in the RAS before the return instruction executes, the system eliminates the need for the processor to wait for signature generation during the critical return path. The verification uses pre-computed data, allowing instructions to commit in order without stalling the pipeline for cryptographic computation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system performs signature verification to the extent necessary for security (comparing the retrieved signature with the computed verification value) without requiring complete re-verification of all subroutine calls. This partial verification approach, focused only on return addresses, provides adequate security while minimizing pipeline impact.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20250378157A1Systems and Methods for Optimizing Authentication Branch Instructions
Publication Date: 2025.12.11 APPLE INC
  • US20250378157A1 patent drawing
  • US20250378157A1 patent drawing
  • US20250378157A1 patent drawing

AI summary

Systems, apparatuses, and methods for efficient handling of subroutine epilogues. When an indirect control transfer instruction corresponding to a procedure return for a subroutine is identified, the return address and a signature are retrieved from one or more of a return address stack and the memory stack. An authenticator generates a signature based on at least a portion of the retrieved return address. While the signature is being generated, instruction processing speculatively continues. No instructions are permitted to commit yet. The generated signature is later compared to a copy of the signature generated earlier during the corresponding procedure call. A mismatch causes an exception.