电子学报 ›› 2020, Vol. 48 ›› Issue (12): 2417-2424.DOI: 10.3969/j.issn.0372-2112.2020.12.018

• 学术论文 • 上一篇    下一篇

一种针对格式文件的符号执行优化方法

汪孙律1,2, 杨秋松1, 李明树1   

  1. 1. 中国科学院软件研究所基础软件国家工程研究中心, 北京 100190;
    2. 中国科学院大学计算机科学与技术学院, 北京 101408
  • 收稿日期:2019-09-04 修回日期:2020-11-04 出版日期:2020-12-25
    • 通讯作者:
    • 汪孙律
    • 作者简介:
    • 李明树 男,1966年5月出生,吉林德惠人,博士,中国科学院软件研究所研究员、博士生导师,主要究方向是:操作系统与基础软件,软硬件协同设计,以及软件工程方法和软件过程技术等;杨秋松 男,1977年8月出生,河北泊头人,博士,中国科学院软件研究所研究员、博士生导师,主要研究方向是:软件工程、形式化方法、模型检测、安全操作系统.
    • 基金资助:
    • 中国科学院战略性先导科技专项 (No.XDA-Y01-01)

A Symbolic Execution Optimization Method Based on File Format Constraint

WANG Sun-lü1,2, YANG Qiu-song1, LI Ming-shu1   

  1. 1. NFS, Institute of Software, Chinese Academy of Sciences, Beijing 100190, China;
    2. School of Computer Science and Technology, University of Chinese Academy of Sciences, Beijing 101408, China
  • Received:2019-09-04 Revised:2020-11-04 Online:2020-12-25 Published:2020-12-25
    • Corresponding author:
    • WANG Sun-lü
    • Supported by:
    • Chinese Academy of Sciences Strategic Pilot Project (No.XDA-Y01-01)

摘要: 为了解决符号执行中路径爆炸、新路径发现率低等问题,提出了针对文件格式数据块约束的符号执行分析方法(FFCBSE,File Format Constraint Based Symbolic Execution)优化框架.文件格式信息的缺失会影响符号执行的效率以及测试用例生成,该方法通过分析程序代码自动分析程序读取的格式文件数据块之间的依赖关系并建立相关约束,随后使用这些约束引导符号执行更关注于核心功能代码区域.在KLEE中实现了上述优化框架,并对Tcpdump、Readelf、Elfdump、File、Zlib等7个常用文件处理程序做了检测.和KLEE以及DASE相比,FFCBSE发现了13个之前未知的缺陷,在指令覆盖率和分支覆盖率有10%~225%不同程度的提升.

关键词: 符号执行, 文件格式, 路径爆炸, 缺陷查找

Abstract: To solve problems like path explosion, low rate of new path's finding in the software testing, a new vulnerability discovering architecture based on file format constraint (FFCBSE) was proposed. FFCBSE analyzed program source code to extract file structure constraints automatically. FFCBSE then used these structure constraints to guide symbolic execution to focus on core functions. This architecture was implemented in KLEE, and it was evaluated on seven file processing applications, such as Tcpdump, Readelf, File, Zlib. Compare with KLEE and DASE, FFCBSE detects thirteen previously unknown bugs. In addition, FFCBSE increases instruction line coverage/branch coverage by 10%~225%.

Key words: symbolic execution, file format constraint, path explosion, bug finding

中图分类号: