垂悬指针检测与防御方法
作者:
作者简介:

王豫(1991-),男,浙江献县人,学士,主要研究领域为软件工程,程序语言,软件安全;高凤娟(1991-),女,学士,主要研究领域为软件工程,程序语言,软件安全;马可欣(1999-),女,本科生,主要研究领域为软件工程;司徒凌云(1988-),男,硕士,CCF学生会员,主要研究领域为软件工程,软件安全;王林章(1973-),男,博士,教授,博士生导师,CCF杰出会员,主要研究领域为软件工程,软件安全;陈碧欢(1986-),男,博士,CCF专业会员,主要研究领域为软件工程,软件安全;刘杨(1981-),男,博士,教授,博士生导师,主要研究领域为软件工程,网络空间安全,人工智能;赵建华(1971-),男,博士,教授,博士生导师,CCF高级会员,主要研究领域为软件工程;李宣东(1963-),男,博士,教授,博士生导师,CCF会士,主要研究领域为软件工程.

通讯作者:

王林章,E-mail:lzwang@nju.edu.cn

基金项目:

国家重点研发计划(2017YFA0700604);南京大学优秀博士研究生创新能力提升计划B


Detecting and Preventing Dangling Pointers
Author:
Fund Project:

National Key R&D Program (2017YFA0700604); Program B for Outstanding PhD Candidate of Nanjing University

  • 摘要
  • | |
  • 访问统计
  • |
  • 参考文献 [44]
  • |
  • 相似文献 [20]
  • | | |
  • 文章评论
    摘要:

    随着技术的发展,信息物理融合系统(cyber-physical system,简称CPS)在生活中扮演着越来越重要的角色,例如电力系统、铁路系统.如果CPS遭到攻击,将对现实世界的正常运转造成巨大影响,甚至威胁生命安全.垂悬指针是指向的区域被释放后未被置为空的指针,它是一种会导致攻击的软件缺陷.由垂悬指针导致的use-after-free和double-free漏洞能够执行任意恶意代码.迄今为止,只有少量工作针对垂悬指针进行检测、防御.其中多数都会导致过高的额外运行时开销.提出DangDone用于检测和防御垂悬指针.首先,通过静态分析检测潜在垂悬指针;然后,基于检测到的垂悬指针信息和一系列预定义的指针变换规则,依据指针传播信息变换指针,使得指针及其别名都指向同一个新引入的指针.基于该方法,实现了DangDone的原型工具.基于11个开源项目和SPEC CPU benchmark的实验结果表明:DangDone的静态分析部分只有33%的误报率,指针变换部分只引入了1%左右的额外开销.同时,DangDone成功防护了11个开源项目中的use-after-free和double-free漏洞.实验结果体现了DangDone的高效率及有效性.

    Abstract:

    Due to rapid technology advance, cyber-physical system (CPS) plays increasingly important rules in society, such as power system and railway system. However, if these systems are attacked, it would be a serious problem for the world even threats human lives. Dangling pointers is such kind of software defects and can lead to use-after-free and double-free vulnerabilities, which can be leveraged by attackers. So far, only a few approaches have been proposed to protect against dangling pointers, while most of them suffer from high overhead. This paper study proposes a lightweight approach, named DangDone, to detect dangling pointers dynamically. Built upon the root cause of a dangling pointer, i.e., a pointer and its aliases are not nullified but the memory area they point to is deallocated. DangDone first detects dangling pointers by static analysis and fuzzing. Based on the result, DangDone realizes the detection by inserting an intermediate pointer between the pointers (i.e., a pointer and its aliases) and the memory area they point to. Hence, nullifying the intermediate pointer will nullify the pointer and its aliases, which causes crash when encountering use-after-free or double-free. Experimental results have demonstrated that DangDone introduces negligible runtime overhead (i.e., around 1% on average) on SPEC CPU benchmark and is able to protect 11 real-world use-after-free or double-free vulnerabilities. The evaluation demonstrates the efficiency and effectiveness of DangDone.

    参考文献
    [1] Sridhar S, Hahn A, Govindarasu M. Cyber-Physical system security for the electric power grid. Proc. of the IEEE, 2011, 100(1):210-224.
    [2] Bu L, Zhang T, Chen X, et al. Model-Based construction and verification of cyber-physical systems. ACM SIGSOFT Software Engineering Notes, 2018,43(3):6-10..
    [3] Lee E. Cyber physical systems: Design challenges. In: Proc. of the 11th IEEE Int'l Symp. on Object and Component-Oriented Real-Time Distributed Computing (ISORC). IEEE, 2008. 363-369.
    [4] Xu W, Li JR, Shu JL, Yang WB, Xie TY, Zhang YY, Gu DW. From collision to exploitation: Unleashing use-after-free vulnerabilities in linux kernel. In: Proc. of the 22nd ACM SIGSAC Conf. on Computer and Communications Security. ACM, 2015. 414-425.
    [5] Ye JY, Zhang C, Han XH. POSTER: UAFChecker: Scalable static detection of use-after-free vulnerabilities. In: Proc. of the ACM SIGSAC Conf. on Computer and Communications Security. 2014. 1529-1531.
    [6] Feist J, Mounier L, Potet ML. Statically detecting use after free on binary code. Journal of Computer Virology and Hacking Techniques, 2014,10(3):211-217.
    [7] Caballero J, Grieco G, Marron M, Nappa A. Un-Dangle: Early detection of dangling pointers in use-after-free and double-free vulnerabilities. In: Proc. of the Int'l Symp. on Software Testing and Analysis. ACM, 2012. 133-143.
    [8] Dhurjati D, Adve V. Efficiently detecting all dangling pointer uses in production servers. In: Proc. of the Int'l Conf. on Dependable Systems and Networks. IEEE, 2006. 269-280.
    [9] Pattabiraman K, Kalbarczyk ZT, Iyer RK. Automated derivation of application-aware error detectors using static analysis: The trusted illiac approach. IEEE Trans. on Dependable and Secure Computing, 2011,8(1):44-57.
    [10] Lee BY, Song CY, Jang YJ, Wang TL, Kim TS, Lu L, Lee WK. Preventing use-after-free with dangling pointers nullification. In: Proc. of the Network and Distributed System Security Symp. (NDSS). 2015.
    [11] Younan Y. FreeSentry: Protecting against use-after-free vulnerabilities due to dangling pointers. In: Proc. of the Network and Distributed System Security Symp. (NDSS). 2015.
    [12] The LLVM Compiler Infrastructure. 2020. http://llvm.org
    [13] Standard Performance Evaluation Corporation. SPEC CPU 2006. 2020. https://www.spec.org/cpu2006/
    [14] Afek J, Sharabani A. Dangling Pointer: Smashing the Pointer for Fun and Profit. Black Hat USA, 2007. 24.
    [15] Jackson T, Salamat B, Wagner G, Wimmer C, Franz M. On the effectiveness of multi-variant program execution for vulnerability detection and prevention. In: Proc. of the 6th Int'l Workshop on Security Measurements and Metrics. ACM, 2010.
    [16] Lopes BC, Auler R. Getting Started with LLVM Core Libraries. Packt Publishing Ltd, 2014.
    [17] Steensgaard B. Points-to analysis in almost linear time. In: Proc. of the 23rd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages. ACM, 1996. 32-41.
    [18] Andersen LO. Program analysis and specialization for the C programming language [Ph.D. Thesis]. København: University of Cophenhagen, 1994.
    [19] Szekeres L, Payer M, Wei T, Song D. Sok: Eternal war in memory. In: Proc. of the IEEE Symp. on Security and Privacy (SP). IEEE, 2013. 48-62.
    [20] Writing an LLVM Pass. 2020. http://llvm.org/docs/WritingAnLLVMPass.html
    [21] Clang: A C language Family Frontend for LLVM. 2020. http://clang.llvm.org/
    [22] Exploits Database by Offensive Security. Exploits database. 2020. https://www.exploit-db.com/
    [23] Fortify Static Code Analysis Tool. 2020. https://www.microfocus.com/en-us/products/static-code-analysis-sast/overview
    [24] Splint-Secure Programming Lint. 2020. http://www.splint.org/
    [25] Coverity Scan-static Analysis. 2020. https://scan.coverity.com/
    [26] Akritidis P. Cling: A memory allocator to mitigate dangling pointers. In: Proc. of the USENIX Security Symp. 2010. 177-192.
    [27] Berger ED, Zorn BG. DieHard: Probabilistic memory safety for unsafe languages. ACM SIGPLAN Notices, 2006,41(6):158-168.
    [28] Novark G, Berger ED. DieHarder: Securing the heap. In: Proc. of the 17th ACM Conf. on Computer and Communications Security. ACM, 2010. 573-584.
    [29] Musuvathi M, Park DYW, Chou A, Engler DR, Dill DL. CMC: A pragmatic approach to model checking real code. ACM SIGOPS Operating Systems Review, 2002,36(SI):75-88.
    [30] Engler D, Musuvathi M. Static analysis versus software model checking for bug finding. In: Proc. of the Verification, Model Checking, and Abstract Interpretation. Springer-Verlag, 2004. 191-210.
    [31] Berdine J, Cook B, Ishtiaq S. SLAyer: Memory safety for systems-level code. In: Proc. of the Int'l Conf. on Computer Aided Verification. Springer-Verlag, 2011. 178-183.
    [32] Morgado A. Understanding valgrind memory leak reports. 2020. https://aleksander.es/data/valgrind-memcheck.pdf
    [33] Hastings R, Joyce B. Purify: Fast detection of memory leaks and access errors. In: Proc. of the Winter 1992 Usenix Conf. Citeseer, 1991. 125-136.
    [34] Eigler FC. Mudflap: Pointer use checking for C/C+. In: Proc. of the 1st Annual GCC Developers' Summit. 2003. 57-70.
    [35] Serebryany K, Bruening D, Potapenko A, Vyukov D. AddressSanitizer: A fast address sanity checker. In: Proc. of the USENIX Annual Technical Conf. 2012. 309-318.
    [36] Van Der Kouwe E, Nigade V, Giuffrida C. Dangsan: Scalable use-after-free detection. In: Proc. of the 12th European Conf. on Computer Systems, ACM, 2017. 405-419.
    [37] Nagarakatte S, Zhao JZ, Martin MMK, Zdancewic S. SoftBound: Highly compatible and complete spatial memory safety for C. In: Proc. of the ACM Sigplan Notices. 2009. 245-258.
    [38] Xu W, Duvarney DC, Sekar R. An efficient and backwards-compatible transformation to ensure memory safety of C programs. In: Proc. of the ACM Sigsoft Int'l Symp. on Foundations of Software Engineering. ACM, 2004. 117-126.
    [39] Liu DP, Zhang MW, Wang HN. A robust and efficient defense against use-after-free exploits via concurrent pointer sweeping. In: Proc. of the 2018 ACM SIGSAC Conf. on Computer and Communications Security. ACM, 2018. 1635-1648.
    [40] Shin JS, Kwon DH, Seo JW, Cho YP, Paek YH. CRCount: Pointer invalidation with reference counting to mitigate use-after-free in legacy C/C++. In: Proc. of the Network and Distributed System Security Symp. (NDSS). 2019.
    [41] Standard Performance Evaluation Corporation. SPEC CPU 2000. 2020. https://www.spec.org/cpu2000/
    [42] Wang Y, Gao FJ, Situ LY, Wang LZ, Chen BH, Liu Y, Zhao JH, Li XD. Dangdone: Eliminating dangling pointers via intermediate pointers. In: Proc. of the 10th Asia-Pacific Symp. on Internetware. ACM, 2018. 6.
    [43] Su CJ, Wu CY. JADE implemented mobile multi-agent based, distributed information platform for pervasive health care monitoring. Applied Soft Computing, 2011,11(1):315-325.
    [44] Liang HY, Jagielski M, Zheng BW, et al. Network and system level security in connected vehicle applications. In: Proc. of the IEEE/ACM Int'l Conf. on Computer-Aided Design (ICCAD). IEEE, 2018.
    引证文献
    网友评论
    网友评论
    分享到微博
    发 布
引用本文

王豫,高凤娟,马可欣,司徒凌云,王林章,陈碧欢,刘杨,赵建华,李宣东.垂悬指针检测与防御方法.软件学报,2020,31(6):1600-1618

复制
分享
文章指标
  • 点击次数:3126
  • 下载次数: 9435
  • HTML阅读次数: 3195
  • 引用次数: 0
历史
  • 收稿日期:2019-08-08
  • 最后修改日期:2019-10-23
  • 在线发布日期: 2020-04-20
  • 出版日期: 2020-06-06
文章二维码
您是第19893479位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号