Method and device for detecting memory access overflow

A memory access and detection model technology, applied in the field of computer compilation, can solve the problems of high false negatives and false positives, inability to handle recursion, etc., to reduce false negatives and false positives, and reduce the cost of space and time.

Active Publication Date: 2015-04-29
AGRICULTURAL BANK OF CHINA
View PDF3 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, in reality, the state space may be infinite due to the loop structure and jump branches, but the space and time cost of traversing the state space is unbearable, and because there are many functions and loops in the source code, the exist

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for detecting memory access overflow
  • Method and device for detecting memory access overflow
  • Method and device for detecting memory access overflow

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] Explanation of related terms:

[0049] Memory access overflow (Buffer Overflow) means that due to the program's write operation on a memory object, the system mistakenly changes another memory object;

[0050] A control flow graph (CFG) is an abstract data structure used in compilers. It is an abstract representation of a procedure or program, maintained internally by the compiler. Each node in the control flow graph represents a basic block, ie, a basic block without any jumps or jump targets; jump targets start with a block, and end with a block. Each directed edge in the control flow graph is used to represent the jump direction in the control flow, or the jump relationship between basic blocks.

[0051] The data dependency graph (data dependency) refers to the data constraint relationship between the statements. If the two operations do not occupy the same variable, or they only read the same variable for continuous reading and writing, then the execution results an...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The application discloses a method for detecting memory access overflow and a device for detecting memory access overflow. The method comprises the following steps of preprocessing source codes and analyzing a lexical structure, a grammatical structure and a semantic structure, and generating a control flow graph, a data dependence graph and an abstract syntax tree; establishing various detection models to different detection scenes, analyzing the control flow graph, the data dependence graph and the abstract syntax tree according to the various detection models, performing expression iteration, traversing state space, and outputting detection results; according to detection results, judging whether access overflow is present in source codes, and performing feedback output to detected memory access overflow. Therefore, the various detection models are defined by reviewing the control flow graph of the source codes, the data dependence graph and the abstract syntax tree, and expression iteration and state machine analysis are realized, the memory access overflow in the source codes can be fully excavated, the space and time cost for traversing the state space can be reduced, and underreporting and misinformation of the memory access overflow are reduced.

Description

technical field [0001] The present application relates to the field of computer compilation, in particular to a method and device for detecting memory access overflow. Background technique [0002] Memory access overflow is one of the root causes of vulnerabilities in C language programs. It usually manifests as key problems such as array out-of-bounds access and stack overflow. These key problems may cause the program to have unpredictable results during runtime. It may run normally or cause the program to crash, which will bring great trouble to programmers during testing. As a result, they are all due to the program not performing memory access according to ideal constraints. Therefore, how to detect and judge possible loopholes as much as possible and reduce the misjudgment rate as much as possible is a current research hotspot and difficulty. [0003] Generally speaking, memory access overflow detection is divided into two parts: static detection and dynamic detection...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F21/52
CPCG06F21/52G06F21/563G06F2221/033
Inventor 朱浩
Owner AGRICULTURAL BANK OF CHINA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products