A Smart Status Based Monitoring Algorithm for the Dynamic Analysis of Memory Safety

Author:

Chen Zhe1,Yan Rui1,Ma Yingzi1,Sui Yulei2,Xue Jingling2

Affiliation:

1. Nanjing University of Aeronautics and Astronautics, China

2. University of New South Wales, Australia

Abstract

C is a dominant programming language for implementing system and low-level embedded software. Unfortunately, the unsafe nature of its low-level control of memory often leads to memory errors. Dynamic analysis has been widely used to detect memory errors at runtime. However, existing monitoring algorithms for dynamic analysis are not yet satisfactory as they cannot deterministically and completely detect some types of errors, e.g., segment confusion errors, sub-object overflows, use-after-frees and memory leaks. We propose a new monitoring algorithm, namely Smatus , short for smart status , that improves memory safety by performing comprehensive dynamic analysis. The key innovation is to maintain at runtime a small status node for each memory object. A status node records the status value and reference count of an object, where the status value denotes the liveness and segment type of this object, and the reference count tracks the number of pointer variables pointing to this object. Smatus maintains at runtime a pointer metadata for each pointer variable, to record not only the base and bound of a pointer’s referent but also the address of the referent’s status node. All the pointers pointing to the same referent share the same status node in their pointer metadata. A status node is smart in the sense that it is automatically deleted when it becomes useless (indicated by its reference count reaching zero). To the best of our knowledge, Smatus represents the most comprehensive approach of its kind. We have evaluated Smatus by using a large set of programs including the NIST Software Assurance Reference Dataset, MSBench, MiBench, SPEC and stress testing benchmarks. In terms of effectiveness (detecting different types of memory errors), Smatus outperforms state-of-the-art tools, Google’s AddressSanitizer, SoftBoundCETS and Valgrind, as it is capable of detecting more errors. In terms of performance (the time and memory overheads), Smatus outperforms SoftBoundCETS and Valgrind in terms of both lower time and memory overheads incurred, and is on par with AddressSanitizer in terms of the time and memory overhead tradeoff made (with much lower memory overheads incurred).

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference58 articles.

1. Periklis Akritidis , Manuel Costa , Miguel Castro , and Steven Hand . 2009 . Baggy Bounds Checking: An Efficient and Backwards-Compatible Defense against Out-of-Bounds Errors . In Proceedings of the 18th USENIX Security Symposium. USENIX Association, 51–66 . Periklis Akritidis, Manuel Costa, Miguel Castro, and Steven Hand. 2009. Baggy Bounds Checking: An Efficient and Backwards-Compatible Defense against Out-of-Bounds Errors. In Proceedings of the 18th USENIX Security Symposium. USENIX Association, 51–66.

2. Derek Bruening and Qin Zhao . 2011 . Practical memory checking with Dr . Memory. In Proceedings of the 9th International Symposium on Code Generation and Optimization, CGO 2011. IEEE Computer Society, 213–223. Derek Bruening and Qin Zhao. 2011. Practical memory checking with Dr. Memory. In Proceedings of the 9th International Symposium on Code Generation and Optimization, CGO 2011. IEEE Computer Society, 213–223.

3. CUP

4. Zhe Chen. 2021. The MiBench and SPEC Benchmark Suites. https://github.com/drzchen/movec-benchmarks Zhe Chen. 2021. The MiBench and SPEC Benchmark Suites. https://github.com/drzchen/movec-benchmarks

5. Zhe Chen . 2021 . Movec: A Tool for the Monitoring and Verification of C Programs. https://github.com/drzchen/movec Zhe Chen. 2021. Movec: A Tool for the Monitoring and Verification of C Programs. https://github.com/drzchen/movec

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3