Implementation of the Memory-safe Full ANSI-C Compiler

被引:12
|
作者
Oiwa, Yutaka [1 ]
机构
[1] Natl Inst Adv Ind Sci & Technol, Res Ctr Informat Secur RCIS, Tokyo, Japan
关键词
Memory Safety; C language;
D O I
10.1145/1542476.1542505
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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.
引用
收藏
页码:259 / 269
页数:11
相关论文
共 50 条
  • [1] Implementation of the memory-safe full ANSI-C compiler
    Research Center for Information Security , National Institute of Advanced Industrial Science and Technology , Japan
    [J]. Proc ACM SIGPLAN Conf Program Lang Des Implementation PLDI, (259-269): : 259 - 269
  • [2] Implementation of the Memory-safe Full ANSI-C Compiler
    Oiwa, Yutaka
    [J]. ACM SIGPLAN NOTICES, 2009, 44 (06) : 259 - 269
  • [3] A RETARGETABLE COMPILER FOR ANSI-C
    FRASER, CW
    HANSON, DR
    [J]. SIGPLAN NOTICES, 1991, 26 (10): : 29 - 43
  • [4] Fail-safe ANSI-C compiler: An approach to making C programs secure - Progress report
    Oiwa, Y
    Sekiguchi, T
    Sumii, E
    Yonezawa, A
    [J]. SOFTWARE SECURITY - THEORIES AND SYSTEMS, 2003, 2609 : 133 - 153
  • [5] STANDARDIZING ANSI-C
    YOUNG, GA
    [J]. BYTE, 1986, 11 (07): : 14 - 14
  • [6] A tool for checking ANSI-C programs
    Clarke, E
    Kroening, D
    Lerda, F
    [J]. TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, PROCEEDINGS, 2004, 2988 : 168 - 176
  • [7] CONVERTING OLD-C TO ANSI-C
    MACLAREN, NM
    [J]. PROCEEDINGS : SEAS ANNIVERSARY MEETING 1989, VOLS 1 AND 2: THE CORPORATE NETWORK, 1989, : 1497 - 1500
  • [8] A CODE GENERATION INTERFACE FOR ANSI-C
    FRASER, CW
    HANSON, DR
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 1991, 21 (09): : 963 - 988
  • [9] Loopfrog: A Static Analyzer for ANSI-C Programs
    Kroening, Daniel
    Sharygina, Natasha
    Tonetta, Stefano
    Tsitovich, Aliaksei
    Wintersteiger, Christoph M.
    [J]. 2009 IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2009, : 668 - 670
  • [10] Race-free and Memory-safe Multithreading: Design and Implementation in Cyclone
    Gerakios, Prodromos
    Papaspyrou, Nikolaos
    Sagonas, Konstantinos
    [J]. TLDI '10: PROCEEDINGS OF THE 2010 ACM SIGPLAN WORKSHOP ON TYPES IN LANGUAGE DESIGN AND IMPLEMENTATION, 2010, : 15 - 26