GPU Hardware Memory Safety via Compiler Metadata Tables
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current defenses against memory safety violations primarily focus on central processing units (CPUs) and lack effective detection mechanisms for graphic processing units (GPUs, which can lead to memory corruption, privilege escalation, information leakage, and denial of service.
Innovation Solution
A compiler-based approach that inserts metadata tables and additional code into compiled source code to perform memory safety checks during execution, using base and bounds information to prevent out-of-bounds memory access and detect temporal safety violations by intercepting memory allocations and deallocations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If hardware-based memory safety checks are implemented on GPU, then memory safety and security are improved, but device complexity increases
Solution Approach 1:
The patent introduces a metadata table as an intermediary data structure that stores base and bounds information for memory allocations. This metadata table acts as a mediator between memory allocation operations and safety verification, enabling the GPU to check memory access safety without complex hard-coded verification logic throughout the execution pipeline. The compiler generates metadata table management code that works alongside existing GPU code, adding safety functionality while maintaining relative simplicity.
Solution Approach 2:
The patent performs memory safety verification in advance by maintaining a metadata table that pre-stores base and bounds information for all memory allocations. Instead of performing complex checks during each memory access operation, the system prepares the safety verification data structure beforehand, allowing for simpler and faster runtime verification. The compiler inserts code to populate this metadata table during memory allocation operations.
2Reliability
If metadata tables and additional code are inserted into compiled source code, then memory safety detection capability is improved, but code complexity increases
Solution Approach 1:
The patent extracts memory safety verification logic from the main execution flow and separates it into dedicated metadata table management operations. The compiler generates separate code segments for maintaining the metadata table (population during allocation, validation during access) distinct from the application's core logic. This separation allows safety checks to be performed systematically without entangling verification code with business logic, making the overall system more manageable despite the added complexity.
Solution Approach 2:
The patent implements feedback mechanisms where the metadata table continuously provides safety information back to memory access operations. The compiler-generated code queries the metadata table during memory operations to verify bounds compliance, and the metadata table is updated in response to allocation and deallocation events. This feedback loop enables automatic safety verification without requiring complex manual intervention or restructuring of the application code.
3Reliability
If out-of-bounds checks are performed using metadata table, then spatial memory safety is improved, but execution time increases
Solution Approach 1:
The patent performs the complex work of organizing memory allocation information into the metadata table structure in advance, during memory allocation operations. By preparing this verification data structure beforehand with pre-computed base and bounds values, the system transforms complex runtime verification problems into simple comparisons against pre-stored values. This preliminary organization of safety data significantly reduces the time required for actual bounds checking during execution.
Solution Approach 2:
The patent replaces complex mechanical bounds checking operations with simpler metadata table lookups and comparisons. Instead of performing intricate calculations to verify memory access safety, the system substitutes these operations with direct queries to the pre-populated metadata table, which stores ready-to-use base and bounds information. This substitution of complex verification mechanics with simpler table-based queries reduces execution overhead while maintaining safety guarantees.
Data Source
AI summary
While a compiler compiles source code to create an executable binary, code is added into the compiled source code that, when executed, identifies and stores in a metadata table base and bounds information associated with memory allocations. Additionally, additional code is added into the compiled source code that enables hardware to determine a safety of memory access requests during an implementation of the compiled source code by performing an out-of-bounds (OOB) check in hardware using the base and bounds information stored in the metadata table. This enables the identification and avoidance of unsafe memory operations during the implementation of the executable by a GPU.


