Secure Virtual Architecture: A Safe Execution Environment for Commodity Operating Systems John Criswell, University of Illinois Andrew Lenharth, University.

Slides:



Advertisements
Similar presentations
Architectural Support for Software-Based Protection Mihai Budiu Úlfar Erlingsson Martín Abadi ASID Workshop, Oct 21, 2006 Silicon Valley.
Advertisements

Department of Computer Science and Engineering University of Washington Brian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Dec 5, 2007University of Virginia1 Efficient Dynamic Tainting using Multiple Cores Yan Huang University of Virginia Dec
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM B. Bershad, S. Savage, P. Pardyak, E. G. Sirer, D. Becker, M. Fiuczynski, C. Chambers,
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
SAFECode Memory Safety Without Runtime Checks or Garbage Collection By Dinakar Dhurjati Joint work with Sumant Kowshik, Vikram Adve and Chris Lattner University.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
SAFECode SAFECode: Enforcing Alias Analysis for Weakly Typed Languages Dinakar Dhurjati University of Illinois at Urbana-Champaign Joint work with Sumant.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Static Analysis of Embedded C Code John Regehr University of Utah Joint work with Nathan Cooprider.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Type-Safe Programming in C George Necula EECS Department University of California, Berkeley.
Extensibility, Safety and Performance in the SPIN Operating System Bershad et al Presentation by norm Slides shamelessly “borrowed” from Stefan Savage’s.
Programmability with Proof-Carrying Code George C. Necula University of California Berkeley Peter Lee Carnegie Mellon University.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
LIFT: A Low-Overhead Practical Information Flow Tracking System for Detecting Security Attacks Feng Qin, Cheng Wang, Zhenmin Li, Ho-seop Kim, Yuanyuan.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Extensibility, Safety and Performance in the SPIN Operating System Dave Camarillo.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science PLDI 2006 DieHard: Probabilistic Memory Safety for Unsafe Programming Languages Emery.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines Mark Zbikowski and Gary Kimura.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Tanenbaum 8.3 See references
Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu,
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS Michael M. Swift Brian N. Bershad Henry M. Levy University of Washington.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
Secure Virtual Architecture John Criswell, Arushi Aggarwal, Andrew Lenharth, Dinakar Dhurjati, and Vikram Adve University of Illinois at Urbana-Champaign.
Recent Advances in System Software Dependability 周枫 网易公司 清华大学
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
A Virtual Instruction Set Interface for Operating System Kernels John Criswell, Brent Monroe, Vikram Adve University of Illinois at Urbana-Champaign.
1 Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield.
CHAPTER FOUR COMPUTER SOFTWARE.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
{ Enhanced Operating System Security Through Efficient and Fine-grained Address Space Randomization Cristiano Giuffrida, Anton Kuijsten & Andrew S.Tanenbaum.
Enhanced Operating System Security Through Efficient and Fine-grained Address Space Randomization Vikram Reddy Enukonda.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Highly Scalable Distributed Dataflow Analysis Joseph L. Greathouse Advanced Computer Architecture Laboratory University of Michigan Chelsea LeBlancTodd.
Operating Systems Security
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Protecting C Programs from Attacks via Invalid Pointer Dereferences Suan Hsi Yong, Susan Horwitz University of Wisconsin – Madison.
 Programming - the process of creating computer programs.
MIDORI The Windows Killer!! by- Sagar R. Yeole Under the guidance of- Prof. T. A. Chavan.
Efficient software-based fault isolation Robert Wahbe, Steven Lucco, Thomas Anderson & Susan Graham Presented by: Stelian Coros.
CS533 Concepts of Operating Systems Jonathan Walpole.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Language Based Operating Systems by Sean Olson What is a virtual machine? What is managed code? Kernels. Memory and security models. What is a language.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Computer System Structures
Computer System Structures
Protecting Memory What is there to protect in memory?
Dynamic Compilation Vijay Janapa Reddi
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
OS Virtualization.
High Coverage Detection of Input-Related Security Faults
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
The Design & Implementation of Hyperupcalls
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Presentation transcript:

Secure Virtual Architecture: A Safe Execution Environment for Commodity Operating Systems John Criswell, University of Illinois Andrew Lenharth, University of Illinois Dinakar Dhurjati, DoCoMo Communications Laboratories, USA Vikram Adve, University of Illinois

What is a Safe Execution Environment? Intuitively, the environment provided by a safe programming language (e.g., Java, C#) Array indexing stays within object bounds No uses of uninitialized variables All operations are type safe No uses of dangling pointers Control flow obeys program semantics Sound operational semantics

State of the Art Research operating systems built with safe languages Not used in commodity OSs (written in C/C++) Windows Mac OS X Linux Solaris AIX BSD … and many, many, many others…

Why a Safe Execution Environment for Commodity Systems? Security Memory error vulnerabilities in OS kernel code are a reality 1 Novel Design Opportunities Safe kernel extensions (e.g. SPIN) Single address space OSs (e.g. Singularity) Develop New Solutions to Higher-Level Security Challenges Information flow policies Encoding security policies in type system Preventing memory exhaustion attacks 1. Month of Kernel Bugs (

Secure Virtual Architecture Compiler-based virtual machine Uses analysis & transformation techniques from compilers Supports commodity operating systems (e.g., Linux) Typed virtual instruction set enables sophisticated program analysis Provide safe execution environment for commodity OSs Commodity OS Hardware Compiler + VM Virtual ISA Native ISA

Contributions Compiler-based virtual machine that Hosts a commodity OS Supports sophisticated compiler analysis techniques First system to provide safety guarantees for complete commodity OS (e.g., Linux) Retain explicit memory deallocation Retain custom kernel memory allocators

Outline  SVA Architecture SVA Safety Experimental Results

Memory Safety Run-time Library Hardware OS Memory Allocator SVA Virtual Machine SVA System Architecture Applications OS Kernel SVA ISA Native ISA Safety Checking Compiler Drivers Native Code Generator SVA-OS Run-time Library Safety Verifier Hardware

Software Flow Safety Checking Compiler Safety Verifier Code Generator Compile-Time: Install/Load/Run-Time: Kernel/Application Source Bytecode with Safe Types Bytecode + Run-Time Checks Native Code Hardware TCB

Virtual Instruction Set SVA-Core Based on LLVM 1,2 Typed, Explicit Control Flow Graph, Explicit SSA form Sophisticated compiler analysis and transformation SVA-OS OS-neutral instructions support commodity OSs Removes difficult to analyze assembly code Encapsulates privileged operations Like porting to a new hardware architecture 1.[CGO 2004] 2.

Outline SVA Architecture  SVA Safety Experimental Results

Secure Virtual Architecture Goals Maximize safety guarantees Minimize reliance on OS correctness Minimize kernel changes Retain original kernel memory allocators Allocators have special semantics and features Custom pool allocators (e.g., Linux kmem_cache_alloc()) Flags for DMA memory, pinned memory, etc.

SVA Safety Guarantees Safe LanguageSecure Virtual Architecture Array indexing within bounds No uses of uninitialized variables Type safety for all objectsType safety for subset of objects No uses of dangling pointersDangling pointers are harmless Control flow integrity Sound operational semantics Dangling pointers & non-type-safe objects do not compromise other guarantees Stronger than systems that do not provide any dangling pointer protection

Safety Checks & Transforms Safety Checks Load/Store Checks Bounds Checks Illegal Free Checks Indirect Call Checks Safety Transforms Stack to heap promotion Memory initialization Object Bounds Tracking Methods “Fat” Pointers [SafeC, CCured, Cyclone,…] Programmer Annotations [SafeDrive,…] Object Lookups [Jones-Kelly,SAFECode,…]

Memory Tracking Data Structure Naive Safety Checks P1=kmem_cache_alloc(inode_cache); pchk_reg_obj (P1, reg_size(inode_cache)); … Dest = &P1[index]; bounds = pchk_get_bounds (P1); pchk_check_bounds (P1, Dest, bounds); … P2=vmalloc(size1); pchk_reg_obj (P2, size1); P3=kmem_cache_alloc(file_cache); pchk_reg_obj (P3, reg_size(file_cache)); P4=kmem_cache_alloc(inode_cache); pchk_reg_obj (P4, reg_size(inode_cache)); P1 P4 P2 SVM Metadata: Kernel Code: P3 Run-time lookups are too slow Limited opportunity to remove run-time checks

Improved Object Lookups 1 Alias analysis (DSA) groups objects into logical partitions Run-time records object allocations in partitions Run-time checks only consider objects in a single partition Reduces slowdown from 4x-11x to 10%-30% for nearly all standalone programs, daemons Memory Partitioned Object Set Pointers 1. Dhurjati et al. [ICSE 2006]

Type Safe (Homogeneous) Partitions 1 Alias analysis performs type inference Type-homogeneous partitions reduce run-time checks: No load/store checks No indirect call checks Harmless dangling pointers Type-unsafe partitions require all run-time checks Proved sound operational semantics [PLDI 2006] 1. Dhurjati et al. [TECS 2005, PLDI 2006] Memory Blue Partition Red Partition

Kernel Pool Allocator Constraints All objects from same pool must be in same partition Only reuse memory internally for type-homogeneous partitions Objects must be aligned at a multiple of the object size Inode Kernel Pool Blue Partition Red Partition

SVM Memory Safety P1=kmem_cache_alloc(inode_cache); pchk_reg_obj (MP1, P1, reg_size(inode_cache)); … Dest = &P1[index]; bounds = pchk_get_bounds (MP1, P1); pchk_check_bounds (P1, Dest, bounds); P2=vmalloc(size1); pchk_reg_obj (MP2, P2, size1); P3=kmem_cache_alloc(file_cache); pchk_reg_obj (MP3, P3, reg_size(file_cache)); P4=kmem_cache_alloc(inode_cache); pchk_reg_obj (MP1, P4, reg_size(inode_cache)); P1 P4 P2 SVM Metadata: Kernel Code: P3 MP1 MP3 MP2

Outline SVA Architecture SVA Safety  Experimental Results

Prototype Implementation Ported Linux to SVA instruction set Similar to porting to new hardware architecture Compiled using LLVM Wrote SVA-OS as run-time library linked into kernel Provide safety guarantees to entire kernel except: Memory management code Architecture-dependent utility library Architecture-independent utility library

Linux Kernel Modifications SectionOriginal LOCSVA-OSAllocatorsAnalysisTotal Modified Arch-indep Core9, Net Drivers399, Net Protocols169, Core FS18, Ext35, Total Indep603, Arch-dep29,2374,777014,778 Few memory allocator changes needed Architecture-dependent code almost exclusively modified for SVA-OS port Few changes to architecture-independent code

Web Server Bandwidth Memory safety overhead less than 59% Transfers of larger file sizes show acceptable overhead

Server Latency Overhead Many short data transfers suffer high memory safety overhead Overhead acceptable for larger file sizes Acceptable overhead for security-critical servers

Exploits Tried 5 memory exploits that work on Linux Uncaught exploit due to code not instrumented with checks BugTraq IDKernel ComponentCaught? 11956Console Driver Yes! 10179TCP/IP Yes! 11917TCP/IP Yes! 12911Bluetooth Protocol Yes! 13589ELF/Support LibraryNo

Performance Improvements Source code changes Smarter run-time checks Selective use of “fat” pointers Pre-checking all accesses within monotonic loops Removing redundant object lookups and run-time checks Very fast indirect call checks Improve static analysis Stronger type inference More precise call graph Restore context sensitivity Static array bounds checking

Future Work Ensure safe use of: SVA-OS instructions MMU configuration DMA operations Novel OS Designs Recovery semantics for the virtual machine Private application memory Information flow

Contributions Compiler-based virtual machine that Hosts a commodity OS Supports sophisticated compiler analysis techniques First system to provide safety guarantees for complete commodity OS (e.g., Linux) Retain explicit memory deallocation Retain custom kernel memory allocators Questions? See what we do at