An Open Framework for Architecting TEEs
Dayeol Lee, David Kohlbrenner, Shweta Shinde, Dawn Song, and Krste Asanovic
An Open Framework for Architecting TEEs Dayeol Lee, David - - PowerPoint PPT Presentation
An Open Framework for Architecting TEEs Dayeol Lee, David Kohlbrenner, Shweta Shinde, Dawn Song, and Krste Asanovic Trusted Execution Environment (TEE) Applications User Program and Data Remote OS Attestation Trustworthy Hardware
Dayeol Lee, David Kohlbrenner, Shweta Shinde, Dawn Song, and Krste Asanovic
OS Applications
Trustworthy Hardware
User Program and Data
Integrity Confidentiality Remote Attestation
2
3
○ Extensible functional and security plugins ○ Implement new features without changing core primitive
U-mode S-mode M-mode User process OS Hypervisor Root of Trust Security Monitor Enclave App Privilege Higher
Trusted Untrusted
Lower Enclave Runtime
Standard RISC-V HW
Has been tested on QEMU, FPGA, and SoC
○ Core security primitive: hardware-enforced isolation ○ Memory isolation with RISC-V standard PMP
○ Support research projects ○ Build an open community
Keystone is a framework for customizable TEEs
4
5
○ Authenticate itself (device) ○ Authenticate software ○ Guarantee the integrity and privacy of remote execution
6
○ Secure IoT sensor network ○ Decentralized applications (e.g., smart contracts/blockchain) ○ Lambda applications ○ Confidential computing in the cloud (e.g., machine learning)
primitives and guarantees a TEE should employ
○ e.g., Software Defined Network (SDN)
7
TEE Framework (Software) Source of Randomness Secure Boot Memory Isolation Dynamic Allocation Side-Channel Protection Memory Encryption Secure I/O Attestation Multithreading Secure Timer libc support Compatible Hardware
○ Servers to sensors
○ Manufacturers cannot anticipate all needs or uses
○ Don’t have it if you don’t need it
○ Research on defenses needs better starting places
8
9
10
isolation domains
software TCB Existing TEE platforms are fixed points in the design space
○ Hardware-enforced memory isolation ○ Assists verification
○ Enclaves with supervisor mode
○ Amenable to HW/SW co-design ○ Verifiable
○ Testing ground for all use-cases
11
12
13
14
15
16
17
Switching access permissions of PMP entries at context switches
18
Switching access permissions of PMP entries at context switches
19
Switching access permissions of PMP entries at context switches
20
21
22
Hardware Manufacturer Hardware Provisioning Platform Provider Development Enclave Developer RT eapp Deployment Hardware SM OS User
Security Monitor Customize Enclave App (eapp) Runtime (RT) Customize
23
24
25
○ Configured during compilation ○ Threat models (e.g., Side-channel defense) ○ Workload (e.g., Dynamic resizing)
○ Virtual memory management ○ Untrusted I/O ○ Dynamic resizing ○ ...
26
TCB LoC of each components
27
Page Table text stack data heap text stack data heap RT EApp Static Mapping ... Page Table text data text data RT EApp Free Mem Dynamic Mapping ...
OS Memory
○ Cannot dynamically add new virtual pages ○ Intel took a few years to have “dynamic memory allocation” in SGXv2 ○ Intel SGXv1 has < 100 MB physical memory limit
○ Enclave requests the OS to extend memory ○ OS calls an additional SM SBI “extend_enclave” ○ Took 2 engineer-days for prototyping (< 200 LoC)
28
Enclave Memory OS Memory
29
e.g., mmap, brk, getrandom, …
30
31
32
Platform Core #, Type Cache Size (KB) Latency (cycles) L1-I/D L2 L1 L2 Rocket-S 1 in-order 8/8 512 2 24 Rocket 1 in-order 16/16 512 2 24 BOOM 1 OoO 32/32 2048 4 24 FU540 4 in-order 32/32 2048 2 12-15
○ Enclave measurement dominates initialization
33
34
35
36
37
38
39
40
○ Up to 128.19% (miniz) L2 partitioning overhead ○ L1 flush overhead was trivial with the default context switch period (10 ms)
41
○ Up to 128.19% (miniz) L2 partitioning overhead ○ L1 flush overhead was trivial with the default context switch period (10 ms)
42
○
Min -3.12% (LeNet) due to lack of page faults
○
Max 7.35% (DenseNet) due to mmap implementation
○
Runtime does not initialize free memory with dynamic resizing
43
44
○ Eyrie (3,000 LoC) + Torch Models (21,000-34,000 LoC) ○ seL4 (8,000 LoC) + FANN (14,000 LoC)
○ Using libsodium ○ https://github.com/keystone-enclave/keystone-demo
○ Customizable TEE for various threat models & workloads
○ Memory Management: free memory, dynamic resizing ○ Functionality: syscalls and muslibc support ○ Security: cache way partitioning
○ Trade offs between performance, security, TCB, and functionality
45
○ RV32, M/U-only ISA
○ Hardware, Security Monitor, and the Runtime
○ Secure I/O, Sealing, Page Swapping, MEE ...
○ RUST, Google Asylo, Microsoft OpenEnclave, ...
46
47
○ QEMU / SiFive Unleashed: https://github.com/keystone-enclave/keystone ○ FireSim (FPGA): https://github.com/keystone-enclave/keystone-firesim
○ Website/Blog: https://keystone-enclave.org ○ Development Docs: https://docs.keystone-enclave.org
○ arXiv: https://arxiv.org/abs/1907.10119
48
49
Dayeol Lee (dayeol@berkeley.edu) David Kohlbrenner (dkohlbre@berkeley.edu) Shweta Shinde (shwetas@berkeley.edu) Forum (keystone-enclave-forum@googlegroups.com) Announcement (keystone-enclave@googlegroups.com)
50
Enclave Measurement Other Operations