Hardware-assisted Security: : From Trust Anchors to Melt ltdown of f Trust
Ahmad-Reza Sadeghi Technische Universität Darmstadt & Intel Collaborative Research Institute for Collaborative & Resilient Autonomous Systems
From Trust Anchors to Melt ltdown of f Trust Ahmad-Reza Sadeghi - - PowerPoint PPT Presentation
Hardware-assisted Security: : From Trust Anchors to Melt ltdown of f Trust Ahmad-Reza Sadeghi Technische Universitt Darmstadt & Intel Collaborative Research Institute for Collaborative & Resilient Autonomous Systems His istorical
Ahmad-Reza Sadeghi Technische Universität Darmstadt & Intel Collaborative Research Institute for Collaborative & Resilient Autonomous Systems
Cambridge CAP
1970 1980 1990 2000 2010
Reference monitor Protection rings VAX/VMS Java security architecture Hardware-assisted secure boot Trusted Platform Module (TPM) Late launch/TXT Computer security Mobile security Smart card security Mobile hardware security architectures TI M-Shield ARM TrustZone Mobile OS security architectures Mobile Trusted Module (MTM) Simple smart cards Java Card platform TPM 2.0 Intel SGX GP TEE standards On-board Credentials PUFs
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Fantastic Sad Total Disaster Very Sad Complicated?
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
On-board Credentials (ObC)
2000 2004 2008 2012 2018
Sanctum Bastion AEGIS Trusted Execution Security Extensions HAFIX ObC HardBound TrustLite TyTAN SMART Sancus
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Fantastic Almost Optimistic Total Disaster Sad Complicated?
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Hardware Software Stack Operating System App 1 App 2 App 4 App 3 Peripherals CPU I/O Hardware Software Stack Memory
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory
execution
integrity
identification
authentication capabilities
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Device Hardware Fingerprint (unique intrinsic identifier) Infeasible to predict
Challenge/response behavior is pseudo-random
Inherently Unclonable
Due to unpredictable randomness during manufacturing of tag
≠
Tamper-evident
Tampering with the PUF hardware changes challenge/response behavior
Physically Unclonable Function (noisy function based on physical properties) Challenge 𝑑 Response 𝑠
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
2001 2002-2004 2006 2007 2008
SELECTED PUFs
Optical PUF
[P.Ravikanth, 2001]
Arbiter PUF & RO-PUF
[Gassend et al., CCS‘02]
Feed-Forward A-PUF
[Lee et al., VLSIC’04]
Coating PUF
[Tuyls et al., CHES’06]
SRAM PUF
[Guajardo et al., CHES’07][Holcomb et al., RFIDSec’07]
Latch PUF
[Su et al., ISSCC‘07]
XOR A-PUF
[Suh et al., DAC’07]
Lightweight PUF
[Majzoobi et al., ICCAD‘08]
Flip-Flop PUF
[Kumar et al., WiSec’08]
Butterfly PUF
[Su et al., HOST‘08]
2010-2011
Glitch PUF
[Anderson et al., ASP-DAC‘10]
2012-2013 2016-now
Bistable Ring PUF
[Chen et al., HOST‘11]
Current-based PUF
[Majzoobi et al., ISCAS‘11]
Flash PUF
[Prabhu et al., ICTTC‘11]
Buskeeper PUF
[Simons et al., HOST‘12]
DRAM PUF
[Rosenblatt et al., SSC‘13]
Bitline PUF
[Holcomb et al., CHES‘14]
MEMS PUF
[Willers et al., CCS‘16]
Row Hammer-PUF
[Schaller et al., HOST‘17]
Memory-based PUFs Delay-based PUFs Other PUFs
Processor-based PUF
[Kong et al., DAC’14]
Subthreshold Current PUF
[Kalyanaraman et al., HOST‘13]
Current Mirrors PUF
[Kumar et al., HOST‘14]
Voltage Transfer PUF
[Vijaykumar et al., DATE‘15]
2014-2015
EU UNIQUE Project
MXPUF
[Nguyen et al., eprint‘17]
Monte Carlo PUF
[Rožić et al., FPT ‘17]
www.unique-project.eu
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Arbiter PUF & RO-PUF
[Gassend et al., CCS‘02]
Feed-Forward A-PUF
[Lee et al., VLSIC’04]
SRAM PUF
[Guajardo et al., CHES’07] [Holcomb et al., RFIDSec’07]
XOR A-PUF
[Suh et al., DAC’07]
Lightweight PUF
[Majzoobi et al., ICCAD‘08]
Flip-Flop PUF
[Kumar et al., WiSec’08]
DRAM PUF
[Rosenblatt et al., SSC‘13]
Row Hammer-PUF
[Schaller et al., HOST‘17]
The output determined by the faster path The output is based on the state of memory cells after a power cycle
Delay-based PUFs Memory-based PUFs
Power-on / / / 1 1 / / / 1 1 1 / 1 / / 1 1 1 1 1
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Pair of identically designed delay lines
𝑥0
𝑣
𝑥0
𝑚
Switch
𝑥1
𝑣
𝑥1
𝑚
𝒅𝟏 = 0 𝒅𝟏 = 1
Response Impulse
1
𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕
Challenge
Manufacturing variations affect delay lines
Arbiter
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Arbiter PUF
[Gassend et al., CC‘04]
SRAM PUF
[Guajardo et al., CHES’07] [Holcomb et al., RFIDSec’07]
Delay-based PUFs Memory-based PUFs
Modeling Attacks
[Lee et al., VLSIC’04]
Physical Attacks
[Oren et al., CHES’13] [Helfmeier et al., HOST’13]
Linear Behavior! XOR A-PUF
[Suh et al., DAC’07]
Modeling Attacks
[Ruhrmair et al., CCS’10] [Becker, CHES’15]
Add non-linear funcions Memristor A-PUF
[Suh et al., DAC’15]
Add non-linear components
Physical Attacks
[Merli et al., WESS’11] [Tajik et al., CHES’14] [Rührmair et al., CHES’14]
/ / / 1 1 / / / 1 1 1 / 1 / / 1 1 1 1 1
2004 2008
SELECTED ATTACKS & ANALYSIS
ML-Modeling Attack (A-PUF)
[Lee et al., VLSIC’04]
ML-Modeling Attack (FF A-PUF)
[Majzoobi et al., ITC’08]
2010-2012
ML-Modeling Attack delay-based PUFs
[Ruhrmair et al., CCS’10]
2013 2014
Semi-Invasive EM Attack (RO-PUF)
[Merli et al., WESS’11]
Rémanence Decay SCA (SRAM PUF)
[Oren et al., CHES’13]
Cloning SRAM PUF
[Helfmeier et al., HOST’13]
Semi-Invasive Attack on PUFs
[Nedospasov et al., FDTC’13]
Noise SCA (A-PUF)
[Delvaux et al., HOST’13]
ML-Modeling Attack (Bistable Ring PUF)
[Hesselbarth et al., TRUST’14]
Power&Timing SCA (A-PUF)
[Rührmair et al., CHES’14]
Photon Emission Analysis (A-PUF)
[Tajik et al., CHES’14]
Hybrid Modeling Attacks (Current-based PUF)
[Kumar et al., ICCD’14]
PUFs: Myth, Fact or Busted?
[Katzenbeisser et al., CHES‘12]
Unified Security Model for PUFs
[Armknecht et al., CT-RSA 2016]
Formal Security Model
[Armknecht et al., S&P 2011]
Reliability-based ML-Modeling Attack (XOR A-PUF)
[Becker, CHES’15]
ML-Modeling Attack (Bistable Ring PUF)
[Ganji et al., CHES’16]
ML-Modeling Attack on non-linear PUFs
[Vijaykumar et al., HOST’16]
2015-2018
Hammering RH-PUF
[Zeitouni et al., DAC’18]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Response Impulse
1
𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕
Challenge Arbiter
Goal: Recovering the values of the wire delays inside the switch boxes
Modeling Attacks (Machine Learning) Physical Attacks (Semi-invasive/Side-channel)
CRPs ≈ 102 CRPs ≈ 103 - 106
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Programmable Logic Blocks Placement of an Arbiter PUF with 8 switches Upper Path Lower Path One switch
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse Challenge 1
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter Response Impulse Challenge 1
1 0 0 0 0 0 0 0
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter Response Impulse
Lower path delay 𝑿𝒎 = 𝒖𝟑 − 𝒖𝟏 Upper path delay 𝑿𝒗 = 𝒖𝟐 − 𝒖𝟏
Challenge 1
𝒖𝟏 𝒖𝟐 𝒖𝟑 1 0 0 0 0 0 0 0
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐
0 0 0 0 0 0 0 0
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
1 0 0 0 0 0 0 0
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
Characterize each switch box in the Arbiter PUF by calculating the delay differences for upper and lower paths
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
Characterize each switch box in the Arbiter PUF by calculating the delay differences for upper and lower paths
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
Characterize each switch box in the Arbiter PUF by calculating the delay differences for upper and lower paths 𝒘𝟐 − 𝒘𝟑 = 𝒙𝟐
𝒗𝟏 − 𝒙𝟏 𝒗𝟏
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
[Taji jik et t al., l., CH CHES’14]
Switch Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Response Impulse
Lower path delay 𝑋
𝑚
Upper path delay 𝑋
𝑣
Challenge 1
Characterize each switch box in the Arbiter PUF by calculating the delay differences for upper and lower paths 𝒘𝟐 − 𝒘𝟑 = 𝒙𝟐
𝒗𝟏 − 𝒙𝟏 𝒗𝟏
𝒗𝟐 − 𝒗𝟑 = 𝑥1
𝑚0 − 𝑥0 𝑚0
C 0x00 0x01 0x02 0x04 0x08 0x10 0x20 0x40 0x80 𝑿𝒗 𝑿𝒎 𝒘𝟐 𝒗𝟐 𝒘𝟑 𝒗𝟑
CMOS-based PUFs exhibit linear behavior => vulnerable to machine learning One Solution: Add components with non-linear behavior to complicate/escape machine learning attacks, e.g., Memristors
as voltage is applied
Current-Voltage charcteristics of a memristor (resistor)
Voltage Current
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Arbiter 𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Challenge Response Impulse 1 1
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
𝒅𝟏 𝒅𝟐 𝒅𝟖 𝒅𝟑 𝒅𝟒 𝒅𝟓 𝒅𝟔 𝒅𝟕 Challenge Impulse Arbiter Response
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
CMOS-based Arbiter PUF: Voltage at the upper path Memristor-based Arbiter PUF: Voltage at the upper path
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PUF Circuit Generation Challenge- Response Pairs Generation Analysis of PUF properties: Reproducibility, uniqueness, etc PUF Description Spice PUF circuit CRPs Secure/Insecure PUF Memristor model Advanced Machine Learning
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
App 4 I/O
Operating System App 1 App 2 App 3 TPM Hardware Software Stack Peripherals CPU Memory
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
App 4 I/O
Operating System App 1 App 2 App 3 TPM Hardware Software Stack Peripherals CPU Memory Operating System App 4 App 1 App 2 App 3 Example: IBM Integrity Measurement Architecture (IMA)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
App 4 I/O
Operating System App 1 App 2 App 3 TPM Hardware Software Stack Peripherals CPU Memory
Runtime attacks (e.g., Code-reuse Attacks)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
TPM assumptions and shortcomings
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory
Offline: Control-Flow Graph (CFG) Analysis & Path Measurement
App A
P*x P*2
Online: Runtime Validation
Processor Attestation Engine Hash Controller
Challenge
P1 P2 LP1
Measurement Database
Prover Verifier
Resilient to memory attacks
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory IMEI: International Mobile Equipment Identifier
Assumptions:
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Hardware Software Stack Peripherals CPU I/O Memory Operating System App 1 App 2 App 3 Secure World Trustlet 1 Trustlet 2 Trustlet 3 Operating System
Android
Protection (TIMA)
DRM
IMEI: International Mobile Equipment Identifier
Assumptions:
iOS
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Hardware Software Stack Peripherals CPU I/O Memory Operating System App 1 App 2 App 3 Secure World Trustlet 1 Trustlet 2 Trustlet 3 Operating System IMEI: International Mobile Equipment Identifier
Assumptions:
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Hardware Software Stack Peripherals CPU I/O Memory Operating System App 1 App 2 App 3 Secure World Trustlet 1 Trustlet 2 Trustlet 3 Operating System Trustlet 1 Trustlet 2 Trustlet 3 Operating System IMEI: International Mobile Equipment Identifier
[Dan Rosenberg, BlackHat US, 2014]
[Di Shen, BlackHat US, 2015]
[laginimaineb from Project Zero, 2016]
Assumptions:
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory Enclave 4 Enclave 3 Enclave 2 Enclave 1
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Operating System App 1 App 2 App 4 App 3 Hardware Software Stack Peripherals CPU I/O Memory Enclave 4 Enclave 3 Enclave 2 Enclave 1
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Host Application Operating System
Application N NIC DRAM MMU CPU Attacker Enclave Isolation NIC: Network Interface Controller MMU: Memory Management Unit
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Host Application Host Application Operating System
Application N Operating System NIC DRAM MMU CPU Attacker Enclave Isolation Application N DRAM NIC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
NIC: Network Interface Controller MMU: Memory Management Unit
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Source SGX SDK
App Enclave Function 0 Function 1 Function 2 Function 3 Compiler App Code Untrusted Runtime System (uRTS) Trusted Runtime System (tRTS)
App-to-Enclave function call (ECALL)
[Biondo et al., USENIX Sec. 2018]
App
Enclave Function 0 Function 1 Function 2 Function 3 Trusted Runtime System (tRTS) State
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Biondo et al., USENIX Sec. 2018]
App
Enclave Function 0 Function 1 Function 2 Function 3 Trusted Runtime System (tRTS) Restore State State
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Biondo et al., USENIX Sec. 2018]
App
Enclave Function 0 Function 1 Function 2 Function 3 Trusted Runtime System (tRTS) Restore State State
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Biondo et al., USENIX Sec. 2018]
App
Enclave Function 0 Function 1 Function 2 Function 3 Trusted Runtime System (tRTS) Restore State State Counterfeit state
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Biondo et al., USENIX Sec. 2018]
App
Enclave Function 0 Function 1 Function 2 Function 3 Trusted Runtime System (tRTS) Restore State State Counterfeit state
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Biondo et al., USENIX Sec. 2018]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM
EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault
Granularity: page 4K, good for big data structures
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT
Granularity: page 4K, good for big data structures
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ
Granularity: page 4K, good for big data structures
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ
Granularity: page 4K, good for big data structures
[Xu et al., IEEE S&P’15]
Original Recovered
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU OS EPC RAM PT PT PF Handler IRQ
Granularity: page 4K, good for big data structures
[Xu et al., IEEE S&P’15]
Original Recovered Single-trace RSA key recovery from RSA key generation
procedure of Intel SGX SSL via controlled-channel attack on the binary Euclidean algorithm (BEA) [Weiser et al., AsiaCCS’18]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache PT: Page Tables PF: Page-Fault
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM
EPC: Enclave Page Cache
Cache
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM
EPC: Enclave Page Cache
Cache
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 1 App 2 App 3 CPU EPC RAM
EPC: Enclave Page Cache
Cache
uses
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Prim ime + Probe
cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5
t0 t1 t2
for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)
Prime Victim Probe
Cache Code cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 2
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Prim ime + Probe
cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5
t0 t1 t2
for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)
Prime Victim Probe
Cache Code cache line 2
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Prim ime + Probe
cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5
t0 t1 t2
for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)
Prime Victim Probe
Cache Code cache line 2
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Prim ime + Probe
cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5
t0 t1 t2
for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)
Prime Victim Probe
Cache Code cache line 2
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Prim ime + Probe
cache line 0 cache line 1 cache line 2 cache line 4 cache line 3 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5 cache line 0 cache line 1 cache line 2 cache line 3 cache line 4 cache line 5
t0 t1 t2
for each cline Z write(Z) if (keybit[i] == 0) read(X) else read(Y) For each cline Z read(Z) measure_time(read)
Prime Victim Probe
Cache Code
cache line 2 was used by victim
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2 cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim
cl 2
tm
cl 0 cl 1 cl 2
Probe
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim
cl 2
tm
cl 0 cl 1 cl 2
Probe
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim
cl 2
tm
cl 0 cl 1 cl 2
Probe
cl 0
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim tm
cl 0 cl 1 cl 2
Probe
cl 0 cl 2
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim tm
cl 0 cl 1 cl 2
Probe
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
cl 0
context switches, interrupts, etc.)
*OS: Operating System and any other privileged system software
cl 0 cl 1 cl 2
Prime tk tl tn
cl 0 cl 1 cl 2
Other Process
cl 0 cl 1 cl 2
Victim tm
cl 0 cl 1 cl 2
Probe cl0 and cl2 were used… … by the victim?
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952] Use standard prime + probe to detect key dependent memory accesses, interrupt enclave [Moghimi et al., arXiv:1703.06986] Use prime + probe to extract key from synchronized victim enclave [Götzfried et al., EuroSec’17]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952] Use standard prime + probe to detect key dependent memory accesses, interrupt enclave [Moghimi et al., arXiv:1703.06986] Use prime + probe to extract key from synchronized victim enclave [Götzfried et al., EuroSec’17] A malicious enclave prime + probes another enclave, evading detection [Schwarz et al., DIMVA’17 & arXiv:1702.08719]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Enclave 1 Enclave 2 App 2 App 3 CPU EPC RAM Level 3 CPU Core
Level 2 Level 1 Branch Pred. SMT SMT
OS
Use CPU internal caches to infer control flow [Lee et al., Usenix Sec’17] & [arXiv:1611.06952] Use standard prime + probe to detect key dependent memory accesses, interrupt enclave [Moghimi et al., arXiv:1703.06986] Use prime + probe to extract key from synchronized victim enclave [Götzfried et al., EuroSec’17] A malicious enclave prime + probes another enclave, evading detection [Schwarz et al., DIMVA’17 & arXiv:1702.08719] Our attack: prime + probe attack from malicious OS extracting genome data [Brasser et al., WOOT’17]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
EPC: Enclave Page Cache SMT: Simultaneous Multithreading
Attack Type Observed Cache Interrupting Victim Cache Eviction Measurement Attacker Code Attacked Victim Lee et al. Branch Shadowing BTB / LBR Yes Execution Timing OS RSA & SVM classifier Moghimi et al. Prime + Probe L1(D) Yes Access timing OS AES Götzfried et al. Prime + Probe L1(D) No PCM OS AES Our Attack Prime + Probe L1(D) No PCM OS RSA & Genome Sequencing Schwarz et al. Prime + Probe L3 No Counting Thread Enclave AES
PCM: Performance Counter Monitor BTB: Branch Target Buffer LBR: Last Branch Record
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 Core 0 Core n PCM
Modified Linux scheduler to exclude one core (two threads) from assigning task
thread
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler Handler Handler PCM
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM
Use kernel sysfs interface to assign interrupts to other cores
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM
Probe
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
[Brasser et al., WOOT’17]
SMT SMT L1 OS Process 1 Process 2 Victim Process n Attacker Process m Process m+1 SMT SMT L1 APIC Core 0 Core n Handler Handler PCM
Probe Prime+Probe attack using L1 data cache
Monitor (L1D_REPLACEMENT)
monitoring cache events of attacker possible
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
PCM: Performance Counter Monitor SMT: Simultaneous Multithreading APIC: Advanced Programmable Interrupt Controller
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
while ( i > 0) { prepare(); x = table[secret]; process(x); } prime() { write_cache(); } wait(); Probe() { test_evic(); } Cache Attacker Victim Enclave PC PC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Extracting 2048-bit RSA decryption key Extracting genome sequences
[arXiv:1702.07521]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Encrypted Genome Sequence Genome Analysis Enclave (e.g. PRIMEX)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Encrypted Genome Sequence Pre-processing
sub-sequences (k-mer)
positions in hash-table Analysis
analysis, e.g., to identify correlation in the data Genome Analysis Enclave (e.g. PRIMEX)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Encrypted Genome Sequence Pre-processing
sub-sequences (k-mer)
positions in hash-table Analysis
analysis, e.g., to identify correlation in the data Genome Analysis Enclave (e.g. PRIMEX) Attacker’s goal: Identify k-mer sequences in the input string, allowing the identification of individuals
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Pre-processing
sub-sequences (k-mer)
positions in hash- table
Analysis
analysis, e.g., to identify correlation in the data
Genome Analysis Enclave (e.g. PRIMEX)
ATCGATCGATCG…
Attacker’s goal: Identify k-mer sequences in the input string, allowing the identification of individuals
TTGACCCACTGAATCACGTCTG…
Encrypted Genome Sequence
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
TTGACCCACTGAATCACGTCTGACCGCGCGTACGCGG TCACTTGCGGTGCCGTTTTCTTTGTTACCGACGACCG ACCAGCGACAGCCACCGCGCGCTCACTGCCACCAAAA GAGTCATATCGATCGATCGATCGATCGATCGATCGAT CGATCGATCGATCGATCGATCGATCGATCGATCATCA CAGCCGACCAGTTTCTGGAACGTTCCCGATACTGGAA CGGTCCTAATGCAGTATCCCACCCTCCTTCCATCGAC GCCAGTCGAATCACGCCGCCAGCCACCGTCCGCCAGC CGGCCAGAATACCGATGACTCGGCGGTCTCGTGTCGG TGCCGGCCTCGCAGCCATTGTACTGGCCCTGGCCGCA GTGTCGGCTGCCGCTCCGATTGCCGGGGCGCAGTCCG CCGGCAGCGGTGCGGTCTCAGTCACCATCGGCGACGT GGACGTCTCGCCTGCGAACCCAACCACGGGCACGCAG GTGTTGATCACCCCGTCGATCAACAACTCCGGATCGG CAAGCGGGTCCGCGCGCGTCAACGAGGTCACGCTGCG CGGCGACGGTCTCCTCGCAACGGAAGACAGCCTGGGG
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
… Hash Table Indexer A G C A G C A T C A G G T A C …
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
… Hash Table
1
Indexer A G C A G C A T C A G G T A C …
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
… Hash Table
1 2
Indexer A G C A G C A T C A G G T A C …
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
… Hash Table
3 1 2
Indexer A G C A G C A T C A G G T A C …
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
… Hash Table
3 1 2
Indexer
A G C A G C A T C A G G T A C …
TTGACCCACTGAATCACGTCTGACCGCGCGTACGCGGTCACTTGC GGTGCCGTTTTCTTTGTTACCGACGACCGACCAGCGACAGCCACC GCGCGCTCACTGCCACCAAAAGAGTCATATCGATCGATCGATCGA TCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGAT CATCACAGCCGACCAGTTTCTGGAACGTTCCCGATACTGGAACGG TCCTAATGCAGTATCCCACCCTCCTTCCATCGACGCCAGTCGAAT CACGCCGCCAGCCACCGTCCGCCAGCCGGCCAGAATACCGATGAC TCGGCGGTCTCGTGTCGGTGCCGGCCTCGCAGCCATTGTACTGGC CCTGGCCGCAGTGTCGGCTGCCGCTCCGATTGCCGGGGCGCAGTC CGCCGGCAGCGGTGCGGTCTCAGTCACCATCGGCGACGTGGACGT CTCGCCTGCGAACCCAACCACGGGCACGCAGGTGTTGATCACCCC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
ATCGATCGATCGATCGATCGATCGATCGATCG ATCG TCGA CGAT GATC ATCG cache line 1 cache cache line 2 cache line 3 cache line 4 cache line 5 cache line 6 cache line 8 cache line 7 cache line 0 The microsatellite will activate cache lines 2, 4, 5 and 0 repeatedly
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Execution Time Activity in all related cache lines
A D B C
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
SGX
SGX Leakage Oracle Caches
Page-Faults Spectre Obfuscators SC-resilient SW-design (e.g., Scatter-and-Gather) Cache-archichtecture re-design (e.g., Partitioning) Intel TSX (e.g., T-SGX, Déjà Vu, Cloak ) ORAM / Oblivious Execution Leakage Oracle
Enclave
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
TSX: Transactional Synchronization Extensions
TSX T-SGX: Uses TSX to detect enclave interrupt [Shih et al., NDSS’17] Déjà Vu : Uses TSX to detect enclave slowdown [Chen et al., AsiaCCS’17] Cloak: Prime cache before accessing sensitive data [Schuster et al., USENIX 2017]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Cache partitioning / coloring Temporal cache isolation Randomized cache mappings
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Cache partitioning / coloring Temporal cache isolation Randomized cache mappings
Problems
enabled systems
Problems
for randomization secret
Problems
cache available to individual software
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Side-channel resilient software design Monitoring for attack effects Oblivious execution / ORAM
Problems
applications
hardening required
Problems
entity (not available in SGX model)
Problems
metadata needs to be protected as well
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
ORAM
Process(stash) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
ORAM
Process(stash) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
ORAM
Process(stash) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
ORAM
Process(stash) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Memory (RAM / Cache) Enclave
Process(table) { }
ORAM
Process(stash) { }
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
RAM Sensitive Array
[Brasser et al., DR. SGX: Hardening SGX Enclaves against Cache Attacks with Data Location Randomization, ArXiv]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
RAM Sensitive Array ORAM Tree
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Brasser et al., DR. SGX: Hardening SGX Enclaves against Cache Attacks with Data Location Randomization, ArXiv]
RAM Sensitive Array AES Key
(Pseudo-random Permutation)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
[Brasser et al., DR. SGX: Hardening SGX Enclaves against Cache Attacks with Data Location Randomization, ArXiv]
Initial layout Layout 1 Layout 2 A B C D E F G H F C G E D H A B G D B E H A F C Time Permutation π1 AES-NI Permutation π2 AES-NI Re-randomization window
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Input:
Code:
READ 0xA READ 0xB ADD WRITE 0xA
Data:
17 42
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB:
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC Program Counter (PC):
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB: 0xC
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC Program Counter (PC):
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB: 0xC 17
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
0xD
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC Program Counter (PC):
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB: 17 42
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC Program Counter (PC):
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB: 0xD 17 42 59
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
And what is a processor anyways?
Processor:
ADD READ WRITE
Output:
Code:
READ 0xA READ 0xB ADD WRITE 0xC Program Counter (PC):
Input:
:0xC :0xD :0xE :0xF
Data:
17 42 :0xA :0xB
Code:
READ 0xA READ 0xB ADD WRITE 0xA 0xC: 0xD: 0xE: 0xF:
Data:
17 42 0xA: 0xB: 0xE 0xF 59 59
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
READ 0xA READ 0xB ADD … 50ns 50ns 1ns …
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
MEMORY ACCESS
Instruction Stream:
Why should I wait for a long time? FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
What happens if I just continue.. FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS Looks like we are ready!
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS Looks like we are ready! Ok, result looks good. You can leave early today.
Commit!
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS
To Boost Performance Modern Processors Execute Instructions Out-of-Order!
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
MEMORY ACCESS
Instruction Stream:
Why should I wait for a long time? FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
What happens if I just continue.. FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS Maybe nobody will notice..
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
Out-of-Order Execution:
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
ALU ALU ALU
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS Maybe nobody will notice.. Do it in
stupid!
Rollback!
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
SLOW OP
(e.g., Memory Access or Branch)
FAST OP
(e.g., ALU)
Instruction Stream:
FAST OP
(e.g., ALU)
FAST OP
(e.g., ALU)
MEMORY ACCESS
Only correct optimizations are commited!
ALU ALU ALU
In Order Execution:
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
resulting Out-of-Order stream is called Speculative Execution
CONDITIONAL BRANCH … … … …
into optimizing branches!
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx] 1F 20 2A 2B
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx] Access not allowed, stupid! 1F 20 2A 2B
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx] Access not allowed, stupid! 1F 20 2A 2B
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: Access not allowed, stupid!
Rollback!
1F 20 2A 2B
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
OoO-Processor:
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: OS memory is none of your business! EXCEPTION 1F 20 2A 2B
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 1F 20 2A 2B :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C: [FLUSH+RELOAD]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018
User Memory:
0A 0B 0C 0D 0E 0F 10 1A 1B 1C 1D 1E 1F 20 2A 2B :0x70 :0x74 :0x78 :0x7C
Cache:
00 00 00 00 00 00 00 00 00 00 00 00 1F 20 2A 2B :0x0 :0x4 :0x8 :0xC
Code:
MOV $ebx, [0x8] TEST $ebx, $ebx JE Code MOV 0x70, [0x70+$ebx]
OS Memory:
0A 0B 0C 0D 0E 0F 10 1A 00 00 00 0C 1F 20 2A 2B 0x70: 0x74: 0x78: 0x7C:
0x7C-0x70 = 0x0C! [FLUSH+RELOAD]
Summer School on real-world crypto and privacy, Šibenik (Croatia), June 11–15, 2018