Trusted Execution Environment Return-to-Handler Mechanism

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Trusted Execution Environments (TEEs) like Intel SGX are vulnerable to single-stepping and zero-stepping attacks, which allow malicious hypervisors or operating systems to infer sensitive information by controlling interrupts and exceptions.

Innovation Solution

The introduction of a hardware-based solution that enables return-to-handler (RTH) functionality for TEEs, allowing them to efficiently handle asynchronous exits and exceptions within the enclave without relying on nested ECALLs or OCALLs, thereby mitigating interrupt-driven attacks.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional interrupt handling mechanisms are used in TEEs, then the system can respond to asynchronous events, but the malicious hypervisor or OS can exploit interrupts to perform single-stepping or zero-stepping attacks and infer sensitive information

Engineering Contradiction:
ImprovesecurityVSAvoidside-channel information leakage
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent introduces a trusted runtime (RT) as an intermediary layer between the untrusted OS/hypervisor and the enclave code. The RT handles interrupts and exceptions within the enclave, preventing malicious software from directly exploiting these mechanisms for single-stepping or zero-stepping attacks. The RT acts as a mediator that filters and manages asynchronous events, allowing legitimate error handling while blocking attack vectors.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the exception handling functionality into two distinct parts: (1) the untrusted OS/hypervisor that generates interrupts and exceptions, and (2) the trusted runtime that actually handles them within the enclave. This segmentation isolates the sensitive enclave code from malicious software, allowing the system to respond to asynchronous events while preventing information leakage through side channels.

Inventive Principle:
Principle #1Segmentation

2Reliability

If nested ECALLs or OCALLs are used to handle exceptions in TEEs, then the system can process asynchronous events, but the number of context switches increases, reducing performance

Engineering Contradiction:
Improveexception handling capabilityVSAvoidperformance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The trusted runtime is designed to handle exceptions and interrupts self-sufficiently within the enclave, without requiring repeated transitions to the untrusted OS via nested ECALLs or OCALLs. The RT maintains its own exception handling mechanisms and state, allowing it to process asynchronous events directly and resume enclave execution with minimal context switches. This self-service approach dramatically reduces the performance overhead associated with exception handling.

Inventive Principle:
Principle #25Self-service

3Adaptability or versatility

If the TEE allows standard interrupt handling, then the system maintains compatibility with existing OS mechanisms, but it becomes vulnerable to single-stepping and zero-stepping attacks

Engineering Contradiction:
ImproveOS compatibilityVSAvoidattack surface
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

Solution Approach 1:

The trusted runtime serves as an intermediary that preserves OS compatibility while blocking attack vectors. It intercepts interrupts and exceptions before they can be exploited by malicious software, yet still allows the OS to function normally from the enclave's perspective. The RT translates OS interrupt mechanisms into secure enclave-specific handling, maintaining compatibility without exposing the attack surface.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent converts the potential harm of interrupt-driven attacks into a benefit by using the same interrupt mechanisms as the basis for secure exception handling. The trusted runtime leverages the OS's interrupt infrastructure while transforming it into a secure mechanism that enhances rather than compromises enclave security. The interrupt system becomes a controlled entry point that the RT can manage securely.

Inventive Principle:
Principle #22Blessing in disguise (Convert harm into benefit)

Data Source

PatentUS20250036751A1Apparatus and method to prevent single- and zero-stepping of trusted execution environments
Publication Date: 2025.01.30 INTEL CORP
  • US20250036751A1 patent drawing
  • US20250036751A1 patent drawing
  • US20250036751A1 patent drawing

AI summary

In one embodiment, an apparatus comprises a cache to store a plurality of instructions and data associated with a trusted execution environment; instruction processing circuitry to execute the plurality of instructions and process the data, the plurality of instructions including one or more instructions with memory operands, wherein responsive to an interrupt or an exception, the instruction processing circuitry is to pause processing the plurality of instructions and execute a handler; and decode circuitry to partially decode a next instruction of the plurality of instructions to be processed following execution of the handler to determine if the next instruction indicates a memory access and, if so, to calculate at least one corresponding memory address, wherein the partial decode is performed in accordance with one or more constant time programming restrictions.