Cache attacks: From side channels to fault attacks Clmentine Maurice - - PowerPoint PPT Presentation

cache attacks from side channels to fault attacks
SMART_READER_LITE
LIVE PREVIEW

Cache attacks: From side channels to fault attacks Clmentine Maurice - - PowerPoint PPT Presentation

Cache attacks: From side channels to fault attacks Clmentine Maurice CNRS, Rennes, France November 16, 2017 Cryptacus Workshop, Nijmegen, Netherlands the attacker only needs unprivileged execution on the victims machine


slide-1
SLIDE 1

Cache attacks: From side channels to fault attacks

Clémentine Maurice – CNRS, Rennes, France November 16, 2017 – Cryptacus Workshop, Nijmegen, Netherlands

slide-2
SLIDE 2

Cache attacks

  • side-channel attacks without physical access to the device
  • the attacker only needs unprivileged execution on the victim’s machine
  • realistic scenario with cloud environments, smartphone apps, JavaScript

running on webpages…

  • first practical attacks presented in 2003
  • micro-architecture changed a lot, so did the attacks
  • Y. Tsunoo, T. Saito, and T. Suzaki. “Cryptanalysis of DES implemented on computers with cache”. In: CHES’03. 2003, pp. 62–76.

2

slide-3
SLIDE 3

Cache attacks

  • side-channel attacks without physical access to the device
  • the attacker only needs unprivileged execution on the victim’s machine
  • realistic scenario with cloud environments, smartphone apps, JavaScript

running on webpages…

  • first practical attacks presented in 2003
  • micro-architecture changed a lot, so did the attacks
  • Y. Tsunoo, T. Saito, and T. Suzaki. “Cryptanalysis of DES implemented on computers with cache”. In: CHES’03. 2003, pp. 62–76.

2

slide-4
SLIDE 4

Cache attacks

  • side-channel attacks without physical access to the device
  • the attacker only needs unprivileged execution on the victim’s machine
  • realistic scenario with cloud environments, smartphone apps, JavaScript

running on webpages…

  • first practical attacks presented in 2003
  • micro-architecture changed a lot, so did the attacks
  • Y. Tsunoo, T. Saito, and T. Suzaki. “Cryptanalysis of DES implemented on computers with cache”. In: CHES’03. 2003, pp. 62–76.

2

slide-5
SLIDE 5

Cache attacks

  • side-channel attacks without physical access to the device
  • the attacker only needs unprivileged execution on the victim’s machine
  • realistic scenario with cloud environments, smartphone apps, JavaScript

running on webpages…

  • first practical attacks presented in 2003
  • micro-architecture changed a lot, so did the attacks
  • Y. Tsunoo, T. Saito, and T. Suzaki. “Cryptanalysis of DES implemented on computers with cache”. In: CHES’03. 2003, pp. 62–76.

2

slide-6
SLIDE 6

Cache attacks

  • side-channel attacks without physical access to the device
  • the attacker only needs unprivileged execution on the victim’s machine
  • realistic scenario with cloud environments, smartphone apps, JavaScript

running on webpages…

  • first practical attacks presented in 2003
  • micro-architecture changed a lot, so did the attacks
  • Y. Tsunoo, T. Saito, and T. Suzaki. “Cryptanalysis of DES implemented on computers with cache”. In: CHES’03. 2003, pp. 62–76.

2

slide-7
SLIDE 7

Outline

  • cache side-channel attacks techniques
  • a few words on applications
  • challenges in modern architectures
  • lessons learned and how to apply this to fault attacks on DRAM

3

slide-8
SLIDE 8

Intel CPUs

2008 Nehalem 2012 Sandy Bridge 2013 Ivy Bridge 2014 Haswell 2015 Broadwell 2016 Skylake

  • new microarchitectures yearly
  • performance improvement

5

  • very small optimizations: caches, branch

prediction…

  • no documentation on this intellectual property
  • side channels come from these optimizations

4

slide-9
SLIDE 9

Intel CPUs

2008 Nehalem 2012 Sandy Bridge 2013 Ivy Bridge 2014 Haswell 2015 Broadwell 2016 Skylake

  • new microarchitectures yearly
  • performance improvement ≈ 5%
  • very small optimizations: caches, branch

prediction…

  • no documentation on this intellectual property
  • side channels come from these optimizations

4

slide-10
SLIDE 10

Intel CPUs

2008 Nehalem 2012 Sandy Bridge 2013 Ivy Bridge 2014 Haswell 2015 Broadwell 2016 Skylake

  • new microarchitectures yearly
  • performance improvement ≈ 5%
  • very small optimizations: caches, branch

prediction…

  • no documentation on this intellectual property
  • side channels come from these optimizations

4

slide-11
SLIDE 11

Intel CPUs

2008 Nehalem 2012 Sandy Bridge 2013 Ivy Bridge 2014 Haswell 2015 Broadwell 2016 Skylake

  • new microarchitectures yearly
  • performance improvement ≈ 5%
  • very small optimizations: caches, branch

prediction…

  • no documentation on this intellectual property
  • side channels come from these optimizations

4

slide-12
SLIDE 12

Intel CPUs

2008 Nehalem 2012 Sandy Bridge 2013 Ivy Bridge 2014 Haswell 2015 Broadwell 2016 Skylake

  • new microarchitectures yearly
  • performance improvement ≈ 5%
  • very small optimizations: caches, branch

prediction…

  • no documentation on this intellectual property
  • side channels come from these optimizations

4

slide-13
SLIDE 13

Caches on Intel CPUs

core 0 L1 L2 core 1 L1 L2 core 2 L1 L2 core 3 L1 L2 ring bus LLC slice 0 LLC slice 1 LLC slice 2 LLC slice 3

  • L1 and L2 are private
  • last-level cache
  • divided in slices
  • shared across cores
  • inclusive

5

slide-14
SLIDE 14

Caches on Intel CPUs

core 0 L1 L2 core 1 L1 L2 core 2 L1 L2 core 3 L1 L2 ring bus LLC slice 0 LLC slice 1 LLC slice 2 LLC slice 3

  • L1 and L2 are private
  • last-level cache
  • divided in slices
  • shared across cores
  • inclusive

5

slide-15
SLIDE 15

Caches on Intel CPUs

core 0 L1 L2 core 1 L1 L2 core 2 L1 L2 core 3 L1 L2 ring bus LLC slice 0 LLC slice 1 LLC slice 2 LLC slice 3

  • L1 and L2 are private
  • last-level cache
  • divided in slices
  • shared across cores
  • inclusive

5

slide-16
SLIDE 16

Caches on Intel CPUs

core 0 L1 L2 core 1 L1 L2 core 2 L1 L2 core 3 L1 L2 ring bus LLC slice 0 LLC slice 1 LLC slice 2 LLC slice 3

  • L1 and L2 are private
  • last-level cache
  • divided in slices
  • shared across cores
  • inclusive

5

slide-17
SLIDE 17

Caches on Intel CPUs

core 0 L1 L2 core 1 L1 L2 core 2 L1 L2 core 3 L1 L2 ring bus LLC slice 0 LLC slice 1 LLC slice 2 LLC slice 3

  • L1 and L2 are private
  • last-level cache
  • divided in slices
  • shared across cores
  • inclusive

5

slide-18
SLIDE 18

Set-associative caches

5 6 16 17 31

Tag Index Offset Address Cache

6

slide-19
SLIDE 19

Set-associative caches

5 6 16 17 31

Tag Index Offset Address Cache Cache set

Data loaded in a specific set depending on its address 6

slide-20
SLIDE 20

Set-associative caches

5 6 16 17 31

Tag Index Offset Address Cache Cache set

way 0 way 3

Data loaded in a specific set depending on its address Several ways per set 6

slide-21
SLIDE 21

Set-associative caches

5 6 16 17 31

Tag Index Offset Address Cache Cache set

way 0 way 3

Cache line

Data loaded in a specific set depending on its address Several ways per set Cache line loaded in a specific way depending on the replacement policy 6

slide-22
SLIDE 22

Timing differences

50 100 150 200 250 300 350 400 101 104 107 Access time [CPU cycles] Number of accesses cache hits

7

slide-23
SLIDE 23

Timing differences

50 100 150 200 250 300 350 400 101 104 107 Access time [CPU cycles] Number of accesses cache hits cache misses

7

slide-24
SLIDE 24

Cache attacks

  • cache attacks → exploit timing differences of memory accesses
  • attacker monitors which lines are accessed, not the content
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs
  • side-channel attack: one malicious process spies on benign processes
  • e.g., steals crypto keys, spies on keystrokes

8

slide-25
SLIDE 25

Cache attacks

  • cache attacks → exploit timing differences of memory accesses
  • attacker monitors which lines are accessed, not the content
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs
  • side-channel attack: one malicious process spies on benign processes
  • e.g., steals crypto keys, spies on keystrokes

8

slide-26
SLIDE 26

Cache attacks

  • cache attacks → exploit timing differences of memory accesses
  • attacker monitors which lines are accessed, not the content
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs
  • side-channel attack: one malicious process spies on benign processes
  • e.g., steals crypto keys, spies on keystrokes

8

slide-27
SLIDE 27

Cache attacks

  • cache attacks → exploit timing differences of memory accesses
  • attacker monitors which lines are accessed, not the content
  • covert channel: two processes communicating with each other
  • not allowed to do so, e.g., across VMs
  • side-channel attack: one malicious process spies on benign processes
  • e.g., steals crypto keys, spies on keystrokes

8

slide-28
SLIDE 28

Cache attacks techniques

  • two (main) techniques
  • 1. Flush+Reload (Gullasch et al., Osvik et al., Yarom et al.)
  • 2. Prime+Probe (Percival, Osvik et al., Liu et al.)
  • exploitable on x86 and ARM
  • D. Gullasch, E. Bangerter, and S. Krenn. “Cache Games – Bringing Access-Based Cache Attacks on AES to Practice”. In: S&P’11. 2011.
  • Y. Yarom and K. Falkner. “Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel Attack”. In: USENIX Security Symposium. 2014.
  • D. A. Osvik, A. Shamir, and E. Tromer. “Cache Attacks and Countermeasures: the Case of AES”. In: CT-RSA 2006. 2006.
  • C. Percival. “Cache missing for fun and profit”. In: Proceedings of BSDCan. 2005.
  • F. Liu, Y. Yarom, Q. Ge, G. Heiser, and R. B. Lee. “Last-Level Cache Side-Channel Attacks are Practical”. In: S&P’15. 2015.

9

slide-29
SLIDE 29

Cache attacks: Flush+Reload

Victim address space Cache Attacker address space

Step 1: Attacker maps shared library (shared memory, in cache)

10

slide-30
SLIDE 30

Cache attacks: Flush+Reload

Victim address space Cache Attacker address space

Step 1: Attacker maps shared library (shared memory, in cache)

cached c a c h e d

10

slide-31
SLIDE 31

Cache attacks: Flush+Reload

Victim address space Cache Attacker address space

Step 1: Attacker maps shared library (shared memory, in cache)

fl u s h e s

Step 2: Attacker flushes the shared cache line

10

slide-32
SLIDE 32

Cache attacks: Flush+Reload

Victim address space Cache Attacker address space

Step 1: Attacker maps shared library (shared memory, in cache) Step 2: Attacker flushes the shared cache line

loads data

Step 3: Victim loads the data

10

slide-33
SLIDE 33

Cache attacks: Flush+Reload

Victim address space Cache Attacker address space

Step 1: Attacker maps shared library (shared memory, in cache) Step 2: Attacker flushes the shared cache line Step 3: Victim loads the data

r e l

  • a

d s d a t a

Step 4: Attacker reloads the data

10

slide-34
SLIDE 34

What did the attacker learn?

5 6 16 17 31

Tag Index Offset Address

  • the victim accessed a particular cache line
  • i.e., every bit of the address except the lower 6
  • with almost no false positives

11

slide-35
SLIDE 35

What did the attacker learn?

5 6 16 17 31

Tag Index Offset Address

  • the victim accessed a particular cache line
  • i.e., every bit of the address except the lower 6
  • with almost no false positives

11

slide-36
SLIDE 36

Flush+Reload: Applications

  • cross-VM side channel attacks on crypto algorithms
  • RSA: 96.7% of secret key bits in a single signature
  • AES: full key recovery in 30000 dec. (a few seconds)
  • Cache Template Attacks: automatically finds information leakage

side channel on keystrokes and AES T-tables implementation

  • Y. Yarom and K. Falkner. “Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel Attack”. In: USENIX Security Symposium. 2014
  • B. Gülmezoglu, M. S. Inci, T. Eisenbarth, and B. Sunar. “A Faster and More Realistic Flush+Reload Attack on AES”. In: COSADE’15. 2015
  • D. Gruss, R. Spreitzer, and S. Mangard. “Cache Template Attacks: Automating Attacks on Inclusive Last-Level Caches”. In: USENIX Security
  • Symposium. 2015

https://github.com/IAIK/cache_template_attacks

12

slide-37
SLIDE 37

Flush+Reload: Applications

  • cross-VM side channel attacks on crypto algorithms
  • RSA: 96.7% of secret key bits in a single signature
  • AES: full key recovery in 30000 dec. (a few seconds)
  • Cache Template Attacks: automatically finds information leakage

→ side channel on keystrokes and AES T-tables implementation

  • Y. Yarom and K. Falkner. “Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel Attack”. In: USENIX Security Symposium. 2014
  • B. Gülmezoglu, M. S. Inci, T. Eisenbarth, and B. Sunar. “A Faster and More Realistic Flush+Reload Attack on AES”. In: COSADE’15. 2015
  • D. Gruss, R. Spreitzer, and S. Mangard. “Cache Template Attacks: Automating Attacks on Inclusive Last-Level Caches”. In: USENIX Security
  • Symposium. 2015

https://github.com/IAIK/cache_template_attacks

12

slide-38
SLIDE 38

What if there is no shared memory?

slide-39
SLIDE 39

Inclusive property

L1 L2 LLC core 0 core 1

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-40
SLIDE 40

Inclusive property

L1 L2 LLC core 0 core 1

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-41
SLIDE 41

Inclusive property

L1 L2 LLC core 0 core 1

inclusion

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-42
SLIDE 42

Inclusive property

L1 L2 LLC core 0 core 1

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-43
SLIDE 43

Inclusive property

L1 L2 LLC core 0 core 1

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-44
SLIDE 44

Inclusive property

L1 L2 LLC core 0 core 1

eviction

  • inclusive LLC: superset of L1 and L2
  • data evicted from the LLC is also

evicted from L1 and L2

  • a core can evict lines in the private L1
  • f another core

14

slide-45
SLIDE 45

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

15

slide-46
SLIDE 46

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

Step 1: Attacker primes, i.e., fills, the cache (no shared memory)

15

slide-47
SLIDE 47

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

Step 1: Attacker primes, i.e., fills, the cache (no shared memory) Step 2: Victim evicts cache lines while running

loads data

15

slide-48
SLIDE 48

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

Step 1: Attacker primes, i.e., fills, the cache (no shared memory) Step 2: Victim evicts cache lines while running

loads data

15

slide-49
SLIDE 49

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

Step 1: Attacker primes, i.e., fills, the cache (no shared memory) Step 2: Victim evicts cache lines while running Step 3: Attacker probes data to determine if set has been accessed

f a s t a c c e s s

15

slide-50
SLIDE 50

Cache attacks: Prime+Probe

Victim address space Cache Attacker address space

Step 1: Attacker primes, i.e., fills, the cache (no shared memory) Step 2: Victim evicts cache lines while running Step 3: Attacker probes data to determine if set has been accessed

s l

  • w

a c c e s s

15

slide-51
SLIDE 51

What did the attacker learn?

5 6 16 17 31

Tag Index Offset Address

  • a program accessed cache lines mapping to the same cache set
  • i.e., the index bits,

11 bits in modern last-level caches

  • with false positives

16

slide-52
SLIDE 52

What did the attacker learn?

5 6 16 17 31

Tag Index Offset Address

  • a program accessed cache lines mapping to the same cache set
  • i.e., the index bits, ≈ 11 bits in modern last-level caches
  • with false positives

16

slide-53
SLIDE 53

Prime+Probe: Applications

  • cross-VM side channel attacks on crypto algorithms:
  • El Gamal (sliding window): full key recovery in 12 min.
  • tracking user behavior in the browser, in JavaScript
  • covert channels between virtual machines in the cloud
  • F. Liu, Y. Yarom, Q. Ge, G. Heiser, and R. B. Lee. “Last-Level Cache Side-Channel Attacks are Practical”. In: S&P’15. 2015.
  • Y. Oren, V. P. Kemerlis, S. Sethumadhavan, and A. D. Keromytis. “The Spy in the Sandbox: Practical Cache Attacks in JavaScript and their Implications”.

In: CCS’15. 2015.

  • C. Maurice, M. Weber, M. Schwarz, L. Giner, D. Gruss, C. A. Boano, S. Mangard, and K. Römer. “Hello from the Other Side: SSH over Robust Cache Covert

Channels in the Cloud”. In: NDSS’17. 2017.

17

slide-54
SLIDE 54

Is that it?

slide-55
SLIDE 55

Last-level cache addressing

slice 0 slice 1 slice 2 slice 3 H 2

  • ffset

set tag physical address 30

6 17 35

11 line 19

slide-56
SLIDE 56

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-57
SLIDE 57

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-58
SLIDE 58

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-59
SLIDE 59

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-60
SLIDE 60

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-61
SLIDE 61

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-62
SLIDE 62

Prime+Probe technical issues

  • no need for e.g., memory deduplication → more practical
  • but requires:
  • 1. eviction sets, i.e., addresses in the same cache set, in the same slice
  • 2. actually evicting addresses, i.e., accessing addresses with some strategy
  • issues:
  • 1. the last-level cache addressing function is undocumented
  • 2. the replacement policy is (mostly) undocumented

20

slide-63
SLIDE 63

Reverse-engineering last-level cache addressing

We reverse-engineered this function! Intuition

  • 1. find some way to map one address to one slice
  • 2. repeat for every address with a 64B stride
  • 3. infer a function out of it

21

slide-64
SLIDE 64

Mapping addresses to slices with performance counters

  • event UNC_CBO_CACHE_LOOKUP counts accesses to a slice

slice 0 slice 1 slice 2 slice 3 CBo 0 CBo 1 CBo 2 CBo 3 H address

UNC_CBO_CACHE_LOOKUP

22

slide-65
SLIDE 65

Mapping addresses to slices with performance counters

  • event UNC_CBO_CACHE_LOOKUP counts accesses to a slice

slice 0 slice 1 slice 2 slice 3 CBo 0 CBo 1 CBo 2 CBo 3 H

UNC_CBO_CACHE_LOOKUP

0x3a0071010

1

CBo 0 slice 0

22

slide-66
SLIDE 66

Mapping addresses to slices with performance counters

  • event UNC_CBO_CACHE_LOOKUP counts accesses to a slice

slice 0 slice 1 slice 2 slice 3 CBo 0 CBo 1 CBo 2 CBo 3 H

UNC_CBO_CACHE_LOOKUP

0x3a0071090

1 1

CBo 2 slice 2

22

slide-67
SLIDE 67

Mapping addresses to slices with performance counters

  • event UNC_CBO_CACHE_LOOKUP counts accesses to a slice

slice 0 slice 1 slice 2 slice 3 CBo 0 CBo 1 CBo 2 CBo 3 H

UNC_CBO_CACHE_LOOKUP

0x3a00710d0

1 1 1

CBo 3 slice 3

22

slide-68
SLIDE 68

Last-level cache linear functions

3 functions, depending on the number of cores

Address bit 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 9 8 7 6 2 cores o0 ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ 4 cores o0 ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕

  • 1

⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ 8 cores

⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕

  • 1

⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕

  • 2

⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕ ⊕

  • valid for Sandy Bridge, Ivy Bridge, Haswell, Broadwell, whether Core or Xeon
  • different for 6, 10, 12… cores → non-linear
  • different for Skylake

23

slide-69
SLIDE 69

Lessons learned from cache side-channel attacks

  • undocumented hardware can be a problem,

but not for long :)

  • removing clflush does not address the root causes of vulnerabilities
  • fixing crypto is (relatively) easy, but mitigating all cache attacks is hard

24

slide-70
SLIDE 70

Lessons learned from cache side-channel attacks

  • undocumented hardware can be a problem, but not for long :)
  • removing clflush does not address the root causes of vulnerabilities
  • fixing crypto is (relatively) easy, but mitigating all cache attacks is hard

24

slide-71
SLIDE 71

Lessons learned from cache side-channel attacks

  • undocumented hardware can be a problem, but not for long :)
  • removing clflush does not address the root causes of vulnerabilities
  • fixing crypto is (relatively) easy, but mitigating all cache attacks is hard

24

slide-72
SLIDE 72

Lessons learned from cache side-channel attacks

  • undocumented hardware can be a problem, but not for long :)
  • removing clflush does not address the root causes of vulnerabilities
  • fixing crypto is (relatively) easy, but mitigating all cache attacks is hard

24

slide-73
SLIDE 73

How do we make fault attacks out of that?

slide-74
SLIDE 74

DRAM fault attacks

  • we’re now exploring fault attacks on DRAM
  • attack entirely in software, again no physical access

how can we flip bits without accessing them?

  • we’ll conduct attacks on the cache to create the right conditions
  • (but we’re not flipping bits on the cache)

26

slide-75
SLIDE 75

DRAM fault attacks

  • we’re now exploring fault attacks on DRAM
  • attack entirely in software, again no physical access

how can we flip bits without accessing them?

  • we’ll conduct attacks on the cache to create the right conditions
  • (but we’re not flipping bits on the cache)

26

slide-76
SLIDE 76

DRAM fault attacks

  • we’re now exploring fault attacks on DRAM
  • attack entirely in software, again no physical access

→ how can we flip bits without accessing them?

  • we’ll conduct attacks on the cache to create the right conditions
  • (but we’re not flipping bits on the cache)

26

slide-77
SLIDE 77

DRAM fault attacks

  • we’re now exploring fault attacks on DRAM
  • attack entirely in software, again no physical access

→ how can we flip bits without accessing them?

  • we’ll conduct attacks on the cache to create the right conditions
  • (but we’re not flipping bits on the cache)

26

slide-78
SLIDE 78

DRAM fault attacks

  • we’re now exploring fault attacks on DRAM
  • attack entirely in software, again no physical access

→ how can we flip bits without accessing them?

  • we’ll conduct attacks on the cache to create the right conditions
  • (but we’re not flipping bits on the cache)

26

slide-79
SLIDE 79

Background: DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0 chip

27

slide-80
SLIDE 80

Background: DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0 chip

27

slide-81
SLIDE 81

Background: DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0 chip

27

slide-82
SLIDE 82

Background: DRAM organization

channel 0 channel 1 back of DIMM: rank 1 front of DIMM: rank 0 chip

27

slide-83
SLIDE 83

Background: DRAM organization

chip

bank 0 row 0 row 1 row 2 … row 32767 row buffer

  • bits in cells in rows
  • access: activate row,

copy to row buffer

28

slide-84
SLIDE 84

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer

29

slide-85
SLIDE 85

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer activate row buffer copy

29

slide-86
SLIDE 86

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer activate row buffer copy

29

slide-87
SLIDE 87

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer activate row buffer copy

29

slide-88
SLIDE 88

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer activate row buffer copy

29

slide-89
SLIDE 89

Software-Based Fault Attack: Rowhammer

Rowhammer (Kim et al., 2014) “It’s like breaking into an apartment by repeatedly slamming a neighbor’s door until the vibrations open the door you were after” – Motherboard Vice

DRAM bank

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … 1 1 1 1 1 1 1 1 1 1 1 1 1 1 row buffer row buffer 1 0 1 1 1 1 1 0 1 0 1 1 1 1 bit flips in row 2!

29

slide-90
SLIDE 90

Impact of the CPU cache

CPU core CPU cache DRAM

  • only non-cached accesses reach DRAM
  • original attacks use clflush instruction

→ flush line from cache → next access will be served from DRAM

30

slide-91
SLIDE 91

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

31

slide-92
SLIDE 92

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

31

slide-93
SLIDE 93

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

31

slide-94
SLIDE 94

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

31

slide-95
SLIDE 95

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d

31

slide-96
SLIDE 96

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d r e l

  • a

d r e l

  • a

d

31

slide-97
SLIDE 97

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

31

slide-98
SLIDE 98

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

31

slide-99
SLIDE 99

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

31

slide-100
SLIDE 100

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

31

slide-101
SLIDE 101

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

31

slide-102
SLIDE 102

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

31

slide-103
SLIDE 103

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

clflush clflush

wait for it…

31

slide-104
SLIDE 104

Rowhammer (with clflush)

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

bit flip!

31

slide-105
SLIDE 105

Flush, reload, flush, reload…

  • the core of Rowhammer is essentially a Flush+Reload loop
  • as much an attack on DRAM as on cache

32

slide-106
SLIDE 106

Rowhammer without clflush?

  • idea: avoid clflush to be independent of specific instructions

→ no clflush in JavaScript

  • our approach: use regular memory accesses for eviction

techniques from cache attacks! Rowhammer, Prime+Probe style!

33

slide-107
SLIDE 107

Rowhammer without clflush?

  • idea: avoid clflush to be independent of specific instructions

→ no clflush in JavaScript

  • our approach: use regular memory accesses for eviction

→ techniques from cache attacks! Rowhammer, Prime+Probe style!

33

slide-108
SLIDE 108

Rowhammer without clflush?

  • idea: avoid clflush to be independent of specific instructions

→ no clflush in JavaScript

  • our approach: use regular memory accesses for eviction

→ techniques from cache attacks! → Rowhammer, Prime+Probe style!

33

slide-109
SLIDE 109

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

34

slide-110
SLIDE 110

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-111
SLIDE 111

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-112
SLIDE 112

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-113
SLIDE 113

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-114
SLIDE 114

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-115
SLIDE 115

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-116
SLIDE 116

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-117
SLIDE 117

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

load load

34

slide-118
SLIDE 118

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

34

slide-119
SLIDE 119

Rowhammer without clflush

DRAM bank cache set 2 cache set 1 repeat!

34

slide-120
SLIDE 120

Rowhammer without clflush

DRAM bank cache set 2 cache set 1

r e l

  • a

d r e l

  • a

d

wait for it…

34

slide-121
SLIDE 121

Rowhammer without clflush

DRAM bank cache set 2 cache set 1 bit flip!

34

slide-122
SLIDE 122

Requirements for Rowhammer

  • 1. uncached memory accesses: need to reach DRAM
  • 2. fast memory accesses: race against the next row refresh
  • ptimize the eviction rate and the timing

35

slide-123
SLIDE 123

Requirements for Rowhammer

  • 1. uncached memory accesses: need to reach DRAM
  • 2. fast memory accesses: race against the next row refresh

→ optimize the eviction rate and the timing

35

slide-124
SLIDE 124

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not (and it’s undocumented)
  • either we do not evict with high enough probability, or we are too slow

no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-125
SLIDE 125

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not

(and it’s undocumented)

  • either we do not evict with high enough probability, or we are too slow

no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-126
SLIDE 126

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not (and it’s undocumented)
  • either we do not evict with high enough probability, or we are too slow

no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-127
SLIDE 127

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not (and it’s undocumented)
  • either we do not evict with high enough probability, or we are too slow

no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-128
SLIDE 128

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not (and it’s undocumented)
  • either we do not evict with high enough probability, or we are too slow

→ no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-129
SLIDE 129

Meanwhile, in reality…

  • existing eviction strategies consider that the replacement policy is LRU
  • it’s not (and it’s undocumented)
  • either we do not evict with high enough probability, or we are too slow

→ no bit flip Poking around, we learned two things:

  • 1. adding more unique addresses can increase eviction rate
  • 2. multiple accesses to one address can increase the eviction rate

36

slide-130
SLIDE 130

Cache eviction strategies: The beginning

Address

a1 a2 a3 a4 a5 a6 a7 a8 a9

Time → fast and effective on Haswell: eviction rate >99.97%

37

slide-131
SLIDE 131

Cache eviction strategy: New representation

  • represent accesses as a sequence of numbers: 1,2,1,2,2,3,2,3,3,4,3,4,...
  • can be a long sequence
  • all congruent addresses are indistinguishable w.r.t eviction strategy

→ adding more unique addresses can increase eviction rate → multiple accesses to one address can increase the eviction rate

38

slide-132
SLIDE 132

Cache eviction strategy: Notation (1)

Write eviction strategies as: P-C-D-L-S for (s = 0; s <= S - D ; s += L ) for (c = 0; c <= C ; c += 1) for (d = 0; d <= D ; d += 1) *a[s+d];

39

slide-133
SLIDE 133

Cache eviction strategy: Notation (1)

Write eviction strategies as: P-C-D-L-S for (s = 0; s <= S - D ; s += L ) for (c = 0; c <= C ; c += 1) for (d = 0; d <= D ; d += 1) *a[s+d];

S: total number of different addresses (= set size)

39

slide-134
SLIDE 134

Cache eviction strategy: Notation (1)

Write eviction strategies as: P-C-D-L-S for (s = 0; s <= S - D ; s += L ) for (c = 0; c <= C ; c += 1) for (d = 0; d <= D ; d += 1) *a[s+d];

S: total number of different addresses (= set size) D: different addresses per inner access loop

39

slide-135
SLIDE 135

Cache eviction strategy: Notation (1)

Write eviction strategies as: P-C-D-L-S for (s = 0; s <= S - D ; s += L ) for (c = 0; c <= C ; c += 1) for (d = 0; d <= D ; d += 1) *a[s+d];

S: total number of different addresses (= set size) D: different addresses per inner access loop L: step size of the inner access loop

39

slide-136
SLIDE 136

Cache eviction strategy: Notation (1)

Write eviction strategies as: P-C-D-L-S for (s = 0; s <= S - D ; s += L ) for (c = 0; c <= C ; c += 1) for (d = 0; d <= D ; d += 1) *a[s+d];

S: total number of different addresses (= set size) D: different addresses per inner access loop L: step size of the inner access loop C: number of repetitions of the inner access loop

39

slide-137
SLIDE 137

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • 2 2 1 4

1 2 1 2 2 3 2 3 3 4 3 4

  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

40

slide-138
SLIDE 138

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

40

slide-139
SLIDE 139

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

S = 4

40

slide-140
SLIDE 140

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

S = 4

40

slide-141
SLIDE 141

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

S = 4 D = 2

40

slide-142
SLIDE 142

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

C = 2 S = 4 D = 2

40

slide-143
SLIDE 143

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • 1 1 1 4

1 2 3 4 LRU eviction with set size 4

C = 2 L = 1 S = 4 D = 2

40

slide-144
SLIDE 144

Cache eviction strategy: Notation (2)

for (s = 0; s <= S - D ; s += L ) for (c = 1; c <= C ; c += 1) for (d = 1; d <= D ; d += 1) *a[s+d];

  • P- 2 - 2 - 1 - 4 → 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4
  • P-1-1-1-4 → 1,2,3,4 → LRU eviction with set size 4

C = 2 L = 1 S = 4 D = 2

40

slide-145
SLIDE 145

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 P-1-1-1-20 20

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-146
SLIDE 146

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ P-1-1-1-20 20 99.82% ✓

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-147
SLIDE 147

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-148
SLIDE 148

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-149
SLIDE 149

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34 99.86% ✓

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-150
SLIDE 150

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34 99.86% ✓ 191 ns ✓

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-151
SLIDE 151

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34 99.86% ✓ 191 ns ✓ P-2-2-1-17 64

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-152
SLIDE 152

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34 99.86% ✓ 191 ns ✓ P-2-2-1-17 64 99.98% ✓

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-153
SLIDE 153

Better eviction strategies

We evaluated more than 10000 strategies... strategy # accesses eviction rate loop time P-1-1-1-17 17 74.46% ✗ 307 ns ✓ P-1-1-1-20 20 99.82% ✓ 934 ns ✗ P-2-1-1-17 34 99.86% ✓ 191 ns ✓ P-2-2-1-17 64 99.98% ✓ 180 ns ✓

Executed in a loop, on a Haswell with a 16-way last-level cache

41

slide-154
SLIDE 154

Evaluation on Haswell

Number of bit flips within 15 minutes

5 10 15 20 25 30 35 40 45 50 55 60 65 70 100 102 104 106 Refresh interval in µs (BIOS configuration) Bit flips

clflush Evict (Native) Evict (JavaScript)

First remote software-induced fault attack from a browser, in JavaScript!

42

slide-155
SLIDE 155

Evaluation on Haswell

Number of bit flips within 15 minutes

5 10 15 20 25 30 35 40 45 50 55 60 65 70 100 102 104 106 Refresh interval in µs (BIOS configuration) Bit flips

clflush Evict (Native) Evict (JavaScript)

First remote software-induced fault attack from a browser, in JavaScript!

42

slide-156
SLIDE 156

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet

we can’t exploit that exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-157
SLIDE 157

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet

we can’t exploit that exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-158
SLIDE 158

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush → removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet

we can’t exploit that exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-159
SLIDE 159

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush → removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet

we can’t exploit that exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-160
SLIDE 160

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush → removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet ̸= we can’t exploit that

exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-161
SLIDE 161

Lessons learned from Rowhammer.js

  • DRAM vulnerable to the native attack ̸= vulnerable to the JavaScript version
  • most DRAM modules vulnerable to the native attack are also without

clflush → removing clflush is not a countermeasure What we should have learned from Rowhammer but apparently didn’t

  • nobody managed to exploit that yet ̸= we can’t exploit that

→ exploit by Bosman et al. after we released the code for Rowhammer.js

  • E. Bosman, K. Razavi, H. Bos, and C. Giuffrida. “Dedup Est Machina: Memory Deduplication as an Advanced Exploitation Vector”. In: S&P’16. 2016.

43

slide-162
SLIDE 162

Conclusions

  • lessons from side-channel attacks useful to investigate fault attacks
  • micro-architectural attacks are hard to mitigate
  • probably more software-based fault attacks to come

44

slide-163
SLIDE 163

Shameless advertisement

I am hiring a postdoc!

45

slide-164
SLIDE 164

Cache attacks: From side channels to fault attacks

Clémentine Maurice – CNRS, Rennes, France November 16, 2017 – Cryptacus Workshop, Nijmegen, Netherlands