spying on your neighbor: cpu cache attacks and beyond · spying on your neighbor: cpu cache attacks...

148
SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND BEN GRAS/@BJG, KAVEH RAZAVI, CRISTIANO GIUFFRIDA, HERBERT BOS VRIJE UNIVERSITEIT AMSTERDAM BLACKHAT USA 2018

Upload: others

Post on 23-Jul-2020

24 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S P Y I N G O N Y O U R N E I G H B O R : C P U C A C H E AT TA C K S A N D B E Y O N D

B E N G R A S / @ B J G , K AV E H R A Z AV I , C R I S T I A N O G I U F F R I D A , H E R B E R T B O S V R I J E U N I V E R S I T E I T A M S T E R D A M B L A C K H AT U S A 2 0 1 8

Page 2: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

Page 3: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

Page 4: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

Page 5: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

• We do software hardening, exploitation

Page 6: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

• We do software hardening, exploitation

• Hardware attacks, side channels

Page 7: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

• We do software hardening, exploitation

• Hardware attacks, side channels

• Academic recognition but also hacker scene (Pwnies!)

Page 8: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

• We do software hardening, exploitation

• Hardware attacks, side channels

• Academic recognition but also hacker scene (Pwnies!)

Page 9: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

A B O U T M E

• PhD student in VUsec VU University Research group

• Academic group researching systems software security

• We do software hardening, exploitation

• Hardware attacks, side channels

• Academic recognition but also hacker scene (Pwnies!)

Page 10: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

O V E R V I E W

• Side channels

• Cache attacks

• Cache defences

• Hyperthreading

• TLBleed

• Evaluation

Page 11: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S I D E C H A N N E L S

Page 12: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S I D E C H A N N E L S

Page 13: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S I D E C H A N N E L S

• Leak secrets outside the regular interface

Page 14: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S I D E C H A N N E L S

• Leak secrets outside the regular interface

Page 15: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

R I C H H I S T O R Y - S M A R T C A R D S

• Power Consumption(FPGA Security by Shemal Shroff et al.)

• EM radiation: leak ECC bits(FPGA Security by Shemal Shroff et al.)

• Execution time: leak ECC, RSA bits(Timing Attacks on ECC by Shemal Shroff et al.)

• Acoustic cryptanalysis(RSA Key Extraction [..] by Adi Shamir et al.)

Page 16: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

R I C H H I S T O R Y - S M A R T C A R D S

• Power Consumption(FPGA Security by Shemal Shroff et al.)

• EM radiation: leak ECC bits(FPGA Security by Shemal Shroff et al.)

• Execution time: leak ECC, RSA bits(Timing Attacks on ECC by Shemal Shroff et al.)

• Acoustic cryptanalysis(RSA Key Extraction [..] by Adi Shamir et al.)

Page 17: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

R I C H H I S T O R Y - S M A R T C A R D S

• Power Consumption(FPGA Security by Shemal Shroff et al.)

• EM radiation: leak ECC bits(FPGA Security by Shemal Shroff et al.)

• Execution time: leak ECC, RSA bits(Timing Attacks on ECC by Shemal Shroff et al.)

• Acoustic cryptanalysis(RSA Key Extraction [..] by Adi Shamir et al.)

Page 18: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

R I C H H I S T O R Y - S M A R T C A R D S

• Power Consumption(FPGA Security by Shemal Shroff et al.)

• EM radiation: leak ECC bits(FPGA Security by Shemal Shroff et al.)

• Execution time: leak ECC, RSA bits(Timing Attacks on ECC by Shemal Shroff et al.)

• Acoustic cryptanalysis(RSA Key Extraction [..] by Adi Shamir et al.)

Page 19: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

R I C H H I S T O R Y - S M A R T C A R D S

• Power Consumption(FPGA Security by Shemal Shroff et al.)

• EM radiation: leak ECC bits(FPGA Security by Shemal Shroff et al.)

• Execution time: leak ECC, RSA bits(Timing Attacks on ECC by Shemal Shroff et al.)

• Acoustic cryptanalysis(RSA Key Extraction [..] by Adi Shamir et al.)

Page 20: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E AT TA C K S

Page 21: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• Computing processes ought to be compartmented

• Different owners or privilege levels: trust boundaries

Page 22: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• Computing processes ought to be compartmented

• Different owners or privilege levels: trust boundaries

Page 23: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• Computing processes ought to be compartmented

• Different owners or privilege levels: trust boundaries

Page 24: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• Computing processes ought to be compartmented

• Different owners or privilege levels: trust boundaries

Page 25: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• Computing processes ought to be compartmented

• Different owners or privilege levels: trust boundaries

Page 26: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E : S O F T W A R E E Q U I VA L E N T

• There are shared resources between processes

• RAM, CPU cache, TLB, computational resources ..

• Practically always: allows signaling: covert channel

• Sometimes: allows side channel (spying)

Page 27: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 28: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 29: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 30: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

C R O S S - P R O C E S S S H A R E D S TAT E

Page 31: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 32: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 33: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Shared RAM row(DRAMA paper, by Peter Peßl et al.)

• Shared cache set (FLUSH+RELOAD by Yuval Yarom et al.shown, many others exist)

• Cache prefetch (Prefetch Side-Channel Attacks,by Daniel Gruss et al.)

C R O S S - P R O C E S S S H A R E D S TAT E

Page 34: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C R O S S - P R O C E S S / V M S H A R E D S TAT E

• This is only possible because of shared resources

Page 35: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C R O S S - P R O C E S S / V M S H A R E D S TAT E

• This is only possible because of shared resources

Page 36: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• One of several cache attacks

• Relies on shared memory

• Can be shared object (mmap()ed shared libraries)

• Or shared pages after deduplication (KSM in Linux)

Page 37: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• Work by Yuval Yarom, Katrina Falkner

• Memory access patterns can betray secrets

• Because access patterns frequently depend on secrets

• Example: RSA keys. (n,e,d) Private: d. n=pq and d are 1024 bits or more

Page 38: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• Signing is: computing md (mod n)

• Often square-and-multiply depending on bits in d

• Shared cache activity betrays memory access patterns

• Quickly probing the cache can betray the bits in d

Page 39: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 40: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 41: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 42: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 43: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 44: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 45: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 46: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 47: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 48: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 49: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

Page 50: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• Can also attack AES implementation with T tables

• A table lookup happens Tj [xi = pi ⊕ ki ]

• pi is a plaintext byte, ki a key byte where pi is a plaintext byte, ki a key byte,

Page 51: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• Again: secrets are betrayed by memory accesses

• Known plaintext + accesses = key recovery where pi is a plaintext byte, ki a key byte,

Page 52: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E X A M P L E : F L U S H + R E L O A D

• Again: secrets are betrayed by memory accesses

• Known plaintext + accesses = key recovery where pi is a plaintext byte, ki a key byte,

Page 53: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E D E F E N C E S

Page 54: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

Page 55: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

Page 56: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

Page 57: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

Page 58: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

6 7 8 9 10

16 17 18 19 20

26 27 28 29 30

Page 59: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

6 7 8 9 10

16 17 18 19 20

26 27 28 29 30

Page 60: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

6 7 8 9 10

16 17 18 19 20

26 27 28 29 30

Page 61: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

6 7 8 9 10

16 17 18 19 20

26 27 28 29 30

Page 62: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E C O L O U R I N G

• Figure out page colors

• These map to shared cache sets

• Do not share same colors across security boundaries

• Kernel arranges this

1 2 3 4 5

11 12 13 14 15

21 22 23 24 25

6 7 8 9 10

16 17 18 19 20

26 27 28 29 30

Page 63: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

Page 64: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 65: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 66: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 67: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 68: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 69: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 70: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : C AT

• Intel CAT: Cache Allocation Technology

• Intended for predictable performance for VMs

• Partitions caches in ways

• Hardware feature

1 2 3 4 5

11 12 13 14 15

6 7 8 9 10

16 17 18 19 20

21 22 23 24 25 26 27 28 29 30

Page 71: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X

Page 72: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

Page 73: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

Page 74: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

• But relies on unshared cache activity

Page 75: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

• But relies on unshared cache activity

• Transactions fit in cache, otherwise auto-abort

Page 76: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

• But relies on unshared cache activity

• Transactions fit in cache, otherwise auto-abort

• We can use this as a defence

Page 77: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

• But relies on unshared cache activity

• Transactions fit in cache, otherwise auto-abort

• We can use this as a defence

Page 78: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C A C H E PA R T I T I O N I N G : T S X• Intel TSX: Transactional Synchronization Extensions

• Intended for hardware transactional memory

• But relies on unshared cache activity

• Transactions fit in cache, otherwise auto-abort

• We can use this as a defence

Page 79: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

H Y P E R T H R E A D I N G

Page 80: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

Page 81: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 82: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 83: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 84: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 85: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 86: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

S U P E R S C A L A R C P U U T I L I S AT I O N

• Share functional units (FU): increase utilisation

Page 87: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

H Y P E R T H R E A D I N G

Page 88: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

H Y P E R T H R E A D I N G

• Low investment, high utilisation yield

Page 89: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

H Y P E R T H R E A D I N G

Page 90: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

H Y P E R T H R E A D I N G

• Significant resource sharing: good and bad

Page 91: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D

Page 92: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B

Page 93: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 94: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 95: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

• Other structures than cache shared between threads?

• What about the TLB?

• Documented: TLB has L1iTLB, L1dTLB, and L2TLB

• They have sets and ways

• Not documented: structure

Page 96: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 97: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Try linear structure first

• All combinations of ways (set size) and sets (stride)

• Smallest number of ways is it

• Smallest corresponding stride is number of sets

Page 98: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Try linear structure first

• All combinations of ways (set size) and sets (stride)

• Smallest number of ways is it

• Smallest corresponding stride is number of sets

Page 99: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Try linear structure first

• All combinations of ways (set size) and sets (stride)

• Smallest number of ways is it

• Smallest corresponding stride is number of sets

Page 100: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 101: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• For L2TLB:

We reverse engineered a more complex hash function

Page 102: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• For L2TLB:

We reverse engineered a more complex hash function

• Skylake XORs 14 bits, Broadwell XORs 16 bits

Page 103: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• For L2TLB:

We reverse engineered a more complex hash function

• Skylake XORs 14 bits, Broadwell XORs 16 bits

• Represented by this matrix, using modulo 2 arithmetic

Page 104: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• For L2TLB:

We reverse engineered a more complex hash function

• Skylake XORs 14 bits, Broadwell XORs 16 bits

• Represented by this matrix, using modulo 2 arithmetic

Page 105: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 106: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

Page 107: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Now we know the structure.. Are TLB’s shared between hyperthreads?

Page 108: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Now we know the structure.. Are TLB’s shared between hyperthreads?

• Let’s experiment with misses when accessing the same set

Page 109: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Now we know the structure.. Are TLB’s shared between hyperthreads?

• Let’s experiment with misses when accessing the same set

Page 110: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Now we know the structure.. Are TLB’s shared between hyperthreads?

• Let’s experiment with misses when accessing the same set

Page 111: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s experiment with performance counters

• Now we know the structure.. Are TLB’s shared between hyperthreads?

• Let’s experiment with misses when accessing the same set

Page 112: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 113: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• We find more TLB properties

• Size, structure, sharing, miss penalty, hash function

Page 114: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 115: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

• Can we use only latency?

• Map many virtual addresses to same physical page

Page 116: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

• Can we use only latency?

• Map many virtual addresses to same physical page

Page 117: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 118: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s observe EdDSA ECC key multiplication

Page 119: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s observe EdDSA ECC key multiplication

• Scalar is secret and ADD only happens if there’s a 1

Page 120: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s observe EdDSA ECC key multiplication

• Scalar is secret and ADD only happens if there’s a 1

• Like RSA square-and-multiply

Page 121: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s observe EdDSA ECC key multiplication

• Scalar is secret and ADD only happens if there’s a 1

• Like RSA square-and-multiply

• But: we can not use code information! Only data..!

Page 122: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 123: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

• Typical cache attack relies on spatial separation

• I.E. different cache lines

Page 124: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

• Typical cache attack relies on spatial separation

• I.E. different cache lines

Page 125: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 126: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s find the spatial L1 DTLB separation

• There isn’t any

• Too much activity in both blue/green cases

Page 127: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Let’s find the spatial L1 DTLB separation

• There isn’t any

• Too much activity in both blue/green cases

Page 128: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E

Page 129: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

Page 130: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 131: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 132: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 133: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 134: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 135: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D : T L B A S S H A R E D S TAT E• Monitor a single TLB set and use temporal information

• Use machine learning (SVM classifier) to tell the difference

Page 136: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

E VA L U AT I O N

Page 137: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D R E L I A B I L I T Y

Page 138: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D R E L I A B I L I T Y

Page 139: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D R E L I A B I L I T Y

Page 140: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

T L B L E E D R E L I A B I L I T Y

Page 141: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Work also by Kaveh Razavi, Cristiano Giuffrida, Herbert Bos

• Some diagrams in these slides were taken from other work: FLUSH+RELOAD, Prefetch, DRAMA

• Yuval Yarom, Katrina Falkner, Peter Peßl, Daniel Gruss

C R E D I T

Page 142: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

C O N C L U S I O N

Page 143: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

C O N C L U S I O N

Page 144: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

• They bypass defences

C O N C L U S I O N

Page 145: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

• They bypass defences

• @bjg @gober

C O N C L U S I O N

Page 146: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

• They bypass defences

• @bjg @gober

• @vu5ec

C O N C L U S I O N

Page 147: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

• They bypass defences

• @bjg @gober

• @vu5ec

• www.vusec.net

C O N C L U S I O N

Page 148: SPYING ON YOUR NEIGHBOR: CPU CACHE ATTACKS AND BEYOND · spying on your neighbor: cpu cache attacks and beyond ben gras/@bjg, kaveh razavi, cristiano giuffrida, herbert bos vrije

• Practical, reliable, high resolution side channels exist outside the cache

• They bypass defences

• @bjg @gober

• @vu5ec

• www.vusec.net

• Thank you for listening

C O N C L U S I O N