MemSafe: ensuring the spatial and temporal memory safety of C?at runtime

被引:43
作者
Simpson, Matthew S. [1 ]
Barua, Rajeev K. [1 ]
机构
[1] Univ Maryland, Dept Elect & Comp Engn, College Pk, MD 20742 USA
关键词
memory safety; reliability; verification; programming languages; COST;
D O I
10.1002/spe.2105
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Memory access violations are a leading source of unreliability in C programs. As evidence of this problem, a variety of methods exist that retrofit C with software checks to detect memory errors at runtime. However, these methods generally suffer from one or more drawbacks including the inability to detect all errors, the use of incompatible metadata, the need for manual code modifications, and high runtime overheads. This paper presents a compiler analysis and transformation for ensuring the memory safety of C called MemSafe. MemSafe makes several novel contributions that improve upon previous work and lower the cost of safety. These include (i) a method for modeling temporal errors as spatial errors, (ii) a metadata representation that combines features of both object-based and pointer-based approaches, and (iii) a dataflow representation that simplifies optimizations for removing unneeded checks. MemSafe is capable of detecting real errors with lower overheads than previous efforts. Experimental results show that MemSafe detects all memory errors in six programs with known violations as well as two large and widely used open source applications. Finally, MemSafe ensures complete safety with an average overhead of 88% on 30 programs commonly used for evaluating the performance of error detection tools. Copyright (c) 2012 John Wiley & Sons, Ltd.
引用
收藏
页码:93 / 128
页数:36
相关论文
共 60 条
  • [31] Eigler FrankCh., 2003, P GCC DEVELOPERS SUM, P57
  • [32] Engler D., 2001, Operating Systems Review, V35, P57, DOI 10.1145/502059.502041
  • [33] *GNU PROJ, GNU COMP COLL
  • [34] GNU Project, GNU COR UT
  • [35] Hastings Reed., 1992, WINTER USENIX C, P125
  • [36] International Organization for Standardization, 1999, 9899 ISOIEC
  • [37] Jim T, 2002, USENIX ASSOCIATION PROCEEDINGS OF THE GENERAL TRACK, P275
  • [38] JONES RWM, 1997, P 3 INT WORKSH AUT D, P13
  • [39] Lattner C, 2004, INT SYM CODE GENER, P75, DOI 10.1109/CGO.2004.1281665
  • [40] Lattner C., 2005, THESIS U ILLINOIS UR