Heap data processing method and device

A data processing and metadata technology, applied in the computer field, which can solve problems such as program or operating system damage

CN102521143BActive Publication Date: 2015-04-15RAISECOM TECH
4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Publication Date
2015-04-15

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a heap data processing method and a heap data processing device. The heap data processing method comprises the following steps: selecting an idle heap for distribution from a heap zone when confirming that a users demands to distribute memory write-in data, and updating heap metadata corresponding to the distributed heap in a set zone dynamically; or when confirming that the user requests to release the distributed heap, releasing the distributed heap which is requested by the user, and dynamically updating the heap metadata corresponding to the released heap in the set zone, wherein the heap metadata of all heaps are centrally stored in a set zone in the memory except zones occupied by all heaps. With the method disclosed by the invention, the heap metadata of all heaps are stored in a safe memory zone in concentration mode, the heap metadata are separated from heap data in terms of storage mode; and only the heap data can be the modification object of a user but the heap metadata cannot be modified, such that the problem that an attacker modifies the heap metadata through heap overflow can be prevented.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present invention relates to the field of computer technology, in particular to a heap data processing method and device. Background technique

[0002] The heap is a computer memory area with continuous addresses. The heap area includes multiple continuous heaps. Heap overflow refers to the data length exceeding the heap that occurs when the amount of data filled by a computer program into a heap exceeds the capacity of the heap itself. storage boundary phenomenon. When a very long data is input into a certain heap, the excess part will be written into other adjacent heaps in the heap area, and other heaps may have stored data, such as storing the pointer of the next instruction executed by the program, or It is the output content of other programs, so all or part of these contents may be overwritten or destroyed. If the overwritten or destroyed content is more important, it will affect the subsequent normal operation. It can be seen that the over...

Examples

Embodiment Construction

[0022] The specific implementation manners of the heap data processing method and device of the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0023] The present invention provides a heap data processing method, such as figure 1 shown, including:

[0024] When it is determined that the user needs to allocate memory to write data, select a free heap from the heap area for allocation, and dynamically update the heap metadata corresponding to the allocated heap in the set area; or,

[0025] When it is determined that the user requests to release the allocated heap, release the allocated heap requested by the user, and dynamically update the heap metadata corresponding to the released heap in the set area;

[0026] The heap metadata of all the heaps is stored centrally in a set area in the memory outside the area occupied by all the heaps.

[0027] The heap is the memory area used by the user ...