ZombieLoad Cross-Privilege-Boundary Data Sampling Michael Schwarz, - - PowerPoint PPT Presentation

zombieload
SMART_READER_LITE
LIVE PREVIEW

ZombieLoad Cross-Privilege-Boundary Data Sampling Michael Schwarz, - - PowerPoint PPT Presentation

ZombieLoad Cross-Privilege-Boundary Data Sampling Michael Schwarz, Moritz Lipp, Daniel Moghimi , Jo Van Bulck, Julian Stecklina, Thomas Prescher, Daniel Gruss whoami Daniel Moghimi (@danielmgmi) Computer Security since 2010 Reverse


slide-1
SLIDE 1

ZombieLoad

Cross-Privilege-Boundary Data Sampling

Michael Schwarz, Moritz Lipp, Daniel Moghimi, Jo Van Bulck, Julian Stecklina, Thomas Prescher, Daniel Gruss

slide-2
SLIDE 2

whoami

▪ Daniel Moghimi (@danielmgmi) ▪ Computer Security since 2010

▪ Reverse Engineering ▪ Binary Analysis ▪ Application Security

▪ PhD Student since 2017

▪ Microarchitectural Security ▪ Side Channels ▪ Breaking Cryptographic Implementations

slide-3
SLIDE 3
slide-4
SLIDE 4

Background: Cache Attacks – Cache Memory

CPU Register Cache DRAM

Cheaper, but Slower More expensive, but Faster

slide-5
SLIDE 5

Background: Cache Attacks – Cache Miss

Cache 10100110

slide-6
SLIDE 6

Background: Cache Attacks

Cache 10100110 10100110

slide-7
SLIDE 7

Background: Cache Attacks

Cache 10100110 10100110 10100110

slide-8
SLIDE 8

Background: Cache Attacks – Cache Hit

Cache 10100110 10100110

slide-9
SLIDE 9

Background: Cache Attacks – Cache Hit

Cache 10100110 10100110 10100110

slide-10
SLIDE 10

Background: Cache Attacks – Flush & Reload (Yarom et al.)

Cache 10100110 10100110 Attacker Victim

slide-11
SLIDE 11

Background: Cache Attacks – Flush & Reload (Yarom et al.)

Cache 10100110 Attacker Victim

slide-12
SLIDE 12

Background: Cache Attacks – Flush & Reload (Yarom et al.)

Cache 10100110 Attacker Victim 10100110

slide-13
SLIDE 13

Background: Cache Attacks – Flush & Reload (Yarom et al.)

Cache 10100110 Attacker Victim 10100110

slide-14
SLIDE 14

Background: Cache Attacks – Flush & Reload (Yarom et al.)

Cache 10100110 Attacker Victim 10100110 delta > threshold = cache hit delta < threshold = cache miss

slide-15
SLIDE 15

2018: Meltdown Attack?

slide-16
SLIDE 16

2018: Meltdown Attack?

slide-17
SLIDE 17

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space 256 different CPU Cache Line CPU Registers

slide-18
SLIDE 18

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

slide-19
SLIDE 19

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

Fault

slide-20
SLIDE 20

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

P

Fault

slide-21
SLIDE 21

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

P

Fault

slide-22
SLIDE 22

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

slide-23
SLIDE 23

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers F+R

slide-24
SLIDE 24

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers F+R

slide-25
SLIDE 25

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers F+R

slide-26
SLIDE 26

2018: Meltdown Attack?

0xf…81a0123 P A S S W O R D Virtual Address Space

User Space Kernel Space

Oracle

256 different CPU Cache Line CPU Registers

‘P’ = 0x50

slide-27
SLIDE 27

Meltdown-style Attacks !!!

▪ Can we do Meltdown with other faults/microcode-assists? ▪ Which part of the CPU leak the data?! ▪ Can we still leak somebody’s data?

▪ KPTI ▪ Meltdown-resistant CPUs, .e.g. Coffee Lake

slide-28
SLIDE 28
slide-29
SLIDE 29

ZombieLoad – How does CPU Work these days?

234 0x000401

Virtual Address

slide-30
SLIDE 30

ZombieLoad – How does CPU Work these days?

234 0x000401

Virtual Address TLB

slide-31
SLIDE 31

PMH

ZombieLoad – How does CPU Work these days?

234 0x000401

Virtual Address TLB

slide-32
SLIDE 32

PMH

ZombieLoad – How does CPU Work these days?

234 0x000401

Virtual Address TLB

P

RW US A …

Physical Page Number

… …

Page Walk

slide-33
SLIDE 33

ZombieLoad – How does CPU Work these days?

L1D Cache

DRAM L3 L2

Core

slide-34
SLIDE 34

ZombieLoad – How does CPU Work these days?

LFB

L1D Cache

DRAM L2 L3

Core

slide-35
SLIDE 35

ZombieLoad – How does CPU Work these days?

LFB

L1D Cache

DRAM L3 L2

Core

slide-36
SLIDE 36

DRAM

ZombieLoad – How does CPU Work these days?

LFB

L1D Cache

L3 L2

Core Cache Line

slide-37
SLIDE 37

DRAM

ZombieLoad – How does CPU Work these days?

LFB

L1D Cache

L3

Cache Line

L2

Core

slide-38
SLIDE 38

x x x x

DRAM

ZombieLoad – How does CPU Work these days?

LFB

L1D Cache

x x x …

L3

Cache Line

L2

Core

slide-39
SLIDE 39

x x x x

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line

L2

Core De-allocate

slide-40
SLIDE 40

x x x x

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A …

Physical Page Number

… …

Cache Line

L2

Core

slide-41
SLIDE 41

x x x x

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A …

Physical Page Number

… …

L2

Core

slide-42
SLIDE 42

x x x x

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A …

Physical Page Number

… …

L2

Core

slide-43
SLIDE 43

x x x x

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A …

Physical Page Number

… …

x x x x

L2

Core

slide-44
SLIDE 44

0 0 0 0

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A …

Physical Page Number

… …

x x x x Cache Line 0 0 0

L2

Core

slide-45
SLIDE 45

0 0 0 0

DRAM

ZombieLoad Attack !?!

LFB (10 entries)

L1D Cache

x x x x x …

L3

Cache Line P

RW

US

A

Physical Page Number

… …

x x x x Cache Line 0 0 0

Variant 1 Variant 3

L2

Core

slide-46
SLIDE 46

ZombieLoad – Microcode Assist on ‘A’ Bit

▪ Access Bit

▪ CPU tells → OS: A page has been accessed by setting the ‘A’ Bit ▪ OS tells → CPU: A page has not been accessed (just allocated) by clearing the bit

▪ ‘A’ Bit Microcode Assist

▪ Microcode Assists: The CPU executes an internal event handler to service complex instructions/operations ▪ The microcode assist flushes the pipeline. ▪ Intel CPUs set ‘A’ bit using a microcode assist P

RW

US

A

Physical Page Number

… …

Variant 3

slide-47
SLIDE 47

ZombieLoad VS. other Meltdown-Style Attacks

slide-48
SLIDE 48

What can we do with this data leakage?

▪ Architecturally

▪ Attack across Process Context Switches ▪ Attack across Simultaneous Multithreading (SMT) AKA. Intel Hyperthreading

▪ Scenarios:

▪ Cross-Process ▪ Cross-VM ▪ Intel SGX

slide-49
SLIDE 49

Data Sampling - Domino Attack

▪ We may leak bytes of data from other unimportant fill buffer entries ▪ Leak domino bytes to perform error correction

T arget Secret

1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

slide-50
SLIDE 50

Data Sampling - Domino Attack

1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

T arget Secret

0xd3 0x10 0x4f

▪ We may leak bytes of data from other unimportant fill buffer entries ▪ Leak domino bytes to perform error correction

slide-51
SLIDE 51

Data Sampling - Domino Attack

1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

T arget Secret

0xd3 0x10 0x4f 0x37 0x0e 0xb0

▪ We may leak bytes of data from other unimportant fill buffer entries ▪ Leak domino bytes to perform error correction

slide-52
SLIDE 52

Data Sampling - Domino Attack

1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

T arget Secret

0xd3 0x10 0x4f 0x37 0x0e 0xb0 0x7f 0x84

▪ We may leak bytes of data from other unimportant fill buffer entries ▪ Leak domino bytes to perform error correction

slide-53
SLIDE 53

Data Sampling - Domino Attack

1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

T arget Secret

0xd3 0x10 0x4f 0x37 0x0e 0xb0 0x7f 0x84 0xd3 0x37 0x7f

▪ We may leak bytes of data from other unimportant fill buffer entries ▪ Leak domino bytes to perform error correction

slide-54
SLIDE 54
slide-55
SLIDE 55

Recovering Intel SGX Sealing Key

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-56
SLIDE 56

Recovering Intel SGX Sealing Key

sgx-step

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-57
SLIDE 57

Recovering Intel SGX Sealing Key

sgx-step

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-58
SLIDE 58

Recovering Intel SGX Sealing Key

sgx-step

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-59
SLIDE 59

Recovering Intel SGX Sealing Key

sgx-step

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-60
SLIDE 60

Recovering Intel SGX Sealing Key

z-step Mark Non- Executabl e

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-61
SLIDE 61

Recovering Intel SGX Sealing Key

z-step Mark Non- Executabl e Try to Execute

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-62
SLIDE 62

Recovering Intel SGX Sealing Key

z-step Mark Non- Executabl e Try to Execute Exception

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-63
SLIDE 63

Recovering Intel SGX Sealing Key

z-step Mark Non- Executabl e Try to Execute Exception Handle Exception

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS

slide-64
SLIDE 64

Recovering Intel SGX Sealing Key

▪ Intel SGX allow developers to have hardware support for TEE ▪ Malicious OS is part of the threat model ▪ We can read register values of a trusted enclave with help of a malicious OS ▪ Repeated Context Switch in the transient domain w/ the same register values

slide-65
SLIDE 65

Is there any Mitigation?

▪ Short-term

▪ Intel suggested an instruction sequence to fill all the buffers across context switch ▪ Disable hyperthreading ▪ Intel SGX: Remote attestation to Verify hyperthreading is Disabled

▪ Long-term

▪ Microarchitectural hardware fixes (Buy new CPUs !! ☺)

slide-66
SLIDE 66

https://zombieloadattack.com/