Sie sind auf Seite 1von 267

SCIENCE PASSION TECHNOLOGY

Software-based Microarchitectural Attacks

Daniel Gruss
April 19, 2018
Graz University of Technology

1 Daniel Gruss — Graz University of Technology


Whoami www.tugraz.at

• Daniel Gruss
• Post-Doc @ Graz University of Technology
• Twitter: @lavados
• Email: daniel.gruss@iaik.tugraz.at

2 Daniel Gruss — Graz University of Technology


Timeline of Meltdown and Spectre www.tugraz.at

• Both vulnerabilities existed for many years

3 Daniel Gruss — Graz University of Technology


Timeline of Meltdown and Spectre www.tugraz.at

• Both vulnerabilities existed for many years


• No one discovered it before

3 Daniel Gruss — Graz University of Technology


Timeline of Meltdown and Spectre www.tugraz.at

• Both vulnerabilities existed for many years


• No one discovered it before
• Suddenly, 4 independent teams discover it within 6 months

3 Daniel Gruss — Graz University of Technology


Timeline of Meltdown and Spectre www.tugraz.at

• Both vulnerabilities existed for many years


• No one discovered it before
• Suddenly, 4 independent teams discover it within 6 months
• Let’s create an evidence board

3 Daniel Gruss — Graz University of Technology


3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
3 Daniel Gruss — Graz University of Technology
Meltdown vs. Spectre www.tugraz.at

Why two names, two papers, etc?


• Two different problems

4 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Why two names, two papers, etc?


• Two different problems
• They only have a very loose connection

4 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Why two names, two papers, etc?


• Two different problems
• They only have a very loose connection
• Two different teams had already quite matured drafts ready when
learning of each other

4 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Why two names, two papers, etc?


• Two different problems
• They only have a very loose connection
• Two different teams had already quite matured drafts ready when
learning of each other
• Initially we tried to merge, but all co-authors quickly agreed that it
would mix things that don’t belong together
→ More on that after we understand the attacks

4 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages
• there are comics, including xkcd

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages
• there are comics, including xkcd

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages
• there are comics, including xkcd

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages
• there are comics, including xkcd
• you get a lot of Twitter follower after Snowden mentioned you

5 Daniel Gruss — Graz University of Technology


The Fallout www.tugraz.at

You realize it is something big when...


• it is in the news, all over the world
• you get a Wikipedia article in multiple languages
• there are comics, including xkcd
• you get a lot of Twitter follower after Snowden mentioned you

5 Daniel Gruss — Graz University of Technology


The Wall www.tugraz.at

6 Daniel Gruss — Graz University of Technology


The Core of Meltdown/Spectre www.tugraz.at

• Kernel is isolated from user space Userspace Kernelspace

Operating
Applications System Memory

8 Daniel Gruss — Graz University of Technology


The Core of Meltdown/Spectre www.tugraz.at

• Kernel is isolated from user space Userspace Kernelspace

• This isolation is a combination of


hardware and software

Operating
Applications System Memory

8 Daniel Gruss — Graz University of Technology


The Core of Meltdown/Spectre www.tugraz.at

• Kernel is isolated from user space Userspace Kernelspace

• This isolation is a combination of


hardware and software
• User applications cannot access
anything from the kernel

Operating
Applications System Memory

8 Daniel Gruss — Graz University of Technology


The Core of Meltdown/Spectre www.tugraz.at

• Kernel is isolated from user space Userspace Kernelspace

• This isolation is a combination of


hardware and software
• User applications cannot access
anything from the kernel
• There is only a well-defined
Operating
interface → syscalls Applications System Memory

8 Daniel Gruss — Graz University of Technology


8 Daniel Gruss — Graz University of Technology
8 Daniel Gruss — Graz University of Technology
8 Daniel Gruss — Graz University of Technology
8 Daniel Gruss — Graz University of Technology
1337 4242

Revolutionary concept!

Store your food at home,


never go to the grocery store
during cooking.

Can store ALL kinds of food.

ONLY TODAY INSTEAD OF $1,300

ORDER VIA PHONE: +555 12345

8 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

printf("%d", i);
printf("%d", i);

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

h e miss
Cac
printf("%d", i);
printf("%d", i);

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

h e miss Req
uest
Cac
printf("%d", i);
printf("%d", i);

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

h e miss Req
uest
Cac
printf("%d", i);
onse
printf("%d", i); Resp

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

h e miss Req
uest
Cac
printf("%d", i);
i onse
printf("%d", i); Resp

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

h e miss Req
uest
Cac
printf("%d", i);
i onse
printf("%d", i); Resp

e hit
Cach

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

ess,
DRAM acc
slow

h e miss Req
uest
Cac
printf("%d", i);
i onse
printf("%d", i); Resp

e hit
Cach

9 Daniel Gruss — Graz University of Technology


CPU Cache www.tugraz.at

ess,
DRAM acc
slow

h e miss Req
uest
Cac
printf("%d", i);
i onse
printf("%d", i); Resp

e hit
Cach
acc ess,
No DRAM
er
much fast
9 Daniel Gruss — Graz University of Technology
Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush access
access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush ca
ch e d access
ed Shared Memory
ch
access ca

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush Shared Memory access


access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush access
access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush access
access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush Shared Memory access


access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush Shared Memory access


access

10 Daniel Gruss — Graz University of Technology


Flush+Reload www.tugraz.at

Shared Memory
ATTACKER VICTIM

flush Shared Memory access


access

fast if victim accessed data,


slow otherwise
10 Daniel Gruss — Graz University of Technology
Memory Access Latency www.tugraz.at

11 Daniel Gruss — Graz University of Technology


Memory Access Latency www.tugraz.at

11 Daniel Gruss — Graz University of Technology


Cache Template Attack Demo
Cache Template www.tugraz.at

Key
g h i j k l m n o p q r s t u v w x y z
0x7c680
0x7c6c0
0x7c700
0x7c740
0x7c780
0x7c7c0
0x7c800

Address
0x7c840
0x7c880
0x7c8c0
0x7c900
0x7c940
0x7c980
0x7c9c0
0x7ca00
0x7cb80
0x7cc40
0x7cc80
0x7ccc0
0x7cd00

13 Daniel Gruss — Graz University of Technology


13 Daniel Gruss — Graz University of Technology
13 Daniel Gruss — Graz University of Technology
13 Daniel Gruss — Graz University of Technology
Wait for an hour

13 Daniel Gruss — Graz University of Technology


Wait for an hour

LATENCY

13 Daniel Gruss — Graz University of Technology


13 Daniel Gruss — Graz University of Technology
ency Parallelize
Depend

13 Daniel Gruss — Graz University of Technology


Out-of-order Execution www.tugraz.at

1 int width = 10 , height = 5;


2

3 float diagonal = sqrt ( width * width


4 + height * height ) ;
5 int area = width * height ;
6

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

14 Daniel Gruss — Graz University of Technology


Out-of-order Execution www.tugraz.at

Parallelize
ency

int width = 10 , height = 5;


Depend

3 float diagonal = sqrt ( width * width


4 + height * height ) ;
5 int area = width * height ;
6

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

14 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 printf ( " % c \ n " , data ) ;

15 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 printf ( " % c \ n " , data ) ;

1 segfault at ffffffff81a000e0 ip 0000000000400535


2 sp 00007 ffce4a80610 error 5 in reader

15 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 printf ( " % c \ n " , data ) ;

1 segfault at ffffffff81a000e0 ip 0000000000400535


2 sp 00007 ffce4a80610 error 5 in reader

• Kernel addresses are not accessible

15 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 printf ( " % c \ n " , data ) ;

1 segfault at ffffffff81a000e0 ip 0000000000400535


2 sp 00007 ffce4a80610 error 5 in reader

• Kernel addresses are not accessible


• Are privilege checks also done when executing instructions out of order?

15 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Adapted code

1 *( volatile char *) 0;
2 array [84 * 4096] = 0; // unreachable

16 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Adapted code

1 *( volatile char *) 0;
2 array [84 * 4096] = 0; // unreachable

• Static code analyzer is not happy

1 warning : Dereference of n u l l p o i n t e r
2 ∗( v o l a t i l e char ∗) 0 ;

16 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array


500

Access time
[cycles]
400
300

0 50 100 150 200 250


Page

• “Unreachable” code line was actually executed

17 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array


500

Access time
[cycles]
400
300

0 50 100 150 200 250


Page

• “Unreachable” code line was actually executed


• Exception was only thrown afterwards

17 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Combine the two things

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 array [ data * 4096] = 0;

18 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Combine the two things

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 array [ data * 4096] = 0;

= sending end of a cache covert channel


• Then check whether any part of array is cached

18 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Combine the two things

1 char data = *( char *) 0 xffffffff81a000e0 ;


2 array [ data * 4096] = 0;

= sending end of a cache covert channel


• Then check whether any part of array is cached
= receiving end of a cache covert channel

18 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array


500

Access time
[cycles]
400
300

0 50 100 150 200 250


Page

• Index of cache hit reveals data

19 Daniel Gruss — Graz University of Technology


Building Meltdown www.tugraz.at

• Flush+Reload over all pages of the array


500

Access time
[cycles]
400
300

0 50 100 150 200 250


Page

• Index of cache hit reveals data


• Permission check is in some cases not fast enough

19 Daniel Gruss — Graz University of Technology


Leaking Passwords from your Password Manager www.tugraz.at

23 Daniel Gruss — Graz University of Technology


Not so fast. . .

24 Daniel Gruss — Graz University of Technology


Take the kernel addresses... www.tugraz.at

• Kernel addresses in user space are a problem

25 Daniel Gruss — Graz University of Technology


Take the kernel addresses... www.tugraz.at

• Kernel addresses in user space are a problem


• Why don’t we take the kernel addresses...

25 Daniel Gruss — Graz University of Technology


...and remove them www.tugraz.at

• ...and remove them if not needed?

26 Daniel Gruss — Graz University of Technology


...and remove them www.tugraz.at

• ...and remove them if not needed?


• User accessible check in hardware is not reliable

26 Daniel Gruss — Graz University of Technology


Idea www.tugraz.at

• Let’s just unmap the kernel in user space

27 Daniel Gruss — Graz University of Technology


Idea www.tugraz.at

• Let’s just unmap the kernel in user space


• Kernel addresses are then no longer present

27 Daniel Gruss — Graz University of Technology


Idea www.tugraz.at

• Let’s just unmap the kernel in user space


• Kernel addresses are then no longer present
• Memory which is not mapped cannot be accessed at all

27 Daniel Gruss — Graz University of Technology


27 Daniel Gruss — Graz University of Technology
27
K ernel A ddress I solation to have S ide channels E fficiently R emoved
Daniel Gruss — Graz University of Technology
KAISER /ˈkʌɪzə/
1. [german] Emperor,
ruler of an empire
2. largest penguin,
emperor penguin

27
K ernel A ddress I solation to have S ide channels E fficiently R emoved
Daniel Gruss — Graz University of Technology
Userspace Kernelspace

Operating
Applications System Memory
27 Daniel Gruss — Graz University of Technology
Kernel View User View

Userspace Kernelspace Userspace Kernelspace

Operating
Applications System Memory Applications

context switch
27 Daniel Gruss — Graz University of Technology
Kernel Address Space Isolation www.tugraz.at

• We published KAISER in July 2017

28 Daniel Gruss — Graz University of Technology


Kernel Address Space Isolation www.tugraz.at

• We published KAISER in July 2017


• Intel and others improved and merged it into Linux as KPTI (Kernel
Page Table Isolation)

28 Daniel Gruss — Graz University of Technology


Kernel Address Space Isolation www.tugraz.at

• We published KAISER in July 2017


• Intel and others improved and merged it into Linux as KPTI (Kernel
Page Table Isolation)
• Microsoft implemented similar concept in Windows 10

28 Daniel Gruss — Graz University of Technology


Kernel Address Space Isolation www.tugraz.at

• We published KAISER in July 2017


• Intel and others improved and merged it into Linux as KPTI (Kernel
Page Table Isolation)
• Microsoft implemented similar concept in Windows 10
• Apple implemented it in macOS 10.13.2 and called it “Double Map”

28 Daniel Gruss — Graz University of Technology


Kernel Address Space Isolation www.tugraz.at

• We published KAISER in July 2017


• Intel and others improved and merged it into Linux as KPTI (Kernel
Page Table Isolation)
• Microsoft implemented similar concept in Windows 10
• Apple implemented it in macOS 10.13.2 and called it “Double Map”
• All share the same idea: switching address spaces on context switch

28 Daniel Gruss — Graz University of Technology


28 Daniel Gruss — Graz University of Technology
Performance www.tugraz.at

• Depends on how often you need to switch between kernel and user space

29 Daniel Gruss — Graz University of Technology


Performance www.tugraz.at

• Depends on how often you need to switch between kernel and user space
• Can be slow, 40% or more on old hardware

29 Daniel Gruss — Graz University of Technology


Performance www.tugraz.at

• Depends on how often you need to switch between kernel and user space
• Can be slow, 40% or more on old hardware
• But modern CPUs have additional features

29 Daniel Gruss — Graz University of Technology


Performance www.tugraz.at

• Depends on how often you need to switch between kernel and user space
• Can be slow, 40% or more on old hardware
• But modern CPUs have additional features
• ⇒ Performance overhead on average below 2%

29 Daniel Gruss — Graz University of Technology


Meltdown and Spectre www.tugraz.at

30 Daniel Gruss — Graz University of Technology


Meltdown and Spectre www.tugraz.at

30 Daniel Gruss — Graz University of Technology


30 Daniel Gruss — Graz University of Technology
30
Prosciutto Daniel Gruss — Graz University of Technology
Funghi
30 Daniel Gruss — Graz University of Technology
30
Diavolo Daniel Gruss — Graz University of Technology
30
Diavolo Daniel Gruss — Graz University of Technology
30
Diavolo Daniel Gruss — Graz University of Technology
30
Diavolo Daniel Gruss — Graz University of Technology
»A table for 6 please«

30 Daniel Gruss — Graz University of Technology


30 Daniel Gruss — Graz University of Technology
Speculative Cooking

30 Daniel Gruss — Graz University of Technology


»A table for 6 please«

30 Daniel Gruss — Graz University of Technology


30 Daniel Gruss — Graz University of Technology
30 Daniel Gruss — Graz University of Technology
30 Daniel Gruss — Graz University of Technology
30 Daniel Gruss — Graz University of Technology
What does Spectre do? www.tugraz.at

• Mistrains branch prediction

31 Daniel Gruss — Graz University of Technology


What does Spectre do? www.tugraz.at

• Mistrains branch prediction


• CPU speculatively executes code which should not be executed

31 Daniel Gruss — Graz University of Technology


What does Spectre do? www.tugraz.at

• Mistrains branch prediction


• CPU speculatively executes code which should not be executed
• Can also mistrain indirect calls

31 Daniel Gruss — Graz University of Technology


What does Spectre do? www.tugraz.at

• Mistrains branch prediction


• CPU speculatively executes code which should not be executed
• Can also mistrain indirect calls
→ Spectre “convinces” program to execute code

31 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 0;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 0;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 0;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 0;

char* data = "textKEY";

if (index < 4)
Execute
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 1;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 1;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 1;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 1;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 2;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 2;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 2;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 2;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 3;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 3;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 3;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 3;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 4;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 4;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 4;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 4;

char* data = "textKEY";

if (index < 4)
Execute
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 5;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 5;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 5;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 5;

char* data = "textKEY";

if (index < 4)
Execute
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 6;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 6;

char* data = "textKEY";

if (index < 4)

el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 6;

char* data = "textKEY";

if (index < 4)
Speculate
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 1) www.tugraz.at

index = 6;

char* data = "textKEY";

if (index < 4)
Execute
el s
en e
th
Prediction

LUT[data[index] * 4096] 0

32 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
sw
( ) swim() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
Speculate
sw
() swim() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
sw
( ) swim() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
Execute
sw
( ) swim() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
Speculate
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = bird;

a->move()
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = fish;

a->move()
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = fish;

a->move()
Speculate
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = fish;

a->move()
sw
( ) fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = fish;

a->move()
Execute
sw
() fly() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Spectre (variant 2) www.tugraz.at

Animal* a = fish;

a->move()
sw
( ) swim() im
fly ()

Prediction
LUT[data[index] * 4096] 0

33 Daniel Gruss — Graz University of Technology


Mitigating Spectre www.tugraz.at

• Trivial approach: disable speculative execution

34 Daniel Gruss — Graz University of Technology


Mitigating Spectre www.tugraz.at

• Trivial approach: disable speculative execution


• No wrong speculation if there is no speculation

34 Daniel Gruss — Graz University of Technology


Mitigating Spectre www.tugraz.at

• Trivial approach: disable speculative execution


• No wrong speculation if there is no speculation
• Problem: massive performance hit!

34 Daniel Gruss — Graz University of Technology


Mitigating Spectre www.tugraz.at

• Trivial approach: disable speculative execution


• No wrong speculation if there is no speculation
• Problem: massive performance hit!
• Also: How to disable it?

34 Daniel Gruss — Graz University of Technology


Mitigating Spectre www.tugraz.at

• Trivial approach: disable speculative execution


• No wrong speculation if there is no speculation
• Problem: massive performance hit!
• Also: How to disable it?
• Speculative execution is deeply integrated into CPU

34 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

35 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Workaround: insert instructions stopping speculation

35 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Workaround: insert instructions stopping speculation


→ insert after every bounds check

35 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Workaround: insert instructions stopping speculation


→ insert after every bounds check
• x86: LFENCE, ARM: CSDB

35 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Workaround: insert instructions stopping speculation


→ insert after every bounds check
• x86: LFENCE, ARM: CSDB
• Available on all Intel CPUs, retrofitted to existing
ARMv7 and ARMv8

35 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

36 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier requires compiler supported

36 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier requires compiler supported


• Already implemented in GCC, LLVM, and MSVC

36 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier requires compiler supported


• Already implemented in GCC, LLVM, and MSVC
• Can be automated (MSVC) → not really reliable

36 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier requires compiler supported


• Already implemented in GCC, LLVM, and MSVC
• Can be automated (MSVC) → not really reliable
• Explicit use by programmer: builtin load no speculate

36 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

37 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

37 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

38 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier works if affected code constructs are


known

38 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier works if affected code constructs are


known
• Programmer has to fully understand vulnerability

38 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier works if affected code constructs are


known
• Programmer has to fully understand vulnerability
• Automatic detection is not reliable

38 Daniel Gruss — Graz University of Technology


Spectre Variant 1 Mitigations www.tugraz.at

• Speculation barrier works if affected code constructs are


known
• Programmer has to fully understand vulnerability
• Automatic detection is not reliable
• Non-negligible performance overhead of barriers

38 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode
→ lesser privileged code cannot influence predictions

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode
→ lesser privileged code cannot influence predictions
• Indirect Branch Predictor Barrier (IBPB):

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode
→ lesser privileged code cannot influence predictions
• Indirect Branch Predictor Barrier (IBPB):
• Flush branch-target buffer

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode
→ lesser privileged code cannot influence predictions
• Indirect Branch Predictor Barrier (IBPB):
• Flush branch-target buffer
• Single Thread Indirect Branch Predictors (STIBP):

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Microcode/MSRs) www.tugraz.at

Intel released microcode updates


• Indirect Branch Restricted Speculation (IBRS):
• Do not speculate based on anything before entering IBRS mode
→ lesser privileged code cannot influence predictions
• Indirect Branch Predictor Barrier (IBPB):
• Flush branch-target buffer
• Single Thread Indirect Branch Predictors (STIBP):
• Isolates branch prediction state between two hyperthreads

39 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop


• instead of the correct (or wrong) target function

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop


• instead of the correct (or wrong) target function → performance?

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop


• instead of the correct (or wrong) target function → performance?
• On Broadwell or newer:

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop


• instead of the correct (or wrong) target function → performance?
• On Broadwell or newer:
• ret may fall-back to the BTB for prediction

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

Retpoline (compiler extension)


1 push < call_target >
2 call 1 f
3 2: ; s p e c u l a t i o n will continue here
4 lfence ; s p e c u l a t i o n barrier
5 jmp 2 b ; endless loop
6 1:
7 lea 8(% rsp ) , % rsp ; restore stack pointer
8 ret ; the actual call to < call_target >

→ always predict to enter an endless loop


• instead of the correct (or wrong) target function → performance?
• On Broadwell or newer:
• ret may fall-back to the BTB for prediction
→ microcode patches to prevent that

40 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

• ARM provides hardened Linux kernel

41 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

• ARM provides hardened Linux kernel


• Clears branch-predictor state on context switch

41 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

• ARM provides hardened Linux kernel


• Clears branch-predictor state on context switch
• Either via instruction (BPIALL)...

41 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

• ARM provides hardened Linux kernel


• Clears branch-predictor state on context switch
• Either via instruction (BPIALL)...
• ...or workaround (disable/enable MMU)

41 Daniel Gruss — Graz University of Technology


Spectre Variant 2 Mitigations (Software) www.tugraz.at

• ARM provides hardened Linux kernel


• Clears branch-predictor state on context switch
• Either via instruction (BPIALL)...
• ...or workaround (disable/enable MMU)
• Non-negligible performance overhead (≈ 200-300 ns)

41 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer

42 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer


→ Own timer using timing thread

42 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer


→ Own timer using timing thread
• Flush instruction only privileged

42 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer


→ Own timer using timing thread
• Flush instruction only privileged
→ Cache eviction through memory accesses

42 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer


→ Own timer using timing thread
• Flush instruction only privileged
→ Cache eviction through memory accesses
• Just move secrets into secure world

42 Daniel Gruss — Graz University of Technology


What does not work www.tugraz.at

• Prevent access to high-resolution timer


→ Own timer using timing thread
• Flush instruction only privileged
→ Cache eviction through memory accesses
• Just move secrets into secure world
→ Spectre works on secure enclaves

42 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
Out-of-Order Execution)

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
• has nothing to do with branch prediction Out-of-Order Execution)
• fundamentally builds on branch
(mis)prediction

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
• has nothing to do with branch prediction Out-of-Order Execution)
• turning off speculative execution entirely • fundamentally builds on branch
has no effect on Meltdown (mis)prediction
• turning off speculative execution entirely
would work

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
• has nothing to do with branch prediction Out-of-Order Execution)
• turning off speculative execution entirely • fundamentally builds on branch
has no effect on Meltdown (mis)prediction
→ melts down the isolation provided by the • turning off speculative execution entirely
user accessible-bit would work
• has nothing to do with the
user accessible-bit

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
• has nothing to do with branch prediction Out-of-Order Execution)
• turning off speculative execution entirely • fundamentally builds on branch
has no effect on Meltdown (mis)prediction
→ melts down the isolation provided by the • turning off speculative execution entirely
user accessible-bit would work
• in theory: OoO not required, pipelining • has nothing to do with the
can be sufficient user accessible-bit
• KAISER has no effect on Spectre at all

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown Spectre
• Out-of-Order Execution • Speculative Execution (subset of
• has nothing to do with branch prediction Out-of-Order Execution)
• turning off speculative execution entirely • fundamentally builds on branch
has no effect on Meltdown (mis)prediction
→ melts down the isolation provided by the • turning off speculative execution entirely
user accessible-bit would work
• in theory: OoO not required, pipelining • has nothing to do with the
can be sufficient user accessible-bit
• mitigated by KAISER • KAISER has no effect on Spectre at all

43 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre

44 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre
• performs illegal memory accesses → we
• performs only legal memory accesses
need to take care of processor exceptions

44 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre
• performs illegal memory accesses → we
• performs only legal memory accesses
need to take care of processor exceptions
• has nothing to do with exception
• exception handling
handling

44 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre
• performs illegal memory accesses → we
• performs only legal memory accesses
need to take care of processor exceptions
• has nothing to do with exception
• exception handling
handling or suppression
• exception suppression with TSX

44 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre
• performs illegal memory accesses → we
• performs only legal memory accesses
need to take care of processor exceptions
• has nothing to do with exception
• exception handling
handling or suppression
• exception suppression with TSX
• exception suppression with branch
misprediction

44 Daniel Gruss — Graz University of Technology


Meltdown vs. Spectre www.tugraz.at

Meltdown
Spectre
• performs illegal memory accesses → we
• performs only legal memory accesses
need to take care of processor exceptions
• has nothing to do with exception
• exception handling
handling or suppression
• exception suppression with TSX
• exception suppression with branch
misprediction

→ two papers, two names, etc.

44 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”
• Intel had much interest in not fancy-naming them ;)

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”
• Intel had much interest in not fancy-naming them ;)

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”
• Intel had much interest in not fancy-naming them ;)
... why were they presented on the same date and on the same website?

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”
• Intel had much interest in not fancy-naming them ;)
... why were they presented on the same date and on the same website?
• We did not choose the date

45 Daniel Gruss — Graz University of Technology


But ... www.tugraz.at

... why were they named variant 1, 2 and 3 by Google?


• “How can you use speculative execution maliciously?”
• Intel had much interest in not fancy-naming them ;)
... why were they presented on the same date and on the same website?
• We did not choose the date
• We did not want to have one of them overshadow the other
immediately

45 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:


• attacks on crypto

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:


• attacks on crypto → “software should be fixed”

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:


• attacks on crypto → “software should be fixed”
• attacks on ASLR

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:


• attacks on crypto → “software should be fixed”
• attacks on ASLR → “ASLR is broken anyway”

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many many years:


• attacks on crypto → “software should be fixed”
• attacks on ASLR → “ASLR is broken anyway”
• attacks on SGX and TrustZone

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many 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”

46 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

We have ignored microarchitectural attacks for many 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”
→ for years we solely optimized for performance

46 Daniel Gruss — Graz University of Technology


When you read the manuals... www.tugraz.at

After learning about a side channel you realize:

47 Daniel Gruss — Graz University of Technology


When you read the manuals... www.tugraz.at

After learning about a side channel you realize:


• the side channels were documented in the Intel manual

47 Daniel Gruss — Graz University of Technology


When you read the manuals... www.tugraz.at

After learning about a side channel you realize:


• the side channels were documented in the Intel manual
• only now we understand the implications

47 Daniel Gruss — Graz University of Technology


What do we learn from it? www.tugraz.at

Motor Vehicle Deaths in U.S. by Year

48 Daniel Gruss — Graz University of Technology


Conclusions www.tugraz.at

A unique chance to
• rethink processor design

49 Daniel Gruss — Graz University of Technology


Conclusions www.tugraz.at

A unique chance to
• rethink processor design
• grow up, like other fields (car industry, construction industry)

49 Daniel Gruss — Graz University of Technology


Conclusions www.tugraz.at

A unique chance to
• rethink processor design
• grow up, like other fields (car industry, construction industry)
• dedicate more time into identifying problems and not solely in
mitigating known problems

49 Daniel Gruss — Graz University of Technology


SCIENCE PASSION TECHNOLOGY

Software-based Microarchitectural Attacks

Daniel Gruss
April 19, 2018
Graz University of Technology

50 Daniel Gruss — Graz University of Technology

Das könnte Ihnen auch gefallen