Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A stack overflow detection system and method

A detection system and detection method technology, applied in the computer field, can solve the problems of complex implementation, occupying the top space of the stack, unable to detect in the first time, etc., and achieve the effect of saving stack space overhead and avoiding omissions.

Active Publication Date: 2020-05-05
武汉长江计算科技有限公司
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0012] For the above-mentioned dynamic analysis method, the detection method of Method 1 relies on scanning the content of the stack space after the event, which belongs to the post-event detection. In fact, it cannot be detected in the first time when the stack overflow occurs. At this time, the stack has overflowed and May rewrite the memory outside the stack space, etc.
Method 2 can be detected in the first time, but if the address accessed by the stack overflow passes through the detection space and breaks through the isolation protection at the top of the stack, the stack overflow will not be detected
For the third method, taking the VxWorks operating system as an example, it is necessary to add the RTSP field in the TCB (Task Control Block, task control block), or to use the reserved field of the TCB, or to use the task variable to implement, and it is necessary to target the kernel task It is more complicated to implement in a different way from user tasks
At the same time, the added RTSP occupies additional space on the top of the stack. When the function call level is very deep, the stack space is also a considerable overhead.

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
  • A stack overflow detection system and method
  • A stack overflow detection system and method
  • A stack overflow detection system and method

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0077] The original executable file also includes the original interrupt initialization function. On the basis of the installation method of the stack overflow detection system in the first embodiment of the present invention, the installation method of the stack overflow detection system in the second embodiment of the present invention also includes:

[0078] After the original executable file is loaded, the second initialization module 1b is inserted into the exit of the original interrupt initialization function by instrumentation.

[0079] see Figure 6 As shown, the detection method of the stack overflow detection system in the second embodiment of the present invention includes:

[0080] S10. The first initialization module 1a obtains the basic information of the stack when creating a task, and the second initialization module 1b obtains the basic information of the stack when performing interrupt initialization. The basic information of the stack includes the type of t...

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 invention discloses a stack overflow detection system and method and relates to the technical field of computers. The detection system comprises a first initialization module, a stack overflow detection module and an exception handling module, wherein the first initialization module is arranged at an output port of each task creation function of an executable file and used for acquiring basicinformation of a stack during task creation; the stack overflow detection module is arranged at an input port of each task execution function of the executable file and used for judging whether stackoverflow occurs according to an SP value corresponding to a current execution instruction of the task execution function and the basic information of the stack of the function; the exception handlingmodule is used for recording a judgment result of the stack overflow detection module and recalling illegally covered memory space addresses when stack overflow occurs. Stack overflow can be detectedaccurately in the first time, missing can be avoided, the probably illegally modified memory area beyond stack space can be reminded during stack overflow, and the stack space cost is saved.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a stack overflow detection system and method. Background technique [0002] In computer science, the stack is usually used to store temporary variables, pass parameters to called functions, save task state, save function return addresses, etc. Normally, the base address of the stack, that is, the bottom of the stack is a fixed address, and the top of the stack is the address after a certain amount of space is increased or downward based on the base address of the stack. The space between the top of the stack and the bottom of the stack is for the stack space. SP (Stack Pointer, stack pointer) points to the actual top of the stack, and SP cannot go beyond the top of the stack. The present invention is illustrated with 32-bit MIPS (Microprocessor without Interlocked Piped Stages, the microprocessor without internal interlocking pipeline level) system as an example, MIPS has 32 ...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F21/52
CPCG06F21/52
Inventor 曾颜
Owner 武汉长江计算科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products