SoftBound: Highly Compatible and Complete Spatial Memory Safety for C

被引:215
作者
Nagarakatte, Santosh [1 ]
Zhao, Jianzhou [1 ]
Martin, Milo M. K. [1 ]
Zdancewic, Steve [1 ]
机构
[1] Univ Penn, Dept Comp & Informat Sci, Philadelphia, PA 19104 USA
来源
PLDI'09 PROCEEDINGS OF THE 2009 ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION | 2009年
关键词
spatial memory safety; buffer overflows; C;
D O I
10.1145/1542476.1542504
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
The serious bugs and security vulnerabilities facilitated by C/C++'s lack of bounds checking are well known, yet C and C++ remain in widespread use. Unfortunately, C's arbitrary pointer arithmetic, conflation of pointers and arrays, and programmer-visible memory layout make retrofitting C/C++ with spatial safety guarantees extremely challenging. Existing approaches suffer from incompleteness, have high runtime overhead, or require non-trivial changes to the C source code. Thus far, these deficiencies have prevented widespread adoption of such techniques. This paper proposes SoftBound, a compile-time transformation for enforcing spatial safety of C. Inspired by HardBound, a previously proposed hardware-assisted approach, SoftBound similarly records base and bound information for every pointer as disjoint metadata. This decoupling enables SoftBound to provide spatial safety without requiring changes to C source code. Unlike HardBound, SoftBound is a software-only approach and performs metadata manipulation only when loading or storing pointer values. A formal proof shows that this is sufficient to provide spatial safety even in the presence of arbitrary casts. SoftBound's full checking mode provides complete spatial violation detection with 67% runtime overhead on average. To further reduce overheads, SoftBound has a store-only checking mode that successfully detects all the security vulnerabilities in a test suite at the cost of only 22% runtime overhead on average.
引用
收藏
页码:245 / 258
页数:14
相关论文
共 48 条
[1]  
ABADI M, 2005, P 10 ACM C COMP COMM
[2]  
*AD, AD SEC ADV APSB08 19
[3]  
Akritidis P., 2008, P 2008 IEEE S SEC PR
[4]  
[Anonymous], 2008, COQ PROOF ASS REF MA
[5]  
[Anonymous], 2008, Adobe Reader vulnerability exploited in the wild
[6]  
[Anonymous], P 2003 ACM SIGPLAN C
[7]  
[Anonymous], 2003, GCC DEV SUMMIIT
[8]  
[Anonymous], 2004, P INT S COD GEN OPT
[9]  
Austin T. M., 1994, P SIGPLAN 1994 C PRO
[10]  
BERGER ED, 2006, P SIGPLAN 2006 C PRO