西安电子科技大学学报 ›› 2021, Vol. 48 ›› Issue (1): 124-132.doi: 10.19665/j.issn1001-2400.2021.01.014

• • 上一篇    下一篇

嵌入式C代码释放后重用缺陷检测

王亚昕1(),李孝庆1(),伍高飞2(),唐士建1(),朱亚杰1(),董婷1()   

  1. 1.北京空间机电研究所,北京,100094
    2.西安电子科技大学 网络与信息安全学院,陕西 西安 710071
  • 收稿日期:2020-08-14 出版日期:2021-02-20 发布日期:2021-02-03
  • 作者简介:王亚昕(1990—),女,工程师,硕士,E-mail: yxwang2015@163.com|李孝庆(1984—),男,高级工程师,硕士,E-mail: 417242808@qq.com|伍高飞(1987—),男,讲师,博士,E-mail: wugf@nipc.org.cn|唐士建(1983—),男,高级工程师,硕士,E-mail: 741124372@qq.com|朱亚杰(1986—),女,工程师,硕士,E-mail: 570383726@qq.com|董 婷(1986—),女,高级工程师,硕士,E-mail: 627752468@qq.com
  • 基金资助:
    国家自然科学基金(61602361);国家自然科学基金(U1836210);国家自然科学基金(61572460);国家重点研发计划(2018YFB080470)

Detecting use-after-free bugs in embedded C programs

WANG Yaxin1(),LI Xiaoqing1(),WU Gaofei2(),TANG Shijian1(),ZHU Yajie1(),DONG Ting1()   

  1. 1. Beijing Institute of Space Mechanics & Electricity, Beijing 100094,China
    2. School of Cyber Engineering,Xidian University, Xi’an 710071,China
  • Received:2020-08-14 Online:2021-02-20 Published:2021-02-03

摘要:

C代码中的释放后重用缺陷严重影响着嵌入式系统的鲁棒性与可靠性。针对此类漏洞的现有检测方案多针对于计算机系统及应用程序,无法为复杂多样的嵌入式程序提供支持。静态代码分析可以在没有代码运行环境的前提下进行代码缺陷检测。因此,基于LLVM编译框架设计了静态污点追踪方案,实现了针对释放后重用缺陷代码特征的自动化检测。实验结果证明了该方法能够快速、准确地检测C代码释放后重用缺陷,并且能够在大规模的嵌入式C代码项目中应用。

关键词: 嵌入式系统, C语言, 释放后重用, 代码缺陷检测, 静态代码分析

Abstract:

Use-after-Free (UaF) bugs in C programs seriously affect the robustness and reliability of embedded systems.Current detection methods are mostly focused on computer operating systems or applications,which does not support complex and variable embedded systems.A static code analysis can achieve the detection without the requirement of execution environment.Therefore,a static taint analysis tool based on the LLVM compiler infrastructure has been implemented to detect UaF bugs in theembedded C code automatically.Experimental results prove that this static analysis method can detect UaF bugs in C programs rapidly with low false positive and false negative.It is also proved that the tool can be applied in large-scale embedded C projects.

Key words: embedded system, C programs, use-after-free, bug detection, static code analysis

中图分类号: 

  • TP312