skip to main content
10.1145/1595696.1595710acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Backward-compatible constant-time exception-protected memory

Published:24 August 2009Publication History

ABSTRACT

We present a novel, table-free technique for detecting all temporal and spatial memory access errors (e.g. dangling pointers, out-of-bounds check, etc.) in programs supporting general pointers. Our approach is the first technique to provide such error checking using only constant-time operations. The scheme relies on fat pointers, whose size is contained within standard scalar sizes (up to two words) so that atomic hardware support for operations upon the pointers is obtained along with meaningful casts in-between pointers and other scalars. Optimized compilation of code becomes possible since the scalarized-for-free encoded pointers get register allocated and manipulated. Backward compatibility is enabled by the scalar pointer sizes, with novel automatic support provided for encoding and decoding of fat pointers in place for interaction with unprotected code (e.g. library binaries). Implementation and benchmarks of the technique over several applications of the memory-intensive Olden suite indicate that the average time overhead of our method is about half the time cost of an unprotected application's execution (< 55%). This performance is over twice faster than the nearest prior work.

References

  1. Austin, T. M., Breach, S. E., and Sohi, G. S. 1994. Efficient detection of all pointer and array access errors. In Proc. ACM SIGPLAN 1994 Conf. Programming Language Design and Implementation (Orlando, Florida, United States, June 20 - 24, 1994). PLDI '94. ACM, New York, NY, 290--301. DOI=http://doi.acm.org/10.1145/178243.178446. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Berger, E. D. and Zorn, B. G. 2006. DieHard: probabilistic memory safety for unsafe languages. In Proc. ACM SIGPLAN 2006 Conf. Prog. Language Design and Implementation,, SIGPLAN Not. 41, 6 (Jun. 2006), 158--168. DOI=http://doi.acm.org/10.1145/1133981.1134000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Boehm, H. 1993. Space efficient conservative garbage collection. In Proc. ACM SIGPLAN 1993 Conf. Prog. Language Design and Implementation (Albuquerque, New Mexico, United States, June 21 - 25, 1993). R. Cartwright, Ed. PLDI '93. ACM, New York, NY, 197--206. DOI=http://doi.acm.org/10.1145/155090.155109. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ISO/IEC 9899:1999 C standard, 1999. ISO/IEC 14882:1998 C++ standard, 1998. Also, ISO/IEC 9899: 1999 C Technical Corrigendum, 2001, www.iso.org.Google ScholarGoogle Scholar
  5. Chilimbi, T. M. and Hauswirth, M. 2004. Low-overhead memory leak detection using adaptive statistical profiling. In ASPLOS 2004, SIGPLAN Not. 39, 11 (Nov. 2004), 156--164. DOI=http://doi.acm.org/10.1145/1037187.1024412. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Condit, J., Harren, M., McPeak, S., Necula, G. C., and Weimer, W. 2003. CCured in the real world. In Proc. ACM SIGPLAN 2003 Conf. on Programming Language Design and Implementation (San Diego, California, USA, June 09 - 11, 2003). PLDI '03. ACM, New York, NY, 232--244. DOI=http://doi.acm.org/10.1145/781131.781157. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dhurjati, D. and Adve, V. 2006. Backwards-compatible array bounds checking for C with very low overhead. In Proc. 28th Int. Conf. Software Engineering (Shanghai, China, May 20 - 28, 2006). ICSE '06. ACM, New York, NY, 162--171. DOI=http://doi.acm.org/10.1145/1134285.1134309. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Dhurjati, D. and Adve, V. 2006. Efficiently Detecting All Dangling Pointer Uses in Production Servers. In Proc. Int. Conf. Dependable Systems and Networks (June, '06). DSN '06. IEEE Computer Society, Washington, DC, 269--280. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dhurjati, D., Kowshik, S., and Adve, V. 2006. SAFECode: enforcing alias analysis for weakly typed languages. In Proc. ACM SIGPLAN 2006 Conf. Prog. Language Design and Implementation, SIGPLAN Not. 41, 6 (Jun. 2006), 144--157. DOI=http://doi.acm.org/10.1145/1133255.1133999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Hastings and B. Joyce. Purify: Fast detection of memory leaks and access errors. In Proc. Usenix Winter 1992 Technical Conference (San Francisco, CA, USA, Jan. 1992). Usenix Association, 125--136.Google ScholarGoogle Scholar
  11. Jim, T., Morrisett, J. G., Grossman, D., Hicks, M. W., Cheney, J., and Wang, Y. 2002. Cyclone: A Safe Dialect of C. In Proceedings of the General Track: 2002 USENIX Annual Technical Conference (June 10 - 15, 2002). C. S. Ellis, Ed. USENIX Association, Berkeley, CA, 275--288. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. W. M. Jones and P. H. J. Kelly. Backwards-compatible bounds checking for arrays and pointers in C programs. In Automated and Algorithmic Debugging, Linkoping, Sweden, pages 13--26, 1997.Google ScholarGoogle Scholar
  13. Loginov, A., Yong, S. H., Horwitz, S., and Reps, T. W. 2001. Debugging via Run-Time Type Checking. In Proc. 4th International Conf. Fundamental Approaches To Software Engineering (April 02 - 06, 2001). H. Hußmann, Ed. LNCS vol. 2029. Springer--Verlag, London, 217--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Necula, G. C., McPeak, S., and Weimer, W. 2002. CCured: type-safe retrofitting of legacy code. In Proc. 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Portland, Oregon, January 16 - 18, 2002). POPL '02. ACM, New York, NY, 128--139. DOI= http://doi.acm.org/10.1145/503272.503286. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Nethercote, N. and Seward, J. 2007. Valgrind: a framework for heavyweight dynamic binary instrumentation. In Proc. ACM SIGPLAN Conf. on Programming Language Design and Implementation (June 2007). PLDI '07. ACM, New York, NY, 89--100. DOI= http://doi.acm.org/10.1145/1273442.1250746. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Oiwa, Y. Implementation of a Fail-Safe ANSI C Compiler. PhD Thesis, Department of Computer Science, University of Tokyo, December 2004.Google ScholarGoogle Scholar
  17. Qin, F., Lu, S., and Zhou, Y. 2005. SafeMem: Exploiting ECC-Memory for Detecting Memory Leaks and Memory Corruption During Production Runs. In Proc. HPCA (February 12 - 16, 2005). IEEE Computer Society, Washington, DC, 291--302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Ruwase, O. and Lam, M. 2004. A practical dynamic buffer overflow detector. In Proc. Network and Distributed System Security (NDSS) Symposium. February 2004, 159--169.Google ScholarGoogle Scholar
  19. Seward, J. and Nethercote, N. 2005. Using Valgrind to detect undefined value errors with bit-precision. In Proc. USENIX Annual Technical Conference (Anaheim, CA, April 2005). USENIX '05. USENIX Association, Berkeley, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Varma, P. "Generalizing Recognition of an Individual Dialect in Program Analysis and Transformation", In Proc. ACM Symp. Applied Computing (SAC 2007) (Seoul, Korea, March 11-15, '07) ACM Press, New York. 1432--1439. DOI=http://doi.acm.org/10.1145/1244002.1244310. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Varma, P. Anand, A., Pazel, D. P., Tibbitts, B. R. "NextGen EXtreme Porting: Structured by Automation", In Proc. ACM Symp. Applied Computing (SAC 2005) (Santa Fe, NM, USA, March '05) ACM Press, New York. 1511--1517. DOI=http://doi.acm.org/10.1145/1066677.1067018. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Xu, W., DuVarney, D. C., and Sekar, R. 2004. An efficient and backwards-compatible transformation to ensure memory safety of C programs. In Proc. 12th ACM SIGSOFT Int. Symposium on Foundations of Software Engineering (Newport Beach, CA, USA, October 31 - November 06, 2004). SIGSOFT '04/FSE-12. ACM, New York, NY, 117--126. DOI= http://doi.acm.org/10.1145/1029894.1029913. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Backward-compatible constant-time exception-protected memory

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                ESEC/FSE '09: Proceedings of the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering
                August 2009
                408 pages
                ISBN:9781605580012
                DOI:10.1145/1595696

                Copyright © 2009 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 24 August 2009

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                ESEC/FSE '09 Paper Acceptance Rate32of217submissions,15%Overall Acceptance Rate112of543submissions,21%
              • Article Metrics

                • Downloads (Last 12 months)7
                • Downloads (Last 6 weeks)1

                Other Metrics

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader