Side-Channel Attacks and Defenses for SGX and SEV Yinqian Zhang - - PowerPoint PPT Presentation

side channel attacks and defenses for sgx and sev
SMART_READER_LITE
LIVE PREVIEW

Side-Channel Attacks and Defenses for SGX and SEV Yinqian Zhang - - PowerPoint PPT Presentation

Open Source Enclave Workshop 2019 Side-Channel Attacks and Defenses for SGX and SEV Yinqian Zhang Associate Professor Computer Science & Engineering The Ohio State University Userland TEEs on Commodity Processors Application VM VM


slide-1
SLIDE 1

Side-Channel Attacks and Defenses for SGX and SEV

Yinqian Zhang Associate Professor

Computer Science & Engineering The Ohio State University

Open Source Enclave Workshop 2019

slide-2
SLIDE 2

Userland TEEs on Commodity Processors

2

Software Guard Extension (2015)

Application OS Enclave Enclave CPU

Secure Encrypted Virtualization (2016-2017)

VMM VM CPU VM

slide-3
SLIDE 3

Side-Channel Threats on Intel SGX

3

Application OS Enclave CPU Mem I/O Privileged Adversary

  • CPU management
  • CPU Scheduling
  • Interrupt delivery and

handling

  • Memory management
  • Paging
  • Segmentation
  • I/O management
  • Network
  • Storage
  • Display
slide-4
SLIDE 4

Side-Channel Threats on AMD SEV

4

Privileged Adversary

  • CPU management
  • CPU Scheduling
  • Interrupt delivery and

handling

  • Memory management
  • Paging
  • Segmentation
  • I/O management
  • Network
  • Storage
  • Display

VMM VM VM

CPU Mem I/O

slide-5
SLIDE 5

Example: Deterministic Page Fault Side Channels

5

Application

Page 1 ec_mul Page 2 add_points Page 3 dup_point

Page Fault Handler

Page Trace P1 P2 P1 P3 P2 P1

Kernel

Physical Page Address 0 DA G U W C R 51 9 12 Page Table Entry 11 X D 52 62 63

Global DIR Offset Table Middle DIR Upper DIR

+

Page Global Directory Page Upper Directory Page Middle Directory Page Table

cr3

+ + +

P

slide-6
SLIDE 6

Example: Fine-Grained CPU Preemption

6

OS (CPU Scheduler) CPU Page/Cache/BPU

1 instruction

Application Enclave

slide-7
SLIDE 7

More Issues with AMD SEV

7

  • Lack of memory integrity
  • Chosen plaintext attacks
  • Fault injection attacks
  • Page table manipulation
  • Unencrypted VMCB
  • Inference by reading

register values at VMExit

  • ROP attacks by altering

register values

  • Page fault side channel
  • Page offset mask
  • Unprotected I/O
  • IOMMU & ASID
  • Encryption/decryption
  • racles

VMM VM VM

CPU Mem I/O

SWIOTLB SWIOTLB Li, Zhang, Lin, Solihin, “Exploiting Unprotected I/O Operations in AMD’s Secure Encrypted Virtualization”, Usenix Security 2019

slide-8
SLIDE 8

Side-Channel Attack Surface

8

fetcher

Translation Units ITLB DTLB STLB paging caches page tables

decoder issuer scheduler

port n port 0 port 1 port 2 Execution Units

……

port 3 BPU BTB RSB store buffer load buffer Cache & Memory

L1-I

L2 LLC DRAM LFB

L1-D

slide-9
SLIDE 9

Solutions to SGX/SEV side- channel attacks

slide-10
SLIDE 10

Solutions to SGX Side Channels?

17

Hypervisor VM VM

Cross-VM/Process Attacks SGX Attacks

Enclave Enclave OS

slide-11
SLIDE 11

Three Ideas of Mitigating SGX Side Channels

18

Xiao, Li, Zhang, “Stacco: Differentially Analyzing Side-Channel Traces for Detecting SSL/TLS Vulnerabilities in Secure Enclaves”, ACM CCS 2017 Chen, Chen, Xiao, Zhang, Lin, Lai, “SGXPECTRE: Stealing Intel Secrets from SGX Enclaves via Speculative Execution”, IEEE EuroS&P 2019 Wang, Zhang, Lin, “Time and Order: Towards Automatically Identifying Side-Channel Vulnerabilities in Enclave Binaries”, RAID 2019

Vulnerability Detection

  • Analyzing enclave

code to eliminate

  • Secret-dependent

memory access

  • Spectre gadgets
slide-12
SLIDE 12

Three Ideas of Mitigating SGX Side Channels

19

Attack Prevention

  • Preventing side-

channel attacks by enforcing oblivious execution

Ahmad, Joe, Xiao, Zhang, Shin, Lee, “OBFUSCURO: A Commodity Obfuscation Engine on Intel SGX”, NDSS 2019

Vulnerability Detection

  • Analyzing enclave

code to eliminate

  • Secret-dependent

memory access

  • Spectre gadgets
slide-13
SLIDE 13

Three Ideas of Mitigating SGX Side Channels

20

Attack Detection

  • Detecting side-

channel attacks at runtime via program instrumentation

Chen, Zhang, Reiter, Zhang, “Detecting Privileged Side-Channel Attacks in Shielded Execution with DEJA VU”, ACM AsiaCCS 2017 Chen, Wang, Chen, Chen, Zhang, Wang, Lai, Lin, Racing in Hyperspace: Closing Hyper- Threading Side Channels on SGX with Contrived Data Races, IEEE S&P 2018

Attack Prevention

  • Preventing side-

channel attacks by enforcing oblivious execution

Vulnerability Detection

  • Analyzing enclave

code to eliminate

  • Secret-dependent

memory access

  • Spectre gadgets
slide-14
SLIDE 14

Side-Channel Attacks and Defenses for SGX and SEV

Yinqian Zhang Associate Professor

Computer Science & Engineering The Ohio State University

Thank You!

yinqian@cse.ohio-state.edu