skip to main content
research-article
Open Access

Securing Branch Predictors with Two-Level Encryption

Published:03 August 2020Publication History
Skip Abstract Section

Abstract

Modern processors rely on various speculative mechanisms to meet performance demand. Branch predictors are one of the most important micro-architecture components to deliver performance. However, they have been under heavy scrutiny because of recent side-channel attacks. Branch predictors are indexed using the PC and recent branch histories. An adversary can manipulate these parameters to access and control the same branch predictor entry that a victim uses. Recent Spectre attacks exploit this to set up speculative-execution-based security attacks.

In this article, we aim to mitigate branch predictor side-channels using two-level encryption. At the first level, we randomize the set-index by encrypting the PC using a per-context secret key. At the second level, we encrypt the data in each branch predictor entry. While periodic key changes make the branch predictor more secure, performance degradation can be significant. To alleviate performance degradation, we propose a practical set update mechanism that also considers parallelism in multi-banked branch predictors. We show that our mechanism exhibits only 1.0% and 0.2% performance degradation while changing keys every 10K and 50K cycles, respectively, which is much lower than other state-of-the-art approaches.

References

  1. Onur Aciiçmez, Shay Gueron, and Jean-Pierre Seifert. 2007. New branch prediction vulnerabilities in openSSL and necessary software countermeasures. In Proceedings of the 11th IMA International Conference on Cryptography and Coding (IMACC). Springer-Verlag, Berlin, 185--203.Google ScholarGoogle Scholar
  2. Onur Aciiçmez, Çetin Kaya Koç, and Jean-Pierre Seifert. 2006. Predicting secret keys via branch prediction. In Proceedings of the 2007 Cryptographers’ Track at the RSA Conference on Topics in Cryptology (CT-RSA). Springer-Verlag, Berlin, 225--242.Google ScholarGoogle Scholar
  3. Onur Aciiçmez, Çetin Kaya Koç, and Jean-Pierre Seifert. 2007. On the power of simple branch prediction analysis. In Proceedings of the 2nd ACM Symposium on Information, Computer and Communications Security (ASIACCS). ACM, New York, NY, 312--320.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thomas Allan, Billy Bob Brumley, Katrina Falkner, Joop van de Pol, and Yuval Yarom. 2016. Amplifying side channels through performance degradation. In Proceedings of the 32nd Annual Conference on Computer Security Applications (ACSAC). ACM, New York, NY, 422--435.Google ScholarGoogle Scholar
  5. Arm. 2017. Arm TrustZone True Random Number Generator. Retrieved from https://static.docs.arm.com/100976/0000/trustzone_true_random_number_generator_technical_reference_manual_100976_0000_00_en.pdf.Google ScholarGoogle Scholar
  6. Chandler Carruth. 2018. Speculative Load Hardening. Retrieved from https://llvm.org/docs/SpeculativeLoadHardening.html.Google ScholarGoogle Scholar
  7. G. Cox, C. Dike, and D. J. Johnston. 2011. Intel’s digital random number generator (DRNG). In Proceedings of the 2011 IEEE Hot Chips 23 Symposium (HCS). IEEE Computer Society, Washington, DC, 1--13.Google ScholarGoogle Scholar
  8. Dmitry Evtyushkin, Dmitry Ponomarev, and Nael Abu-Ghazaleh. 2016. Jump over ASLR: Attacking branch predictors to bypass ASLR. In Proceedings of the 49th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). IEEE Press, Piscataway, NJ, Article 40, 13 pages.Google ScholarGoogle ScholarCross RefCross Ref
  9. Dmitry Evtyushkin, Ryan Riley, Nael CSE Abu-Ghazaleh, ECE, and Dmitry Ponomarev. 2018. BranchScope: A new side-channel attack on directional branch predictor. In Proceedings of the 23rd ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). ACM, New York, NY, 693--707.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Agner Fog. 2019. Instruction tables. Retrieved from https://www.agner.org/optimize/instruction_tables.pdf.Google ScholarGoogle Scholar
  11. Qian Ge, Yuval Yarom, Tom Chothia, and Gernot Heiser. 2019. Time protection: The missing OS abstraction. In Proceedings of the 14th EuroSys Conference 2019 (EuroSys). ACM, New York, NY, Article 1, 17 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Ben Gras, Kaveh Razavi, Herbert Bos, and Cristiano Giuffrida. 2018. Translation leak-aside buffer: Defeating cache side-channel protections with TLB attacks. In Proceedings of the 27th USENIX Security Symposium (Security). USENIX Association, Baltimore, MD, 955--972.Google ScholarGoogle Scholar
  13. Thomas Christopher Grocutt and Yasuo Ishii. 2019. Encoding of input to branch prediction circuitry. https://patentscope.wipo.int/search/en/detail.jsf?docId=WO2019106333. US Patent 2019/0166158 A1.Google ScholarGoogle Scholar
  14. David Gullasch, Endre Bangerter, and Stephan Krenn. 2011. Cache games—Bringing access-based cache attacks on AES to practice. In Proceedings of the 32nd IEEE Symposium on Security and Privacy (S&P). IEEE Computer Society, Washington, DC, 490--505.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Shohreh Hosseinzadeh, Hans Liljestrand, Ville Leppänen, and Andrew Paverd. 2018. Mitigating branch-shadowing attacks on Intel SGX using control flow randomization. In Proceedings of the 3rd Workshop on System Software for Trusted Execution (SysTEX). ACM, New York, NY, 42--47.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Intel. 2020. Intel 64 and IA-32 Architectures Software Developer’s Manual Volumn 3A. Retrieved from https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf.Google ScholarGoogle Scholar
  17. D. A. Jimenez and C. Lin. 2001. Dynamic branch prediction with perceptrons. In Proceedings of the 7th IEEE International Symposium on High-Performance Computer Architecture (HPCA). IEEE Computer Society, Washington, DC, 197--206.Google ScholarGoogle Scholar
  18. Mehmet Kayaalp, Nael Abu-Ghazaleh, Dmitry Ponomarev, and Aamer Jaleel. 2016. A high-resolution side-channel attack on last-level cache. In Proceedings of the 53rd Annual Design Automation Conference (DAC). ACM, New York, NY, Article 72, 6 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Khaled N. Khasawneh, Esmaeil Mohammadian Koruyeh, Chengyu Song, Dmitry Evtyushkin, Dmitry Ponomarev, and Nael Abu-Ghazaleh. 2019. SafeSpec: Banishing the spectre of a meltdown with leakage-free speculation. In Proceedings of the 56th Annual Design Automation Conference (DAC). ACM, New York, NY, 6.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Paul Kocher, Jann Horn, Anders Fogh, Daniel Genkin, Daniel Gruss, Werner Haas, Mike Hamburg, Moritz Lipp, Stefan Mangard, Thomas Prescher, Michael Schwarz, and Yuval Yarom. 2019. Spectre attacks: Exploiting speculative execution. In Proceedings of the 40th IEEE Symposium on Security and Privacy (S&P). IEEE Computer Society, Washington, DC, 1--19.Google ScholarGoogle ScholarCross RefCross Ref
  21. Esmaeil Mohammadian Koruyeh, Khaled N. Khasawneh, Chengyu Song, and Nael Abu-Ghazaleh. 2018. Spectre returns! Speculation attacks using the return stack buffer. In Proceedings of the 12th USENIX Workshop on Offensive Technologies (WOOT). USENIX Association, Baltimore, MD.Google ScholarGoogle Scholar
  22. Sangho Lee, Ming-Wei Shih, Prasun Gera, Taesoo Kim, Hyesoon Kim, and Marcus Peinado. 2017. Inferring fine-grained control flow inside SGX enclaves with branch shadowing. In Proceedings of the 26th USENIX Security Symposium (Security). USENIX Association, Vancouver, BC, 557--574.Google ScholarGoogle Scholar
  23. Fangfei Liu, Yuval Yarom, Qian Ge, Gernot Heiser, and Ruby B. Lee. 2015. Last-level cache side-channel attacks are practical. In Proceedings of the 36th IEEE Symposium on Security and Privacy (S&P). IEEE Computer Society, Washington, DC, 605--622.Google ScholarGoogle Scholar
  24. Giorgi Maisuradze and Christian Rossow. 2018. Ret2Spec: Speculative execution using return stack buffers. In Proceedings of the 25th ACM SIGSAC Conference on Computer and Communications Security (CCS). ACM, New York, NY, 2109--2122.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Scott Mcfarling. 1993. Combining branch predictors. In Technical Report TN-36, Digital Western Research Laboratory.Google ScholarGoogle Scholar
  26. Dag Arne Osvik, Adi Shamir, and Eran Tromer. 2006. Cache attacks and countermeasures: The case of AES. In Proceedings of the 2006 Cryptographers’ Track at the RSA Conference on Topics in Cryptology (CT-RSA). Springer-Verlag, Berlin, 1--20.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Arthur Perais, Rami Sheikh, Luke Yen, Michael McIlvaine, and Robert D. Clancy. 2019. Elastic instruction fetching. In Proceedings of the 25th IEEE International Symposium on High-Performance Computer Architecture (HPCA). IEEE Computer Society, Washington, DC, 478--490.Google ScholarGoogle Scholar
  28. Colin Percival. 2005. Cache missing for fun and profit. In Proceedings of the Technical BSD Conference (BSDCan 2005).Google ScholarGoogle Scholar
  29. Erez Perelman, Greg Hamerly, Michael Van Biesbrouck, Timothy Sherwood, and Brad Calder. 2003. Using simpoint for accurate and efficient simulation. In Proceedings of the 2003 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems (SIGMETRICS). ACM, New York, NY, 318--319. https://cseweb.ucsd.edu/ calder/simpoint/.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Primate Labs. 2019. Geekbench. Retrieved from https://www.geekbench.com/.Google ScholarGoogle Scholar
  31. Moinuddin K. Qureshi. 2018. CEASER: Mitigating eviction-based cache attacks via dynamically encrypted address. In Proceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). IEEE Computer Society, Washington, DC, 775--787.Google ScholarGoogle Scholar
  32. Moinuddin K. Qureshi. 2019. New attacks and defense for encrypted-address cache. In Proceedings of the 46th Annual International Symposium on Computer Architecture (ISCA). ACM, New York, NY, 360--371.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Charles Reis, Alexander Moshchuk, and Nasko Oskov. 2019. Site isolation: Process separation for web sites within the browser. In Proceedings of the 28th USENIX Security Symposium (Security). USENIX Association, Santa Clara, CA, 1661--1678.Google ScholarGoogle Scholar
  34. Gururaj Saileshwar and Moinuddin K. Qureshi. 2019. CleanupSpec: An “undo” approach to safe speculation. In Proceedings of the 52nd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). ACM, New York, NY, 73--86.Google ScholarGoogle Scholar
  35. Christos Sakalis, Stefanos Kaxiras, Alberto Ros, Alexandra Jimborean, and Magnus Själander. 2019. Efficient invisible speculative execution through selective delay and value prediction. In Proceedings of the 46th Annual International Symposium on Computer Architecture (ISCA). ACM, New York, NY, 723--735.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Andre Seznec. 2014. TAGE-SC-L Branch Predictors again. In Proceedings of the 5th JILP Workshop on Computer Architecture Competitions (JWAC-5): Championship Branch Prediction (CBP-5).Google ScholarGoogle Scholar
  37. André Seznec, Stephen Felix, Venkata Krishnan, and Yiannakis Sazeides. 2002. Design tradeoffs for the Alpha EV8 conditional branch predictor. In Proceedings of the 29th Annual International Symposium on Computer Architecture (ISCA). IEEE Computer Society, Washington, DC, 295--306.Google ScholarGoogle ScholarCross RefCross Ref
  38. Youngjoo Shin, Hyung Chan Kim, Dokeun Kwon, Ji Hoon Jeong, and Junbeom Hur. 2018. Unveiling hardware-based data prefetcher, a hidden source of information leakage. In Proceedings of the 25th ACM SIGSAC Conference on Computer and Communications Security (CCS). ACM, New York, NY, 131--145.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Standard Performance Evaluation Corporation. 2017. SPEC CPU Benchmark Suites. Retrieved from https://www.spec.org/cpu/.Google ScholarGoogle Scholar
  40. Mohammadkazem Taram, Ashish Venkat, and Dean Tullsen. 2019. Context-sensitive fencing: Securing speculative execution via microcode customization. In Proceedings of the 24th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). ACM, New York, NY, 395--410.Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Eran Tromer, Dag Arne Osvik, and Adi Shamir. 2010. Efficient cache attacks on AES, and countermeasures. Journal of Cryptology 23, 1 (Jan. 2010), 37--71.Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Paul Turner. 2018. Retpoline: A software construct for preventing branch-target-injection. Retrieved from https://support.google.com/faqs/answer/7625886.Google ScholarGoogle Scholar
  43. Ilias Vougioukas, Nikos Nikoleris, Andreas Sandberg, Stephan Diestelhorst, Bashir M. Al-Hashimi, and Geoff V. Merrett. 2019. BRB: Mitigating branch predictor side-channels. In Proceedings of the 25th IEEE International Symposium on High-Performance Computer Architecture (HPCA). IEEE Computer Society, Washington, DC, 466--477.Google ScholarGoogle Scholar
  44. Mario Werner, Thomas Unterluggauer, Lukas Giner, Michael Schwarz, Daniel Gruss, and Stefan Mangard. 2019. ScatterCache: Thwarting cache attacks via cache set randomization. In Proceedings of the 28th USENIX Security Symposium (Security). USENIX Association, Santa Clara, CA, 675--692.Google ScholarGoogle Scholar
  45. Y. Xu, W. Cui, and M. Peinado. 2015. Controlled-channel attacks: Deterministic side channels for untrusted operating systems. In Proceedings of the 36th IEEE Symposium on Security and Privacy (S&P). IEEE Computer Society, Washington, DC, 640--656.Google ScholarGoogle Scholar
  46. Mengjia Yan, Jiho Choi, Dimitrios Skarlatos, Adam Morrison, Christopher W. Fletcher, and Josep Torrellas. 2018. InvisiSpec: Making speculative execution invisible in the cache hierarchy. In Proceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). IEEE Press, Piscataway, NJ, 428--441.Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Yuval Yarom and Katrina Falkner. 2014. FLUSH+RELOAD: A high resolution, low noise, L3 cache side-channel attack. In Proceedings of the 23rd USENIX Security Symposium (Security). USENIX Association, San Diego, CA, 719--732.Google ScholarGoogle Scholar
  48. Tse-Yu Yeh and Yale N. Patt. 1991. Two-level adaptive training branch prediction. In Proceedings of the 24th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). ACM, New York, NY, 51--61.Google ScholarGoogle Scholar
  49. Jiyong Yu, Mengjia Yan, Artem Khyzha, Adam Morrison, Josep Torrellas, and Christopher W. Fletcher. 2019. Speculative taint tracking (STT): A comprehensive protection for speculatively accessed data. In Proceedings of the 52nd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). ACM, New York, NY, 954--968.Google ScholarGoogle Scholar
  50. Tao Zhang, Kenneth Koltermann, and Dmitry Evtyushkin. 2020. Exploring branch predictors for constructing transient execution Trojans. In Proceedings of the 25th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). ACM, New York, NY, 667--682.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Securing Branch Predictors with Two-Level Encryption

      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

      Full Access

      • Published in

        cover image ACM Transactions on Architecture and Code Optimization
        ACM Transactions on Architecture and Code Optimization  Volume 17, Issue 3
        September 2020
        200 pages
        ISSN:1544-3566
        EISSN:1544-3973
        DOI:10.1145/3415154
        Issue’s Table of Contents

        Copyright © 2020 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: 3 August 2020
        • Accepted: 1 June 2020
        • Revised: 1 April 2020
        • Received: 1 December 2019
        Published in taco Volume 17, Issue 3

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      HTML Format

      View this article in HTML Format .

      View HTML Format