|国家预印本平台
首页|程序回调引起的非法计算静态检测方法

程序回调引起的非法计算静态检测方法

Static Detection Method for Illegal Arithmetic Operation caused by Callback in C Program

中文摘要英文摘要

函数指针是C程序中常见的语法,因其同时具有变量和函数的语义,具有一定的复杂性,在静态分析中常被忽略。文章研究函数指针相关的数据流问题,提出了一种能够表达函数指针信息的数据流分析方法,并且利用此数据流分析方法检测C程序中由回调引起的非法计算,最后实现了检测此类型缺陷的静态分析工具。文章首先讨论了函数指针在数据流分析中存在的问题,提出了扩展的函数调用图构建方法和基于可变函数摘要的区间计算方法;然后将回调引起的非法计算抽象为缺陷状态机模型,并提出此类型非法计算的检测算法。最后通过和其他静态分析工具的实验对比,证明了此数据流分析方法和缺陷检测方法的有效性。

Function pointer is a common syntax in C programs. Because it has the semantics of variables and functions at the same time, it has certain complexity and is often ignored in static analysis. This paper studies the data flow problem related to function pointers, proposes a data flow analysis method that can express the information of function pointers, and uses this data flow analysis method to detect illegal calculations caused by callbacks in C programs, and finally implemented a static analysis tool to detect this type of defect. The paper first discusses the problems of function pointers in data flow analysis, and proposes an extended function call graph construction method and an interval calculation method based on mutable procedure summary. Then, the illegal arithmetic operation caused by callbacks is abstracted into a defect state machine model, and a detection algorithm for this type of illegal arithmetic operation is proposed. Finally, the effectiveness of this data flow analysis method and defect detection method is proved by the experimental comparison results with other static analysis tools.

武帅、金大海

计算技术、计算机技术

软件测试非法计算函数指针静态分析区间计算

Software testIllegal arithmetic operationFunction pointerStatic analysisInterval computation

武帅,金大海.程序回调引起的非法计算静态检测方法[EB/OL].(2022-12-21)[2025-08-11].http://www.paper.edu.cn/releasepaper/content/202212-76.点此复制

评论