# US 2016/0259682 A1 · Heap management for memory corruption detection

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

- Number: US 2016/0259682 A1
- Document ID: US20160259682A1
- Status: Published application
- Kind: A1
- Application number: 14/635,896
- Filed: 2015-03-02
- Published: 2016-09-08
- Earliest claimed: 2015-03-02
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Tomer Stark; Ady Tal; Ron Gabor
- Web page: https://patentgrep.com/patent/US20160259682A1

## CPC

- G06F 11/079: {Root cause analysis, i.e. error or fault diagnosis (in a hardware test environment G06F11/22; in a software test environment G06F11/36)}
- G06F 11/073: {in a memory management context, e.g. virtual memory or cache management (memory management G06F12/00; testing of static memory units G11C29/00)}
- G06F 11/0751: {Error or fault detection not based on redundancy (power supply failures G06F1/30; network fault management H04L41/06)}
- G06F 11/0772: {Means for error signaling, e.g. using interrupts, exception flags, dedicated error registers}
- G06F 11/10: Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F 11/1064: {in cache or content addressable memories}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Memory corruption detection technologies are described. A method can include receiving, from the application, an allocation request for an allocation of one or more contiguous memory blocks of the memory for a memory object. The method can further include allocating, by a processor, the one or more contiguous memory blocks for the memory object in view of a size of the memory object requested. The method can further include writing, into a MCD table, a first memory corruption detection (MCD) unique identifier associated with the one or more contiguous memory blocks. The method can further include creating a pointer with a memory address of the memory object and a second MCD unique identifier associated with the memory object. The method can further include sending, to the application, the pointer.

## Claims

### Claim 1

A processor, comprising:
a memory to store data from an application, wherein the memory comprises a memory corruption detection (MCD) table; and
a processor core coupled to the memory, wherein the processing core is operable to:
receive, from the application, an allocation request for an allocation of one or more contiguous memory blocks of the memory for a memory object;
allocate the one or more contiguous memory blocks for the memory object in view of a size of the memory object requested;
write, into the MCD table, a first MCD unique identifier associated with the one or more contiguous memory blocks;
create a pointer with a memory address of the memory object and a second MCD unique identifier associated with the memory object; and
send, to the application, the pointer.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the processor core is further to determine the size of the memory object requested by the allocation request.

### Claim 3 (depends on 1)

The processor of claim 1, wherein the processor core is further to:
compare the first MCD unique identifier with the second MCD unique identifier; and
communicate a corruption detection message to the application when the first MCD unique identifier and the second MCD unique identifier do not match.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the size of the memory object requested is:
a first size, wherein the first size is a request for the memory object with a number of contiguous memory blocks below a first threshold amount;
a second size, wherein the second size is a request for the memory object with a number of contiguous memory blocks that exceeds the first threshold amount and is below a second threshold amount; and
a third size, wherein the third size is a request for the memory object with a number of contiguous memory blocks that exceeds the second threshold amount.

### Claim 5 (depends on 1)

The processor of claim 1, wherein the processor core is further to:
divide the one or more contiguous memory blocks into a plurality of sub-blocks, wherein the plurality of sub-blocks comprise:
an initial sub-block;
one or more middle sub-blocks; and
a last sub-block; and
store data, to be aligned with to each of the plurality of sub-blocks, of at least one of a memory allocation meta-data field, a user data field, an overhead data filed, or an empty data field.

### Claim 6 (depends on 5)

The processor of claim 5, wherein the processor core is further to:
store data of the memory allocation meta-data field within initial sub-block so that the memory allocation meta-data field is aligned with a starting boundary of the initial block;
store data of the user data field within a first middle sub-block of the one or more middle sub-blocks so that the user data field is aligned with a starting boundary of the first middle sub-block; and
store data of the overhead data field with the last sub-block of the last sub-block so that the overhead data field is aligned with an ending boundary of the last sub-block.

### Claim 7 (depends on 5)

The processor of claim 5, the processor core is further to:
store data of the empty data field within initial sub-block so that the empty data field is aligned with a starting boundary of the initial block;
store data of the memory allocation meta-data field within a first middle sub-block of the one or more middle sub-blocks so that the memory allocation meta-data field is aligned with a starting boundary of the first middle sub-block;
store data of the user data field within a second middle sub-block of the one or more middle sub-blocks so that the user data field is aligned with a starting boundary of the second middle sub-block; and
store data of the overhead data field with the last sub-block of the last sub-block so that the overhead data field is aligned with an ending boundary of the last sub-block.

### Claim 8 (depends on 5)

The processor of claim 5, the processor core is further to:
store data of the memory allocation meta-data field within initial sub-block so that the memory allocation meta-data field is aligned with a starting boundary of the initial block;
store data of the overhead data field within a first middle sub-block of the one or more middle sub-blocks so that the overhead data field is aligned with a starting boundary of the first middle sub-block; and
store data of the user data field with the last sub-block of the last sub-block so that the user data field is aligned with an ending boundary of the last sub-block.

### Claim 9 (depends on 5)

The processor of claim 5, wherein the processor core is further to store data of the memory allocation meta-data field, data of the user data field, data of the overhead data field, or data of the empty data field based on a predetermined sub-block alignment of the processor.

### Claim 10 (depends on 1)

The processor of claim 1, wherein the processor is further to determine the MCD unique identifier associated with the memory object using a round-robin selection scheme.

### Claim 11 (depends on 1)

The processor of claim 1, wherein the processor core is further to:
determine the MCD unique identifier associated with the memory object using a random selection scheme; and
verify that the MCD unique identifier is different from another MCD unique identifier of an adjacent contiguous memory block.

### Claim 12

A system on a chip (SoC) comprising:
a processor;
a memory device coupled to the processor;
a memory controller coupled to the memory device, the memory controller to:
receive, from an application, an release request for a release of a memory object in a system memory of a processor, wherein the release request comprises a pointer;
identify a first memory corruption detection (MCD) unique identifier and a memory address of the pointer;
change the first MCD unique identifier;
change a second MCD unique identifier in a MCD table of the system memory associated with the memory address of the pointer; and
release a memory object in the system memory associated with the memory address.

### Claim 13 (depends on 12)

The SoC claim 12, wherein the memory controller is further to change, by the processor device, the second MCD unique identifier using a round-robin selection scheme.

### Claim 14 (depends on 12)

The SoC claim 12, wherein the memory controller is further to change, by the processor device, the second MCD unique identifier using a random selection scheme.

### Claim 15 (depends on 14)

The SoC claim 14, wherein the memory controller is further to verifying, by the processor device, that the second MCD unique identifier is different from another MCD unique identifier of an adjacent contiguous memory block.

### Claim 16

A method comprising:
receiving, from the application, an allocation request for an allocation of one or more contiguous memory blocks of the memory for a memory object;
allocating, by a processor, the one or more contiguous memory blocks for the memory object in view of a size of the memory object requested;
writing, into a MCD table, a first memory corruption detection (MCD) unique identifier associated with the one or more contiguous memory blocks;
creating a pointer with a memory address of the memory object and a second MCD unique identifier associated with the memory object; and
sending, to the application, the pointer.

### Claim 17 (depends on 16)

The method of claim 16, further comprising determining, by the processor the size of the memory object requested by the allocation request.

### Claim 18 (depends on 16)

The method of claim 16, further comprising:
comparing the first MCD unique identifier with the second MCD unique identifier; and
communicating a corruption detection message to the application when the first MCD unique identifier the second MCD unique identifier do not match.

### Claim 19 (depends on 16)

The method of claim 16, wherein the size of the memory object requested is:
a first size, wherein the first size is the memory object with a number of contiguous memory blocks below a first threshold amount;
a second size, wherein the second size is the memory object with a number of contiguous memory blocks that exceeds the first threshold amount and is below a second threshold amount; and
a third size, wherein the third size is the memory object with a number of contiguous memory blocks that exceeds the second threshold amount.

### Claim 20 (depends on 16)

The method of claim 16, further comprising:
dividing the one or more contiguous memory blocks into a plurality of sub-blocks, wherein the plurality of sub-blocks comprise:
an initial sub-block;
one or more middle sub-blocks; and
a last sub-block; and
storing data, to be aligned with to each of the plurality of sub-blocks, of at least one of a memory allocation meta-data field, a user data field, an overhead data filed, or an empty data field.
