Dynamic Memory Manager Using Virtual Memory Tags to Prevent Use-After-Free
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing dynamic memory management technologies face challenges in preventing Use-After-Free (UAF) vulnerabilities, which occur when deallocated memory is reused, leading to high performance overhead and resource requirements.
Innovation Solution
A dynamic memory management apparatus and method that utilize a combination of actual and virtual memory to manage heap allocation and deallocation, incorporating access authority and count information to prevent dangling pointers and UAF attacks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If memory managers reallocate and use deallocated memory to improve performance and efficiency, then memory utilization and response speed are improved, but security vulnerabilities (Use-After-Free) occur when deallocated memory is accessible
Solution Approach 1:
The patent introduces an intermediary mechanism (memory tag/cookie verification system) between the memory allocator and the memory access operations. When memory is allocated, a unique tag is embedded in the memory block metadata. Before any memory access, the system verifies the tag matches the expected value. This intermediary verification prevents direct access to invalid or reused memory blocks, resolving the contradiction by allowing fast reallocation while blocking security-violating accesses through tag validation.
Solution Approach 2:
The patent applies preliminary action by pre-establishing memory tags in allocated blocks before deallocation occurs. When memory is freed, the tag is invalidated or marked as such, but the actual memory can be immediately reused. Before any access operation, the tag is verified in advance to ensure the block is still valid. This preliminary tagging and verification approach enables fast memory reuse while preventing Use-After-Free vulnerabilities through pre-checks.
2Reliability
If conventional UAF detection technology (Red-Zone insertion, Reuse Delay, coloring) is implemented to prevent Use-After-Free vulnerabilities, then memory security is improved, but high performance overhead occurs
Solution Approach 1:
The patent changes the parameter representation by using compact memory tags (e.g., 8-16 bit values) embedded in memory block metadata rather than complex verification structures. The tag is stored in unused portions of the memory header, and verification involves simple comparison operations. This parameter change from complex detection mechanisms to simple tag verification reduces computational overhead while maintaining security, resolving the contradiction between security and performance.
3Measurement precision
If garbage entities are individually identified and deallocated using extra CPU cores, then memory management accuracy is improved, but additional resources are required and scalability is limited
Solution Approach 1:
The patent implements self-service by embedding verification information (memory tags) directly in the memory blocks themselves, allowing the memory management system to verify block validity autonomously during allocation and access operations. Each memory block carries its own identification tag that enables self-verification without requiring external tracking structures or additional CPU cores. This self-contained verification approach improves accuracy while reducing resource requirements and enhancing scalability.
Data Source
AI summary
Disclosed herein are a dynamic memory management apparatus and a method for allocating/deallocating dynamic memory. The apparatus includes actual memory configured to allocate or deallocate a heap, virtual memory configured to set/store heap allocation information at a virtual address mapped to an actual address that is a body start address of a heap area of the actual memory, and a dynamic memory manager configured to process a memory allocation or deallocation request and the virtual memory, wherein the heap allocation information includes access authority information for storing information indicating whether a heap at an actual address is allocated or deallocated, and count information increased whenever a heap is allocated, and the dynamic memory manager is configured to return an address pointer including an actual address of a heap allocated to the actual memory and heap allocation information to the program, and process a heap deallocation or reallocation request.


