Processor Bounds-Checking Unit for Buffer Overflow Protection
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Reliability
If bounds checking is added to prevent buffer overflows, then security is improved, but execution performance deteriorates
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.
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.
3Reliability
If automatic bounds tracking is implemented for all buffers, then safety is improved, but system complexity increases
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.
Data Source
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.


