Sok: Hardware Security Support for Trustworthy Execution
Total Page:16
File Type:pdf, Size:1020Kb
SoK: Hardware Security Support for Trustworthy Execution Lianying Zhao1, He Shuang2, Shengjie Xu2, Wei Huang2, Rongzhen Cui2, Pushkar Bettadpur2, and David Lie2 1Carleton Universityz, Ottawa, ON, Canada 2University of Toronto, Toronto, ON, Canada Abstract—In recent years, there have emerged many new hard- contribute to lowering power consumption, which is critical ware mechanisms for improving the security of our computer for resource-constrained devices. systems. Hardware offers many advantages over pure software Furthermore, hardware is the Root of Trust (RoT) [48], as approaches: immutability of mechanisms to software attacks, better execution and power efficiency and a smaller interface it bridges the physical world (where human users reside) and allowing it to better maintain secrets. This has given birth to the digital world (where tasks run as software). To securely a plethora of hardware mechanisms providing trusted execution perform a task or store a secret, the user trusts at least part of environments (TEEs), support for integrity checking and memory the computer hardware. safety and widespread uses of hardware roots of trust. Dedicated hardware security support has seen its prolif- In this paper, we systematize these approaches through the lens eration since the early days of computers. It can take a of abstraction. Abstraction is key to computing systems, and the interface between hardware and software contains many abstrac- straightforward form as discrete components to assist the tions. We find that these abstractions, when poorly designed, can CPU, ranging from the industrial-grade tamper-responding both obscure information that is needed for security enforcement, IBM Cryptocards (e.g., 4758 [37]), Apple’s proprietary secure as well as reveal information that needs to be kept secret, leading enclave processor (SEP [84]) for consumer electronics, to the to vulnerabilities. We summarize such vulnerabilities and discuss more open Trusted Platform Module (TPM), smart cards and several research trends of this area. Index Terms—Hardware Security Primitives, Trusted Execu- other security tokens. Meanwhile, architectural enhancements tion Environments are being introduced to the CPU, as well as its chipset, such as Trusted Execution Environments (TEEs, see Section III), the NX-bit, Intel MPX, MPK, etc. I. INTRODUCTION Driven by demand over the few decades, hardware is being The trustworthiness of a computer system entails that the “patched” cumulatively, as reflected in the increase of the system can correctly fulfill tasks as intended by the user. x86 ISA extensions (according to Baumann [10], hardware This can include user tasks (e.g., applications) and system is becoming the new software). The added complexity and tasks (e.g., a system integrity monitor). Enabling techniques interaction between hardware features has led to numerous for trustworthy execution can be implemented in software, problems, which has motivated us to reflect on the role of hardware or both. For instance, there exist proposals for both hardware in security, and what key features make a good software-based [17] and hardware-based [26] solutions for hardware security mechanism. Control-Flow Integrity (CFI); and likewise, isolation for code Most hardware security features achieve their purpose by can be achieved with either software (e.g., containerization and hiding information or access from an entity, and/or exposing sandboxing) or hardware components [109]. a new/reduced interface to it. For instance, memory protection Nonetheless, there exists a common belief in hardware’s between processes is implemented by virtual memory, which arXiv:1910.04957v1 [cs.CR] 11 Oct 2019 advantages over software in consideration of the following prevents processes from accessing each other’s memory by aspects: 1) Relative immutability. Tampering with hardware is presenting each process with its own virtual address space. non-trivial and requires physical access. This makes hardware The design of virtual memory can be considered an instance support a necessity in mitigation techniques under a strong of “abstraction” [22], [72], which 1) removes or attenuates adversarial model, e.g., rootkit-level threats [76] and hyper- information (by hiding the true implementation of memory) visor threats [66]. 2) Efficiency. Contrary to software that and 2) creates new semantics (such as page tables), which introduces a layer of architectural abstraction, direct hardware are also called “abstractions”. Hence there is a relationship implementation can save redundant processing cycles (e.g., between security and abstraction, which is particularly impor- instruction decode). This allows for better efficiency for cer- tant considering the heavy use of abstractions in computer tain iterative/repetitive operations (e.g., consider how DSPs hardware to separate its implementation from that of the outperform regular CPUs for signal processing). It can further software it runs. We propose to use abstraction (Section II-A) as a lens zThe work was started when the first author was at the University of through which the workings of hardware security support Toronto. and various related issues are examined. Specifically, we find that: 1) beyond the commonly perceived immutability A. Abstraction and efficiency, the properties of hardware security support In computer science, an abstraction can be thought of as a can be explained as mechanisms that hide/expose something; model of a concrete artifact that retains the artifact’s essential 2) certain low-level attacks can be attributed to insufficient properties while eliding details of its implementation [72]. Ab- (SectionIV) or excess (SectionV) abstraction.; and 3) many straction is used heavily across the interface of components to proposals seek to leverage abstractions to increase security reduce the complexity of interactions across those components. (SectionVI) or propose new abstractions to increase the Thus, it is quite natural that abstraction is heavily used at flow of information between hardware and software for better the interface between hardware and software, one of the most security (Section VII). complex interfaces in modern computing. Some key properties While traditionally Trusted Computing [91] emphasizes of an abstraction, which is the interface created when one merely the protection for initial integrity and isolation during abstracts a concrete implementation, are 1) the attenuation of execution, we expand the scope to be more holistic and to information and 2) the creation of new semantics. For example, ensure the eventual correct execution outcome. This includes consider the implementation of modern processor caches: run-time dynamic aspects such as control/data flow integrity of 1) Attenuation of information: Explicit access to and control the running program and secure input/output. We also include of cache memories is hidden, only revealing faster code firmware in the processor, system chipset and peripheral execution. devices, which while they do not execute trusted application 2) New semantics: Caches expose the abstraction of a cache software, are still nonetheless part of the trusted computing line, the size of the cache memory, a mapping function base of much of that software. We examine how hardware- between cache lines and memory and certain instruc- enforced abstraction affects execution within this entire scope. tions (e.g., WBINVD/PREFETCH/CLFLUSH), which in- It is not our intention to focus on improper implementation fluence cache behavior. that fails to properly implement a specification. However, a hardware-related fault may not clearly be attributable to either From this example, we can see that abstraction both hides a design flaw or an implementation error. We will not try to and exposes information. Depending on the components in- draw a boundary (which might be difficult to do in any case). volved, what can be hidden is the existence of resources or metadata. Other examples of hardware-software abstractions Contributions. include the processor ISA, which exposes the semantics of 1) We develop a general model for hardware security sup- an instruction for software to utilize hardware resources, but port based on the notion of abstraction, and examine hides implementation details such as pipelining, out-of-order- various Trusted Execution Environments (TEEs) along execution and speculation. several key properties of the abstractions the TEEs pro- We distinguish abstraction from isolation because while vide. both reduce the flow of information, total isolation as clas- 2) We associate the extent of abstraction (excessive/insuffi- sically defined by Lampson [74] means that there is no infor- cient) with the root cause of a series of vulnerabilities, mation flow at all, while abstraction merely attenuates it, still represented by side channels on one hand and insufficient allowing information to flow over the new semantics it defines. information flow on the other. Namely, when the abstrac- Similarly, virtualization is a particular instance of abstraction, tion specification does not hide all that is supposed to which seeks to maintain one abstraction with a vastly different be hidden, leaked information leads to attacks. On the implementation (i.e. backing RAM memories with disk). other hand, when such leakage is inevitable, too much The security concern with abstraction is that as hardware hiding across components also hinders effective reference has become a critical piece of security for software, hardware monitoring,