Processor Bounds-Checking Unit for Buffer Overflow Protection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current computer programming technologies lack effective protection against out-of-bounds buffer references, which can lead to buffer overflows, causing erratic program behavior, crashes, and potential cyberattacks, especially in languages like C and C++ that do not have built-in protection.

Innovation Solution

Incorporating a bounds-checking functional unit in processor cores to manage and check memory buffer bounds, with a compiler that generates and tracks bounds information for allocated buffers, and checks for out-of-bounds references at runtime, triggering interrupts for errors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If manual memory management is used in C/C++ for high performance, then execution speed is improved, but buffer overflow vulnerabilities increase

Engineering Contradiction:
Improveexecution speedVSAvoidbuffer overflow protection
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent introduces a compiler as an intermediary between the programmer and the processor. The compiler automatically inserts bounds-checking instructions into the code without requiring changes to the high-level C/C++ syntax. This intermediary layer provides safety checks while maintaining the original execution flow and performance characteristics of the code.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent performs bounds checking in advance before memory access operations occur. The compiler analyzes array declarations and generates code that checks bounds conditions prior to executing memory reads or writes. This preliminary validation prevents buffer overflows before they can occur, maintaining both safety and performance.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If bounds checking is added to prevent buffer overflows, then security is improved, but execution performance deteriorates

Engineering Contradiction:
Improvebuffer overflow protectionVSAvoidexecution speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

The patent applies bounds checking selectively rather than uniformly to all memory operations. The compiler identifies specific array variables that require bounds checking and generates check instructions only for those cases. This localized approach provides necessary safety while minimizing the performance impact on the overall program execution.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent transforms the bounds-checking parameter from a runtime computation to a compile-time determined value. By analyzing array declarations during compilation, the bounds values are determined in advance and hard-coded into the generated instructions. This eliminates the need for complex runtime calculations, reducing the performance overhead of bounds checking.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If automatic bounds tracking is implemented for all buffers, then safety is improved, but system complexity increases

Engineering Contradiction:
Improvememory safetyVSAvoidbounds tracking mechanism
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent makes the compiler self-service the task of bounds tracking. Instead of requiring a complex runtime system or hardware support, the compiler autonomously analyzes array declarations, determines bounds values, and generates appropriate check instructions. This self-service approach provides comprehensive bounds tracking while keeping the overall system complexity manageable by leveraging the existing compiler infrastructure.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11681806B2Protecting against out-of-bounds buffer references
Publication Date: 2023.06.20 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11681806B2 patent drawing
  • US11681806B2 patent drawing
  • US11681806B2 patent drawing

AI summary

In an approach to protecting against out-of-bounds buffer references, an apparatus comprises one or more processor cores and a bounds-checking functional unit in each processor core configured to manage bounds information for one or more memory buffers. When a buffer is allocated, an address range of the buffer is stored. When a pointer is assigned an address within the address range of the buffer, the address range of the buffer is associated with the pointer. When the pointer is used to compute an address for an operation, whether the address for the operation is within the address range associated with the pointer is determined. If the address is not within the address range associated with the pointer, signaling that an error has occurred.