A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010.

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

Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Programming Languages and Paradigms
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 11 – Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
Chapter 3 Loaders and Linkers
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM B. Bershad, S. Savage, P. Pardyak, E. G. Sirer, D. Becker, M. Fiuczynski, C. Chambers,
Chap 2 System Structures.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
Testing and Analysis of Device Drivers Supervisor: Abhik Roychoudhury Author: Pham Van Thuan 1.
A Practical Dynamic Buffer Overflow Detector (CRED) Olatunji Ruwase Monica S. Lam Transmeta Corp. Stanford University Network and Distributed Security.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Communication in Distributed Systems –Part 2
Scalable and Flexible Static Analysis of Flight-Critical Software Guillaume P. Brat Arnaud J. Venet Carnegie.
Lecture 16 Buffer Overflow
Efficient Protection of Kernel Data Structures via Object Partitioning Abhinav Srivastava, Jonathon Giffin AT&T Labs-Research, HP Fortify ACSAC 2012.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
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?
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS Michael M. Swift Brian N. Bershad Henry M. Levy University of Washington.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Secure Virtual Architecture: A Safe Execution Environment for Commodity Operating Systems John Criswell, University of Illinois Andrew Lenharth, University.
Secure Virtual Architecture John Criswell, Arushi Aggarwal, Andrew Lenharth, Dinakar Dhurjati, and Vikram Adve University of Illinois at Urbana-Champaign.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Improving the Reliability of Commodity Operating Systems.
SafeDrive: Safe and Recoverable Extensions Using Language-Based Techniques Feng Zhou, Jeremy Condit, Zachary Anderson, Ilya Bagrak, Rob Ennals, Matthew.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
Specialization Tools and Techniques for Systematic Optimization of System Software Presented By: Ashwini Kulkarni Operating Systems Winter 2006.
CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Operating Systems Security
Protecting C Programs from Attacks via Invalid Pointer Dereferences Suan Hsi Yong, Susan Horwitz University of Wisconsin – Madison.
Full and Para Virtualization
Buffer overflow and stack smashing attacks Principles of application software security.
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.
RUNTIME ENVIRONMENT AND VARIABLE BINDINGS How to manage local variables.
Buffer Overflows Taught by Scott Coté.-. _ _.-. / \.-. ((___)).-. / \ /.ooM \ / \.-. [ x x ].-. / \ /.ooM \ -/ \ /-----\-----/---\--\ /--/---\-----/-----\ / \-
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Improving the Reliability of Commodity Operating Systems Michael M. Swift, Brian N. Bershad, Henry M. Levy Presented by Ya-Yun Lo EECS 582 – W161.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
Chapter 10 Buffer Overflow 1. A very common attack mechanism o First used by the Morris Worm in 1988 Still of major concern o Legacy of buggy code in.
1 Introduction to Information Security , Spring 2016 Lecture 2: Control Hijacking (2/2) Avishai Wool.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Introduction to Operating Systems Concepts
Introduction to Operating Systems
Protection of System Resources
Suman Jana *Original slides from Vitaly Shmatikov
Operating System I/O System Monday, August 11, 2008.
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
Inline Reference Monitors: SFI, CFI, XFI, WIT, NaCl
Introduction to Operating Systems
IMPROVING THE RELIABILITY OF COMMODITY OPERATING SYSTEMS
Lecture Topics: 11/1 General Operating System Concepts Processes
Operating Systems Lecture 3.
CETS: Compiler-Enforced Temporal Safety for C
Understanding and Preventing Buffer Overflow Attacks in Unix
Run-time environments
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Return-to-libc Attacks
Presentation transcript:

A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010

Introduction Terminology – Device Drivers in Windows – (Kernel) Modules in Linux Improve OS extensibility and customization – Use new hardware devices – Increase application performance Browsers RAMDISK Reduce OS Reliability – Typically written by non kernel developers – Linux Makes up over 50 % of source code 7X bug density relative to rest of kernel – 90 % of Windows XP crashes

Survey Methodology Instrumentation based techniques: SafeDrive, XFI, BGI – Protect against buggy, but not malicious drivers – Generic programming errors (23 % of Linux driver errors) Detected driver errors – No discussion of recovery from driver errors Key Ideas – Metadata – Instrumentation Limitations – False negatives – Not applicable to driver binaries – Interposition library complexity i.e kernel & driver function wrappers – Driver code restrictions Comparison to Lifeguard approach

SafeDrive [Zhou et al OSDI ‘06] Detected driver errors – Out-of-bounds access Key Ideas – Annotate driver and kernel header sources with pointer bounds information – Compile-time instrumentation of driver with bounds checks based on annotations – Kernel wrappers to track memory (de)allocation

Annotations & Runtime checks Linux e1000 network card driver

SafeDriver Compilation of SafeDrivers Block Diagram of SafeDriver in Linux

SafeDrive Limitations Concurrency breaks check/access atomicity Not applicable to driver binaries False Negatives – No memory access control i.e (r,w,x) violations Code restrictions –No casts between “significantly” different types –Array & length encapsulated in struct Annotation burden –4 % of driver source code –~ 943 LOC of kernel headers Fairly complex interposition library

XFI [Erlingsson et al OSDI’06] Detected driver errors –Unpermitted (r,w,x) memory access –Illegal control flow transfers Key Ideas – Accessible memory of driver Data sections and allocated memory Pointers passed by kernel – Binary rewriting & verification to load only instrumented drivers Control flow, stack overflow, memory range checks – Two stacks for driver execution Verified scoped stack: non pointer addressable local vars including return addr Allocation stack: pointer addressable local variables – Kernel & driver wrappers to maintain accessible memory and stacks

XFI Checks Call instruction check Memory write checks

XFI Module

XFI Limitations Concurrency breaks check/access atomicity Improper use of kernel API possible False Negatives –Buffer overflows –Wild pointer accesses Driver code restrictions – No global/static variable access via pointers – No privileged x86 instructions Complex interposition library

BGI [Castro et al SOSP ‘09] Detected driver errors – Unpermitted(read,write, type) memory access – Unpermitted control flow transfers – Misuse of kernel objects and API Key Ideas – Target drivers using Windows Driver Model(WDM) – Protection domains: Kernel & Driver – Byte-granularity access control lists(ACL) Permissions: {read,write,type, } Maintained by compiler instrumentation and kernel wrappers

BGI wrappers(initialize, insert)

BGI Drivers Generating a BGI driver Kernel address space with BGI drivers

BGI Limitations Concurrency breaks check/access atomicity Not applicable to driver binaries Driver code restrictions due to WDM (good ?) – No direct kernel object modification – No inline assembly – Proper static types of variables i.e no void * Kernel/driver complexity increased by wrappers – 16.7 KLOC, 262 kernel, 84 driver wrappers False Negatives – Buffer overflows not detected – Any function with same arg stack size could be called

Comparison to Lifeguard approach SafeDriveXFIBGILifeguard Check/Access atomicityNo Yes Works on driver binariesNoYesNoYes Complex interposition libraryMaybeYes No Restrictions on driver codeYes No Error containment requiredNo Yes