Skip to main content

The Interface Definition Language for Fail-Safe C

  • Conference paper
Software Security - Theories and Systems (ISSS 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3233))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. Ritchie, D.M., Kernighan, B.W.: The C Programming Language, 2nd edn. Prentice Hall, Englewood Cliffs (1988)

    Google Scholar 

  3. 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

  4. Kent Dybvig, R.: Chez Scheme User’s Guide (1998), http://www.scheme.com/csug/index.html

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. Peyton Jones, S.: Haskell 98 language and libraries: The Revised Report (December 2002), http://www.haskell.org/definition/haskell98-report.pdf

  9. Xavier Leroy. CamlIDL Users Manual. INRIA Recquencourt (July 2001), http://camlidl.inria.fr/camlidl

  10. 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)

    Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics