SlideShare a Scribd company logo
1 of 26
Download to read offline
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kernel Recipes 2018
Mitigating Spectre and
Meltdown (and L1TF)
David Woodhouse
2018-09-28
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Content
• Understanding speculative attacks
• Spectre & Meltdown
• KPTI / KAISER
• Microcode features
• Retpoline
• L1 Terminal Fault (L1TF)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (1/3)
1. Entering speculative execution
●
Conditional branch
movl $100,%edi
loop: …
subl $1,%edi
jne loop
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (1/3)
1. Entering speculative execution
●
Conditional branch
●
Indirect branch
func: …
movl func,%edx
jmp *edx
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (1/3)
1. Entering speculative execution
●
Conditional branch
●
Indirect branch
●
Exceptions
movl (%edx),%rax
movl (%rax),%rbx
…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (1/3)
1. Entering speculative execution
●
Conditional branch
●
Indirect branch
●
Exceptions
●
TSX
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (2/3)
2. Prolonging speculative execution
●
Load with cache miss
●
Dependent loads
●
Dependent arithmetic operations
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Components of a speculative attack (3/3)
3) Leaking information
●
Data cache
●
Instruction cache
●
Prediction cache
●
Translation cache
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Meltdown (aka ‘variant 3’)
• Allows direct read from non-permitted (e.g. kernel) memory.
• Runs entirely in unprivileged code.
• Affects Intel (not AMD), POWER, ARM Cortex-A75.
movl $0xc1234567,%edx
movl (%edx),%ecx
movl mydata(%ecx),%edx
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre
• Variant 2: Indirect branches
– Branch predictions from unprivileged mode, affect privileged code.
– Attacker can cause kernel to (speculatively) run arbitrary code.
• Variant 1: Conditional branches
– Loops will always happen n+1 times.
– Sanity checks don’t prevent speculative execution.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Meltdown: KPTI / KAISER
• Kernel Address Isolation to have Side-channels Efficiently Removed
• Dual set of page tables per process
• Change %cr3 (root of page tables) on each kernel entry/exit
Image credit:
Wikipedia user Phoenix7777
CC BY-SA 4.0
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v2: Microcode features
• New functions in MSRs:
– Indirect Branch Restricted Speculation (IBRS)
– Indirect Branch Prediction Barrier (IBPB)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v2: Retpoline
• Confuse the branch predictor!
• Original code:
jmp *r11
• Replaced with:
call set_up_target
capture_speculation:
pause
jmp capture_speculation
set_up_target:
mov %r11, %(rsp)
ret
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v2: Retpoline for calls
call *r11
• Replaced with:
jmp do_call
do_retpoline_jmp:
call set_up_target
capture_speculation:
pause
jmp capture_speculation
set_up_target:
mov %r11, %(rsp)
ret
do_call:
call do_retpoline_jmp
…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v2: Reducing the retpoline impact
• Retpoline always causes a prediction miss
• If there’s a common case, explicitly call it:
if (func == generic_func)
generic_func();
else
*func();
• Inline functions which take callback functions as arguments
(e.g. slot_handle_level_range())
n:∀ callback(n);
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v2: Return Stack Buffer
• RSB cleared on context switch and VMEXIT.
call 2f
1: pause
lfence
jmp 1b
2: call 4f
…
• From Skylake onwards, Intel CPUs take branch predictions from the BTB
when the RSB is depleted.
} 32 times
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spectre v1
• New array_index_nospec() adds data dependency in bounds checking.
if (index < size) {
index = array_index_nospec(index, size);
val = array[index];
}
• Similar masking in get_user() etc.
• Static analysis with Coverity and similar tools.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
L1 Terminal Fault (L1TF)
• Non-present PTEs in a VM guest mishandled
• A hyperthread CPU can read any data its sibling is touching
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
L1 Terminal Fault (L1TF)
• Non-present PTEs in a VM guest mishandled
• A hyperthread CPU can read any data its sibling is touching
• Mitigations:
– Flush L1$ on each VM entry
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
L1 Terminal Fault (L1TF)
• Non-present PTEs in a VM guest mishandled
• A hyperthread CPU can read any data its sibling is touching
• Mitigations:
– Flush L1$ on each VM entry
– Turn off hyperthreading
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
L1 Terminal Fault (L1TF)
• Non-present PTEs in a VM guest mishandled
• A hyperthread CPU can read any data its sibling is touching
• Mitigations:
– Flush L1$ on each VM entry
– Turn off hyperthreading
– Co(re) scheduling: https://lwn.net/Articles/764482/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
L1 Terminal Fault (L1TF)
• Non-present PTEs in a VM guest mishandled
• A hyperthread CPU can read any data its sibling is touching
• Mitigations:
– Flush L1$ on each VM entry
– Turn off hyperthreading
– Co(re) scheduling: https://lwn.net/Articles/764482/
– Secret Hiding
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
State of Linux today
●
Retpoline + IBRS on calls into firmware.
●
IBPB on context switch between VMs or “sensitive” processes.
●
Clear RSB on context switch and VMEXIT.
●
Clear GPRs on kernel entry
●
Flush dcache on kernel exit
●
For Skylake+, pray to the deity of your choice.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Xen
●
IBRS supported for Xen entry if SKL+ or no retpoline.
●
IBPB on context switch between VMs.
●
Clear RSB on VMEXIT.
●
Clear GPRs on Xen entry.
●
No prayer required.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application considerations
• IBRS / IBPB are kernel-only
• Use retpoline
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Questions?
We’re hiring:
http://www.amazon.jobs/location/dresden-germany
http://www.amazon.jobs/location/bucharest-romania

More Related Content

Similar to Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Woodhouse

Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28
Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28
Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28Amazon Web Services
 
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...CODE BLUE
 
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...Amazon Web Services
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfMICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfKarthiA15
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERFastBit Embedded Brain Academy
 
Spark Meetup July 2015
Spark Meetup July 2015Spark Meetup July 2015
Spark Meetup July 2015Debasish Das
 
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...Amazon Web Services
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...The Linux Foundation
 
SequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshareSequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshareDoug Norton
 
SequenceL intro slideshare
SequenceL intro slideshareSequenceL intro slideshare
SequenceL intro slideshareDoug Norton
 
Trends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient PerformanceTrends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient Performanceinside-BigData.com
 
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...Priyanka Aash
 
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on..." Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on...PROIDEA
 
Oracle RAC features on Exadata
Oracle RAC features on ExadataOracle RAC features on Exadata
Oracle RAC features on ExadataAnil Nair
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rulesFreddy Buenaño
 
A trial investigation system for vulnerability on M2M network
A trial investigation system for vulnerability on M2M networkA trial investigation system for vulnerability on M2M network
A trial investigation system for vulnerability on M2M networkMocke Tech
 
A Trial Investigation System for Vulnerability on M2M Network
A Trial Investigation System for Vulnerability on M2M NetworkA Trial Investigation System for Vulnerability on M2M Network
A Trial Investigation System for Vulnerability on M2M NetworkKiyotaka Atsumi
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT SecurityHannes Tschofenig
 

Similar to Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Woodhouse (20)

Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28
Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28
Amazon EC2 deepdive and a sprinkel of AWS Compute | AWS Floor28
 
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
[CB19] MalConfScan with Cuckoo: Automatic Malware Configuration Extraction Sy...
 
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...
Accelerate Your C/C++ Applications with Amazon EC2 F1 Instances (CMP405) - AW...
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Linux on System z debugging with Valgrind
Linux on System z debugging with ValgrindLinux on System z debugging with Valgrind
Linux on System z debugging with Valgrind
 
MICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdfMICROCONTROLLER PROGRAMMING.pdf
MICROCONTROLLER PROGRAMMING.pdf
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
 
Spark Meetup July 2015
Spark Meetup July 2015Spark Meetup July 2015
Spark Meetup July 2015
 
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...
[REPEAT] Deep Learning for Developers: An Introduction, Featuring Samsung SDS...
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
 
SequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshareSequenceL Auto-Parallelizing Toolset Intro slideshare
SequenceL Auto-Parallelizing Toolset Intro slideshare
 
SequenceL intro slideshare
SequenceL intro slideshareSequenceL intro slideshare
SequenceL intro slideshare
 
Trends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient PerformanceTrends in Systems and How to Get Efficient Performance
Trends in Systems and How to Get Efficient Performance
 
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
 
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on..." Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
 
Oracle RAC features on Exadata
Oracle RAC features on ExadataOracle RAC features on Exadata
Oracle RAC features on Exadata
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
A trial investigation system for vulnerability on M2M network
A trial investigation system for vulnerability on M2M networkA trial investigation system for vulnerability on M2M network
A trial investigation system for vulnerability on M2M network
 
A Trial Investigation System for Vulnerability on M2M Network
A Trial Investigation System for Vulnerability on M2M NetworkA Trial Investigation System for Vulnerability on M2M Network
A Trial Investigation System for Vulnerability on M2M Network
 
The Role of Standards in IoT Security
The Role of Standards in IoT SecurityThe Role of Standards in IoT Security
The Role of Standards in IoT Security
 

More from Anne Nicolas

Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstAnne Nicolas
 
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIKernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIAnne Nicolas
 
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelKernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelAnne Nicolas
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyAnne Nicolas
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureAnne Nicolas
 
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Anne Nicolas
 
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataAnne Nicolas
 
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...Anne Nicolas
 
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxEmbedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxAnne Nicolas
 
Embedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialEmbedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialAnne Nicolas
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconAnne Nicolas
 
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureEmbedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureAnne Nicolas
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayAnne Nicolas
 
Embedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerEmbedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerAnne Nicolas
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationAnne Nicolas
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingAnne Nicolas
 
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaAnne Nicolas
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedAnne Nicolas
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPAnne Nicolas
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Anne Nicolas
 

More from Anne Nicolas (20)

Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream first
 
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIKernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
 
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelKernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are money
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and future
 
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
 
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
 
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
 
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxEmbedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
 
Embedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialEmbedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less special
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
 
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureEmbedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Embedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerEmbedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmaker
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integration
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDP
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Kernel Recipes 2018 - Mitigating Spectre and Meltdown (and L1TF) - David Woodhouse

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Kernel Recipes 2018 Mitigating Spectre and Meltdown (and L1TF) David Woodhouse 2018-09-28
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Content • Understanding speculative attacks • Spectre & Meltdown • KPTI / KAISER • Microcode features • Retpoline • L1 Terminal Fault (L1TF)
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (1/3) 1. Entering speculative execution ● Conditional branch movl $100,%edi loop: … subl $1,%edi jne loop
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (1/3) 1. Entering speculative execution ● Conditional branch ● Indirect branch func: … movl func,%edx jmp *edx
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (1/3) 1. Entering speculative execution ● Conditional branch ● Indirect branch ● Exceptions movl (%edx),%rax movl (%rax),%rbx …
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (1/3) 1. Entering speculative execution ● Conditional branch ● Indirect branch ● Exceptions ● TSX
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (2/3) 2. Prolonging speculative execution ● Load with cache miss ● Dependent loads ● Dependent arithmetic operations
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Components of a speculative attack (3/3) 3) Leaking information ● Data cache ● Instruction cache ● Prediction cache ● Translation cache
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Meltdown (aka ‘variant 3’) • Allows direct read from non-permitted (e.g. kernel) memory. • Runs entirely in unprivileged code. • Affects Intel (not AMD), POWER, ARM Cortex-A75. movl $0xc1234567,%edx movl (%edx),%ecx movl mydata(%ecx),%edx
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre • Variant 2: Indirect branches – Branch predictions from unprivileged mode, affect privileged code. – Attacker can cause kernel to (speculatively) run arbitrary code. • Variant 1: Conditional branches – Loops will always happen n+1 times. – Sanity checks don’t prevent speculative execution.
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Meltdown: KPTI / KAISER • Kernel Address Isolation to have Side-channels Efficiently Removed • Dual set of page tables per process • Change %cr3 (root of page tables) on each kernel entry/exit Image credit: Wikipedia user Phoenix7777 CC BY-SA 4.0
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v2: Microcode features • New functions in MSRs: – Indirect Branch Restricted Speculation (IBRS) – Indirect Branch Prediction Barrier (IBPB)
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v2: Retpoline • Confuse the branch predictor! • Original code: jmp *r11 • Replaced with: call set_up_target capture_speculation: pause jmp capture_speculation set_up_target: mov %r11, %(rsp) ret
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v2: Retpoline for calls call *r11 • Replaced with: jmp do_call do_retpoline_jmp: call set_up_target capture_speculation: pause jmp capture_speculation set_up_target: mov %r11, %(rsp) ret do_call: call do_retpoline_jmp …
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v2: Reducing the retpoline impact • Retpoline always causes a prediction miss • If there’s a common case, explicitly call it: if (func == generic_func) generic_func(); else *func(); • Inline functions which take callback functions as arguments (e.g. slot_handle_level_range()) n:∀ callback(n);
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v2: Return Stack Buffer • RSB cleared on context switch and VMEXIT. call 2f 1: pause lfence jmp 1b 2: call 4f … • From Skylake onwards, Intel CPUs take branch predictions from the BTB when the RSB is depleted. } 32 times
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Spectre v1 • New array_index_nospec() adds data dependency in bounds checking. if (index < size) { index = array_index_nospec(index, size); val = array[index]; } • Similar masking in get_user() etc. • Static analysis with Coverity and similar tools.
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. L1 Terminal Fault (L1TF) • Non-present PTEs in a VM guest mishandled • A hyperthread CPU can read any data its sibling is touching
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. L1 Terminal Fault (L1TF) • Non-present PTEs in a VM guest mishandled • A hyperthread CPU can read any data its sibling is touching • Mitigations: – Flush L1$ on each VM entry
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. L1 Terminal Fault (L1TF) • Non-present PTEs in a VM guest mishandled • A hyperthread CPU can read any data its sibling is touching • Mitigations: – Flush L1$ on each VM entry – Turn off hyperthreading
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. L1 Terminal Fault (L1TF) • Non-present PTEs in a VM guest mishandled • A hyperthread CPU can read any data its sibling is touching • Mitigations: – Flush L1$ on each VM entry – Turn off hyperthreading – Co(re) scheduling: https://lwn.net/Articles/764482/
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. L1 Terminal Fault (L1TF) • Non-present PTEs in a VM guest mishandled • A hyperthread CPU can read any data its sibling is touching • Mitigations: – Flush L1$ on each VM entry – Turn off hyperthreading – Co(re) scheduling: https://lwn.net/Articles/764482/ – Secret Hiding
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. State of Linux today ● Retpoline + IBRS on calls into firmware. ● IBPB on context switch between VMs or “sensitive” processes. ● Clear RSB on context switch and VMEXIT. ● Clear GPRs on kernel entry ● Flush dcache on kernel exit ● For Skylake+, pray to the deity of your choice.
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Xen ● IBRS supported for Xen entry if SKL+ or no retpoline. ● IBPB on context switch between VMs. ● Clear RSB on VMEXIT. ● Clear GPRs on Xen entry. ● No prayer required.
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Application considerations • IBRS / IBPB are kernel-only • Use retpoline
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Questions? We’re hiring: http://www.amazon.jobs/location/dresden-germany http://www.amazon.jobs/location/bucharest-romania