skip to main content
10.1145/2714576.2714635acmconferencesArticle/Chapter ViewAbstractPublication Pagesasia-ccsConference Proceedingsconference-collections
research-article

The Performance Cost of Shadow Stacks and Stack Canaries

Published:14 April 2015Publication History

ABSTRACT

Control flow defenses against ROP either use strict, expensive, but strong protection against redirected RET instructions with shadow stacks, or much faster but weaker protections without. In this work we study the inherent overheads of shadow stack schemes. We find that the overhead is roughly 10% for a traditional shadow stack. We then design a new scheme, the parallel shadow stack, and show that its performance cost is significantly less: 3.5%. Our measurements suggest it will not be easy to improve performance on current x86 processors further, due to inherent costs associated with RET and memory load/store instructions. We conclude with a discussion of the design decisions in our shadow stack instrumentation, and possible lighter-weight alternatives.

References

  1. Itanium(R) Processor Family Performance Advantages: Register Stack Architecture. https://software.intel.com/en-us/articles/itaniumr-processor-family-performance-advantages-register-stack-architecture, October 2008.Google ScholarGoogle Scholar
  2. SPEC CPU2006: Read Me First. http://www.spec.org/cpu2006/Docs/readme1st.html, September 2011.Google ScholarGoogle Scholar
  3. Software Optimization Guide for AMD Family 15h Processors. January 2012.Google ScholarGoogle Scholar
  4. ARM Information Center. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0439d/Chdedegj.html, September 2013.Google ScholarGoogle Scholar
  5. Emerging 'Stack Pivoting' Exploits Bypass Common Security. http://blogs.mcafee.com/mcafee-labs/emerging-stack-pivoting-exploits-bypass-common-security, May 2013.Google ScholarGoogle Scholar
  6. Intel(R) 64 and IA-32 Architectures Optimization Reference Manual. March 2014.Google ScholarGoogle Scholar
  7. M. Abadi, M. Budiu, Ú. Erlingsson, and J. Ligatti. Control-flow integrity principles, implementations, and applications. TISSEC, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Baratloo, N. Singh, and T. K. Tsai. Transparent Run-Time Defense Against Stack-Smashing Attacks. In USENIX ATC, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Bhatkar, D. C. DuVarney, and R. Sekar. Efficient Techniques for Comprehensive Protection from Memory Error Exploits. In USENIX Security, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Bird, A. Phansalkar, L. K. John, A. Mericas, and R. Indukuru. Performance Characterization of SPEC CPU Benchmarks on Intel's Core Microarchitecture Based Processor. In SPEC Benchmark Workshop, 2007.Google ScholarGoogle Scholar
  11. T. Bletsch, X. Jiang, V. W. Freeh, and Z. Liang. Jump-oriented programming: a new class of code-reuse attack. In CCS, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Budiu, Ú. Erlingsson, and M. Abadi. Architectural support for software-based protection. In Proceedings of the 1st workshop on Architectural and system support for improving software dependability, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. N. Carlini and D. Wagner. ROP is still dangerous: Breaking modern defenses. In USENIX Security, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Checkoway, L. Davi, A. Dmitrienko, A.-R. Sadeghi, H. Shacham, and M. Winandy. Return-oriented programming without returns. In CCS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T.-c. Chiueh and F.-H. Hsu. RAD: A compile-time solution to buffer over flow attacks. In ICDCS, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. L. Corliss, E. C. Lewis, and A. Roth. Using DISE to protect return addresses from attack. ACM SIGARCH Computer Architecture News, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Dahn and S. Mancoridis. Using program transformation to secure C programs against buffer over flows. In 20th Working Conference on Reverse Engineering, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Davi, P. Koeberl, and A.-R. Sadeghi. Hardware-Assisted Fine-Grained Control-Flow Integrity: Towards Efficient Protection of Embedded Systems Against Software Exploitation. In DAC, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. Davi, D. Lehmann, A.-R. Sadeghi, and F. Monrose. Stitching the gadgets: On the ineffectiveness of coarse-grained control-flow integrity protection. In USENIX Security, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. Davi, A.-R. Sadeghi, and M. Winandy. ROPdefender: A detection tool to defend against return-oriented programming attacks. In CCS, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ú. Erlingsson, M. Abadi, M. Vrable, M. Budiu, and G. C. Necula. XFI: Software guards for system address spaces. In OSDI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Fog. The microarchitecture of Intel, AMD and VIA CPUs. www.agner.org/optimize/microarchitecture.pdf, August 2014.Google ScholarGoogle Scholar
  23. M. Frantzen and M. Shuey. StackGhost: Hardware Facilitated Stack Protection. In USENIX Security, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. E. Göktas, E. Athanasopoulos, H. Bos, and G. Portokalidis. Out of control: Overcoming control-flow integrity. In IEEE S&P, 2014.Google ScholarGoogle Scholar
  25. S. Gupta, P. Pratap, H. Saran, and S. Arun-Kumar. Dynamic code instrumentation to detect and recover from return address corruption. In International workshop on Dynamic systems analysis, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. K. Inoue. Lock and Unlock: A Data Management Algorithm for A Security-Aware Cache. In ICECS, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  27. C. Isen and L. John. On the object orientedness of c++ programs in spec cpu 2006. In SPEC Benchmark Workshop, 2008.Google ScholarGoogle Scholar
  28. W.-F. Kao and S. F. Wu. Light-weight Hardware Return Address and Stack Frame Tracking to Prevent Function Return Address Attack. In International Conference on Computational Science and Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. V. Kuznetsov, L. Szekeres, M. Payer, G. Candea, R. Sekar, and D. Song. Code-Pointer Integrity. In OSDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. B. Lee, D. K. Karig, J. P. McGregor, and Z. Shi. Enlisting hardware architecture to thwart malicious code injection. In Security in Pervasive Computing. 2004.Google ScholarGoogle ScholarCross RefCross Ref
  31. A. J. Mashtizadeh, A. Bittau, D. Mazières, and D. Boneh. Cryptographically enforced control flow integrity. In arXiv:1408.1451, 2014.Google ScholarGoogle Scholar
  32. H. Massalin. Superoptimizer: a look at the smallest program. In ACM SIGPLAN Notices, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. McCamant and G. Morrisett. Evaluating SFI for a CISC Architecture. In USENIX Security, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. T. Mytkowicz, A. Diwan, M. Hauswirth, and P. F. Sweeney. Producing wrong data without doing anything obviously wrong! In ASPLOS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. D. Nebenzahl, M. Sagiv, and A. Wool. Install-time vaccination of Windows executables to defend against stack smashing attacks. Dependable and Secure Computing, IEEE Transactions on, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. One. Smashing the stack for fun and profit. Phrack magazine, 1996.Google ScholarGoogle Scholar
  37. P. O'Sullivan, K. Anand, A. Kotha, M. Smithson, R. Barua, and A. D. Keromytis. Retrofitting security in COTS software with binary rewriting. In Future Challenges in Security and Privacy for Academia and Industry. 2011.Google ScholarGoogle ScholarCross RefCross Ref
  38. H. Ozdoganoglu, T. Vijaykumar, C. E. Brodley, B. A. Kuperman, and A. Jalote. SmashGuard: A hardware solution to prevent security attacks on the function return address. Computers, IEEE Transactions on, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. S.-H. Park, Y.-J. Han, S.-J. Hong, H.-C. Kim, and T.-M. Chung. The dynamic buffer over flow detection and prevention tool for windows executables using binary rewriting. In The 9th International Conference on Advanced Communication Technology, 2007.Google ScholarGoogle ScholarCross RefCross Ref
  40. M. Payer and T. R. Gross. Fine-grained user-space security through virtualization. In VEE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Payer, T. Hartmann, and T. R. Gross. Safe loading-a foundation for secure execution of untrusted programs. In IEEE S&P, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. M. Prasad and T.-c. Chiueh. A Binary Rewriting Defense Against Stack based Buffer Over flow Attacks. In USENIX ATC, 2003.Google ScholarGoogle Scholar
  43. K. Serebryany, D. Bruening, A. Potapenko, and D. Vyukov. AddressSanitizer: A Fast Address Sanity Checker. In USENIX ATC, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. H. Shacham. The geometry of innocent flesh on the bone: Return-into-libc without function calls (on the x86). In CCS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. S. Sidiroglou, G. Giovanidis, and A. D. Keromytis. A dynamic mechanism for recovering from buffer over flow attacks. In Information security. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. S. Sinnadurai, Q. Zhao, and W. fai Wong. Transparent runtime shadow stack: Protection against malicious return address modifications. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.120.5702&rep=rep1&type=pdf, 2008.Google ScholarGoogle Scholar
  47. L. Szekeres, M. Payer, T. Wei, and D. Song. SoK: Eternal war in memory. In IEEE S&P, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. C. Tice, T. Roeder, P. Collingbourne, S. Checkoway, Ú. Erlingsson, L. Lozano, and G. Pike. Enforcing forward-edge control-flow integrity in gcc & llvm. In USENIX Security, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Vendicator. Stack Shield. http://www.angelfire.com/sk/stackshield/info.html, 2000.Google ScholarGoogle Scholar
  50. P. Wagle and C. Cowan. Stackguard: Simple stack smash protection for gcc. In GCC Developers Summit, 2003.Google ScholarGoogle Scholar
  51. R. Wahbe, S. Lucco, T. E. Anderson, and S. L. Graham. Efficient software-based fault isolation. In SOSP, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. J. Xu, Z. Kalbarczyk, S. Patel, and R. K. Iyer. Architecture support for defending against buffer over flow attacks. In Workshop on Evaluating and Architecting Systems for Dependability, 2002.Google ScholarGoogle Scholar
  53. C. Zhang, T. Wei, Z. Chen, L. Duan, L. Szekeres, S. McCamant, D. Song, and W. Zou. Practical control flow integrity and randomization for binary executables. In IEEE S&P, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. M. Zhang, R. Qiao, N. Hasabnis, and R. Sekar. A platform for secure static binary instrumentation. In VEE, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. M. Zhang and R. Sekar. Control Flow Integrity for COTS Binaries. In USENIX Security, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The Performance Cost of Shadow Stacks and Stack Canaries

    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
      ASIA CCS '15: Proceedings of the 10th ACM Symposium on Information, Computer and Communications Security
      April 2015
      698 pages
      ISBN:9781450332453
      DOI:10.1145/2714576

      Copyright © 2015 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 the author(s) 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: 14 April 2015

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      ASIA CCS '15 Paper Acceptance Rate48of269submissions,18%Overall Acceptance Rate418of2,322submissions,18%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader