Spectre Attacks: Exploiting Speculative Execution

Slides:



Advertisements
Similar presentations
Runahead Execution: An Alternative to Very Large Instruction Windows for Out-of-order Processors Onur Mutlu, The University of Texas at Austin Jared Start,
Advertisements

1 Adapted from UCB CS252 S01, Revised by Zhao Zhang in IASTATE CPRE 585, 2004 Lecture 14: Hardware Approaches for Cache Optimizations Cache performance.
1 Advanced Computer Architecture Limits to ILP Lecture 3.
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Practical Timing Side Channel Attacks Against Kernel Space ASLR
Chapter 12 Pipelining Strategies Performance Hazards.
Chapter 12 CPU Structure and Function. Example Register Organizations.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
Pipelining. Overview Pipelining is widely used in modern processors. Pipelining improves system performance in terms of throughput. Pipelined organization.
Branch Regulation: Low-Overhead Protection from Code Reuse Attacks.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
1 Vulnerabilities on high-end processors André Seznec IRISA/INRIA CAPS project-team.
Precomputation- based Prefetching By James Schatz and Bashar Gharaibeh.
Processes and Virtual Memory
Chapter 5 Memory III CSE 820. Michigan State University Computer Science and Engineering Miss Rate Reduction (cont’d)
Information Leaks Without Memory Disclosures: Remote Side Channel Attacks on Diversified Code Jeff Seibert, Hamed Okhravi, and Eric Söderström Presented.
1 CPRE 585 Term Review Performance evaluation, ISA design, dynamically scheduled pipeline, and memory hierarchy.
Superscalar - summary Superscalar machines have multiple functional units (FUs) eg 2 x integer ALU, 1 x FPU, 1 x branch, 1 x load/store Requires complex.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
COMPSYS 304 Computer Architecture Speculation & Branching Morning visitors - Paradise Bay, Bay of Islands.
1 Adapted from UC Berkeley CS252 S01 Lecture 17: Reducing Cache Miss Penalty and Reducing Cache Hit Time Hardware prefetching and stream buffer, software.
Value Prediction Kyaw Kyaw, Min Pan Final Project.
Thwarting cache-based side- channel attacks Yuval Yarom The University of Adelaide and Data61.
Covert Channels Through Branch Predictors: a Feasibility Study
Introduction to Information Security
Translation Lookaside Buffer
Mitigation against Buffer Overflow Attacks
Remix: On-demand Live Randomization
X. Zhang, Y. Xiao, Y. Zhang Return-Oriented Flush-Reload Side Channels on ARM and Their Implications for Android Devices Xiaokuan Zhang, Yuan Xiao, Yinqian.
Introduction to Operating Systems
Data Prefetching Smruti R. Sarangi.
X. Zhang, Y. Xiao, Y. Zhang Return-Oriented Flush-Reload Side Channels on ARM and Their Implications for Android Devices Xiaokuan Zhang, Yuan Xiao, Yinqian.
EnGarde: Mutually Trusted Inspection of SGX Enclaves
Multiscalar Processors
CSC 4250 Computer Architectures
Written by : Thomas Ristenpart, Eran Tromer, Hovav Shacham,
The University of Adelaide, School of Computer Science
Jump Over ASLR: Attacking Branch Predictors to Bypass ASLR
5.2 Eleven Advanced Optimizations of Cache Performance
Architecture Background
RIC: Relaxed Inclusion Caches for Mitigating LLC Side-Channel Attacks
Bruhadeshwar Meltdown Bruhadeshwar
Lecture 23: Cache, Memory, Security
Cache memory Direct Cache Memory Associate Cache Memory
Continuous, Low Overhead, Run-Time Validation of Program Executions
Professor, No school name
Introduction to Operating Systems
Lecture 14: Reducing Cache Misses
Hardware Multithreading
Meltdown and Spectre: Complexity and the death of security
Diptendu Kar
Meltdown CSE 351 Winter 2018 Instructor: Mark Wyse
Fundamentals of Computer Organisation & Architecture
Lecture 24: Memory, VM, Multiproc
Translation Lookaside Buffer
CSE 351: The Hardware/Software Interface
Mengjia Yan† , Jiho Choi† , Dimitrios Skarlatos,
Data Prefetching Smruti R. Sarangi.
Meltdown and Spectre: Complexity and the death of security
15-740/ Computer Architecture Lecture 14: Prefetching
CSE451 Virtual Memory Paging Autumn 2002
ECE 463/563, Microprocessor Architecture, Prof. Eric Rotenberg
System Calls System calls are the user API to the OS
CS703 - Advanced Operating Systems
CS252 S05 EECS 262a Advanced Topics in Computer Systems Lecture 26 Meltdown/Spectre November 29th, 2018 John Kubiatowicz Electrical Engineering and Computer.
Landon Cox January 17, 2018 January 22, 2018
MicroScope: Enabling Microarchitectural Replay Attacks
Computer Architecture and System Programming Laboratory
Spring 2019 Prof. Eric Rotenberg
Meltdown & Spectre Attacks
Presentation transcript:

Spectre Attacks: Exploiting Speculative Execution Paul Kocher [1] , Daniel Genkin [2] , Daniel Gruss [3] , Werner Haas [4] , Mike Hamburg [5] , Moritz Lipp [3] , Stefan Mangard [3] , Thomas Prescher [4] , Michael Schwarz [3] , Yuval Yarom [6] 1 Independent 2 University of Pennsylvania and University of Maryland 3 Graz University of Technology 4 Cyberus Technology 5 Rambus, Cryptography Research Division 6 University of Adelaide and Data61 1

Outline Attack description Background Spectre attack Spectre variations Mitigation options Strengths Weaknesses Discussion 2

Attack description 3

Attack description 4

Attack description Spectre exploit gives the attacker the ability to read out the memory of a bug-free victim process 5

Attack description Spectre exploit gives the attacker the ability to read out the memory of a bug-free victim process Works on Intel, AMD and ARM 6

Attack description Spectre exploit gives the attacker the ability to read out the memory of a bug-free victim process Works on Intel, AMD and ARM How? 7

Background 8

Background: Virtual Memory https://svn.inf.ethz.ch/svn/systems/SPCA2017/trunk/lectures/18-VirtualMemory-upload.pdf 9

Background: Virtual Memory https://svn.inf.ethz.ch/svn/systems/SPCA2017/trunk/lectures/18-VirtualMemory-upload.pdf 10

Background: Virtual Memory https://svn.inf.ethz.ch/svn/systems/SPCA2017/trunk/lectures/18-VirtualMemory-upload.pdf 11

Background: Covert channel 12

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way 13

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way Example of state that can be used: 14

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way Example of state that can be used: Cache timing 15

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way Example of state that can be used: Cache timing Instruction timing 16

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way Example of state that can be used: Cache timing Instruction timing ALU contention 17

Background: Covert channel When two processes cooperate to communicate, not by architecturally defined means but by changing the microarchitectural state in a suitable way Example of state that can be used: Cache timing Instruction timing ALU contention Memory contention 18

Background: Cache CPU Cache Memory 19

Background: Cache CPU Cache Memory 20

Background: Cache Cache miss (slow) CPU Cache Memory 21

Background: Cache Cache miss (slow) CPU Cache Memory 22

Background: Cache Cache miss (slow) Request CPU Cache Memory 23

Background: Cache Cache miss (slow) Request CPU Cache Memory 24

Background: Cache CPU Cache Memory Request Response Cache miss (slow) 25

Background: Cache CPU Cache Memory Request Response Cache miss (slow) 26

Background: Cache CPU Cache Memory Request Response Cache miss (slow) Cache hit (fast) Memory Response 27

Background: Covert channel 28

Background: Covert channel Example: cache timing as covert channel 29

Background: Covert channel Example: cache timing as covert channel Sender process has a value it wants to transmit to the receiver process 30

Background: Covert channel Example: cache timing as covert channel Sender process has a value it wants to transmit to the receiver process Sender changes the cache (loading, evicting) in a value-dependent way 31

Background: Covert channel Example: cache timing as covert channel Sender process has a value it wants to transmit to the receiver process Sender changes the cache (loading, evicting) in a value-dependent way Receiver can’t see the value in the cache directly but can time the cache and thus infer the value 32

Background: Speculative Execution 33

Background: Speculative Execution Predicting/Speculating for example: 34

Background: Speculative Execution Predicting/Speculating for example: Prefetcher (what will be needed in the future) 35

Background: Speculative Execution Predicting/Speculating for example: Prefetcher (what will be needed in the future) Branch Predictor (Speculate if direct branch taken or not) 36

Background: Speculative Execution Predicting/Speculating for example: Prefetcher (what will be needed in the future) Branch Predictor (Speculate if direct branch taken or not) Branch Target Buffer/BTB (Speculate what a value will be) 37

Background: Speculative Execution Predicting/Speculating for example: Prefetcher (what will be needed in the future) Branch Predictor (Speculate if direct branch taken or not) Branch Target Buffer/BTB (Speculate what a value will be) Leads to improved Instruction Level Parallelism 38

Background: Speculative Execution Predicting/Speculating for example: Prefetcher (what will be needed in the future) Branch Predictor (Speculate if direct branch taken or not) Branch Target Buffer/BTB (Speculate what a value will be) Leads to improved Instruction Level Parallelism Otherwise CPU would have to sit idle while waiting for results 39

Background: Speculative Execution Branch predictor if (slow condition){ //do something } else { } Branch predictor 40

Background: Speculative Execution Branch predictor if (slow condition){ //do something } else { } Branch predictor 41

Background: Speculative Execution Branch predictor Start evaluating condition if (slow condition){ //do something } else { } Branch predictor 42

Background: Speculative Execution Branch predictor Start evaluating condition if (slow condition){ //do something } else { } Ask branch predictor Branch predictor 43

Background: Speculative Execution Branch predictor Start evaluating condition if (slow condition){ //do something } else { } Ask branch predictor Taken Branch predictor 44

Background: Speculative Execution Branch predictor if (slow condition){ //do something } else { } Branch predictor 45

Background: Speculative Execution 46

Background: Speculative Execution Up to 200 instruction ahead 47

Background: Speculative Execution Up to 200 instruction ahead Revert the result of incorrect execution 48

Background: Speculative Execution Up to 200 instruction ahead Revert the result of incorrect execution => No correctness issues? 49

Background: Speculative Execution Up to 200 instruction ahead Revert the result of incorrect execution => No correctness issues? But speculative execution has measurable side effects 50

Spectre Attacks 51

Spectre Attacks 52

Spectre Attacks Locate sequence of instructions which act as covert channel transmitter 53

Spectre Attacks Locate sequence of instructions which act as covert channel transmitter Setup phase: Mistrain CPU into speculatively executing these instructions 54

Spectre Attacks 55

Spectre Attacks Second phase: speculatively execute instruction that leak information 56

Spectre Attacks Second phase: speculatively execute instruction that leak information Via syscall/socket/file 57

Spectre Attacks Second phase: speculatively execute instruction that leak information Via syscall/socket/file Misexecute own code (e.g. sandbox, interpreter, JIT) 58

Spectre Attacks 59

Spectre Attacks Final phase: Recover data by retrieving over covert channel 60

Spectre Attacks Final phase: Recover data by retrieving over covert channel Cache 61

Spectre Attacks Final phase: Recover data by retrieving over covert channel Cache Execution time 62

Spectre Attacks Final phase: Recover data by retrieving over covert channel Cache Execution time ALU contention 63

Spectre Attacks Final phase: Recover data by retrieving over covert channel Cache Execution time ALU contention Memory contention 64

Spectre Attacks Final phase: Recover data by retrieving over covert channel Cache Execution time ALU contention Memory contention Other microarchitectural state 65

Spectre Variants 66

Variant 1: Exploiting Conditional Branch Misprediction Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 k 67

Variant 1: Exploiting Conditional Branch Misprediction We want to find out what a certain byte in the virtual address of the victim is Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 k 68

Variant 1: Exploiting Conditional Branch Misprediction We want to find out what a certain byte in the virtual address of the victim is Let’s call this secret byte k Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 k 69

Variant 1: Exploiting Conditional Branch Misprediction 70

Variant 1: Exploiting Conditional Branch Misprediction Locate a conditional which matches this pattern in the software you want to attack 71

Variant 1: Exploiting Conditional Branch Misprediction Locate a conditional which matches this pattern in the software you want to attack Setup phase: 72

Variant 1: Exploiting Conditional Branch Misprediction Locate a conditional which matches this pattern in the software you want to attack Setup phase: call many times with some x < array1_size to mistrain branch predictor 73

Variant 1: Exploiting Conditional Branch Misprediction Locate a conditional which matches this pattern in the software you want to attack Setup phase: call many times with some x < array1_size to mistrain branch predictor Evict array1_size and array2, but leave secret byte k in cache 74

Variant 1: Exploiting Conditional Branch Misprediction 75

Variant 1: Exploiting Conditional Branch Misprediction Second phase: Choose x out-of-bounds such that array1[x] resolves to secret byte 76

Variant 1: Exploiting Conditional Branch Misprediction Victim Attacker Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 77

Variant 1: Exploiting Conditional Branch Misprediction Victim Attacker Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 78

Variant 1: Exploiting Conditional Branch Misprediction Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 79

Variant 1: Exploiting Conditional Branch Misprediction Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 80

Variant 1: Exploiting Conditional Branch Misprediction Cache miss Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 81

Variant 1: Exploiting Conditional Branch Misprediction Cache miss Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 82

Variant 1: Exploiting Conditional Branch Misprediction Cache miss Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 83

Variant 1: Exploiting Conditional Branch Misprediction Cache miss Victim Attacker x = 4 Address Value 000 4 001 13 010 9 011 2 100 12 101 75 110 24 111 87 array1 Tag Value Set 0 Set 1 01 2 k array2 84

Variant 1: Exploiting Conditional Branch Misprediction 85 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Exploiting Conditional Branch Misprediction Final phase: 86 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Exploiting Conditional Branch Misprediction Final phase: If array2 is readable by attacker, load array2[n] for all n, will be fast for n==k 87 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Exploiting Conditional Branch Misprediction Final phase: If array2 is readable by attacker, load array2[n] for all n, will be fast for n==k Otherwise detect eviction 88 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Exploiting Conditional Branch Misprediction Final phase: If array2 is readable by attacker, load array2[n] for all n, will be fast for n==k Otherwise detect eviction Prime & Probe [1] 89 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Exploiting Conditional Branch Misprediction Final phase: If array2 is readable by attacker, load array2[n] for all n, will be fast for n==k Otherwise detect eviction Prime & Probe [1] Call method again with in bounds value of x, if array1[x’] == k, will be fast 90 [1] OSVIK, D. A., SHAMIR, A.,ANDTROMER, E. Cache attacks and countermeasures: The case of AES

Variant 1: Implementations 91

Variant 1: Implementations In C: 92

Variant 1: Implementations In C: Wrote a victim function which has the pattern 93

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function 94

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function Were able to read out address space at 10 kB/second 95

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function Were able to read out address space at 10 kB/second In JS: 96

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function Were able to read out address space at 10 kB/second In JS: JS gets JITed and bounds checks inserted 97

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function Were able to read out address space at 10 kB/second In JS: JS gets JITed and bounds checks inserted Works even though no high res. timer available 98

Variant 1: Implementations In C: Wrote a victim function which has the pattern Attacker function Were able to read out address space at 10 kB/second In JS: JS gets JITed and bounds checks inserted Works even though no high res. timer available Able to read out browser’s address space 99

Variant 2: Poisoning Indirect Branches 100

Variant 2: Poisoning Indirect Branches Locate gadgets whose execution will leak the chosen memory in the process you want to attack (either source code or in shared library) 101

Variant 2: Poisoning Indirect Branches Locate gadgets whose execution will leak the chosen memory in the process you want to attack (either source code or in shared library) Example gadget: 102

Variant 2: Poisoning Indirect Branches Locate gadgets whose execution will leak the chosen memory in the process you want to attack (either source code or in shared library) Example gadget: add R2, [R1] 103

Variant 2: Poisoning Indirect Branches Locate gadgets whose execution will leak the chosen memory in the process you want to attack (either source code or in shared library) Example gadget: add R2, [R1] mov R3, [R2] 104

Background: Speculative Execution Branch Target Buffer jmp //slow computation Branch Target Buffer 105

Background: Speculative Execution Branch Target Buffer jmp //slow computation Branch Target Buffer 106

Background: Speculative Execution Branch Target Buffer Start evaluating jmp //slow computation Branch Target Buffer 107

Background: Speculative Execution Branch Target Buffer Start evaluating jmp //slow computation Ask BTB Branch Target Buffer 108

Background: Speculative Execution Branch Target Buffer Start evaluating jmp //slow computation Ask BTB Predicted target address Branch Target Buffer 109

Background: Speculative Execution Branch Target Buffer Start evaluating jmp //slow computation Ask BTB Predicted target address Branch Target Buffer 110

Variant 2: Poisoning Indirect Branches 111

Variant 2: Poisoning Indirect Branches Setup phase: 112

Variant 2: Poisoning Indirect Branches Setup phase: Train branch target buffer in attacker thread to jump to the chosen gadget’s virtual address 113

Variant 2: Poisoning Indirect Branches Setup phase: Train branch target buffer in attacker thread to jump to the chosen gadget’s virtual address This works because the BTB is unaware/doesn’t care about process ids 114

Variant 2: Poisoning Indirect Branches Setup phase: Train branch target buffer in attacker thread to jump to the chosen gadget’s virtual address This works because the BTB is unaware/doesn’t care about process ids Example of indirect branch: 115

Variant 2: Poisoning Indirect Branches Setup phase: Train branch target buffer in attacker thread to jump to the chosen gadget’s virtual address This works because the BTB is unaware/doesn’t care about process ids Example of indirect branch: jmp eax 116

Variant 2: Poisoning Indirect Branches 117

Variant 2: Poisoning Indirect Branches Second phase: 118

Variant 2: Poisoning Indirect Branches Second phase: Victim speculatively jumps to gadget, which then leaks information 119

Variant 2: Poisoning Indirect Branches Second phase: Victim speculatively jumps to gadget, which then leaks information Final phase: Recover over covert channel 120

Variant 2: Implementation in Windows 121

Variant 2: Implementation in Windows Creates random key, calls sleep, reads from file, calls crypto 122

Variant 2: Implementation in Windows Creates random key, calls sleep, reads from file, calls crypto When compiled with optimization,Sleep() gets made with file data in registers ebx and edi 123

Variant 2: Implementation in Windows Creates random key, calls sleep, reads from file, calls crypto When compiled with optimization,Sleep() gets made with file data in registers ebx and edi Found in ntdll.dll 124

Variant 2: Implementation in Windows Creates random key, calls sleep, reads from file, calls crypto When compiled with optimization,Sleep() gets made with file data in registers ebx and edi Found in ntdll.dll adc edi,dword ptr [ebx+edx+13BE13BDh] 125

Variant 2: Implementation in Windows Creates random key, calls sleep, reads from file, calls crypto When compiled with optimization,Sleep() gets made with file data in registers ebx and edi Found in ntdll.dll adc edi,dword ptr [ebx+edx+13BE13BDh] adc dl,byte ptr [edi] 126

Variant 2: Implementation in Windows 127

Variant 2: Implementation in Windows Branch to mistrain found in Sleep() 128

Variant 2: Implementation in Windows Branch to mistrain found in Sleep() “jmp dword ptr ds:[76AE0078h]” 129

Variant 2: Implementation in Windows Branch to mistrain found in Sleep() “jmp dword ptr ds:[76AE0078h]” Speed: 41 B/s 130

Other Methods of achieving speculative execution [1] Spectre Returns! Speculation Attacks using the Return Stack Buffer By Esmaiel Mohammadian Koruyeh, Khaled Khasawneh, Chengyu Song and Nael Abu-Ghazaleh 131

Other Methods of achieving speculative execution Mistraining return instructions [1] [1] Spectre Returns! Speculation Attacks using the Return Stack Buffer By Esmaiel Mohammadian Koruyeh, Khaled Khasawneh, Chengyu Song and Nael Abu-Ghazaleh 132

Other Methods of achieving speculative execution Mistraining return instructions [1] Return from interrupts [1] Spectre Returns! Speculation Attacks using the Return Stack Buffer By Esmaiel Mohammadian Koruyeh, Khaled Khasawneh, Chengyu Song and Nael Abu-Ghazaleh 133

Method of leaking information 134

Method of leaking information Evict+Time 135

Method of leaking information Evict+Time 136

Method of leaking information Evict+Time Instruction Timing 137

Method of leaking information Evict+Time Instruction Timing 138

Method of leaking information Evict+Time Instruction Timing Contention on the Register File 139

Mitigation Options 140 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation 141 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact 142 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact Itanium, Mill architectures not vulnerable 143 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact Itanium, Mill architectures not vulnerable Retpoline [1] 144 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact Itanium, Mill architectures not vulnerable Retpoline [1] swaps indirect branches for returns, to avoid using predictions which come from the BTB 145 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact Itanium, Mill architectures not vulnerable Retpoline [1] swaps indirect branches for returns, to avoid using predictions which come from the BTB Masking, etc. 146 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options Turn off speculation =>very large performance impact Itanium, Mill architectures not vulnerable Retpoline [1] swaps indirect branches for returns, to avoid using predictions which come from the BTB Masking, etc. Addressing Spectre Variant 1 (CVE-2017- 5753) in Software [2] 147 [2] https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations [1] https://support.google.com/faqs/answer/7625886

Mitigation Options [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 148

Mitigation Options Halt speculative execution on potentially sensitive execution paths [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 149

Mitigation Options Halt speculative execution on potentially sensitive execution paths Not enough only on security-critical code because non-security-critical code in same process. [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 150

Mitigation Options Halt speculative execution on potentially sensitive execution paths Not enough only on security-critical code because non-security-critical code in same process. Compiler can’t find automatically [1] [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 151

Mitigation Options Halt speculative execution on potentially sensitive execution paths Not enough only on security-critical code because non-security-critical code in same process. Compiler can’t find automatically [1] Need to recompile (what about legacy software?) [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 152

Mitigation Options Halt speculative execution on potentially sensitive execution paths Not enough only on security-critical code because non-security-critical code in same process. Compiler can’t find automatically [1] Need to recompile (what about legacy software?) Flush branch prediction state on context switch [1] oo7: Low-overhead Defense against Spectre Attacks via Binary Analysis Guanhua Wang, Sudipta Chattopadhyay, Ivan Gotovchits, Tulika Mitra, Abhik Roychoudhury 153

Mitigation Options 154

Mitigation Options Countermeasures limited to cache likely insufficient 155

Mitigation Options Countermeasures limited to cache likely insufficient => different microarchitectural state can be used to leak information 156

Novelty 157

Novelty 158

Novelty First to exploit speculative execution 159

Novelty First to exploit speculative execution Developers now need to know about microarchitecture to code non-vulnerable software! 160

Strengths 161

Strengths of the Paper 162

Strengths of the Paper Hits at fundamentals of modern CPU 163

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations 164

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected 165

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected Can be used by JS 166

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected Can be used by JS And even remotely: 167

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected Can be used by JS And even remotely: NetSpectre: Read Arbitrary Memory over Network by Michael Schwarz, Martin Schwarzl, Moritz Lipp, Daniel Gruss 168

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected Can be used by JS And even remotely: NetSpectre: Read Arbitrary Memory over Network by Michael Schwarz, Martin Schwarzl, Moritz Lipp, Daniel Gruss Very well written paper 169

Strengths of the Paper Hits at fundamentals of modern CPU No good mitigations Non-buggy software affected Can be used by JS And even remotely: NetSpectre: Read Arbitrary Memory over Network by Michael Schwarz, Martin Schwarzl, Moritz Lipp, Daniel Gruss Very well written paper Gives a refresher on virtual memory, caches, CPU architecture 170

Weaknesses 171

Weaknesses/Limitations of the Paper 172

Weaknesses/Limitations of the Paper Have to target specific application and find gadgets in those 173

Weaknesses/Limitations of the Paper Have to target specific application and find gadgets in those => But one can search in shared libraries 174

Weaknesses/Limitations of the Paper Have to target specific application and find gadgets in those => But one can search in shared libraries Doesn’t tell us the speed of the Javascript implementation 175

Related papers 176

Related papers MeltdownPrime and SpectrePrime: Automatically-Synthesized Attacks Exploiting Invalidation-Based Coherence Protocols by Caroline Trippel, Daniel Lustig, Margaret Martonosi 177

Related papers MeltdownPrime and SpectrePrime: Automatically-Synthesized Attacks Exploiting Invalidation-Based Coherence Protocols by Caroline Trippel, Daniel Lustig, Margaret Martonosi Trusted Browsers for Uncertain Times by David Kohlbrenner and Hovav Shacham 178

Related papers MeltdownPrime and SpectrePrime: Automatically-Synthesized Attacks Exploiting Invalidation-Based Coherence Protocols by Caroline Trippel, Daniel Lustig, Margaret Martonosi Trusted Browsers for Uncertain Times by David Kohlbrenner and Hovav Shacham Foreshadow: Extracting the Keys to the {Intel SGX} Kingdom with Transient Out-of-Order Execution by Van Bulck, Jo and Minkin, Marina and Weisse, Ofir and Genkin, Daniel and Kasikci, Baris and Piessens, Frank and Silberstein, Mark and Wenisch, Thomas F. and Yarom, Yuval and Strackx, Raoul 179

Related papers MeltdownPrime and SpectrePrime: Automatically-Synthesized Attacks Exploiting Invalidation-Based Coherence Protocols by Caroline Trippel, Daniel Lustig, Margaret Martonosi Trusted Browsers for Uncertain Times by David Kohlbrenner and Hovav Shacham Foreshadow: Extracting the Keys to the {Intel SGX} Kingdom with Transient Out-of-Order Execution by Van Bulck, Jo and Minkin, Marina and Weisse, Ofir and Genkin, Daniel and Kasikci, Baris and Piessens, Frank and Silberstein, Mark and Wenisch, Thomas F. and Yarom, Yuval and Strackx, Raoul A Systematic Evaluation of Transient Execution Attacks and Defenses by Claudio Canella, Jo Van Bulck, Michael Schwarz, Moritz Lipp, Benjamin von Berg, Philipp Ortner, Frank Piessens, Dmitry Evtyushkin, Daniel Gruss 180

Discussion Starters 181

Discussion Starters Is there a fundamental tradeoff between security and speed? 182

Discussion Starters Is there a fundamental tradeoff between security and speed? Can Spectre be fixed in hardware? 183