Speculative Execution for Return-Oriented Programming Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for detecting return-oriented programming (ROP) payloads are resource-intensive and performance-overhead-prone, particularly due to the need for dynamic code analysis and emulation, which can be costly in terms of resources and lead to compatibility issues and high overhead in real-world systems.

Innovation Solution

The method leverages the CPU's speculative code execution capabilities to detect ROP payloads by executing a suspected ROP chain in a speculative path, using a 'canary' instruction to determine if the chain is valid, thereby reducing resource and performance overhead without affecting architectural states.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If dynamic code analysis and emulation are used to detect ROP payloads, then detection accuracy is improved, but resource consumption and performance overhead increase significantly

Engineering Contradiction:
Improvedetection accuracyVSAvoidresource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent extracts only the essential detection functionality from full emulation, using static analysis to identify potential ROP gadgets and their addresses without executing the complete code path. This selective extraction maintains detection accuracy for ROP payloads while eliminating the excessive resource consumption of full dynamic emulation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system performs preliminary static analysis to identify and catalog potential ROP gadgets and their addresses before runtime detection. By pre-computing gadget databases and preparing detection patterns in advance, the system reduces the computational burden during actual ROP payload detection, thereby lowering resource consumption while maintaining detection accuracy.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If dynamic code analysis and emulation are used to detect ROP payloads, then detection accuracy is improved, but performance overhead increases significantly

Engineering Contradiction:
Improvedetection accuracyVSAvoidperformance overhead
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent extracts only the essential detection functionality from full emulation, using static analysis to identify potential ROP gadgets and their addresses without executing the complete code path. This selective extraction maintains detection accuracy for ROP payloads while eliminating the excessive resource consumption of full dynamic emulation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system performs preliminary static analysis to identify and catalog potential ROP gadgets and their addresses before runtime detection. By pre-computing gadget databases and preparing detection patterns in advance, the system reduces the computational burden during actual ROP payload detection, thereby lowering resource consumption while maintaining detection accuracy.

Inventive Principle:
Principle #10Preliminary action

3Use of energy by moving object

If speculative code execution is used to detect ROP payloads, then resource overhead is reduced, but detection complexity increases

Engineering Contradiction:
Improveresource overheadVSAvoiddetection complexity
Core Design Contradiction:
Use of energy by moving objectVSDevice complexity

Solution Approach 1:

The patent introduces a canary instruction as an intermediary element that mediates between the suspected ROP chain and the detection mechanism. The canary instruction serves as a marker that, when executed, provides unambiguous evidence of a valid ROP chain without requiring complex analysis of the entire code path, thus reducing resource overhead while managing detection complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system replaces traditional dynamic emulation mechanisms with speculative code execution. Instead of fully emulating and analyzing each potential code path, the system uses CPU speculative execution to automatically explore possible ROP chains and detect them through side-channel observations, substituting a complex mechanical emulation system with a more efficient hardware-based approach.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

4Difficulty of detecting and measuring

If traditional emulation-based methods are used, then comprehensive code analysis is achieved, but control flow hijack risk increases

Engineering Contradiction:
Improvecode analysis completenessVSAvoidcontrol flow hijack risk
Core Design Contradiction:
Difficulty of detecting and measuringVSObject-affected harmful factors

Solution Approach 1:

The patent applies preliminary anti-action by using speculative execution to detect and neutralize ROP threats before they can execute harmful code. The canary instruction is placed in advance at critical locations, and speculative execution proactively tests for ROP chains, preventing control flow hijack before it can occur rather than reacting after the fact.

Inventive Principle:
Principle #9Preliminary anti-action

Solution Approach 2:

The system replaces traditional dynamic emulation mechanisms with speculative code execution. Instead of fully emulating and analyzing each potential code path, the system uses CPU speculative execution to automatically explore possible ROP chains and detect them through side-channel observations, substituting a complex mechanical emulation system with a more efficient hardware-based approach.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentEP3757835B1Mitigation of return-oriented programming exploits
Publication Date: 2022.07.13 INTEL CORP
  • EP3757835B1 patent drawingFigure 1
  • EP3757835B1 patent drawingFigure 2
  • EP3757835B1 patent drawingFigure 3

AI summary

A computing apparatus, including: a processor; a memory; and encoded logic to instruct the processor to: identify within the memory a payload that is suspected to be a return-oriented programming (POP) chain; execute the suspected POP chain in a speculative execution path within the processor; force a missed prediction of the speculative execution path; determine that the suspected POP chain executed through; and take a security action responsive to the determining.