! Apps Apps RAM ! Ring 0 - 2 OS / Hypervisor OS / Hypervisor - - PowerPoint PPT Presentation

apps apps ram ring 0 2 os hypervisor os hypervisor remote
SMART_READER_LITE
LIVE PREVIEW

! Apps Apps RAM ! Ring 0 - 2 OS / Hypervisor OS / Hypervisor - - PowerPoint PPT Presentation

Keystone : An Open Framework for Architecting Trusted Execution Environments Dayeol Lee , David Kohlbrenner, Shweta Shinde, Krste Asanovic, Dawn Song Dept. of Electrical Engineering and Computer Sciences University of California, Berkeley


slide-1
SLIDE 1

Keystone: An Open Framework for

Architecting Trusted Execution Environments

Dayeol Lee, David Kohlbrenner, Shweta Shinde, Krste Asanovic, Dawn Song

  • Dept. of Electrical Engineering and Computer Sciences

University of California, Berkeley

slide-2
SLIDE 2

Trusted Execution Environments (TEEs)

Keystone: an Open Framework for Architecting Trusted Execution Environments 2

OS / Hypervisor

RAM

Sensitive App Ring 0 - 2 Ring 3 Trusted Untrusted Protected Memory

Other Apps

Hardware Integrity Confidentiality Remote Attestation Other Apps Other Apps Trustworthy OS / Hypervisor

! !

“Enclave”

slide-3
SLIDE 3

Trusted Execution Environments (TEEs)

Keystone: an Open Framework for Architecting Trusted Execution Environments 3

OS / Hypervisor

RAM

Sensitive App Ring 0 - 2 Ring 3 Trusted Untrusted Protected Memory

Other Apps

Hardware Integrity Confidentiality Remote Attestation Other Apps Other Apps Trustworthy OS / Hypervisor

! !

Reducing Trusted Computing Base (TCB)

slide-4
SLIDE 4

Challenges in Existing TEEs

Keystone: an Open Framework for Architecting Trusted Execution Environments 4

Security Performance Functionality

SGX TrustZone SEV

slide-5
SLIDE 5

Challenges in Existing TEEs

Keystone: an Open Framework for Architecting Trusted Execution Environments 5

Security Performance Functionality

SGX TrustZone SEV

Fixed Design Decisions

slide-6
SLIDE 6

Challenges in Existing TEEs

Keystone: an Open Framework for Architecting Trusted Execution Environments 6

Security Performance Functionality

SGX TrustZone SEV

Fixed Design Decisions Closed-Source Hardware

slide-7
SLIDE 7

Technical Contributions

q Keystone: Customizable RISC-V TEEs

Keystone: an Open Framework for Architecting Trusted Execution Environments 7

Fine-Grained Configuration Modular Extensions No µarch Modification Minimal TCB q Framework ØExtensive benchmarking ØReal-world applications ØMulti-platform deployment q Open-Source ØFull-stack available ØCommunity-driven efforts ØTEE verification & research

slide-8
SLIDE 8

Keystone Architecture and Trust Model

Keystone: an Open Framework for Architecting Trusted Execution Environments 8

Higher Privilege User (U-mode) Supervisor (S-mode) Machine (M-mode) Trusted Hardware

C0 C1 C2 C3 Root of Trust ! Optional HW Trusted

slide-9
SLIDE 9

Keystone Architecture and Trust Model

Keystone: an Open Framework for Architecting Trusted Execution Environments 9

Higher Privilege User (U-mode) Supervisor (S-mode) Machine (M-mode) Trusted Hardware

Trusted

OS Security Monitor (SM) App App App App Runtime

C C 1 C 2 C 3 Root of Trust

!

Optional HW

Enclave App Enclave App Runtime

slide-10
SLIDE 10

Keystone Architecture and Trust Model

Keystone: an Open Framework for Architecting Trusted Execution Environments 10

User (U-mode) Supervisor (S-mode) Machine (M-mode) OS Security Monitor (SM) App App App App

Hardware-Enforced and Software-Defined Isolation

Runtime Enclave App Enclave App Runtime

slide-11
SLIDE 11

Security Monitor (SM) OS App App App App Runtime Enclave App

Memory Isolation via RISC-V PMP

Keystone: an Open Framework for Architecting Trusted Execution Environments 11

Physical Memory PMP0 PMP1 PMP2

PMP7

Entries Accessibility defined by each entry

Higher Priority SM Enclave 1 Enclave 2 Can’t Undefined Accessibility Can

slide-12
SLIDE 12

Memory Isolation via RISC-V PMP

Keystone: an Open Framework for Architecting Trusted Execution Environments 12

Physical Memory PMP0 PMP1 PMP2

PMP7

Entries Accessibility defined by each entry

Higher Priority SM Enclave 1 Enclave 2 Can’t Undefined Accessibility Can

Security Monitor (SM) OS App App App App Runtime Enclave App

slide-13
SLIDE 13

Keystone Architecture and Trust Model

Keystone: an Open Framework for Architecting Trusted Execution Environments 13

User (U-mode) Supervisor (S-mode) Machine (M-mode) OS Security Monitor (SM) App App App App

What Does Keystone Runtime Do?

Runtime Enclave App Enclave App Runtime

slide-14
SLIDE 14

What does Keystone Runtime Do?

Keystone: an Open Framework for Architecting Trusted Execution Environments 14

User (U-mode) Supervisor (S-mode) Machine (M-mode) OS Security Monitor (SM) App App Runtime Enclave App

! " ⚙ $ %

slide-15
SLIDE 15

What does Keystone Runtime Do?

Keystone: an Open Framework for Architecting Trusted Execution Environments 15

User (U-mode) Supervisor (S-mode) Machine (M-mode) OS Security Monitor (SM) App App Runtime Enclave App seL4 App

Interface Interface

slide-16
SLIDE 16

What does Keystone Runtime Do?

Keystone: an Open Framework for Architecting Trusted Execution Environments 16

User (U-mode) Supervisor (S-mode) Machine (M-mode) OS Security Monitor (SM) App App Enclave App freemem paging I/O syscall libc seL4 App

slide-17
SLIDE 17

Memory Management in Keystone

Keystone: an Open Framework for Architecting Trusted Execution Environments 17

! = untrusted " = page table ⚙ = management

App Enclave OS " ⚙ Intel SGX App Enclave " Monitor ⚙ ARM TrustZone OS App Eapp RT " ⚙ Security Monitor OS Enclave

q Enclave self resource management (e.g., dynamic memory resizing) q Various memory protection mechanisms

Intel SGX Komodo Keystone

slide-18
SLIDE 18

Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption

18

slide-19
SLIDE 19

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

19

Baseline

slide-20
SLIDE 20

Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption

20

Cache Partitioning

"

slide-21
SLIDE 21

Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption

21

On-Chip Enclave

" "

slide-22
SLIDE 22

Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption

22

Software Encryption

" "

slide-23
SLIDE 23

Adversary SW

⚫ ⚫ ⚫ ⚫ ⚫

Cache SC

⚫ ⚫ ⚫ ⚫

HW

⚫ ⚫ ⚫

Various Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

Baseline Cache Partitioning On-Chip Enclave Software Encryption Hardware Encryption

23

slide-24
SLIDE 24

Evaluation

Keystone: an Open Framework for Architecting Trusted Execution Environments 24

q Security Analysis

Ø Keystone enclave defends various adversary models

q Modularity Analysis

Ø Keystone supports fine-grained and modular configuration

q Trusted Computing Base Analysis

Ø Various of real-world applications with a few thousands of LoC

q Performance Analysis

Ø Security Monitor Overhead Ø Runtime Overhead Ø Cost of Memory Protection Mechanisms

slide-25
SLIDE 25

Evaluation

Keystone: an Open Framework for Architecting Trusted Execution Environments 25

q Security Analysis

Ø Keystone enclave defends various adversary models

q Modularity Analysis

Ø Keystone supports fine-grained and modular configuration

q Trusted Computing Base Analysis

Ø Various of real-world applications with less than thousands of LoC

q Performance Analysis

Ø Security Monitor Overhead Ø Runtime Overhead Ø Cost of Memory Protection Mechanisms

Please check our paper!

slide-26
SLIDE 26

Runtime Overhead: Memory Management

wLderesnet resnext29 LnceptLonv3 resnet50 densenet vgg19 resnet110 squeezenet lenet 200 400 600 Latency (s) base (other) base (user) keyst (other) keyst (eapp) keyst-dyn (other) keyst-dyn (eapp)

Keystone: an Open Framework for Architecting Trusted Execution Environments

qTorch benchmark

ØUnmodified NN inference

qInitialization overhead

ØEnclave measurement (SHA3)

26

qExecution overhead

Ø Min -3.12% (LeNet) Ø Max 7.35% (DenseNet)

qDynamic memory resizing

Ø No noticeable overhead

slide-27
SLIDE 27

Cost of Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

On-chip Execution Self Paging Software Encryption Cache Partitioning

27

Baseline Cache Partitioning On-Chip Enclave Software Encryption

slide-28
SLIDE 28

Cost of Memory Protection Mechanisms

Keystone: an Open Framework for Architecting Trusted Execution Environments

On-chip Execution Self Paging Software Encryption Cache Partitioning

28

slide-29
SLIDE 29

Conclusion

q Introduced Keystone, a customizable framework for TEEs q Modular design with fine-grained customizability q Useful for building TEEs for different threat models, functionality, and performance requirements q Keystone is fully open-source under BSD 3-Clause

Ø https://keystone-enclave.org

Keystone: an Open Framework for Architecting Trusted Execution Environments 29

slide-30
SLIDE 30

Thank You!

Keystone: an Open Framework for Architecting Trusted Execution Environments 30