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.
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- Chandler Carruth. 2018. Speculative Load Hardening. Retrieved from https://llvm.org/docs/SpeculativeLoadHardening.html.Google Scholar
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Agner Fog. 2019. Instruction tables. Retrieved from https://www.agner.org/optimize/instruction_tables.pdf.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- Scott Mcfarling. 1993. Combining branch predictors. In Technical Report TN-36, Digital Western Research Laboratory.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Colin Percival. 2005. Cache missing for fun and profit. In Proceedings of the Technical BSD Conference (BSDCan 2005).Google Scholar
- 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 ScholarDigital Library
- Primate Labs. 2019. Geekbench. Retrieved from https://www.geekbench.com/.Google Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Standard Performance Evaluation Corporation. 2017. SPEC CPU Benchmark Suites. Retrieved from https://www.spec.org/cpu/.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Paul Turner. 2018. Retpoline: A software construct for preventing branch-target-injection. Retrieved from https://support.google.com/faqs/answer/7625886.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
Index Terms
- Securing Branch Predictors with Two-Level Encryption
Recommendations
BranchScope: A New Side-Channel Attack on Directional Branch Predictor
ASPLOS '18We present BranchScope - a new side-channel attack where the attacker infers the direction of an arbitrary conditional branch instruction in a victim program by manipulating the shared directional branch predictor. The directional component of the ...
BranchScope: A New Side-Channel Attack on Directional Branch Predictor
ASPLOS '18: Proceedings of the Twenty-Third International Conference on Architectural Support for Programming Languages and Operating SystemsWe present BranchScope - a new side-channel attack where the attacker infers the direction of an arbitrary conditional branch instruction in a victim program by manipulating the shared directional branch predictor. The directional component of the ...
Branch classification: a new mechanism for improving branch predictor performance
MICRO 27: Proceedings of the 27th annual international symposium on MicroarchitectureThere is wide agreement that one of the most important impediments to the performance of current and future pipelined superscalar processors is the presence of conditional branches in the instruction stream. Speculative execution seems to be one ...
Comments