INVISIOS: a Lightweight, Minimally Intrusive Secure Execution Environment ∗
Total Page:16
File Type:pdf, Size:1020Kb
Technical Report No. CE-J09-001, Dept. of Electrical Engineering, Princeton University, Jan. 30, 2009. INVISIOS: A Lightweight, Minimally Intrusive Secure Execution Environment ∗ Divya Arora Najwa Aaraj Anand Raghunathan Intel Corporation Princeton University Purdue University [email protected] [email protected] [email protected] Niraj K. Jha Princeton University [email protected] Abstract 1 Introduction Security has long been the subject of extensive research Many information security attacks exploit vulnerabilities in in the context of computing and communication systems. “trusted” and privileged software executing on the system, such as This has led to developments of various “functional” security the operating system (OS). On the other hand, most security mech- measures [1,2] such as cryptographic algorithms and secure anisms provide no immunity to security-critical user applications if communication protocols. However, security attacks over the vulnerabilities are present in the underlying OS. While technologies years have made it abundantly clear that while functional se- have been proposed that facilitate isolation of security-critical soft- curity measures are necessary, they are not sufficient. Many ware, they require either significant computational resources and attacks target weaknesses in a system’s implementation and are hence not applicable to many resource-constrained systems, a system’s security is only as strong as the weakest link in its or necessitate extensive re-design of the underlying processors and implementation. hardware. A recurring theme among many security attacks is that In this work, we propose INVISIOS – a lightweight, minimally “trusted” code is hijacked at run-time – so even if the orig- intrusive hardware-software architecture to make the execution of inal code is not malicious by intent, it can be manipulated security-critical software invisible to the OS, and hence protected by clever attackers, resulting in unwarranted behavior, such from its vulnerabilities. The INVISIOS software architecture encap- as execution of malicious code, leakage of sensitive informa- sulates the security-critical software into a self-contained software tion, and corruption of program variables. While the sub- module, called the secure core. While the secure core is part of the version of a user application can cause a significant amount kernel and is run with kernel-level privileges, its code, data, and of damage, security breaches that exploit vulnerabilities in execution are transparent to and protected from the rest of the ker- the OS are especially dangerous. Modern OSs are huge and nel. The INVISIOS hardware architecture consists of simple add-on complex software, spanning tens of millions of lines of code, hardware components that are responsible for bootstrapping the se- making it extremely difficult to make them vulnerability-free. cure core, ensuring that it is exercised by applications in only per- Moreover, most commodity OSs are monolithic, implying mitted ways, and enforcing the isolation of its code and data from that the entire OS runs at the highest privilege level. Since the rest of the system. We implemented INVISIOS by enhancing the there is no privilege separation within the OS, compromise QEMU full-system emulator and Linux to model the proposed soft- of one part can easily bring down the entire system. ware and hardware enhancements, and applied it to protect a com- While it may not be feasible to secure all applications mercial cryptograhpic library. Our experiments demonstrate that from a compromised OS, it may be possible to achieve a INVISIOS is capable of facilitating secure execution at very small secure execution environment for selected, security-critical overheads, making it suitable for resource-constrained embedded applications (e.g., cryptographic libraries, key management systems and systems-on-chip. software, integrity verification kernels). Some work has been done towards the above objective, which involves isolation of the critical software from the rest of the system. The isola- tion may be based on physical separation, wherein the crit- ∗Acknowledgments: This work was supported by NSF under Grant No. ical software is executed on a physically separate processor CNS-0720110. and uses a separate memory (e.g., IBM co-processor [3]), or 1 logical separation, in which both the sensitive and untrusted • We implement a prototype to show the viability of our code run on the same processor, but are isolated, either us- approach. We incorporate several modifications in the ing an additional layer of software, such as virtualization, or Linux kernel and perform a comprehensive analysis of through additional hardware support (e.g., Intel TXT [4] and the penalties imposed by our processor architecture. We ARM TrustZone [5]). analyze the security of our architecture by running the In this paper, we present a lightweight, minimally intru- modified Linux kernel on a modified version of the sive secure execution environment based on the principle of QEMU processor emulator [7]. logical separation. Securing critical software through logi- The rest of this paper is organized as follows. We present cal separation is non-trivial since it cannot be achieved by a survey of relevant past work in Section 2. We describe the securing the code alone. Even the knowledge of a few in- details of the hardware and software components of INVI- termediate variables, which may be obtained by reading pro- SIOS in Section 3. We present our experimental methodol- cessor registers during context switches, can be used by an ogy and results in Section 4. We analyze the security of our attacker to infer the original sensitive data from which they architecture in Section 5 and conclude in Section 6. were computed [6]. We focus on providing a secure exe- cution environment for critical software while making min- 2 Related Work imally intrusive changes to the existing processor architec- ture. The proposed scheme is especially suitable in the con- Secure execution environments can be achieved by using text of SoCs, which are assembled using standard compo- an additional layer of software underneath the OS to virtual- nents (including processors), that are provided in the form ize the hardware platform. Despite significant advances in ef- of intellectual property (IP) cores. In such scenarios, it is ficient virtualization, they remain beyond the reach of many difficult for the SoC designer to make intrusive changes to resource-constrained embedded systems, which are the pri- the processor. Our proposal includes add-on hardware units mary target of our work. Moreover, the complexity of virtual which simply observe the address lines on the main proces- machine monitors (VMMs) has grown significantly to a point sor chip and base their checking on the observed addresses where there is concern about vulnerabilities in the VMM it- and certain pre-configured constants. They do not modify self [8]. the processor pipeline, datapath or other on-chip structures, Next, we review past work in the field of hardware- such as caches and register files. We also do not add any new assisted secure program execution. instructions. The contributions of our work are as follows: Researchers have proposed architectural enhancements to validate the control flow of an executing program at run-time • We propose a set of hardware enhancements to the pro- and flag deviations from the expected control flow as security cessor that can facilitate an execution environment that exceptions. The enhancements can be in the form of modifi- is invisible to, and protected from, the rest of the soft- cations to the processor pipeline [20], dedicated add-on hard- ware that executes on the processor. We refer to the ware checkers [9], and additions to the processor instruction above environment as the secure domain, while the non- set [10] that augment the existing instructions to perform ad- critical software is run in the normal domain. ditional checking. 1. The hardware enhancements consist of (i) a mem- Dynamic information flow tracking [11] is a hardware- ory access checker and a bus monitor, which monitor supported information flow tracker, which tracks the flow of the processor-to-cache bus, and the system memory bus spurious information and prevents it from violating a speci- respectively, in order to enforce memory separation be- fied security policy. Secure return address stack [12] is an- tween the secure domain and the normal domain, and other hardware technique which prevents the disruption of (ii) a secure bootstrap controller which authenticates normal control flow affected by a specific type of attack, and verifies the integrity of the sensitive code, and in- namely, stack overflow. Secure program execution frame- stalls it for execution in the secure domain. We assume work (SPEF) [13] is a combination of architectural and com- the critical software is available as a library, which pro- pilation techniques which ensure software integrity and pre- vides services to other applications. vent any code, which has not been explicitly installed, from 2. The software architecture of INVISIOS comprises being executed on the system. (i) a user-level stub that provides the same application The above techniques are primarily designed to protect a programming interface (API) as the secure library, en- benign application from its own vulnerabilities. However, codes the API calls, and makes an appropriate system they cannot protect this application, if the vulnerabilities