Memory Stability Detection for Custom Allocators

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing memory error detectors, such as address sanitizers, are unable to effectively detect memory safety violations in custom memory allocators (CMAs), leading to undetected memory vulnerabilities like heap buffer overflows, due to their heuristic-based detection methods which may not cover all implementation schemes.

Innovation Solution

A memory stability determination apparatus and method that uses a machine-trained classifier to identify custom memory allocation codes, inserts functions to increase memory chunk size and poison regions with garbage values, and executes the program to detect access to these regions, determining security vulnerabilities based on access to the poisoned areas.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If heuristic-based detection methods are used to detect custom memory allocation codes, then detection rate is improved for known patterns, but detection capability deteriorates for atypical implementations

Engineering Contradiction:
Improvedetection rateVSAvoiddetection coverage
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent replaces heuristic-based detection (mechanical rule-based system) with machine learning-based detection (intelligent adaptive system). The classifier trained on memory allocation code characteristics automatically identifies both typical and atypical custom memory allocators, resolving the contradiction between precision for known patterns and adaptability for new implementations.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent changes the detection parameters from fixed heuristic rules to dynamic machine learning models that can adapt to different code patterns. By training classifiers on various memory allocation code characteristics, the system achieves high detection rates for known patterns while maintaining versatility for atypical implementations.

Inventive Principle:
Principle #35Parameter changes

2Productivity

If memory error detectors use standard detection methods, then detection overhead is reduced, but detection capability deteriorates for custom memory allocator vulnerabilities

Engineering Contradiction:
Improvedetection efficiencyVSAvoidvulnerability detection accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the detection process into two phases: (1) using a lightweight classifier to identify custom memory allocation codes, and (2) applying poison regions only to detected custom allocators. This segmentation maintains efficiency for standard code while improving reliability for custom allocator vulnerabilities.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary classifier between the detector and the memory allocation code. This classifier acts as a mediator that identifies custom memory allocators before applying detection mechanisms, ensuring that detection resources are focused where needed while maintaining overall system efficiency.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If poison regions are inserted before custom memory allocation codes, then security detection is improved, but device complexity increases

Engineering Contradiction:
Improvesecurity detection capabilityVSAvoiddetection system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by inserting poison regions before runtime execution of custom memory allocation codes. This allows detection of buffer overflows and memory safety violations during normal program execution without requiring complex analysis tools, improving reliability while keeping the system relatively simple.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating duplicate memory regions (poison regions) adjacent to the actual memory allocation. These copied regions serve as detection zones that trigger alerts when accessed, providing simple yet effective security detection without complex instrumentation.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS20240202029A1Memory stability determination apparatus, method of determining stability of memory allocation code by detecting atypical memory allocation code, and computer program
Publication Date: 2024.06.20 UNIST (ULSAN NAT INST OF SCI & TECH)
  • US20240202029A1 patent drawing
  • US20240202029A1 patent drawing
  • US20240202029A1 patent drawing

AI summary

A method of determining stability of a memory allocation code includes inputting, by a memory stability determination apparatus, a program to a classifier and detecting a custom memory allocation code, inserting, by the memory stability determination apparatus, a first function to increase a memory chunk to be allocated by a set size and allocate the memory chunk and a second function to poison an increased region with a garbage value, to a point preceding the custom memory allocation code, runtime executing, by the memory stability determination apparatus, a program into which the first function and the second function are inserted, to detect an access to a poisoned region poisoned with the garbage value, and determining, by the memory stability determination apparatus, that security of the custom memory allocation code is weak when the access to the poisoned region is true (1).