Komodo: Using Verification to Disentangle Secure-Enclave Hardware from Software
Andrew Ferraiuolo†, Andrew Baumann, Chris Hawblitzel, Bryan Parno* Microsoft Research, Cornell University†, Carnegie Mellon University*
1
Disentangle Secure-Enclave Hardware from Software Andrew Ferraiuolo, - - PowerPoint PPT Presentation
Komodo: Using Verification to Disentangle Secure-Enclave Hardware from Software Andrew Ferraiuolo, Andrew Baumann, Chris Hawblitzel, Bryan Parno* Microsoft Research, Cornell University, Carnegie Mellon University* 1 Secure Remote
Andrew Ferraiuolo†, Andrew Baumann, Chris Hawblitzel, Bryan Parno* Microsoft Research, Cornell University†, Carnegie Mellon University*
1
Application + Secrets OS, Hypervisor, Other SW CPU Memory Application/Data Owner Remote Machine
2
Enclave
Secret Data
EnclaveEntry: mov fs:[Tcs],rbx mov fs:[CSSA],eax cmp eax, 0 jne ExceptionEntry mov r10,fs:[ResAdr] cmp r10,0 je @F jmp r10 @@:mov rcx, r8 mov rdx, r9 mov r8, rbxOS (untrusted) Reference Monitor Memory Memory encryption Remote attestation SGX instructions Implement a reference monitor
3
Software developers must wait for Intel to make changes Change is necessary
SGX instructions are primarily microcode
4
Software Hardware Development Time
SGX is complex
Hardware is no more trustworthy than software
SGX vulnerabilities have already been found (CVE-2017-569)
5
Enclave management in software Evolve independently of hardware Trust through formal verification
6
Komodo monitor software:
Hardware Requirements:
Untrusted OS User proc. Enclave Komodo monitor CPU / HW Mem isolation
7
Secure-world memory is isolated from normal world.
Komodo Monitor Untrusted OS Enclaves User apps Privileged modes: User mode: Secure world Normal world
8
INIT_ADDRSPACE() INIT_L2PT() MAP_SECURE() / MAP_INSECURE() INIT_THREAD() FINALISE()
9
Data Context Entry (PC)
L1PT: State: Init Final Measurement L2PT
ENTER() / RESUME()
10
L1PT: Context Entry (PC) State: Final
PC L1PT GPRs CPU: Interrupt/ Exception
Compute on data in its secure pages Communicate with outside world
Komodo enclave API
11
1) Prove Komodo conforms to specification of correct execution
2) Prove that correctness spec enforces security properties
Correctness Specification Security Properties
Implementation
12
Enclaves are protected from an OS + malicious enclave adversary:
Formalized as noninterference – adversarially-observable outputs are purely determined by adversarially-controlled inputs Declassified to OS: exception type, dynamic allocation, return values, and insecure memory
13
Dafny, Z3 ARMv7 ISA model
(~1.5k LOC)
Komodo implementation (annotated assembly)
code proof
Komodo abstract spec
(~2k LOC)
komodo.S
Trusted Untrusted
Supporting proofs
14
Prototype on Raspberry Pi 2.
Operation Cycles Null SMC 123 Enter 496 Resume 625 Enter + Exit 738
15
10 20 30 40 50 60 70 80 4 8 16 32 64 128 256 512 Time (ms) Input size (kB) Komodo enclave Linux process
16
Total verification effort – 2 person-years Source lines of code : Spec Impl Proof Total 4,446 2,710 18,655
17
Security 175 Correctness 795 ARM 1,174 Other 2,302
Motivation: software can evolve more quickly than hardware SGX2 extends SGX1 with dynamic memory management
We extended Komodo with dynamic memory in 6 person-months!
18
CertiKOS / seL4
Sanctum
19
A small code base is not a substitute for verification.
Trusted components require extra diligence
Verification tools can still improve
20
SGX defends against a powerful threat-model, but it has limitations:
Komodo improves evolvability and security
Verification of software enclaves is tractable, permits evolution
https://github.com/Microsoft/Komodo
21