Abstract
Fail-Safe C is a safe implementation of full ANSI-C being developed by Oiwa and Sekiguchi. It uses its own internal data representations such as 2-word pointers and memory blocks with headers describing their contents. Because of this, calls to external functions compiled by conventional compilers require conversion of data representations. Moreover, for safety, many of those functions need additional checks on their arguments and return values. This paper presents a method of semi-automatically generating a wrapper doing such work. Our approach is to develop an Interface Definition Language to describe what the wrappers have to do before and after function calls. Our language is based on CamlIDL, which was developed for a similar purpose between Objective Caml and C. Our IDL processor generates code by using the types and attributes of functions. The attributes are additional information describing properties which cannot be expressed only by ordinary types, such as whether a pointer can be NULL, what range of memory can be safely accessed via a pointer, etc. We examined Linux system calls as test cases and designed a set of attributes required for generating their wrapper.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Austin, T.M., Breach, S.E., Sohi, G.S.: Efficient detection of all pointer and array access errors. In: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, pp. 290–301 (1994)
Ritchie, D.M., Kernighan, B.W.: The C Programming Language, 2nd edn. Prentice Hall, Englewood Cliffs (1988)
CERT/CC. CERT Advisory CA-2003 -10 Integer overflow in Sun RPC XDR library routines (April 2003), http://www.cert.org/advisories/CA-2003-10.html
Kent Dybvig, R.: Chez Scheme User’s Guide (1998), http://www.scheme.com/csug/index.html
Finne, S., Leijen, D., Meijer, E., Peyton Jones, S.L.: H/Direct: A binary foreign language interface for Haskell. In: Proceedings of the third ACM SIGPLAN international conference on Functional programming, pp. 153–162 (1998)
Finne, S., Leijen, D., Meijer, E., Peyton Jones, S.L.: Calling hell from heaven and heaven from hell. In: Proceedings of the fourth ACM SIGPLAN international conference on Functional programming, pp. 114–125 (1999)
Jim, T., Morrisett, G., Grossman, D., Hicks, M., Cheney, J., Wang, Y.: Cyclone: A safe dialect of C. In: Proceedings of USENIX Annual Technical Conference (June 2002)
Peyton Jones, S.: Haskell 98 language and libraries: The Revised Report (December 2002), http://www.haskell.org/definition/haskell98-report.pdf
Xavier Leroy. CamlIDL Users Manual. INRIA Recquencourt (July 2001), http://camlidl.inria.fr/camlidl
Necula, G.C., McPeak, S., Weimer, W.: CCured:Type-safe retrofitting of legacy code. In: Proceedings of the 29th ACM SIGPLAN–SIGACT symposium on Principles of Programming Languages, pp. 128–139 (2002)
Oiwa, Y., Sekiguchi, T., Sumii, E., Yonezawa, A.: Fail-safe ANSI-C compiler: An approach to making C programs secure (progress report). In: Okada, M., Pierce, B.C., Scedrov, A., Tokuda, H., Yonezawa, A. (eds.) ISSS 2002. LNCS, vol. 2609, pp. 133–153. Springer, Heidelberg (2003)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Leroy, X., Jacques, D.D., Rémy, G.D., Vouillon, J.: The Objective Caml system release 3.06 Documentation and user’s manual. Institut National de Recherche en Informatique et en Automatique (August 2002)
Condit, J., Harren, M., McPeak, S., Necula, G.C., Weimer, W.: CCured in the real world. In: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (June 2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Suenaga, K., Oiwa, Y., Sumii, E., Yonezawa, A. (2004). The Interface Definition Language for Fail-Safe C. In: Futatsugi, K., Mizoguchi, F., Yonezaki, N. (eds) Software Security - Theories and Systems. ISSS 2003. Lecture Notes in Computer Science, vol 3233. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-37621-7_10
Download citation
DOI: https://doi.org/10.1007/978-3-540-37621-7_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23635-1
Online ISBN: 978-3-540-37621-7
eBook Packages: Springer Book Archive