FLOWSET FLOWCHECK Opcodes Control Flow Integrity

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current control flow integrity methods, such as those employing branch flags and shadow stacks, are insufficient in preventing unauthorized control flow redirects and misdirections, allowing attackers to exploit return-oriented programming (ROP) techniques, which can compromise system security.

Innovation Solution

The introduction of FLOWSET and FLOWCHECK opcodes and operations within the processor's instruction set architecture (ISA) to identify and enforce control flow integrity by marking entry and exit points of instruction blocks, ensuring that only intended flows are executed, with fault notifications triggered for any deviations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If branch flags and shadow stacks are used to protect control flow, then some control flow integrity is achieved, but the system remains vulnerable to ROP attacks and unauthorized control flow redirects

Engineering Contradiction:
Improvecontrol flow integrityVSAvoidvulnerability to ROP attacks
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent segments control flow protection into multiple independent verification mechanisms: branch flags for forward edges, shadow stacks for return edges, and the new FLOWSET/FLOWCHECK instructions for explicit flow boundaries. Each mechanism operates independently to provide layered defense against control flow attacks.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The FLOWSET instruction performs preliminary action by establishing expected control flow destinations before indirect branches are executed. The shadow stack pre-stores return addresses and the FLOWCHECK instruction verifies actual destinations match expected ones, preventing ROP attacks by checking control flow integrity in advance.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If existing control flow protection methods are implemented, then some security improvements are made, but precise enforcement of intended program flows is not achieved

Engineering Contradiction:
ImprovesecurityVSAvoidprecision of control flow enforcement
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The FLOWCHECK instruction provides feedback by comparing actual control flow destinations against expected destinations stored in the shadow stack. This feedback mechanism precisely detects deviations from intended program flows and triggers fault notifications, enabling precise enforcement of control flow integrity.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent replaces traditional mechanical control flow transfer with a verified system using FLOWSET/FLOWCHECK instructions. Instead of direct indirect branches, the system uses shadow stack verification and explicit flow boundary checks, substituting unverified control transfer with verified control transfer that provides precise enforcement.

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

3Reliability

If more control flow verification mechanisms are added, then control flow integrity is enhanced, but device complexity increases

Engineering Contradiction:
Improvecontrol flow integrityVSAvoidprocessor architecture complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The shadow stack serves multiple functions: storing return addresses for RET instructions, storing expected destinations for FLOWCHECK verification, and providing a verification mechanism for indirect branches. This multi-functionality reduces the need for separate dedicated structures for each control flow protection mechanism.

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

Solution Approach 2:

The FLOWSET and FLOWCHECK instructions are self-contained and work autonomously without requiring additional external verification mechanisms. The shadow stack automatically manages its own contents and the FLOWCHECK instruction independently verifies control flow, reducing the need for complex external control logic.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS10579457B1Processor for achieving flow integrity and a method of providing notice of a fault in control flow
Publication Date: 2020.03.03 NATIONAL SECURITY AGENCY
  • US10579457B1 patent drawing
  • US10579457B1 patent drawing
  • US10579457B1 patent drawing

AI summary

A processor and methods are provided for detecting fault in a control flow. The processor includes an instruction set architecture defining a pair of FLOWSET and FLOWCHECK opcodes and FLOWSET and FLOWCHECK operations. This pair of opcodes and associated operation works together with a CFI shadow stack to detect faults in an intended flow of instructions. Upon detection of a fault, a fault notice is provided. The methods of detecting fault in a control flow may be implemented using hardware or software and a shadow stack.