Enriched Pointer Mechanism for Memory Safety
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods, such as those described in EP3761199A1, fail to detect erroneous pointer usage that involves a single pointer pointing to the starting address of a data structure being used to write or read adjacent fields, leading to potential attacks like stack overflow or use-after-free vulnerabilities.
Innovation Solution
The proposed solution involves enriching pointers with an identifier and using a compiler to generate binary code that securely manages data structures by constructing pointers that explicitly distinguish between fields within a data structure, ensuring that each field is accessed with a unique identifier, preventing unauthorized access or data leakage between fields.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If enriched pointers with identifiers are used to detect erroneous pointer usage, then memory safety and detection capability are improved, but device complexity and processing overhead increase
Solution Approach 1:
The pointer is segmented into two distinct parts: a conventional address portion for memory location and an identifier portion for field recognition. This segmentation allows the pointer to carry both location information and field identification information, enabling detection of erroneous pointer usage without requiring a completely different data structure.
Solution Approach 2:
The identifier is merged with the address in the pointer structure, combining two previously separate functions (addressing and field identification) into a single unified pointer. This merging eliminates the need for separate identifier variables and reduces overall system complexity despite the enhanced functionality.
2Measurement precision
If identifiers are added to pointers to distinguish fields within data structures, then detection precision of erroneous usage is improved, but processing time and computational overhead increase
Solution Approach 1:
The identifier is pre-loaded into the pointer structure during pointer creation, eliminating the need for runtime lookups or additional identification steps. This preliminary action ensures that field identification information is immediately available when the pointer is used, reducing processing time during actual field access operations.
3Ease of operation
If a single pointer is used to point to the starting address of a data structure for manipulating multiple fields, then ease of operation is improved, but reliability decreases due to inability to detect adjacent field attacks
Solution Approach 1:
The pointer is segmented into two distinct parts: a conventional address portion for memory location and an identifier portion for field recognition. This segmentation allows the pointer to carry both location information and field identification information, enabling detection of erroneous pointer usage without requiring a completely different data structure.
Solution Approach 2:
Different parts of the pointer have different functions: the address portion handles memory location while the identifier portion handles field-specific identification. This local quality differentiation allows the same pointer structure to simultaneously maintain ease of operation (through unified addressing) and reliability (through field-specific identification).
Data Source
AI summary
A method for the execution of a binary code defining a data structure including a particular field to be read using a pointer, this method including writing, to the main memory, the value of the particular field associated with a first identifier of a pointer that points directly to this particular field, this identifier being determined from an identifier of the particular field that differs for all of the fields of the data structure that are adjacent to the particular field, and then constructing a pointer that points directly to this particular field, this construction including determining an identifier of this constructed pointer, and then checking that the identifier constructed in step b) corresponds to the identifier associated with this particular field in step a), and when these pointer identifiers do not match, triggering the signaling of an execution fault.


