CCured: type-safe retrofitting of legacy software
Top Cited Papers
- 1 May 2005
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 27 (3) , 477-526
- https://doi.org/10.1145/1065887.1065892
Abstract
This article describes CCured, a program transformation system that adds type safety guarantees to existing C programs. CCured attempts to verify statically that memory errors cannot occur, and it inserts run-time checks where static verification is insufficient.CCured extends C's type system by separating pointer types according to their usage, and it uses a surprisingly simple type inference algorithm that is able to infer the appropriate pointer kinds for existing C programs. CCured uses physical subtyping to recognize and verify a large number of type casts at compile time. Additional type casts are verified using run-time type information. CCured uses two instrumentation schemes, one that is optimized for performance and one in which metadata is stored in a separate data structure whose shape mirrors that of the original user data. This latter scheme allows instrumented programs to invoke external functions directly on the program's data without the use of a wrapper function.We have used CCured on real-world security-critical network daemons to produce instrumented versions without memory-safety vulnerabilities, and we have found several bugs in these programs. The instrumented code is efficient enough to be used in day-to-day operations.Keywords
This publication has 13 references indexed in Scilit:
- CIL: Intermediate Language and Tools for Analysis and Transformation of C ProgramsPublished by Springer Nature ,2002
- Coping with Type Casts in CPublished by Springer Nature ,1999
- Dynamic typing for distributed programming in polymorphic languagesACM Transactions on Programming Languages and Systems, 1999
- A sound polymorphic type system for a dialect of CScience of Computer Programming, 1998
- A practical soft type system for schemeACM Transactions on Programming Languages and Systems, 1997
- Static detection of dynamic memory errorsACM SIGPLAN Notices, 1996
- A practical approach to type inference for EuLispHigher-Order and Symbolic Computation, 1993
- Adding run‐time checking to the portable C compilerSoftware: Practice and Experience, 1992
- Dynamic typing in a statically typed languageACM Transactions on Programming Languages and Systems, 1991
- Garbage collection in an uncooperative environmentSoftware: Practice and Experience, 1988