SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Speculative Sidechannels and Mitigations
Andrew Cooper
Citrix Hypervisor
Wednesday 10th July 2019
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 1 / 10
Speculative Vulnerabilities
Bounds Check Bypass, Spectre v1
Branch Target Injection, Spectre v2
Rogue Data Cache Load, Meltdown
Rogue System Register Read
Bounds Check Bypass Store, Spectre v1.1
Read-only Protection Bypass, Spectre v1.2
SpectreRSB
NetSpectre
LazyFPU
L1 Terminal Fault, Foreshadow
Microarchitectural {Load Port, Store Buffer, Fill Buffer, Uncacheable
Memory} Data Sampling, Rogue In-Flight Data Load, Write Transient
Forwarding, ZombieLoad
Not speculative: TLBleed, SPOILER
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 2 / 10
Speculation
What is speculation?
To perform a task, in the anticipation of it being needed.
e.g. Speculative Decode or Execution.
Why speculate?
Performance
Hide the latency of longer operations
Vulnerabilities: Two categories
Incorrect prediction ⇒ e.g. execute the wrong instructions
Deferred fault checking ⇒ e.g. execute past a fault
Shared CPU resources
Branch predictors, some shared, some statically partitioned
Internal data busses, some shared, some statically partitioned
L1D cache shared, coherent across the system
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 3 / 10
Bounds Check Bypass - Spectre v1
Attacker poisons/trains the conditional branch predictor.
Predicts conditional jumps ⇒ Jcc rel, JCXZ rel
CPU starts speculatively executing the wrong basic block.
Classic example is an OoB array read, and second dependent read.
Easily constructed in JIT code. Less common in compiled code.
Mitigations
Arrays ⇒ create data dependency for the index value.
Problematic with data-value speculation.
General ⇒ LFENCE after the Jcc instruction.
Usually need to fence both basic blocks.
Hardware fix is still an open problem.
It is context dependent which data values are safe to speculate on.
Some gadgets are very common and very useful to an attacker.
Type confusion ⇒ if ( is_pv(v) ) { ... } else { ... }
Arbitrary cache load ⇒ Single OoB array read.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 4 / 10
Branch Target Injection - Spectre v2
Attacker poisons the Branch Target Buffer
Predicts indirect branches ⇒ CALL r/m, JMP r/m
Take control of function pointers, switch jump tables.
Redirect speculative execution to an attacker chosen location.
Software workaround ⇒ Retpoline
RET has dedicated predictions to match previous CALL’s
RSB - Return Stack Buffer (Intel), RAS - Return Address Stack (AMD)
Not safe on parts where an RSB underflow falls back to the BTB.
Microcode workaround ⇒ new functionality in MSRs
ABI designed for future hardware fix and existing microcode capabilities
IBRS - Prevent poisoning from influencing more privileged code.
Set on every entry, clear on exit to user/guest. Expensive and invasive.
STIBP - Prevent cross-thread BTB poisoning.
IBPB - Flush the BTB. Very expensive, used on vcpu context switch.
OS/Hypervisor needs to opt in to Enhanced IBRS on newer hardware.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 5 / 10
Rogue Data Cache Load - Meltdown
Faults from page protections (U/S, R/W) deferred until retirement.
Attacker constructs a pointer into kernel space and reads from it.
TLB and L1 cache hits ⇒ data forwarded to dependant instructions.
Able to leak via cache timing attack, etc.
Attack pulled off from userspace, with unprivileged instructions!
To mitigate, must prevent one of the two hits.
Flush L1D cache on exit to user/guest, or
Flush TLB on exit to guest/user, or
Put all sensitive data in uncached memory.
Split user and kernel pagetables, switch on every context switch.
Expensive and invasive, but it does prevent TLB hits.
Inspired by earlier KAISER paper. KPTI/XPTI/KVAS.
Overhead can reduced with Process Context ID support.
PCID switches don’t flush the TLB.
Fixed in hardware which enumerates RDCL_NO.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 6 / 10
Brief mentions
Spectre v1 variations
Out of bounds write ⇒ speculative stack smashing.
Speculatively clobbered return address does the attacker-helpful thing.
Combine with Meltdown ⇒ speculative update to read-only data.
Speculative Store Bypass
Better described as “Memory Access Misprediction”.
Load moved ahead of a dependent store. Executes with stale data.
Problematic when a stack slot is reused for a new object.
NetSpectre
Demonstrated Spectre-v1 timing attacks via network latency.
AVX frequency sidechannel. Speculative decode of an AVX instruction
drops the CPU frequency until the vector pipeline powers up.
LazyFPU
CPU speculates past #NM (Device Not Available) exception.
Leaks the previous tasks FPU registers.
EagerFPU is actually a performance win.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 7 / 10
L1 Terminal Fault - Foreshadow
Terminal Fault is a pagewalk which has no valid translation.
Pagewalk speculatively looks up the next-level address.
Either the next PTE on the walk, or the target memory address.
Performs an L1D lookup before checking Present/RSVD bits.
Attacker constructs a not-present mapping and reads from it.
L1 cache hit ⇒ data forwarded to dependant instructions.
Bypasses all SMM, EPT and SGX protections!
Page Size bit is considered ⇒ speculative superpages.
Userspace can use mprotect() or know the paging-out algorithm.
Guest kernel can construct pagetables directly.
Mitigations totally different for native and virtualised cases.
Native (inc. Xen PV): Real L1D width generally larger than reported.
Invert all bits for not-present PTEs ⇒ L1D miss.
Virtualised (HVM): Hypervisor can’t control guest PTEs.
Disable HT. New microcode MSR to flush L1D on VMEntry.
Fixed in hardware which enumerates RDCL_NO.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 8 / 10
Microarchitectural Data Sampling -
M{LP,SB,FB}DS/MDSUM/Fallout/RIDL/ZombieLoad
Faulting or assisting load forwards stale data from a buffer.
Attacker constructs a misaligned pointer which faults or sets an A/D
bit, and reads from it.
Store Buffer ⇒ likely the content of the most recent XSAVE.
Load/Fill Buffers ⇒ memory operands from other thread.
Includes data from uncached memory ⇒ No longer safe for secrets.
Mitigations
Legacy VERW instruction given new flushing side effect.
Use on return to user/guest path to flush uarch buffers.
Synchronised Scheduling (synchronise interrupt/exception/vmexit
handling to ensure you are never running code of two different privilege
levels concurrently), or disable HT.
Fixed in hardware which enumerates MDS_NO.
Fill Buffer subset already fixed with RDCL_NO.
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 9 / 10
Current and future work
Complete
Retpoline, IBRS, XPTI ⇒ XSA-254
SSBD ⇒ XSA-263
Eager FPU ⇒ XSA-267
PV-L1TF, no-SMT ⇒ XSA-273
MD-CLEAR ⇒ XSA-293
In development
Core-aware scheduling
MSR ARCH CAPS virtualisation for guests
Per-guest SSBD settings on AMD
“half-spectre-v1” hardening
Future
Enhanced IBRS for Intel
Removal of mappings in Xen
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 10 / 10
Questions
Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th
July 2019 11 / 10

Contenu connexe

Tendances

Video Conferencing Update
Video Conferencing UpdateVideo Conferencing Update
Video Conferencing Update
Videoguy
 
Hardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux conHardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux con
sprdd
 

Tendances (20)

OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
Scale17x: Thinking outside of the conceived tech comfort zone
Scale17x: Thinking outside of the conceived tech comfort zoneScale17x: Thinking outside of the conceived tech comfort zone
Scale17x: Thinking outside of the conceived tech comfort zone
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS18: Xen Project Weather Report 2018
XPDDS18: Xen Project Weather Report 2018XPDDS18: Xen Project Weather Report 2018
XPDDS18: Xen Project Weather Report 2018
 
Video Conferencing Update
Video Conferencing UpdateVideo Conferencing Update
Video Conferencing Update
 
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler CollectionIntel® Advanced Vector Extensions Support in GNU Compiler Collection
Intel® Advanced Vector Extensions Support in GNU Compiler Collection
 
Securing Your Linux System
Securing Your Linux SystemSecuring Your Linux System
Securing Your Linux System
 
Using VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear ContainersUsing VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear Containers
 
XS Boston 2008 Network Topology
XS Boston 2008 Network TopologyXS Boston 2008 Network Topology
XS Boston 2008 Network Topology
 
Affordable trustworthy-systems
Affordable trustworthy-systemsAffordable trustworthy-systems
Affordable trustworthy-systems
 
The Role of a Network Software Developer in Network Transformation
The Role of a Network Software Developer in Network TransformationThe Role of a Network Software Developer in Network Transformation
The Role of a Network Software Developer in Network Transformation
 
PowerDRC/LVS 2.0 Overview
PowerDRC/LVS 2.0 OverviewPowerDRC/LVS 2.0 Overview
PowerDRC/LVS 2.0 Overview
 
Sioux Hot-or-Not: The future of Linux (Alan Cox)
Sioux Hot-or-Not: The future of Linux (Alan Cox)Sioux Hot-or-Not: The future of Linux (Alan Cox)
Sioux Hot-or-Not: The future of Linux (Alan Cox)
 
Docker security - OWASP Seasides
Docker security - OWASP SeasidesDocker security - OWASP Seasides
Docker security - OWASP Seasides
 
Hardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux conHardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux con
 
Dell EMC validates your Genetec video management system before it reaches you...
Dell EMC validates your Genetec video management system before it reaches you...Dell EMC validates your Genetec video management system before it reaches you...
Dell EMC validates your Genetec video management system before it reaches you...
 
Altitude San Francisco 2018: WAF Workshop
Altitude San Francisco 2018: WAF WorkshopAltitude San Francisco 2018: WAF Workshop
Altitude San Francisco 2018: WAF Workshop
 

Similaire à XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix

DefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO RoutersDefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO Routers
Michael Smith
 
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
Priyanka Aash
 
Clustered Architecture Patterns Delivering Scalability And Availability
Clustered Architecture Patterns Delivering Scalability And AvailabilityClustered Architecture Patterns Delivering Scalability And Availability
Clustered Architecture Patterns Delivering Scalability And Availability
ConSanFrancisco123
 
Readactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory DisclosureReadactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory Disclosure
ch0psticks
 
Black ops of tcp2005 japan
Black ops of tcp2005 japanBlack ops of tcp2005 japan
Black ops of tcp2005 japan
Dan Kaminsky
 
6.Resource Exhaustion
6.Resource Exhaustion6.Resource Exhaustion
6.Resource Exhaustion
phanleson
 

Similaire à XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix (20)

Common Types of DDoS Attacks | MazeBolt Technologies
Common Types of DDoS Attacks | MazeBolt TechnologiesCommon Types of DDoS Attacks | MazeBolt Technologies
Common Types of DDoS Attacks | MazeBolt Technologies
 
DefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO RoutersDefCon 2012 - Rooting SOHO Routers
DefCon 2012 - Rooting SOHO Routers
 
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
Hacktivity2014: Virtual Machine Introspection to Detect and ProtectHacktivity2014: Virtual Machine Introspection to Detect and Protect
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
 
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
Wrangling with the Ghost: An Inside Story of Mitigating Speculative Execution...
 
CEH v9 cheat sheet notes Certified Ethical Hacker
CEH v9 cheat sheet notes  Certified Ethical HackerCEH v9 cheat sheet notes  Certified Ethical Hacker
CEH v9 cheat sheet notes Certified Ethical Hacker
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
Automating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsAutomating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency Spreads
 
Postgres clusters
Postgres clustersPostgres clusters
Postgres clusters
 
Cisco Switch Security
Cisco Switch SecurityCisco Switch Security
Cisco Switch Security
 
Clustered Architecture Patterns Delivering Scalability And Availability
Clustered Architecture Patterns Delivering Scalability And AvailabilityClustered Architecture Patterns Delivering Scalability And Availability
Clustered Architecture Patterns Delivering Scalability And Availability
 
Anomaly Detection at Scale
Anomaly Detection at ScaleAnomaly Detection at Scale
Anomaly Detection at Scale
 
Practical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacksPractical steps to mitigate DDoS attacks
Practical steps to mitigate DDoS attacks
 
Readactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory DisclosureReadactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory Disclosure
 
CrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardwareCrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardware
 
Pitfalls of virtual machine introspection on modern hardware
Pitfalls of virtual machine introspection on modern hardwarePitfalls of virtual machine introspection on modern hardware
Pitfalls of virtual machine introspection on modern hardware
 
Introduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigationIntroduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigation
 
Black ops of tcp2005 japan
Black ops of tcp2005 japanBlack ops of tcp2005 japan
Black ops of tcp2005 japan
 
Scaling the Container Dataplane
Scaling the Container Dataplane Scaling the Container Dataplane
Scaling the Container Dataplane
 
Simplify Networking for Containers
Simplify Networking for ContainersSimplify Networking for Containers
Simplify Networking for Containers
 
6.Resource Exhaustion
6.Resource Exhaustion6.Resource Exhaustion
6.Resource Exhaustion
 

Plus de The Linux Foundation

Plus de The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityXPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
 
XPDDS19: Support of PV Devices in Nested Xen - Jürgen Groß, SUSE
XPDDS19: Support of PV Devices in Nested Xen - Jürgen Groß, SUSEXPDDS19: Support of PV Devices in Nested Xen - Jürgen Groß, SUSE
XPDDS19: Support of PV Devices in Nested Xen - Jürgen Groß, SUSE
 
XPDDS19: Application Agnostic High Availability Solution On Hypervisor Level ...
XPDDS19: Application Agnostic High Availability Solution On Hypervisor Level ...XPDDS19: Application Agnostic High Availability Solution On Hypervisor Level ...
XPDDS19: Application Agnostic High Availability Solution On Hypervisor Level ...
 
XPDSS19: Live-Updating Xen - Amit Shah & David Woodhouse, Amazon
XPDSS19: Live-Updating Xen - Amit Shah & David Woodhouse, AmazonXPDSS19: Live-Updating Xen - Amit Shah & David Woodhouse, Amazon
XPDSS19: Live-Updating Xen - Amit Shah & David Woodhouse, Amazon
 
XPDDS19: Xen API Archaeology: Creating a Full-Featured VMI Debugger for the...
XPDDS19:   Xen API Archaeology: Creating a Full-Featured VMI Debugger for the...XPDDS19:   Xen API Archaeology: Creating a Full-Featured VMI Debugger for the...
XPDDS19: Xen API Archaeology: Creating a Full-Featured VMI Debugger for the...
 
XPDDS19: Secure Unikraft Applications with Solo5 - Haibo Xu, ARM
XPDDS19: Secure Unikraft Applications with Solo5 - Haibo Xu, ARMXPDDS19: Secure Unikraft Applications with Solo5 - Haibo Xu, ARM
XPDDS19: Secure Unikraft Applications with Solo5 - Haibo Xu, ARM
 
XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...
XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...
XPDDS19: The Xen-Blanket for 2019 - Christopher Clark and Kelli Little, Star ...
 

Dernier

+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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (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...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
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...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
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 🔝✔️✔️
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix

  • 1. Speculative Sidechannels and Mitigations Andrew Cooper Citrix Hypervisor Wednesday 10th July 2019 Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 1 / 10
  • 2. Speculative Vulnerabilities Bounds Check Bypass, Spectre v1 Branch Target Injection, Spectre v2 Rogue Data Cache Load, Meltdown Rogue System Register Read Bounds Check Bypass Store, Spectre v1.1 Read-only Protection Bypass, Spectre v1.2 SpectreRSB NetSpectre LazyFPU L1 Terminal Fault, Foreshadow Microarchitectural {Load Port, Store Buffer, Fill Buffer, Uncacheable Memory} Data Sampling, Rogue In-Flight Data Load, Write Transient Forwarding, ZombieLoad Not speculative: TLBleed, SPOILER Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 2 / 10
  • 3. Speculation What is speculation? To perform a task, in the anticipation of it being needed. e.g. Speculative Decode or Execution. Why speculate? Performance Hide the latency of longer operations Vulnerabilities: Two categories Incorrect prediction ⇒ e.g. execute the wrong instructions Deferred fault checking ⇒ e.g. execute past a fault Shared CPU resources Branch predictors, some shared, some statically partitioned Internal data busses, some shared, some statically partitioned L1D cache shared, coherent across the system Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 3 / 10
  • 4. Bounds Check Bypass - Spectre v1 Attacker poisons/trains the conditional branch predictor. Predicts conditional jumps ⇒ Jcc rel, JCXZ rel CPU starts speculatively executing the wrong basic block. Classic example is an OoB array read, and second dependent read. Easily constructed in JIT code. Less common in compiled code. Mitigations Arrays ⇒ create data dependency for the index value. Problematic with data-value speculation. General ⇒ LFENCE after the Jcc instruction. Usually need to fence both basic blocks. Hardware fix is still an open problem. It is context dependent which data values are safe to speculate on. Some gadgets are very common and very useful to an attacker. Type confusion ⇒ if ( is_pv(v) ) { ... } else { ... } Arbitrary cache load ⇒ Single OoB array read. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 4 / 10
  • 5. Branch Target Injection - Spectre v2 Attacker poisons the Branch Target Buffer Predicts indirect branches ⇒ CALL r/m, JMP r/m Take control of function pointers, switch jump tables. Redirect speculative execution to an attacker chosen location. Software workaround ⇒ Retpoline RET has dedicated predictions to match previous CALL’s RSB - Return Stack Buffer (Intel), RAS - Return Address Stack (AMD) Not safe on parts where an RSB underflow falls back to the BTB. Microcode workaround ⇒ new functionality in MSRs ABI designed for future hardware fix and existing microcode capabilities IBRS - Prevent poisoning from influencing more privileged code. Set on every entry, clear on exit to user/guest. Expensive and invasive. STIBP - Prevent cross-thread BTB poisoning. IBPB - Flush the BTB. Very expensive, used on vcpu context switch. OS/Hypervisor needs to opt in to Enhanced IBRS on newer hardware. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 5 / 10
  • 6. Rogue Data Cache Load - Meltdown Faults from page protections (U/S, R/W) deferred until retirement. Attacker constructs a pointer into kernel space and reads from it. TLB and L1 cache hits ⇒ data forwarded to dependant instructions. Able to leak via cache timing attack, etc. Attack pulled off from userspace, with unprivileged instructions! To mitigate, must prevent one of the two hits. Flush L1D cache on exit to user/guest, or Flush TLB on exit to guest/user, or Put all sensitive data in uncached memory. Split user and kernel pagetables, switch on every context switch. Expensive and invasive, but it does prevent TLB hits. Inspired by earlier KAISER paper. KPTI/XPTI/KVAS. Overhead can reduced with Process Context ID support. PCID switches don’t flush the TLB. Fixed in hardware which enumerates RDCL_NO. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 6 / 10
  • 7. Brief mentions Spectre v1 variations Out of bounds write ⇒ speculative stack smashing. Speculatively clobbered return address does the attacker-helpful thing. Combine with Meltdown ⇒ speculative update to read-only data. Speculative Store Bypass Better described as “Memory Access Misprediction”. Load moved ahead of a dependent store. Executes with stale data. Problematic when a stack slot is reused for a new object. NetSpectre Demonstrated Spectre-v1 timing attacks via network latency. AVX frequency sidechannel. Speculative decode of an AVX instruction drops the CPU frequency until the vector pipeline powers up. LazyFPU CPU speculates past #NM (Device Not Available) exception. Leaks the previous tasks FPU registers. EagerFPU is actually a performance win. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 7 / 10
  • 8. L1 Terminal Fault - Foreshadow Terminal Fault is a pagewalk which has no valid translation. Pagewalk speculatively looks up the next-level address. Either the next PTE on the walk, or the target memory address. Performs an L1D lookup before checking Present/RSVD bits. Attacker constructs a not-present mapping and reads from it. L1 cache hit ⇒ data forwarded to dependant instructions. Bypasses all SMM, EPT and SGX protections! Page Size bit is considered ⇒ speculative superpages. Userspace can use mprotect() or know the paging-out algorithm. Guest kernel can construct pagetables directly. Mitigations totally different for native and virtualised cases. Native (inc. Xen PV): Real L1D width generally larger than reported. Invert all bits for not-present PTEs ⇒ L1D miss. Virtualised (HVM): Hypervisor can’t control guest PTEs. Disable HT. New microcode MSR to flush L1D on VMEntry. Fixed in hardware which enumerates RDCL_NO. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 8 / 10
  • 9. Microarchitectural Data Sampling - M{LP,SB,FB}DS/MDSUM/Fallout/RIDL/ZombieLoad Faulting or assisting load forwards stale data from a buffer. Attacker constructs a misaligned pointer which faults or sets an A/D bit, and reads from it. Store Buffer ⇒ likely the content of the most recent XSAVE. Load/Fill Buffers ⇒ memory operands from other thread. Includes data from uncached memory ⇒ No longer safe for secrets. Mitigations Legacy VERW instruction given new flushing side effect. Use on return to user/guest path to flush uarch buffers. Synchronised Scheduling (synchronise interrupt/exception/vmexit handling to ensure you are never running code of two different privilege levels concurrently), or disable HT. Fixed in hardware which enumerates MDS_NO. Fill Buffer subset already fixed with RDCL_NO. Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 9 / 10
  • 10. Current and future work Complete Retpoline, IBRS, XPTI ⇒ XSA-254 SSBD ⇒ XSA-263 Eager FPU ⇒ XSA-267 PV-L1TF, no-SMT ⇒ XSA-273 MD-CLEAR ⇒ XSA-293 In development Core-aware scheduling MSR ARCH CAPS virtualisation for guests Per-guest SSBD settings on AMD “half-spectre-v1” hardening Future Enhanced IBRS for Intel Removal of mappings in Xen Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 10 / 10
  • 11. Questions Andrew Cooper (Citrix Hypervisor) Speculative Sidechannels and Mitigations Wednesday 10th July 2019 11 / 10