ACM Home Page
Please provide us with feedback. Feedback
Implementation of the memory-safe full ANSI-C compiler
Full text PdfPdf (425 KB)
Source
Conference on Programming Language Design and Implementation archive
Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation table of contents
Dublin, Ireland
SESSION: Memory and errors table of contents
Pages 259-269  
Year of Publication: 2009
ISBN:978-1-60558-392-1
Also published in ...
Author
Yutaka Oiwa  National Institute of Advanced Industrial Science and Technology (AIST), Japan, Tokyo, Japan
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 50,   Downloads (12 Months): 215,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1542476.1542505
What is a DOI?

ABSTRACT

This paper describes a completely memory-safe compiler for C language programs that is fully compatible with the ANSI C specification.

Programs written in C often suffer from nasty errors due to dangling pointers and buffer overflow. Such errors in Internet server programs are often exploited by malicious attackers to crack an entire system. The origin of these errors is usually corruption of in-memory data structures caused by out-of-bound array accesses. Usual C compilers do not provide any protection against such out-of-bound access, although many other languages such as Java and ML do provide such protection. There have been several proposals for preventing such memory corruption from various aspects: runtime buffer overrun detectors, designs for new C-like languages, and compilers for (subsets of) the C language. However, as far as we know, none of them have achieved full memory protection and full compatibility with the C language specification at the same time.

We propose the most powerful solution to this problem ever presented. We have developed Fail-Safe C, a memory-safe implementation of the full ANSI C language. It detects and disallows all unsafe operations, yet conforms to the full ANSI C standard (including casts and unions). This paper introduces several techniques--both compile-time and runtime--to reduce the overhead of runtime checks, while still maintaining 100% memory safety. This compiler lets programmers easily make their programs safe without heavy rewriting or porting of their code. It also supports many of the "dirty tricks" commonly used in many existing C programs, which do not strictly conform to the standard specification. In this paper, we demonstrate several real-world server programs that can be processed by our compiler and present technical details and benchmark results for it.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
American National Standard Institute. American national standard for information systems -- programming language -- C. ANSI X3.159-1989.
2
 
3
Hans Boehm. A garbage collector for C and C++. http: //www.hpl.hp.com/personal/Hans Boehm/gc/.
 
4
5
 
6
 
7
Hiroaki Etoh and Kunikazu Yoda. Propolice: Improved stacksmashing attack detection. IPSJ SIG Notes, 2001(75):181--188, 2001.
 
8
Jun Furuse. VITC: Safe C code compilation against attacks. In 4th Workshop on Dependable Software, 2006. In Japanese.
9
 
10
International Organization for Standards and International Electrotechnical Commission. Programming languages -- C. ISO/IEC Standard ISO/IEC 9899:1990.
 
11
 
12
Richard W. M. Jones and Paul H. J. Kelly. Backwards-compatible bounds checking for arrays and pointers in C programs. In Automated and Algorithmic Debugging, pages 13--26, 1997.
 
13
Yuhki Kamijima and Eijiro Sumii. Safe implementation of C pointer arithmetics by translation to Java. JSSST, 26(1):139--154, 2009. In japanese.
 
14
 
15
16
 
17
Yutaka Oiwa. Fail-Safe C webpage. https://staff.aist.go.jp/y.oiwa/FailSafeC/index--en.html.
 
18
Yutaka Oiwa. An extension to Fail-Safe C to support object-oriented languages. In Symposium on Programming and Programming Languages, March 2005.
 
19
Yutaka Oiwa. Implementation of a Fail-Safe ANSI C Compiler. PhD thesis, University of Tokyo, 2005.
 
20
Yutaka Oiwa. Type-safe linking of C programs. In Symposium on Programming and Programming Languages, March 2007.
 
21
Gray Watson. Dmalloc -- debug malloc library. http://www.dmalloc.com/.
 
48
George Necula, Scott McPeak, and Westley Weimer. CCured: