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 条
  • [41] hcc - A portable ANSI C compiler (with a code generator for the PowerPCs)
    Abdullah, MH
    [J]. ACM SIGPLAN NOTICES, 1996, 31 (08) : 52 - 59
  • [42] Context-Bounded Model Checking of LTL Properties for ANSI-C Software
    Morse, Jeremy
    Cordeiro, Lucas
    Nicole, Denis
    Fischer, Bernd
    [J]. SOFTWARE ENGINEERING AND FORMAL METHODS, 2011, 7041 : 302 - +
  • [43] From UML to ANSI-C - An Eclipse-based code generation framework
    Funk, Mathias
    Nyssen, Alexander
    Lichter, Horst
    [J]. ICSOFT 2008: PROCEEDINGS OF THE THIRD INTERNATIONAL CONFERENCE ON SOFTWARE AND DATA TECHNOLOGIES, VOL SE/GSDCA/MUSE, 2008, : 12 - +
  • [44] Retaining Sandbox Containment Despite Bugs in Privileged Memory-Safe Code
    Cappos, Justin
    Dadgar, Armon
    Rasley, Jeff
    Samuel, Justin
    Beschastnikh, Ivan
    Barsan, Cosmin
    Krishnamurthy, Arvind
    Anderson, Thomas
    [J]. PROCEEDINGS OF THE 17TH ACM CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'10), 2010, : 212 - 223
  • [45] ANSI-C in safety critical applications lessons-learned from software evaluation
    Lindner, A
    [J]. COMPUTER SAFETY, RELIABILITY AND SECURITY, 1998, 1516 : 209 - 217
  • [46] Scheduling and partitioning ANSI-C programs onto multi-FPGA CCM architectures
    Peterson, JB
    OConnor, RB
    Athanas, PM
    [J]. IEEE SYMPOSIUM ON FPGAS FOR CUSTOM COMPUTING MACHINES, PROCEEDINGS, 1996, : 178 - 187
  • [47] Iris-MSWasm: Elucidating and Mechanising the Security Invariants of Memory-Safe WebAssembly
    Legoupil, Maxime
    Rousseau, June
    Georges, Aïna Linn
    Pichon-Pharabod, Jean
    Birkedal, Lars
    [J]. Proceedings of the ACM on Programming Languages, 2024, 8 (OOPSLA2)
  • [48] AN ANSI-C ROUTINE TO DETERMINE IF A POINT IS WITHIN A SPECIFIED CONVEX POLYGON IN LOGARITHMIC TIME
    LARKIN, BJ
    [J]. COMPUTERS & GEOSCIENCES, 1991, 17 (06) : 841 - 847
  • [49] DESURV - AN ANSI-C PROGRAM FOR BOREHOLE DESURVEY CALCULATION BY LOCAL LEAST-SQUARES FITTING
    KUKA, N
    SHTUKA, A
    ROYER, JJ
    [J]. COMPUTERS & GEOSCIENCES, 1994, 20 (06) : 919 - 960
  • [50] IMPLEMENTATION OF A C-COMPILER
    HOTTA, H
    INADA, M
    OKAMOTO, T
    [J]. NTT REVIEW, 1990, 2 (03): : 90 - 96