Leveraging Hardware Transactional Memory for Cache Side-Channel Defenses

Leveraging Hardware Transactional Memory for Cache Side-Channel Defenses

Leveraging Hardware Transactional Memory for Cache Side-Channel Defenses Sanchuan Chen Fangfei Liu Zeyu Mi Yinqian Zhang The Ohio State University Intel Corporation Shanghai Jiao Tong The Ohio State University [email protected] [email protected] University [email protected]. [email protected] edu Ruby B. Lee Haibo Chen XiaoFeng Wang Princeton University Shanghai Jiao Tong Indiana University at [email protected] University Bloomington [email protected] [email protected] ABSTRACT Existing defenses against these attacks are generally classified A program’s use of CPU caches may reveal its memory access into one of the three categories: hardware defenses, system-level pattern and thus leak sensitive information when the program defenses and software-level defenses. Hardware defenses propose performs secret-dependent memory accesses. In recent studies, it new hardware designs to eliminate cache side-channel attacks from has been demonstrated that cache side-channel attacks that ex- the root cause, e.g., by randomizing cache accesses, partitioning tract secrets by observing the victim program’s cache uses can be cache regions, etc. Some of these approaches are particularly effec- conducted under a variety of scenarios, among which the most con- tive against certain types of attacks while preserving performance cerning are cross-VM attacks and those against SGX enclaves. In efficiency [22]. However, it usually takes a very long time for a this paper, we propose a mechanism that leverages hardware trans- novel cache design to be adopted in commercial products. In con- actional memory (HTM) to enable software programs to defend trast, system-level defenses leverage the privileges of an operating themselves against various cache side-channel attacks. We observe system or hypervisor to enforce isolation between unprivileged soft- that when the HTM is implemented by retrofitting cache coherence ware components by static cache partition [19] or dynamic cache protocols, as is the case of Intel’s Transactional Synchronization partition [10, 11, 29], or to add random noise into side-channel Extensions, the cache interference that is necessary in cache side- observations [28]. System-level defenses can be effective solutions channel attacks will inevitably terminate hardware transactions. to many types of side-channel threats, but also come with the draw- We provide a systematic analysis of the security requirements that backs of being very specific to the attacks they aim to defeat, usually a software-only solution must meet to defeat cache attacks, propose at the cost of inefficient use of hardware resources, and more impor- a software design that leverages HTM to satisfy these requirements tantly not applicable in cases where the system software is not fully and devise several optimization techniques in our implementation trusted. A third approach, software-level defenses, transforms the to reduce performance impact caused by transaction aborts. The em- victim software itself to eliminate secret-dependent control flow and pirical evaluation suggests that the performance overhead caused data flow [14], or to diversify the victim software to enforce proba- by the HTM-based solution is low. bilistic defenses [5]. Software-level defenses face the challenges of generalizing the protection to arbitrary software programs and at the same time to maintain low performance overhead. 1 INTRODUCTION In this paper, we present a mechanism to enable software appli- Cache side-channel attacks are one type of security threats that cations to defend themselves against a wide range of cache side- break the confidentiality of a computer system or application which channel attacks. Our solution leverages an existing hardware-based have several variants, e.g., Prime-Probe [9, 12, 16, 17, 26], Flush- performance enhancement feature, hardware transactional mem- Reload [23, 24, 27], Evict-Time [21], and Cache-Collision [3] ory (HTM), available on modern commercial processors to deter- attacks. These attacks differ in ways they are conducted, their un- ministically eliminate cache side-channel threats. The hardware derlying assumptions about the attack scenarios, and exploitable transactional memory is usually implemented through cache, such levels of CPU caches (e.g., L1, LLC), which makes the construction as Intel’s Transactional Synchronization Extensions (TSX) [4]. The of effective defenses challenging. hidden assumption of this mechanism is that whenever the cache line contained in the read set or write set is evicted out of the cache, Permission to make digital or hard copies of all or part of this work for personal or it loses track of the cache line, therefore the transaction will abort, classroom use is granted without fee provided that copies are not made or distributed and all the modifications are rolled back. 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 In this work, we particularly explore Intel TSX as a case study, must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, and show how such hardware features, when facilitated by a set to post on servers or to redistribute to lists, requires prior specific permission and/or a of software mechanisms, can be leveraged to defeat known cache fee. Request permissions from [email protected]. ASIA CCS ’18, June 4–8, 2018, Incheon, Republic of Korea side-channel attacks that target various cache levels. To do so, we © 2018 Association for Computing Machinery. systematically analyzed four types of side-channel attacks, includ- ACM ISBN 978-1-4503-5576-6/18/06...$15.00 ing Prime-Probe, Flush-Reload, Evict-Time, Cache-Collision, https://doi.org/10.1145/3196494.3196501 and enumerated the security requirements that the software so- Table 1: Existing cache side channel attacks in literature. lution must meet to defeat all these types of cache side-channel Cache Side-Channel Attacks Literature attacks. Guided by the security requirements, we propose a system (L1C, Prime-Probe, *, ASYNC) [16–18, 26] (L1C, Prime-Probe, data, SYNC) [17, 21] design that uses Intel TSX to protect security-critical regions from (LLC, Prime-Probe, inst, ASYNC) [12] cache attacks and elaborated the implementation efforts to satisfy (LLC, Prime-Probe, data, SYNC) [9] the requirements. We applied the solution to the vulnerable imple- (L1C, Flush-Reload, data, ASYNC) [8] (LLC, Flush-Reload, inst, ASYNC) [23, 24] mentation of AES and ECDSA algorithm in OpenSSL and vulnerable (LLC, Flush-Reload, *, SYNC) [27] modular exponentiation algorithm (used in RSA and ElGamal al- (L1C, Evict-Time, data, SYNC) [2, 17, 21] mbedTLS-SGX (LLC, Evict-Time, data, SYNC) [1] gorithms) in the library. Experimental evaluation (L1C, Cache-Collision, data, SYNC) [3] suggests that the induced performance overhead is small. cache coherence protocol can be easily extended for conflict de- In summary, we make the following contributions in this paper: tection. In cache-based HTMs, a transaction must be terminated • An analysis of security requirements for software solutions to whenever an overflow occurs due to set associativity conflicts. defeat all four types of side-channel attacks, including Prime- Probe, Flush-Reload, Evict-Time, Cache-Collision attacks. 3 SECURITY REQUIREMENTS AND SYSTEM • A software-level solution leveraging hardware transactional memory features in commodity processor to enable a program DESIGN to protect itself from a wide range of cache side-channel attacks. 3.1 Security Requirements • Case studies of applying the solution to the AES, RSA and To defeat various cache side channels we listed in Table 1, a software ECDSA implementations of popular open-source cryptographic solution must satisfy the following design goals: libraries, such as OpenSSL and mbedTLS-SGX, demonstrating the • S1: Cache lines loaded in the security-critical regions cannot efficiency of the protected algorithms. be evicted or invalidated during the execution of the security- critical regions. If so it happens, the code must be able to detect such occurrences. 2 BACKGROUND • S2: The execution time of the security-critical region is inde- Cache Side-Channel Attacks. Cache side-channel attacks exploit pendent of the cache hits and misses. the timing difference between cache hits and cache misses to infer • S3: The cache footprints after the execution of the security- the victim’s memory access patterns, hence indirectly deduce the critical region are independent of its sensitive code or data. secret information if it is dependent on such access patterns. Secret • P1: Performance overhead for the protected program is low information can be modulated into the memory accesses through without attacks. secret-dependent control flow or secret-dependent data flow. We argue by satisfying the security goals (S1 - S3), we can prevent Cache side-channel attacks are conventionally categorized into all types of cache side-channel attacks we consider. The security access-driven attacks and timing-driven attacks. In access-driven analysis is listed as follows. attacks, attacker can observe which cache lines have been accessed • Asynchronous attacks: Asynchronous attacks can only be per- by victim by measuring his own memory access time, e.g., Prime- formed using Prime-Probe or Flush-Reload techniques. In Probe and Flush-Reload attacks. In timing-driven attacks, attacker either case, the attacker needs to evict (or

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us