缓冲区溢出快速修复:[论文阅读] Automated Generation of Buffer Overflows Quick Fixes Using Symbolic Execution...

版权声明:如需转载或引用,请注明出处。 https://blog.csdn.net/weixin_39278265/article/details/87872268

前言

本文旨在介绍:2015年 SAFECOMP 会议上有关 缓冲区溢出快速修复文章 : Automated Generation of Buffer Overflows Quick Fixes Using Symbolic Execution and SMT。

1 基本信息

[126] P. Muntean, V. K. Kommanapalli, A. Ibing, and C. Eckert. “Automated Generation of Buffer Overflows Quick Fixes Using Symbolic Execution and SMT”. In: International Conference on Computer Safety, Reliability & Security (SAFECOMP’15). 2015.

一作:Paul Muntean
其主页:https://scholar.google.com/citations?user=goiWh_gAAAAJ&hl=zh-CN&oi=sra 以及 https://www.sec.in.tum.de/i20/people/paul-muntean
值得关注的地方:虽然被引用量不高,但是有一些SMT,符号执行的文章,还是可以一读的

2 文章内容

开头介绍写的挺好的,让人相信是真的困难:

In many C programs, debugging requires significant effort and can consume a lot of time. Even if the bug’s cause is known, detecting a bug in such programs and generating a bug fix patch manually is a tedious task.

我们的工作:

In this paper, we present a novel approach used to generate bug fixes for buffer overflow automatically using static execution, code patch patterns, quick fix locations, user input saturation and Satisfiability Modulo Theories (SMT).

进一步解释工作:

The generated patches are syntactically correct, can be semi-automatically inserted into code and do not need additional human refinement.

实证:

We evaluated our approach on 58 C open source programs contained in the Juliet test suite and measured an overhead of 0.59 % with respect to the bug detection time. We think that our approach is generalizable and can be applied with other bug checkers that we developed.

大意是:

debug c程序需要很多时间和努力。即使bug的原因找到了,人为地在程序中检测到bug并产生一个bug的修复补丁也是一个冗长无趣的工作。

本文呈现一个先进的方法:通过静态执行,代码补丁模式,快速修复定位,用户输入饱和以及可满足性模理论(SMT)来对缓冲区溢出进行自动生成缺陷修复。

生成的补丁句法正确,可以被半自动的插入到代码中,且不需要额外的人为提炼(改良)(refinement)。

我们在58个C开源程序中(包含Juliet测试用例集)评估了我们的方法,并测量发现在缺陷检测时间上有0.59%的开销。我们认为我们的方法是可推广的,并且能够和我们开发的其他bug checker结合使用。

3 几个QA

3.1 QA1:符号执行和SMT的基本介绍?

文中不会介绍这么基础的知识。

可参考 [2-7] 。

3.2 QA2:这里面怎么定位缺陷的?Fault Localization

参考QA3.
反正不是用 基于谱的缺陷定位技术定的。

3.3 QA3:怎么生成补丁的呢?怎么确保句法正确哇?

我觉得应该是通过错误测试用例执行路径,在这个缺陷语句上不断变异(符号变异或者变量变异),一遍又一遍的跑出来的(直到成功)。或者是:通过符号执行,那么就需要把测试用例抽取、转化成specifications,然后转成约束。

快随修复生成步骤如下:
1)Quick Fix Locations Search Algorithm,即 快随修复位置的搜索算法。先找到一条包括缺陷语句的程序执行路径,随后产生in-place(at the location where the bug was detected)快随修复;此外,用后向程序执行顺序,从bug被检测到的位置,遍历当前被选定的执行路径,直到一个not in-place fix location(修复位置)被找到(这个步骤是针对第一步中in-place修复可能不是正确修复,所以找一个alternative);第一步和第二步不断被重复(对所有包含缺陷语句的执行路径)。 总体来说,先找possible insertion locations(可以插入语句的地方),然后在这个地方产生修复。
2)用SMT进行缺陷检测:第一步利用输入饱和(Input Saturation)来定位缺陷,后面还有6步。。。

Our contribution lies in bridging the gap between a buffer overflow bug report provided by an existing buffer overflow checker and automated generation of one or more quick fixes (quick fix structure, insertion location and values used inside the patches) which remove (automatically assessed by re-running the bug detector on the patched program) the buffer overflow bug.

3)Semi-automatic Patch Insertion Wizard,即 半自动的补丁插入(向导)程序。类似于Eclipse插件,感觉还挺牛的,fix recommendation


以上。其实我对SMT和SAT solver还是不太明白,感觉文中讲的比较专业(专业性比较强)。

4 总结

不足&未来工作见注释。

参考文献

[1] 语法里的词法和句法各研究些什么 https://zhidao.baidu.com/question/713877696711010845.html
句法+词法=语法。

[2] 符号执行:基础概念 https://blog.csdn.net/wannafly1995/article/details/80842459

[3] 符号执行——从入门到上高速 https://blog.csdn.net/woswod/article/details/83047283

[4] 什么是 SMT (satisfiability modulo theories)? https://www.zhihu.com/question/29586582/answer/364043245

[5] 有哪些充满暴力美学的数据结构或算法? - 赵轩昂的回答 - 知乎 https://www.zhihu.com/question/26743389/answer/33972527

[6] SAT问题 https://blog.csdn.net/seaskying/article/details/51726217

[7] 布尔可满足性问题 https://baike.baidu.com/item/布尔可满足性问题/4715567?fr=aladdin

猜你喜欢

转载自blog.csdn.net/weixin_39278265/article/details/87872268