CPU Architecture Encrypting Return Addresses to Prevent Stack Smashing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current CPU architectures are vulnerable to stack smashing, stack overflow, and buffer overflow exploits, which allow hackers to gain unauthorized access by corrupting return addresses, posing a significant security risk across various operating systems.

Innovation Solution

Implementing a CPU architecture that encrypts return addresses during function calls and decrypts them upon return, using a private symmetric encryption key, thereby preventing malicious code execution without requiring state information retention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If return addresses are stored in plain text in the stack, then function call resumption is simple and fast, but the system becomes vulnerable to stack smashing and buffer overflow exploits

Engineering Contradiction:
ImprovesecurityVSAvoidCPU architecture complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies parameter changes by transforming the return address from plain text to encrypted form. The CPU encrypts the return address before pushing it to the stack, and decrypts it upon function return. This parameter transformation (from readable to encrypted) maintains security while enabling proper function resumption, directly resolving the vulnerability to stack smashing exploits.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces an intermediary mechanism (encryption/decryption module) between the return address storage and retrieval processes. This intermediary transforms the return address into an encrypted form for storage and back to plain text for execution, protecting the return address from corruption while maintaining functional correctness.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If encryption is applied to return addresses, then security against stack overflow exploits is improved, but processing time and computational overhead increase

Engineering Contradiction:
ImprovesecurityVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by encrypting the return address at the moment of function call (before it is pushed to the stack). This pre-encryption ensures security is established upfront, and the decryption occurs immediately upon function return, minimizing the time the encrypted form needs to be processed. The security measure is built into the normal function call/return sequence without requiring additional processing time.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If the CPU retains state information of calling programs, then function call resumption is accurate, but the architecture complexity and memory requirements increase

Engineering Contradiction:
Improvereturn address accuracyVSAvoidCPU architecture complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent extracts the return address information from the complex state management system and handles it separately through encryption. Instead of relying on complex stateful mechanisms to protect the return address, the solution extracts the return address, encrypts it, and stores it in the stack, simplifying the overall architecture while maintaining accuracy.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent creates an encrypted copy of the return address for storage in the stack, while the original return address logic remains in the CPU's state management. This copying approach allows the CPU to maintain accurate state information while the encrypted copy provides security protection against corruption exploits.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11995220B2Secure CPU architecture using encryption of return addresses
Publication Date: 2024.05.28 AT&T INTELLECTUAL PROPERTY I L P
  • US11995220B2 patent drawing
  • US11995220B2 patent drawing
  • US11995220B2 patent drawing

AI summary

Aspects of the subject disclosure may include, for example, identifying, during a CPU's execution of a first program, a branching instruction of the first program that redirects execution to a second program. Responsive to the identifying of the branching instruction, a return address of a next instruction of the first program is encrypted. The encrypted return address is transferred to the second program without the CPU retaining a record of the return address. The encrypted return address is received from the second program responsive to its completion of execution. The received encrypted return address is decrypted to obtain the return address enabling a resumption of execution of the first program from the next instruction. Other embodiments are disclosed.