meltdown / spectre - red hat€¦ · patching spectre variant #1 – bounds check violations kernel...

32
Meltdown / Spectre Patrick Ladd Technical Account Manager January 10 th 2018

Upload: others

Post on 29-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Meltdown / Spectre

Patrick Ladd

Technical Account Manager

January 10th 2018

Page 2: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

For your manager...

Page 3: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

3

https://www.youtube.com/watch?v=syAdX44pokE

Page 4: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

4

https://youtu.be/bReA1dvGJ6Y

Page 5: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

5

https://youtu.be/RbHbFkh6eeE

Page 6: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

History / Timeline

Page 7: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Technical Details

Page 8: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Speculative Execution

Page 9: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Side-Channel Attacks

Page 10: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Meltdown

Page 11: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED11

Exploit Code

raise_exception();

// the line below is never reached

access(probe_array[data * 4096]);

Page 12: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Spectre

Page 13: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED13

Exploit Code

Conditional Branch Exploit

if (x < array1_size)

y = array2[array1[x] * 256];

Indirect Branch Exploit

Other Variants

Page 14: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Patching

Page 15: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED15

Patching Meltdown

Kernel Patch

Page 16: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED16

Patching Spectre

Variant #1 – Bounds Check Violations

Kernel Patch

Variant #2 – Branch Predictor

Kernel Patch & CPU Microcode Updates

Page 17: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Impact

Page 18: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED18

Page 19: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED19

Highly cached random memory, with buffered I/O, OLTP database workloads, and benchmarks with high kernel-to-user space transitions are impacted between 8-19%.

Performance ImpactMeasurable: 8-19%

● OLTP Workloads (tpc)

● sysbench

● pgbench

● netperf (< 256 byte)

● fio (random I/O to NvME).

Page 20: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED20

Database analytics, Decision Support System (DSS), and Java VMs are impacted less than the “Measurable” category. These applications may have significant sequential disk or network traffic, but kernel/device drivers are able to aggregate requests to moderate level of kernel-to-user transitions

Performance ImpactModest: 3-7%

● SPECjbb2005

● Queries/Hour

● Overall analytic timing (sec)

Page 21: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED21

HPC (High Performance Computing) CPU-intensive workloads are affected the least with only 2-5% performance impact because jobs run mostly in user space and are scheduled using cpu-pinning or numa-control.

Performance ImpactSmall: 2-5%

● Linpack NxN on x86

● SPECcpu2006

Page 22: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED22

Linux accelerator technologies that generally bypass the kernel in favor of user direct access are the least affected

Performance ImpactMinimal: <2%

● DPDK (VsPERF at 64 byte)

● OpenOnload (STAC-N)

● Userspace accesses to VDSO like get-time-of-day are not impacted

Page 23: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Tuning

Page 24: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED24

Kernel Tuning Parameters

CVE-2017-5715Variant #2 / Spectre

CVE-2017-5715Variant #2 / Spectre

CVE-2017-5754Variant #3 / Meltdown

noibrs / ibrs_enabled

Indirect Branch Restricted Speculation (ibrs)

noibpb / ibpb_enabled

Indirect Branch Prediction Barriers (ibpb)

nopti / pti_enabled

Kernel Page Table Isolation (pti)

Page 25: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

INSERT DESIGNATOR, IF NEEDED25

Variants 1,2,3 Enabled

pti 1 ibrs 1 ibpb 1 ->fix variant#1,2,3

pti 1 ibrs 0 ibpb 0 -> fix variant#1 #3 (for older Intel systems with no microcode update available)

Variants 1,2 EnabledNot Vulnerable to #3

pti 0 ibrs 0 ibpb 2 -> fix variant #1 #2 if the microcode update is applied

pti 0 ibrs 2 ibpb 1 -> fix variant #1 #2 on older processors that can disable indirect

branch prediction without microcode updates

Architectural DefaultsAutomatically Depending on Detected Architecture

Page 26: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

What Do I Do Now?

Page 27: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

Resources

Page 28: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

28

ResourcesRed Hat Customer Portal

Master Vulnerability Pagehttps://access.redhat.com/security/vulnerabilities/speculativeexecution

Performance Impacthttps://access.redhat.com/articles/3307751

Tunableshttps://access.redhat.com/articles/3311301

Page 29: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

29

ResourcesRed Hat

What you need to know – Jon Mastershttps://www.redhat.com/en/blog/what-are-meltdown-and-spectre-here%E2%80%99s-what-you-need-know

Q&A Webinar - Thursday, January 11 at 11:00AM ESThttps://onlinexperiences.com/Launch/QReg/ShowKey=47447&AffiliateData=701f2000000tsoPAAQ&

https://www.redhat.com/en/blog/what-are-meltdown-and-spectre-here%E2%80%99s-what-you-need-know

Page 30: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

30

ResourcesExternal

Meltdown Paper

Spectre Paperhttps://spectreattack.com/spectre.pdf

https://meltdownattack.com/meltdown.pdf

https://googleprojectzero.blogspot.ca/2018/01/reading-privileged-memory-with-side.html

Google Project Zero

Page 31: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

31

ResourcesExternal

Meltdown Exploit POC Codehttps://github.com/IAIK/meltdown

Page 32: Meltdown / Spectre - Red Hat€¦ · Patching Spectre Variant #1 – Bounds Check Violations Kernel Patch Variant #2 – Branch Predictor Kernel Patch & CPU Microcode Updates. Impact

plus.google.com/+RedHat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNewslinkedin.com/company/red-hat

THANK YOU