210
Transient Execution Attacks Daniel Gruss June 20, 2019 Graz University of Technology 1 Daniel Gruss — Graz University of Technology

Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Transient Execution Attacks

Daniel Gruss

June 20, 2019

Graz University of Technology

1 Daniel Gruss — Graz University of Technology

Page 2: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 3: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 4: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?

→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 5: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 6: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 7: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 8: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names?

→ what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 9: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 10: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 11: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 12: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 13: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own

→ no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 14: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Marketing... www.tugraz.at

• Why do you have a website?→ Inform journalists and the general public

• Otherwise: completely misleading presentation of your work in the media

→ defend yourself against misleading presentations!

• Why do you have fancy names? → what was CVE-2017-5754 again?

• People will throw things together that don’t belong together

→ Names enable unambiguous communication

• Why do you need a logo?

• Otherwise: media makes their own → no control over how inappropriate these are

2 Daniel Gruss — Graz University of Technology

Page 15: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 16: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 17: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters?

→ No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 18: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 19: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key?

→ Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 20: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 21: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload?

→ No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 22: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 23: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings?

→ Yes

4 Daniel Gruss — Graz University of Technology

Page 24: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Side Channel or not? www.tugraz.at

• Profiling cache utilization with performance counters? → No

• Observing cache utilization with performance counters and

using it to infer a crypto key? → Yes

• Measuring memory access latency with Flush+Reload? → No

• Measuring memory access latency with Flush+Reload and using

it to infer keystroke timings? → Yes

4 Daniel Gruss — Graz University of Technology

Page 25: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 26: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 27: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels

lazy exception handling

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 28: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nelsm

isspeculation

lazy exception handling

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 29: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nelsm

isspeculation

lazy exception handling

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 30: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 31: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 32: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 33: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

• traditional cache attacks (crypto, keys, etc)

• actual misspeculation (e.g., branch

misprediction)

• Meltdown, Foreshadow, ZombieLoad, etc

• Let’s avoid the term Speculative

Side-Channel Attacks

• Let’s be more precise

• → then we can think about actual mitigations

6 Daniel Gruss — Graz University of Technology

Page 34: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

Meltdown

6 Daniel Gruss — Graz University of Technology

Page 35: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Side-Channel Attacks? www.tugraz.at

side

chan

nels Spectre

Meltdown

Bug fixing

6 Daniel Gruss — Graz University of Technology

Page 36: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Back to Work

Page 37: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 38: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 39: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Wait for an hour

Page 40: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Wait for an hour

LATENCY

Page 41: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 42: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ParallelizeD

epen

denc

y

Page 43: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Out-of-order Execution www.tugraz.at

int width = 10, height = 5;

float diagonal = sqrt(width * width

+ height * height);

int area = width * height;

printf("Area %d x %d = %d\n", width , height , area);

7 Daniel Gruss — Graz University of Technology

Page 44: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Out-of-order Execution www.tugraz.at

int width = 10, height = 5;

float diagonal = sqrt(width * width

+ height * height);

int area = width * height;

printf("Area %d x %d = %d\n", width , height , area);

7 Daniel Gruss — Graz University of Technology

Page 45: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

*( volatile char*) 0;

array [84 * 4096] = 0;

8 Daniel Gruss — Graz University of Technology

Page 46: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array

0 50 100 150 200 250

300

400

500

PageA

cces

sti

me

[cyc

les]

• “Unreachable” code line was actually executed

• Exception was only thrown afterwards

9 Daniel Gruss — Graz University of Technology

Page 47: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array

0 50 100 150 200 250

300

400

500

PageA

cces

sti

me

[cyc

les]

• “Unreachable” code line was actually executed

• Exception was only thrown afterwards

9 Daniel Gruss — Graz University of Technology

Page 48: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array

0 50 100 150 200 250

300

400

500

PageA

cces

sti

me

[cyc

les]

• “Unreachable” code line was actually executed

• Exception was only thrown afterwards

9 Daniel Gruss — Graz University of Technology

Page 49: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Out-of-order instructions leave microarchitectural traces

• We can see them for example through the cache

• Give such instructions a name: transient instructions

• We can indirectly observe the execution of transient instructions

10 Daniel Gruss — Graz University of Technology

Page 50: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Out-of-order instructions leave microarchitectural traces

• We can see them for example through the cache

• Give such instructions a name: transient instructions

• We can indirectly observe the execution of transient instructions

10 Daniel Gruss — Graz University of Technology

Page 51: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Out-of-order instructions leave microarchitectural traces

• We can see them for example through the cache

• Give such instructions a name: transient instructions

• We can indirectly observe the execution of transient instructions

10 Daniel Gruss — Graz University of Technology

Page 52: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Out-of-order instructions leave microarchitectural traces

• We can see them for example through the cache

• Give such instructions a name: transient instructions

• We can indirectly observe the execution of transient instructions

10 Daniel Gruss — Graz University of Technology

Page 53: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Add another layer of indirection to test

char data = *(char*) 0xffffffff81a000e0;

array[data * 4096] = 0;

• Then check whether any part of array is cached

11 Daniel Gruss — Graz University of Technology

Page 54: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Add another layer of indirection to test

char data = *(char*) 0xffffffff81a000e0;

array[data * 4096] = 0;

• Then check whether any part of array is cached

11 Daniel Gruss — Graz University of Technology

Page 55: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array

0 50 100 150 200 250

300

400

500

PageA

cces

sti

me

[cyc

les]

• Index of cache hit reveals data

• Permission check is in some cases not fast enough

12 Daniel Gruss — Graz University of Technology

Page 56: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array

0 50 100 150 200 250

300

400

500

PageA

cces

sti

me

[cyc

les]

• Index of cache hit reveals data

• Permission check is in some cases not fast enough

12 Daniel Gruss — Graz University of Technology

Page 57: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 58: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 59: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 60: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 61: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Details: Exception Handling www.tugraz.at

• Basic Meltdown code leads to a crash (segfault)

• How to prevent the crash?

Fault

Handling

Fault

Suppression

Fault

Prevention

16 Daniel Gruss — Graz University of Technology

Page 62: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Details: Exception Handling www.tugraz.at

• Basic Meltdown code leads to a crash (segfault)

• How to prevent the crash?

Fault

Handling

Fault

Suppression

Fault

Prevention

16 Daniel Gruss — Graz University of Technology

Page 63: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Details: Exception Handling www.tugraz.at

• Basic Meltdown code leads to a crash (segfault)

• How to prevent the crash?

Fault

Handling

Fault

Suppression

Fault

Prevention

16 Daniel Gruss — Graz University of Technology

Page 64: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown with Fault Suppression www.tugraz.at

• Intel TSX to suppress exceptions instead of signal handler

if(xbegin () == XBEGIN_STARTED) {

char secret = *(char*) 0xffffffff81a000e0;

array[secret * 4096] = 0;

xend();

}

for (size_t i = 0; i < 256; i++) {

if (flush_and_reload(array + i * 4096) == CACHE_HIT) {

printf("%c\n", i);

}

}

17 Daniel Gruss — Graz University of Technology

Page 65: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown with Fault Prevention www.tugraz.at

• Speculative execution to prevent exceptions

int speculate = rand() % 2;

size_t address = (0 xffffffff81a000e0 * speculate) +

(( size_t)&zero * (1 - speculate));

if(! speculate) {

char secret = *(char*) address;

array[secret * 4096] = 0;

}

for (size_t i = 0; i < 256; i++) {

if (flush_and_reload(array + i * 4096) == CACHE_HIT) {

printf("%c\n", i);

}

}

18 Daniel Gruss — Graz University of Technology

Page 66: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow / Foreshadow-NG1 www.tugraz.at

1Jo Van Bulck et al. Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient

Out-of-Order Execution. In: USENIX Security Symposium. 2018.

19 Daniel Gruss — Graz University of Technology

Page 67: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

L1TF/Foreshadow Demo

Page 68: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 69: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Kernel Address Isolation to have Side channels Efficiently Removed

Page 70: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Kernel Address Isolation to have Side channels Efficiently Removed

KAISER /ˈkʌɪzə/1. [german] Emperor,ruler of an empire2. largest penguin, emperor penguin

Page 71: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER Illustration www.tugraz.at

Without KAISER:

Shared address space

User memory Kernel memory

0 −1

context switch

With KAISER:

User address space

User memory Not mapped

0 −1

Kernel address space

SMAP + SMEP Kernel memory

0 −1

context switch

switch

addr.

space

Interrupt

dispatcher

21 Daniel Gruss — Graz University of Technology

Page 72: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER Illustration www.tugraz.at

Without KAISER:

Shared address space

User memory Kernel memory

0 −1

context switch

With KAISER:

User address space

User memory Not mapped

0 −1

Kernel address space

SMAP + SMEP Kernel memory

0 −1

context switch

switch

addr.

space

Interrupt

dispatcher

21 Daniel Gruss — Graz University of Technology

Page 73: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER (Stronger Kernel Isolation) Patches www.tugraz.at

• Our patch

• Adopted in

Linux

• Adopted in

Windows

• Adopted in

OSX/iOS

→ now in every computer

22 Daniel Gruss — Graz University of Technology

Page 74: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER (Stronger Kernel Isolation) Patches www.tugraz.at

• Our patch

• Adopted in

Linux

• Adopted in

Windows

• Adopted in

OSX/iOS

→ now in every computer

22 Daniel Gruss — Graz University of Technology

Page 75: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER (Stronger Kernel Isolation) Patches www.tugraz.at

• Our patch

• Adopted in

Linux

• Adopted in

Windows

• Adopted in

OSX/iOS

→ now in every computer

22 Daniel Gruss — Graz University of Technology

Page 76: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER (Stronger Kernel Isolation) Patches www.tugraz.at

• Our patch

• Adopted in

Linux

• Adopted in

Windows

• Adopted in

OSX/iOS

→ now in every computer

22 Daniel Gruss — Graz University of Technology

Page 77: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

KAISER (Stronger Kernel Isolation) Patches www.tugraz.at

• Our patch

• Adopted in

Linux

• Adopted in

Windows

• Adopted in

OSX/iOS

→ now in every computer

22 Daniel Gruss — Graz University of Technology

Page 78: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 79: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 80: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 81: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 82: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 83: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 84: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 85: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

»A table for 6 please«

Page 86: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 87: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Speculative Cooking

Page 88: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

»A table for 6 please«

Page 89: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 90: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 91: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 92: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 93: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 0;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 94: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 0;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 95: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Speculate

index = 0;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 96: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’t’

Execute

index = 0;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 97: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 1;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 98: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 1;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 99: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’e’Speculate

index = 1;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 100: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’e’

index = 1;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 101: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 2;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 102: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 2;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 103: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’x’

Speculate

index = 2;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 104: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’x’

index = 2;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 105: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 3;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 106: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 3;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 107: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’t’

Speculate

index = 3;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 108: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’t’

index = 3;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 109: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 4;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 110: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 4;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 111: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’K’

Speculate

index = 4;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 112: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’K’

Execute

index = 4;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 113: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 5;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 114: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 5;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 115: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’E’

Speculate

index = 5;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 116: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’E’

Execute

index = 5;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 117: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 6;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 118: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 6;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 119: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’Y’

Speculate

index = 6;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 120: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT

Index ’Y’

Execute

index = 6;

if (index < 4)

char* data = "textKEY";

LUT[data[index] * 4096] 0

then

else

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 121: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre-PHT (v1) www.tugraz.at

LUT index = 6;

if (index < 4)

LUT[data[index] * 4096] 0

then

Prediction

Spectre-STL (v4): Ignore sanitizing write access and use unsanitized old value instead

29 Daniel Gruss — Graz University of Technology

Page 122: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 123: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

Speculate

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 124: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 125: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

Execute

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 126: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 127: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

Speculate

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 128: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = bird;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 129: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 130: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

Speculate

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 131: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 132: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

Execute

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

fly()

swim()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 133: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 134: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 135: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre v2 www.tugraz.at

a->move()

Animal* a = fish;

LUT[data[a->m] * 4096] 0

fly()

Prediction

swim()swim

()

Spectre-BTB (v2): mistrain BTB → mispredict indirect jump/call

Spectre-RSB (v5): mistrain RSB → mispredict return

30 Daniel Gruss — Graz University of Technology

Page 136: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

“Speculative Buffer Overflows”2 www.tugraz.at

• v1.1: Speculatively write to memory locations

→ Many more gadgets than previously anticipated n

• v1.2: Ignore writable bit

→ = Meltdown-RW

2Vladimir Kiriansky et al. Speculative Buffer Overflows: Attacks and Defenses. In: arXiv:1807.03757

(2018).

31 Daniel Gruss — Graz University of Technology

Page 137: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

“Speculative Buffer Overflows”2 www.tugraz.at

• v1.1: Speculatively write to memory locations

→ Many more gadgets than previously anticipated n

• v1.2: Ignore writable bit

→ = Meltdown-RW

2Vladimir Kiriansky et al. Speculative Buffer Overflows: Attacks and Defenses. In: arXiv:1807.03757

(2018).

31 Daniel Gruss — Graz University of Technology

Page 138: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

“Speculative Buffer Overflows”2 www.tugraz.at

• v1.1: Speculatively write to memory locations

→ Many more gadgets than previously anticipated n

• v1.2: Ignore writable bit

→ = Meltdown-RW

2Vladimir Kiriansky et al. Speculative Buffer Overflows: Attacks and Defenses. In: arXiv:1807.03757

(2018).

31 Daniel Gruss — Graz University of Technology

Page 139: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

“Speculative Buffer Overflows”2 www.tugraz.at

• v1.1: Speculatively write to memory locations

→ Many more gadgets than previously anticipated n

• v1.2: Ignore writable bit

→ = Meltdown-RW

2Vladimir Kiriansky et al. Speculative Buffer Overflows: Attacks and Defenses. In: arXiv:1807.03757

(2018).

31 Daniel Gruss — Graz University of Technology

Page 140: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Spectre www.tugraz.at

operation #n

retir

e

prediction

retir

e

operation #n+2

retir

e

pred

ict

CF/

DF

possiblyarchitectural transient execution

flush pipelineon wrongprediction

time

32 Daniel Gruss — Graz University of Technology

Page 141: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

operation #n

retir

e

retir

e

operation #n+2

retir

e

data dependency

data Meltdown

possiblyarchitectural transient execution

exception raise

time

33 Daniel Gruss — Graz University of Technology

Page 142: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Mistraining Location www.tugraz.at

in-place/same-address-space

out-of-place/same-address-space

Victim

Victim branch

Congruentbranch

Add

ress

colli

sion

in-place/cross-address-space

out-of-place/cross-address-space

Attacker

Shadow branch

Congruentbranch

Add

ress

colli

sion

Shared Branch Prediction State

34 Daniel Gruss — Graz University of Technology

Page 143: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Classification Tree www.tugraz.at

Transientcause?

Spectre-type

microarchitec-tural buffer

Meltdown-type

fault type

Spectre-PHT

Spectre-BTB

Spectre-RSB

Spectre-STL [32]

mistrainingstrategy

Cross-address-space

Same-address-space

PHT-CA-IP ⭑

PHT-CA-OP ⭑

PHT-SA-IP [54, 52]

PHT-SA-OP ⭑

in-place (IP) vs., out-of-place (OP)

Cross-address-space

Same-address-space

BTB-CA-IP [54, 18]

BTB-CA-OP [54]

BTB-SA-IP ⭑

BTB-SA-OP [18]Cross-address-space

Same-address-space RSB-CA-IP [64, 56]

RSB-CA-OP [56]

RSB-SA-IP [64]

RSB-SA-OP [64, 56]

Meltdown-NM [86]

Meltdown-AC ⭐

Meltdown-DE ⭐

Meltdown-PF

Meltdown-UD ⭐

Meltdown-SS ⭐

Meltdown-BR

Meltdown-GP [10, 41]

Meltdown-US [61]

Meltdown-P [93, 96]

Meltdown-RW [52]

Meltdown-PK ⭑

Meltdown-XD ⭐

Meltdown-SM ⭐

Meltdown-MPX [44]

Meltdown-BND ⭑

prediction

fault

35 Daniel Gruss — Graz University of Technology

Page 144: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 145: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 146: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Mitigations www.tugraz.at

Table 1: Spectre-type defenses and what they mitigate.

Attack

Defense

Invi

siS

pec

Saf

eSp

ecD

AW

GR

SB

Stu

ffing

Ret

pol

ine

Poi

son

Val

ueIn

dex

Mas

king

Sit

eIs

olat

ion

SL

HY

SN

BIB

RS

ST

IPB

IBP

BS

eria

lizat

ion

Tai

ntT

rack

ing

Tim

erR

educ

tion

Slo

thS

SB

D/S

SB

B

Intel

Spectre-PHT

Spectre-BTB

Spectre-RSB

Spectre-STL

ARM

Spectre-PHT

Spectre-BTB

Spectre-RSB

Spectre-STL

AMD

Spectre-PHT

Spectre-BTB

Spectre-RSB

Spectre-STL

Symbols show if an attack is mitigated ( ), partially mitigated ( ), not mitigated ( ), theoretically

mitigated ( ), theoretically impeded ( ), not theoretically impeded ( ), or out of scope ( ).36 Daniel Gruss — Graz University of Technology

Page 147: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Performance Costs www.tugraz.at

Table 2: Reported performance impacts of countermeasures

Defense

ImpactPerformance Loss Benchmark

InvisiSpec 22% SPEC

SafeSpec 3% (improvement) SPEC2017 on MARSSx86

DAWG 2–12%, 1–15% PARSEC, GAPBS

RSB Stuffing no reports

Retpoline 5–10% real-world workload servers

Site Isolation only memory overhead

SLH 36.4%, 29% Google microbenchmark suite

YSNB 60% Phoenix

IBRS 20–30% two sysbench 1.0.11 benchmarks

STIPB 30– 50% Rodinia OpenMP, DaCapo

IBPB no individual reports

Serialization 62%, 74.8% Google microbenchmark suite

SSBD/SSBB 2–8% SYSmark R©2014 SE & SPEC integer

KAISER/KPTI 0–2.6% system call rates

L1TF mitigations -3–31% various SPEC

37 Daniel Gruss — Graz University of Technology

Page 148: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer

...

...

µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 149: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 150: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 151: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 152: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 153: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 154: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 155: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 156: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 157: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 158: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 159: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Meltdown www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P RW US

Nope! STOP EVERYTHING!!!

WT UC R D S G Ignored

Physical Page Number

Ignored X

Page 160: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer

...

...

µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 161: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 162: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 163: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 164: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 165: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 166: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 167: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 168: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

DTLBL1 Data Cache

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 169: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

DTLBL1 Data Cache

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 170: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ... Load Buffer Store Buffer

DTLBL1 Data Cache

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 171: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Foreshadow-VMM www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer Store Buffer

DTLBL1 Data Cache

LFB

STLB

L2 Cache

L3 Cache

DRAM

P

Nope! STOP EVERYTHING!!!

RW US WT UC R D S G Ignored

Guest Physical Page Number

Ignored X

Page 172: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer

...

...

µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 173: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 174: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 175: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 176: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

Load Buffer

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 177: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system

#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 178: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 179: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 180: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 181: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

ZombieLoad www.tugraz.at

Execution

Engine

Reorder buffer...

mov al, byte [rcx]

...µOP µOP µOP µOP µOP µOP µOP µOP

Scheduler

Execution Units

AL

U,

AE

S,

...

AL

U,

FM

A,

...

AL

U,

Vec

t,..

.

AL

U,

Bra

nch

Loa

dd

ata

Loa

dd

ata

Sto

red

ata

AG

U

µOP µOP µOP µOP µOP µOP µOP µOP

CDB

Mem

orySub

system#n+1 ...

#n ppn vpn offset reg.no.

#n-1 ...

data can go

to register

Load Buffer

complex load

situation! need

to reissue this

load! STOP!!

Store Buffer

L1 Data CacheDTLB

LFB

STLB

L2 Cache

L3 Cache

DRAM

Page 182: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 183: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together
Page 184: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Truly remote attacks... www.tugraz.at

Just a few examples:

• Remote timing attacks on crypto ([Ber04; BB05] and many

more)

• ThrowHammer and NetHammer

• NetSpectre

42 Daniel Gruss — Graz University of Technology

Page 185: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Truly remote attacks... www.tugraz.at

Just a few examples:

• Remote timing attacks on crypto ([Ber04; BB05] and many

more)

• ThrowHammer and NetHammer

• NetSpectre

42 Daniel Gruss — Graz University of Technology

Page 186: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Truly remote attacks... www.tugraz.at

Just a few examples:

• Remote timing attacks on crypto ([Ber04; BB05] and many

more)

• ThrowHammer and NetHammer

• NetSpectre

42 Daniel Gruss — Graz University of Technology

Page 187: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Truly remote attacks... www.tugraz.at

Just a few examples:

• Remote timing attacks on crypto ([Ber04; BB05] and many

more)

• ThrowHammer and NetHammer

• NetSpectre

42 Daniel Gruss — Graz University of Technology

Page 188: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 189: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto

→ “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 190: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 191: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR

→ “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 192: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 193: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone

→ “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 194: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 195: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer

→ “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 196: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 197: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

How did we get here? www.tugraz.at

We have ignored microarchitectural attacks for many years:

• attacks on crypto → “software should be fixed”

• attacks on ASLR → “ASLR is broken anyway”

• attacks on SGX and TrustZone → “not part of the threat model”

• Rowhammer → “only affects cheap sub-standard modules”

→ for years we solely optimized for performance

43 Daniel Gruss — Graz University of Technology

Page 198: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

... and we’re still optimizing for performance www.tugraz.at

• lower refresh rate = lower energy but more bit flips

• ECC memory → fewer bit flips

→ it’s an optimization problem

• what if “too aggressive” changes over time?

→ difficult to optimize with an intelligent adversary

44 Daniel Gruss — Graz University of Technology

Page 199: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

... and we’re still optimizing for performance www.tugraz.at

• lower refresh rate = lower energy but more bit flips

• ECC memory → fewer bit flips

→ it’s an optimization problem

• what if “too aggressive” changes over time?

→ difficult to optimize with an intelligent adversary

44 Daniel Gruss — Graz University of Technology

Page 200: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

... and we’re still optimizing for performance www.tugraz.at

• lower refresh rate = lower energy but more bit flips

• ECC memory → fewer bit flips

→ it’s an optimization problem

• what if “too aggressive” changes over time?

→ difficult to optimize with an intelligent adversary

44 Daniel Gruss — Graz University of Technology

Page 201: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

... and we’re still optimizing for performance www.tugraz.at

• lower refresh rate = lower energy but more bit flips

• ECC memory → fewer bit flips

→ it’s an optimization problem

• what if “too aggressive” changes over time?

→ difficult to optimize with an intelligent adversary

44 Daniel Gruss — Graz University of Technology

Page 202: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

... and we’re still optimizing for performance www.tugraz.at

• lower refresh rate = lower energy but more bit flips

• ECC memory → fewer bit flips

→ it’s an optimization problem

• what if “too aggressive” changes over time?

→ difficult to optimize with an intelligent adversary

44 Daniel Gruss — Graz University of Technology

Page 203: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Conclusions www.tugraz.at

• new class of software-based attacks

• many problems to solve around microarchitectural attacks and

especially transient execution attacks

• dedicate more time into identifying problems and not solely in

mitigating known problems

45 Daniel Gruss — Graz University of Technology

Page 204: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Conclusions www.tugraz.at

• new class of software-based attacks

• many problems to solve around microarchitectural attacks and

especially transient execution attacks

• dedicate more time into identifying problems and not solely in

mitigating known problems

45 Daniel Gruss — Graz University of Technology

Page 205: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Conclusions www.tugraz.at

• new class of software-based attacks

• many problems to solve around microarchitectural attacks and

especially transient execution attacks

• dedicate more time into identifying problems and not solely in

mitigating known problems

45 Daniel Gruss — Graz University of Technology

Page 206: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Transient Execution Attacks

Daniel Gruss

June 20, 2019

Graz University of Technology

46 Daniel Gruss — Graz University of Technology

Page 207: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

References

Michael Backes et al. Acoustic Side-Channel Attacks on Printers. In: USENIX

Security. 2010.

David Brumley et al. Remote timing attacks are practical. In: Computer Networks

48.5 (2005), pp. 701–716.

Daniel J. Bernstein. Cache-Timing Attacks on AES. 2004. url:

http://cr.yp.to/antiforgery/cachetiming-20050414.pdf.

Elad Carmon et al. Photonic Side Channel Attacks Against RSA. In: HOST’17.

2017.

Daniel Gruss et al. Rowhammer.js: A Remote Software-Induced Fault Attack in

JavaScript. In: DIMVA. 2016.

Page 208: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Daniel Gruss et al. Cache Template Attacks: Automating Attacks on Inclusive

Last-Level Caches. In: USENIX Security Symposium. 2015.

J. Alex Halderman et al. Lest we remember: cold-boot attacks on encryption keys.

In: Communications of the ACM (May 2009).

Michael Hutter et al. The temperature side channel and heating fault attacks. In:

International Conference on Smart Card Research and Advanced Applications.

Springer. 2013, pp. 219–235.

Paul Kocher et al. Differential power analysis. In: Annual International Cryptology

Conference. Springer. 1999, pp. 388–397.

Paul Kocher et al. Spectre Attacks: Exploiting Speculative Execution. In: S&P.

2019.

Emilia Kasper et al. Faster and Timing-Attack Resistant AES-GCM. In:

Cryptographic Hardware and Embedded Systems (CHES). 2009, pp. 1–17.

Page 209: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Vladimir Kiriansky et al. Speculative Buffer Overflows: Attacks and Defenses. In:

arXiv:1807.03757 (2018).

Moritz Lipp et al. ARMageddon: Cache Attacks on Mobile Devices. In: USENIX

Security Symposium. 2016.

Moritz Lipp et al. Nethammer: Inducing Rowhammer Faults through Network

Requests. In: arXiv:1711.08002 (2017).

Moritz Lipp et al. Meltdown: Reading Kernel Memory from User Space. In:

USENIX Security Symposium. 2018.

Stefan Mangard et al. Power analysis attacks: Revealing the secrets of smart

cards. Vol. 31. Springer Science & Business Media, 2008.

Yossef Oren et al. The Spy in the Sandbox: Practical Cache Attacks in JavaScript

and their Implications. In: CCS. 2015.

Josyula R Rao et al. EMpowering Side-Channel Attacks. In: IACR Cryptology

ePrint Archive 2001 (2001), p. 37.

Page 210: Transient Execution Attacks - Gruss!defend yourself against misleading presentations! Why do you have fancy names? !what was CVE-2017-5754 again? People will throw things together

Alexander Schlosser et al. Simple Photonic Emission Analysis of AES. In:

CHES’12. 2012.

Michael Schwarz et al. Malware Guard Extension: Using SGX to Conceal Cache

Attacks. In: DIMVA. 2017.

Michael Schwarz et al. Automated Detection, Exploitation, and Elimination of

Double-Fetch Bugs using Modern CPU Features. In: AsiaCCS (2018).

Michael Schwarz et al. NetSpectre: Read Arbitrary Memory over Network. In:

arXiv:1807.10535 (2018).

Andrei Tatar et al. Throwhammer: Rowhammer Attacks over the Network and

Defenses. In: USENIX ATC. 2018.

Jo Van Bulck et al. Foreshadow: Extracting the Keys to the Intel SGX Kingdom

with Transient Out-of-Order Execution. In: USENIX Security Symposium. 2018.

Ofir Weisse et al. Foreshadow-NG: Breaking the Virtual Memory Abstraction with

Transient Out-of-Order Execution. In: Technical report (2018).