Diptendu Kar diptendu.kar@colostate.edu.

Slides:



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

Practical Timing Side Channel Attacks Against Kernel Space ASLR
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Virtual Machine Security Design of Secure Operating Systems Summer 2012 Presented By: Musaad Alzahrani.
Early OS security Overview by: Greg Morrisett Cornell University, Edited (by permission) for CSUS CSc250 by Bill Mitchell.
Virtual Machine Monitors CSE451 Andrew Whitaker. Hardware Virtualization Running multiple operating systems on a single physical machine Examples:  VMWare,
Operating System Virtualization
Kenichi Kourai (Kyushu Institute of Technology) Takuya Nagata (Kyushu Institute of Technology) A Secure Framework for Monitoring Operating Systems Using.
Secure Operating Systems Lesson B: Let’s go break something.
Enhanced Operating System Security Through Efficient and Fine-grained Address Space Randomization Vikram Reddy Enukonda.
Super computers Parallel Processing By Lecturer: Aisha Dawood.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
1 Adapted from UC Berkeley CS252 S01 Lecture 17: Reducing Cache Miss Penalty and Reducing Cache Hit Time Hardware prefetching and stream buffer, software.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Operating System Reliability Andy Wang COP 5611 Advanced Operating Systems.
Thwarting cache-based side- channel attacks Yuval Yarom The University of Adelaide and Data61.
Covert Channels Through Branch Predictors: a Feasibility Study
Virtualization.
Buffer Overflows Incomplete Access Control
Virtual Machine Monitors
X. Zhang, Y. Xiao, Y. Zhang Return-Oriented Flush-Reload Side Channels on ARM and Their Implications for Android Devices Xiaokuan Zhang, Yuan Xiao, Yinqian.
Trusted Computing and the Trusted Platform Module
Introduction to Operating Systems
Protecting Memory What is there to protect in memory?
X. Zhang, Y. Xiao, Y. Zhang Return-Oriented Flush-Reload Side Channels on ARM and Their Implications for Android Devices Xiaokuan Zhang, Yuan Xiao, Yinqian.
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
William Stallings Computer Organization and Architecture 8th Edition
Section 9: Virtual Memory (VM)
Jump Over ASLR: Attacking Branch Predictors to Bypass ASLR
Secure Software Development: Theory and Practice
Operating System Reliability
Operating System Reliability
Modularity and Memory Clearly, programs must have access to memory
Bruhadeshwar Meltdown Bruhadeshwar
Patching firmware, computers, internet of things and more
How Open Source Project Xen Puts Security Ahead of Emerging Threats
Lecture 23: Cache, Memory, Security
Mark D. Hill, Wisconsin, CCC, Google Sabbatical
Chapter 2. Malware Analysis in VMs
Microprocessors Chapter 4.
Instruction Scheduling for Instruction-Level Parallelism
Introduction to Operating Systems
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Meltdown and Spectre: Complexity and the death of security
Meltdown CSE 351 Winter 2018 Instructor: Mark Wyse
ConfMVM: A Hardware-Assisted Model to Confine Malicious VMs
Operating System Reliability
Operating System Reliability
Meltdown / Spectre issue?
Mengjia Yan† , Jiho Choi† , Dimitrios Skarlatos,
Meltdown and Spectre: Complexity and the death of security
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Reverse engineering through full system simulations
Operating System Reliability
Shielding applications from an untrusted cloud with Haven
CS252 S05 EECS 262a Advanced Topics in Computer Systems Lecture 26 Meltdown/Spectre November 29th, 2018 John Kubiatowicz Electrical Engineering and Computer.
Chapter 11 Processor Structure and function
Landon Cox January 17, 2018 January 22, 2018
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
University of Illinois at Urbana-Champaign
CMSC 611: Advanced Computer Architecture
MicroScope: Enabling Microarchitectural Replay Attacks
Attacking Windows using Intel TSX
Operating System Reliability
Spectre Attacks: Exploiting Speculative Execution
Meltdown & Spectre Attacks
Operating System Reliability
Presentation transcript:

Diptendu Kar diptendu.kar@colostate.edu

Meltdown and Spectre Meltdown was independently discovered and reported by three teams: Jann Horn (Google Project Zero), Werner Haas, Thomas Prescher (Cyberus Technology), Daniel Gruss, Moritz Lipp, Stefan Mangard, Michael Schwarz(Graz University of Technology) Spectre was independently discovered and reported by two people: Jann Horn (Google Project Zero) and Paul Kocher in collaboration with, in alphabetical order, Daniel Genkin (University of Pennsylvania and University of Maryland), Mike Hamburg (Rambus), Moritz Lipp (Graz University of Technology), and Yuval Yarom (University of Adelaide and Data61) Somewhat related with subtle differences. (will see later)

Example code : x = a +b +c + d * e Out of order execution Example code : x = a +b +c + d * e

Out of order execution (2)

Spectre Basics Spectre exploits speculative execution and branch prediction to leak data from a processor via covert channel (cache lines). Spectre can only read memory from the current process, not the kernel or other physical memory. Spectre breaks the isolation between different applications. It allows an attacker to trick error-free programs, which follow best practices, into leaking their secrets. Spectre is harder to exploit than Meltdown, but it is also harder to mitigate.

Speculative Execution Modern processors perform speculative execution. They execute instructions in parallel or before that are likely to be executed after a branch in code. (if/else) These instruction may never be really executed , so a sort of CPU snapshot is taken at the branch so the execution can be “rolled back” if needed. If(foo_array[index1] ^ foo_array[index2] == 0) { result = bar_array[100] } else { result = bar_array[200] }

Branch Prediction How does the CPU know which side of the branch (if/else) to speculatively execute. Branch prediction algorithms are trained based on current executions. AMD states that ‘Ryzen’ processors have and artificial intelligence neural network to predict this. The CPU learns which branch will be executed from previous executions of the same code. Incorrect branch predictions causes “rollback” of instructions. Old register states are preserved, can be restored. Memory writes are buffered, can be discarded. Cache modifications are not restored !

Spectre Effects The Spectre vulnerability does not allow an unprivileged process to read privileged memory (as we saw in Meltdown). Spectre does allow code executing in victim process to access data it should not have access to (e.g. JavaScript Sandbox) This is most useful in a browser where one tab may contain attacker code while another tab contains sensitive information that should not be accessible to the attacker. From one VM to another.

Overview of how Spectre works If (x < array1.size) y = array2[array1[x] * 256] ; Execution without speculation is safe. CPU will never read array1[x] for any x >= array1.size Execution with speculation can be exploited. Attacker sets up some condition. Train branch predictor to assume ‘if ’ is likely to be true. Make array1.size and array2[] uncached. Attacker detects cache change (using FLUSH + RELOAD or EVICT + RELOAD) E.g. next read to array2[i * 256 ] will be faster if i = array1[x], since this got cached during misspeculation. Note: only a few instructions are needed to run speculatively. But CPUs can run many more (180 on avg., 200 on Haswell)

Violating Javascripts Sandbox

Spectre vs Meltdown Meltdown Spectre Allows kernel memory read Yes No Leaks arbitrary user memory Could be executed remotely Sometimes Definitely Most likely to impact Kernel integrity Browser memory Found to work in Intel Intel AMD ARM

Mitigations There are patches against Meltdown for Linux ( KPTI (formerly KAISER)), Windows, and OS X.  There is also work to harden software against future exploitation of Spectre, respectively to patch software after exploitation through Spectre ( LLVM patch,  MSVC,  ARM speculation barrier header).

Thank You Thoughts..