zerotrace: oblivious memory primitives from intel sgx · [2] - stefanov, emil, et al. path oram: an...

91
ZeroTrace: Oblivious Memory Primitives from Intel SGX Sajin Sasy 1 , Sergey Gorbunov 1 and Christopher Fletcher 2 1 - University of Waterloo, 2 - University of Illinois at Urbana-Champaign

Upload: others

Post on 22-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace: Oblivious Memory Primitives from Intel SGX

Sajin Sasy1, Sergey Gorbunov1 and Christopher Fletcher2

1 - University of Waterloo, 2 - University of Illinois at Urbana-Champaign

Page 2: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Secure Remote Computations

Desirable Properties :● Confidentiality : The server learns nothing about D● Integrity : The server can only return P(D) and no other function of D ● Efficiency : It executes in time close to natively executing P(D)

1

P , D

P , D

P ( D )

Alice with Program(P) and Data(D) wishes to compute P(D)

Page 3: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Solution in the ideal world

Desirable Properties :● Confidentiality : The server learns nothing about D● Integrity : The server can only return P(D) and no other function of D ● Efficiency : It executes in time close to natively executing P(D)

2

,P , D

Alice with Program(P) and Data(D) wishes to compute P(D)

P ( D )

P , D

Page 4: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :

3

Software Solutions :

[1] - Gentry, Craig. A fully homomorphic encryption scheme.

Page 5: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :ConfidentialityIntegrityEfficiency

Software Solutions :

[1] - Gentry, Craig. A fully homomorphic encryption scheme.

3

Page 6: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :ConfidentialityIntegrityEfficiency

ORAM [2] :ConfidentialityIntegrityEfficiency

Software Solutions :

[1] - Gentry, Craig. A fully homomorphic encryption scheme. [2] - Oded Goldreich and Rafail Ostrovsky. Software protection and simulation on oblivious RAMs.

3

Page 7: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :ConfidentialityIntegrityEfficiency

3

ORAM [2] :ConfidentialityIntegrityEfficiency

Intel TPM+TXT [3] :ConfidentialityIntegrityEfficiency

Hardware Solutions :

Software Solutions :

[1] - Gentry, Craig. A fully homomorphic encryption scheme. [2] - Oded Goldreich and Rafail Ostrovsky. Software protection and simulation on oblivious RAMs. [3] - Scarlata, Vincent, et al. TPM virtualization: Building a general framework.

Page 8: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :ConfidentialityIntegrityEfficiency

ORAM [2] :ConfidentialityIntegrityEfficiency

Intel TPM+TXT [3] :ConfidentialityIntegrityEfficiency

Hardware Solutions :

Software Solutions :

Intel SGX [4] :ConfidentialityIntegrityEfficiency

[1] - Gentry, Craig. A fully homomorphic encryption scheme. [2] - Oded Goldreich and Rafail Ostrovsky. Software protection and simulation on oblivious RAMs. [3] - Scarlata, Vincent, et al. TPM virtualization: Building a general framework. [4] - Anati, Ittai, et al. Innovative technology for CPU based attestation and sealing.

3

Page 9: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Real world tools and techniques

FHE [1] :ConfidentialityIntegrityEfficiency

ORAM [2] :ConfidentialityIntegrityEfficiency

Intel TPM+TXT [3] :ConfidentialityIntegrityEfficiency

Hardware Solutions :

Software Solutions :

Intel SGX [4] :ConfidentialityIntegrityEfficiency

[5] - Xu, Yuanzhong et al. Controlled-channel attacks: Deterministic side channels for untrusted operating systems.[6] - Shinde, Shweta, et al. Preventing page faults from telling your secrets.[7] - Lee, Sangho, et al. Inferring fine-grained control flow inside SGX enclaves with branch shadowing. [8] - Brasser, Ferdinand, et al. Software Grand Exposure: SGX Cache Attacks Are Practical.[9] - Moghimi, Ahmad et al. Cachezoom: How SGX amplifies the power of cache attacks. [10] - Van Bulck, Jo, et al. Telling your secrets without page faults: Stealthy page table-based attacks on enclaved execution.

[5,6,7,8,9,10]

3

Page 10: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Our Goal

Can we design a solution that meets all the three desirable properties of secure remote computation ?

Yes, ZeroTrace.

Our Approach :Privacy of ORAM

+Efficiency of SGX

4

Page 11: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Outline

1. Secure Remote Computation2. Preliminaries :

● Intel SGX● ORAM

3. ZeroTrace Architecture4. Evaluation

5

Page 12: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

PreliminariesIntel SGX Background

Page 13: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Intel SGX - Software Guard eXtensions

● x86 instructions extension

6

Page 14: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Intel SGX - Software Guard eXtensions

● x86 instructions extension● Trusted processor fused with secret keys

6

Page 15: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Intel SGX - Software Guard eXtensions

● x86 instructions extension● Trusted processor fused with secret keys● Processor Reserved Memory

(PRM) set aside securely at boot

6

Page 16: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Intel SGX - Software Guard eXtensions

● x86 instructions extension● Trusted processor fused with secret keys● Processor Reserved Memory

(PRM) set aside securely at boot● Secure virtual containers called enclaves

6

Page 17: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Intel SGX - Software Guard eXtensions

● x86 instructions extension● Trusted processor fused with secret keys● Processor Reserved Memory

(PRM) set aside securely at boot● Secure virtual containers called enclaves● “Secure as long as processor

isn’t physically broken into.”

6

Page 18: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Secure Remote Computations with Intel SGX

Properties :● Confidentiality● Integrity● Efficiency

,P , DP ( D )

P , D

7

Page 19: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Properties :● Confidentiality● Integrity● Efficiency

Secure Remote Computations with Intel SGX

,P , DP ( D )

P , D

7

Page 20: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Security Limitations of SGX

Research has shown that SGX is susceptible to side channel attacks. These attacks enable an adversary to extract secret data from enclaves !

● Page Fault Attacks [1,2]● Branch Shadowing Attack [3]● Cache Attacks [4,5]● Data Access Pattern Attacks [1,6]

[1] - Xu, Yuanzhong, Weidong Cui, and Marcus Peinado. Controlled-channel attacks: Deterministic side channels for untrusted operating systems. 2015.[2] - Shinde, Shweta, et al. Preventing page faults from telling your secrets. 2016.[3] - Lee, Sangho, et al. Inferring fine-grained control flow inside SGX enclaves with branch shadowing. 2016.[4] - Brasser, Ferdinand, et al. Software Grand Exposure: SGX Cache Attacks Are Practical. 2017.[5] - Moghimi, Ahmad, Gorka Irazoqui, and Thomas Eisenbarth. Cachezoom: How SGX amplifies the power of cache attacks. 2017.[6] - Van Bulck, Jo, et al. Telling your secrets without page faults: Stealthy page table-based attacks on enclaved execution. 2017.

8

Page 21: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Functional Limitations of SGX

● Effective PRM limited to 90 MB (with expensive cost for paging)● No direct IO / syscalls ● Expensive context switching due to Asynchronous Enclave Exits (AEX)

9

Page 22: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Outline

1. Secure Remote Computation2. Preliminaries :

● Intel SGX - Lightning Tour● ORAM

3. ZeroTrace Architecture4. Evaluation

10

Page 23: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

PreliminariesORAM or Oblivious RAM

Page 24: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Oblivious RAM [1]

● Cryptographic primitive designed to hide memory access patterns● All ORAMs fundamentally require a probabilistic encryption schema

[1] - Goldreich, Oded, and Rafail Ostrovsky. Software protection and simulation on oblivious RAMs. 1996

11

Page 25: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Tree based ORAMs [1,2,3]

[1] - Shi, Elaine, et al. Oblivious RAM with O ((logN) 3) Worst-Case Cost. 2011.[2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013.[3] - Wang, Xiao, Hubert Chan, and Elaine Shi. Circuit ORAM: On tightness of the Goldreich-Ostrovsky lower bound. 2015.

Data Blocks

12

Page 26: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Tree based ORAMs [1,2,3]

[1] - Shi, Elaine, et al. Oblivious RAM with O ((logN) 3) Worst-Case Cost. 2011.[2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013.[3] - Wang, Xiao, Hubert Chan, and Elaine Shi. Circuit ORAM: On tightness of the Goldreich-Ostrovsky lower bound. 2015.

N Data Blocks

BucketClient

Server

N leaves

12

Page 27: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Tree based ORAMs [1,2,3]

[1] - Shi, Elaine, et al. Oblivious RAM with O ((logN) 3) Worst-Case Cost. 2011.[2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013.[3] - Wang, Xiao, Hubert Chan, and Elaine Shi. Circuit ORAM: On tightness of the Goldreich-Ostrovsky lower bound. 2015.

Position Map Stash

N Data Blocks

BucketClient

Server

N leaves

12

Page 28: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Tree based ORAMs [1,2,3]

Position Map Stash

N Data Blocks

N leaves

Bucket

Invariant : A block in the system will always reside in either the local stash, or in its path to the leaf label on the server tree.

[1] - Shi, Elaine, et al. Oblivious RAM with O ((logN) 3) Worst-Case Cost. 2011.[2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013.[3] - Wang, Xiao, Hubert Chan, and Elaine Shi. Circuit ORAM: On tightness of the Goldreich-Ostrovsky lower bound. 2015.

ClientServer

12

Page 29: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7

N leaves

7

12

Page 30: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7

N leaves

7

2 Sample new leaf ′

12

Page 31: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7

N leaves

7

2 Sample new leaf ′

3 Request path to leaf

12

Page 32: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7

N leaves

7

2 Sample new leaf ′

3 Request path to leaf

12

Page 33: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

Position Map

1 Fetch leaf for id = 7

7

2 Sample new leaf ′

3 Request path to leaf

4 Return path to leaf

path

12

Page 34: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

Position Map

1 Fetch leaf for id = 7

7

2 Sample new leaf ′

3 Request path to leaf

path

Stash 5 Push real blocks into stash

4 Return path to leaf

12

Page 35: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

Position Map

1 Fetch leaf for id = 7

7

2 Sample new leaf ′

3 Request path to leaf

path

Stash 5 Push real blocks into stash

4 Return path to leaf

6 Rebuild path from stash

12

Page 36: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

Position Map

1 Fetch leaf for id = 7

7

2 Sample new leaf ′

3 Request path to leaf

path

Stash 5 Push real blocks into stash

4 Return path to leaf

6 Rebuild path from stash

new_path

7 Return new path to leaf

12

Page 37: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

Request ID : 7

Position Map

1 Fetch leaf for id = 7

7

2 Sample new leaf ′

3 Request path to leaf

path

Stash 5 Push real blocks into stash

4 Return path to leaf

6 Rebuild path from stash

new_path

7 Return new path to leaf

ORAM Controller

12

Page 38: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Outline

1. Secure Remote Computation2. Preliminaries :

● Intel SGX - Lightning Tour● ORAM

3. ZeroTrace Architecture4. Evaluation

13

Page 39: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace Architecture

Page 40: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace Threat Model

● By default we consider a malicious active adversary● Everything on the server stack except the processor is untrusted

,P , DP ( D )

P , D

14

Page 41: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 1

Req

Block

15

Page 42: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 1

Problems :1. Controller code susceptible to side channel leakages

Req

Block

1 Side ChannelLeakages

15

Page 43: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 1

2 Access Pattern

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses

Leakages

1 Side ChannelLeakages

Req

Block

15

Page 44: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 1

2 Access Pattern

3 Exceeds PRM Limit

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses3. Position map could exceed available PRM

Leakages

1 Side ChannelLeakages

Req

Block

15

Page 45: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 1

4 No I/O

2 Access Pattern

3 Exceeds PRM Limit

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses3. Position map could exceed available PRM4. Enclaves do not have IO support

Leakages

1 Side ChannelLeakages

Req

Block

15

Page 46: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 2

4 No I/O

2 Access Pattern

3 Exceeds PRM Limit

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses3. Position map could exceed available PRM4. Enclaves do not have IO support

Leakages

1 Side ChannelLeakages

Req

Block

15

Page 47: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 2

2 Access Pattern

3 Exceeds PRM Limit

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses3. Position map could exceed available PRM

Leakages

1 Side ChannelLeakages

Req

Block

15

Page 48: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 2 : Recursive ORAMs

N leaves

Position Map 1

N/c leaves

Position Map 2

...

Position Map X

N / cx entries

16

Page 49: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 2

2 Access Pattern

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses

Leakages

1 Side ChannelLeakages

Req

Block

17

Page 50: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : Recursion

Data blocks are of 1 KB size in this experiment

18

Page 51: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Attempt 3 : Solving the security issues

Untrusted Shim

Leakages 2 Access Pattern

Problems :1. Controller code susceptible to side channel leakages2. Access pattern leakages of position map and stash accesses

1 Side ChannelLeakages

Req

Block

19

Page 52: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

1) Oblivious functions at assembly level● Library of assembly-level functions for oblivious operations.● Wrapper functions over CMOV instruction [14,15]● Example function :

Building blocks for side-channel proofing

[14] - Ohrimenko, Olya, et al. "Oblivious Multi-Party Machine Learning on Trusted Processors." USENIX Security Symposium. 2016.[15] - Rane, Ashay, Calvin Lin, and Mohit Tiwari. "Raccoon: Closing Digital Side-Channels through Obfuscated Execution." USENIX Security Symposium. 2015.

20

Page 53: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

2) Constant time code for the underlying ORAM schema ● Code branches must be data independent● Access to stash and position map are made through linear scans

Building blocks for side-channel proofing

21

Page 54: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace

Page 55: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace

● First oblivious memory controller on a real secure hardware platform● Flexible storage backends● ZeroTrace is secure against ALL software side-channel attacks since it

realizes the oblivious enclave execution definition.

22

Page 56: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace - Usage Models

1) Memory Protection for Secure Computation● Memory controller for other enclaves● Data accesses are now side-channel secure

,P , DP ( D )

P , D

23

Page 57: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : ZeroTrace performance with small data size

Data blocks are of 8 bytes size in this experiment

24

Page 58: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace - Usage Models

2) Remote Oblivious Data Storage● Order of magnitude network bandwidth saving● Order of magnitude decrease in access latency

Req

Block

25

Page 59: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : ZeroTrace performance with increasing data sizes

26

Page 60: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

How to use ZeroTrace

In order to use oblivious memory via ZeroTrace, where necessary :

● Create an oblivious memory abstraction by : ZeroTrace_New (label, N, block_size, <params>)

● Access this oblivious memory by : ZeroTrace_Access (label, id, op, data*)

27

Page 61: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Summary

● Illustrated design and evaluation of ZeroTrace● Showed how to achieve efficient secure remote computation through

ZeroTrace● Go play with ZeroTrace : https://github.com/Sajin7/ZT

28

Page 62: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Summary

● Illustrated design and evaluation of ZeroTrace● Showed how to achieve efficient secure remote computation through

ZeroTrace● Go play with ZeroTrace : https://github.com/Sajin7/ZT

28

Page 63: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Bonus Slides !

63

Page 64: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Comparing with Hardware ORAM solutions :

● No deployed / practically available solutionSince H/W required is custom and not commercially available

● Typically tied to DRAM storage● All or nothing , no flexibility

64

Page 65: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Comparing with Raccoon:

● Experiments on Xeon processors (No SGX Support)● Parameterized to fit recursion within the register space, and

discarded recursive ORAMs for SGX setting● Streaming doesn’t account for encryption/decryption overhead

65

Page 66: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

How does Meltdown/Spectre affect ZeroTrace

● Meltdown does not effect ZeroTrace. No PoC currently● Spectre_1 doesn’t pan out since there are no branches ● Spectre_2 has been patched by Intel already● We are still investigating this

66

Page 67: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

High-level Security of ZeroTrace

27

Req

Block

Side-channel proofed using oblivious techniques

Untrusted Shim

Inherits traditional ORAM security

Page 68: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Future Steps:

● Deploying ZeroTrace as an open source library● Optimizing data structure support● Optimizing initialization costs● Asynchronous ORAM

68

Page 69: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Desired Property : Oblivious Enclave Execution

When a program P is loaded in an enclave, and a set of inputs y = (in1,...,inM) are executed by this enclave it results in an adversarial view V(y) = trace((Ep,in1),...,(Ep,inM)). We say that the enclave execution is oblivious if given two sets of inputs y and z, their adversarial views V(y) and V(z) are computationally indistinguishable.

Here trace(Ep,in) captures the execution trace induced by running the enclave Ep with input in. This trace(Ep,in) contains all the powerful side channel artifacts that the adversary can view such as cache usage, page faults, etc.

10

Page 70: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

ZeroTrace - Security Arguement

70

Page 71: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Side-channel proofed leaf label retrieval

Non-Oblivious Leaf-label Retrieval :

Oblivious Leaf-label Retrieval :

23

Page 72: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Other Graphs

72

Page 73: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : Memory Primitives

28

Page 74: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : Flexibility of Controller

24

Data blocks are of 1 KB size in this experiment

Page 75: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Evaluation : Breakdown of Request Time

75

Page 76: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Overhead of EPC memory accesses

76

Page 77: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

oupdate() in depth

77

Page 78: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Building blocks for side-channel proofing

21

Trusted Processor

Processor Reserved Memory

Page 79: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Building blocks for side-channel proofing

21

Trusted Processor

Processor Reserved Memory

mov eax, src

mov ebx, dst

mov ecx, cond

1

Page 80: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Building blocks for side-channel proofing

21

Trusted Processor

Processor Reserved Memory

mov eax, src

mov ebx, dst

mov ecx, cond

cmp ecx, 1cmovz ebx, eax

1

2

Page 81: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Building blocks for side-channel proofing

21

Trusted Processor

Processor Reserved Memory

mov eax, src

mov ebx, dst

mov ecx, flag

cmp ecx, 1cmovz ebx, eax

1

2

mov src, eax

mov dst, ebx

3

Page 82: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Access Protocol for Tree based ORAM schemes

82

Page 83: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7 from Position Map

N leaves

Page 84: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7 from Position Map

N leaves

2 Request path to leaf

Page 85: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7 from Position Map

N leaves

2 Request path to leaf

3 Sample new leaf

Page 86: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

Request ID : 7

1 2 …. .. N-1 N

Position Map

1 Fetch leaf for id = 7 from Position Map

N leaves

2 Request path to leaf

3 Sample new leaf

Page 87: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

path

Request ID : 7

Position Map

4 Return path to leaf

1 Fetch leaf for id = 7 from Position Map

2 Request path to leaf

3 Sample new leaf

Page 88: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

path Stash

Request ID : 7

Position Map

4 Return path to leaf

1 Fetch leaf for id = 7 from Position Map

2 Request path to leaf

3 Sample new leaf

5 Push real blocks on path into stash

Page 89: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

path

new_path

Stash

Request ID : 7

Position Map

4 Return path to leaf

5 Push real blocks on path into stash

6 Rebuild path from stash

1 Fetch leaf for id = 7 from Position Map

2 Request path to leaf

3 Sample new leaf

Page 90: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

path

new_path

Stash

Request ID : 7

Position Map

4 Return path to leaf

5 Push real blocks on path into stash

6 Rebuild path from stash

7 Return new path to leaf back to server

1 Fetch leaf for id = 7 from Position Map

2 Request path to leaf

3 Sample new leaf

Page 91: ZeroTrace: Oblivious Memory Primitives from Intel SGX · [2] - Stefanov, Emil, et al. Path ORAM: an extremely simple oblivious RAM protocol. 2013. [3] - Wang, Xiao, Hubert Chan, and

Client Server

Tree based ORAMs - Access

12

path

new_path

Stash

Request ID : 7

Position Map

4 Return path to leaf

5 Push real blocks on path into stash

6 Rebuild path from stash

7 Return new path to leaf back to server

1 Fetch leaf for id = 7 from Position Map

2 Request path to leaf

3 Sample new leaf

ORAM Controller