# US 2025/0165620 A1 · Method and apparatus for detecting security vulnerability of dynamic memory

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0165620 A1
- Document ID: US20250165620A1
- Status: Published application
- Kind: A1
- Application number: 18/923,303
- Filed: 2024-10-22
- Published: 2025-05-22
- Earliest claimed: 2023-11-20
- Assignees: Electronics and Telecommunications Research Institute
- Applicants: Electronics and Telecommunications Research Institute
- Inventors: HONG-IL JU; Dong-Wook KANG; GAE-IL AN
- Web page: https://patentgrep.com/patent/US20250165620A1

## CPC

- G06F 21/577: {Assessing vulnerabilities and evaluating computer system security}
- G06F 21/79: in semiconductor storage media, e.g. directly-addressable memories
- G06F 2221/034: Test or assess a computer or a system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed herein is a method for detecting a security vulnerability of dynamic memory. The method includes allocating a heap area in physical memory in response to a heap allocation request from a user, allocating a heap area of virtual memory corresponding to the heap area in the physical memory, and returning a heap allocation address to the user, and the heap allocation address includes heap authentication information, heap allocation address identification information, and heap size information.

## Claims

### Claim 1

A method for detecting a security vulnerability of dynamic memory, comprising:
allocating a heap area in physical memory in response to a heap allocation request from a user;
allocating a heap area of virtual memory corresponding to the heap area in the physical memory; and
returning a heap allocation address to the user,
wherein the heap allocation address includes heap authentication information, heap allocation address identification information, and heap size information.

### Claim 2 (depends on 1)

The method of claim 1, wherein the heap area includes a heap header area and a heap body area.

### Claim 3 (depends on 2)

The method of claim 2, wherein the heap allocation address includes a start address of the heap body area allocated in the physical memory.

### Claim 4 (depends on 1)

The method of claim 1, wherein the heap authentication information includes most significant 7 bits and least significant 7 bits of a hash value generated based on previous heap authentication information, the heap size information, and a heap-allocation virtual address.

### Claim 5 (depends on 2)

The method of claim 2, wherein
a heap header area of the virtual memory indicates previous heap authentication information and access permission information,
a heap body area of the virtual memory indicates the heap size information and access permission information, and
the heap size information in the heap body area corresponds to a heap offset (heap_offset) value defined in 16-byte increments.

### Claim 6 (depends on 4)

The method of claim 4, wherein the heap size information corresponds to 1-bit information that indicates 1 when a size of the allocated heap area is greater than a preset size and that indicates 0 when the size of the allocated heap area is equal to or less than the preset size.

### Claim 7 (depends on 1)

The method of claim 1, wherein, when access to the heap area in the physical memory occurs, access permission information in the virtual memory corresponding to the physical memory is checked, and the access is blocked based on the access permission information.

### Claim 8 (depends on 7)

The method of claim 7, wherein
when access to the heap area in the physical memory occurs, an address of a header area of the virtual memory is calculated using heap size information in the virtual memory, and
when the heap size information is 7 bits (b7˜b1) at the calculated address and corresponds to ‘0000000’, it is determined that the address is not the header area of the virtual memory, and the address of the header area of the virtual memory is calculated again based on a multiple of ‘0x80’.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
setting heap deallocation information in response to a heap deallocation request from the user,
wherein setting the heap deallocation information comprises filling first 8 bytes of a heap body area of the physical memory corresponding to the heap deallocation request with a forward deallocated heap address, filling second 8 bytes of the heap body area of the physical memory corresponding to the heap deallocation request with a backward deallocated heap address, and initializing a remaining heap body area to 0.

### Claim 10 (depends on 9)

The method of claim 9, wherein setting the heap deallocation information comprises updating a header area of the virtual memory corresponding to the heap deallocation request with previous heap authentication information and changing access permission information in a body area of the virtual memory corresponding to the heap deallocation request to 0.

### Claim 11 (depends on 9)

The method of claim 9, further comprising:
after heap deallocation, reallocating a heap area in response to a heap reallocation request from the user,
wherein reallocating the heap area includes
reallocating the heap area in the physical memory,
updating heap area reallocation information in virtual memory corresponding to the reallocated physical memory, and
returning a heap reallocation address to the user.

### Claim 12 (depends on 11)

The method of claim 11, wherein updating the heap area reallocation information in the virtual memory comprises maintaining previous heap authentication information in a heap header area of the virtual memory and updating a heap body area of the virtual memory.

### Claim 13

An apparatus for detecting a security vulnerability of dynamic memory, comprising:
a physical memory management unit for allocating a heap area in physical memory in response to a heap allocation request from a user;
a virtual memory management unit for allocating a heap area of virtual memory corresponding to the heap area in the physical memory; and
an address return unit for returning a heap allocation address to the user,
wherein the heap allocation address includes heap authentication information, heap allocation address identification information, and heap size information.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the heap area includes a heap header area and a heap body area.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the heap allocation address includes a start address of the heap body area allocated in the physical memory.

### Claim 16 (depends on 13)

The apparatus of claim 13, wherein the heap authentication information includes most significant 7 bits and least significant 7 bits of a hash value generated based on previous heap authentication information, the heap size information, and a heap-allocation virtual address.

### Claim 17 (depends on 14)

The apparatus of claim 14, wherein
a heap header area of the virtual memory indicates previous heap authentication information and access permission information,
a heap body area of the virtual memory indicates heap size information and access permission information, and
the heap size information in the heap body area corresponds to a heap offset (heap_offset) value defined in 16-byte increments.

### Claim 18 (depends on 16)

The apparatus of claim 16, wherein the heap size information corresponds to 1-bit information that indicates 1 when a size of the allocated heap area is greater than a preset size and that indicates 0 when the size of the allocated heap area is equal to or less than the preset size.

### Claim 19 (depends on 13)

The apparatus of claim 13, wherein, when access to the heap area in the physical memory occurs, the physical memory management unit checks access permission information in the virtual memory corresponding to the physical memory and blocks the access based on the access permission information.

### Claim 20 (depends on 19)

The apparatus of claim 19, wherein, when access to the heap area in the physical memory occurs, the virtual memory management unit calculates an address of a header area of the virtual memory using heap size information in the virtual memory, and when heap size information at the calculated address corresponds to ‘0000000’, the virtual memory management unit determines that the address is not the header area of the virtual memory and again calculates the address of the header area of the virtual memory based on a multiple of ‘0x80’.
