Testing and Analysis of Device Drivers Supervisor: Abhik Roychoudhury Author: Pham Van Thuan 1.

Slides:



Advertisements
Similar presentations
Advanced programming tools at Microsoft
Advertisements

Lecture 101 Lecture 10: Kernel Modules and Device Drivers ECE 412: Microcomputer Laboratory.
purpose Search : automation methods for device driver development in IP-based embedded systems in order to achieve high reliability, productivity, reusability.
Recovering Device Drivers Michael M Swift, Muthukaruppan Annamalai, Brian N Bershad and Henry Levy.
Leonardo de Moura Microsoft Research. Z3 is a new solver developed at Microsoft Research. Development/Research driven by internal customers. Free for.
Threads, SMP, and Microkernels
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Control Flow Analysis (Chapter 7) Mooly Sagiv (with Contributions by Hanne Riis Nielson)
TaintScope: A Checksum-Aware Directed Fuzzing Tool for Automatic Software Vulnerability Detection Tielei Wang 1, Tao Wei 1, Guofei Gu 2, Wei Zou 1 1 Peking.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chapter 6 Security Kernels.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Submitted by: Omer & Ofer Kiselov Supevised by: Dmitri Perelman Networked Software Systems Lab Department of Electrical Engineering, Technion.
1 Static Testing: defect prevention SIM objectives Able to list various type of structured group examinations (manual checking) Able to statically.
Static Analysis of Embedded C Code John Regehr University of Utah Joint work with Nathan Cooprider.
Software Testing and Quality Assurance
Program analysis Mooly Sagiv html://
Program analysis Mooly Sagiv html://
Ritu Varma Roshanak Roshandel Manu Prasanna
CS590 Z Software Defect Analysis Xiangyu Zhang. CS590F Software Reliability What is Software Defect Analysis  Given a software program, with or without.
Figure 1.1 Interaction between applications and the operating system.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
E Virtual Machines Lecture 4 Device Virtualization
MDK-ARM Microcontroller Development Kit MDK: Microcontroller Development Kit.
CSC2108 Lazy Abstraction on Software Model Checking Wai Sum Mong.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Chapter 3 Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
DART: Directed Automated Random Testing Koushik Sen University of Illinois Urbana-Champaign Joint work with Patrice Godefroid and Nils Klarlund.
CUTE: A Concolic Unit Testing Engine for C Technical Report Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
Disco : Running commodity operating system on scalable multiprocessor Edouard et al. Presented by Jonathan Walpole (based on a slide set from Vidhya Sivasankaran)
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Kernel, processes and threads Windows and Linux. Windows Architecture Operating system design Modified microkernel Layered Components HAL Interacts with.
Department of Computer Science A Static Program Analyzer to increase software reuse Ramakrishnan Venkitaraman and Gopal Gupta.
A Survey of Dynamic Techniques for Detecting Device Driver Errors Olatunji Ruwase LBA Reading Group 18 th May 2010.
Automated Whitebox Fuzz Testing Network and Distributed System Security (NDSS) 2008 by Patrice Godefroid, ‏Michael Y. Levin, and ‏David Molnar Present.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Disco : Running commodity operating system on scalable multiprocessor Edouard et al. Presented by Vidhya Sivasankaran.
Xusheng Xiao North Carolina State University CSC 720 Project Presentation 1.
CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Scalable Symbolic Execution: KLEE.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
ICFEM 2002, Shanghai Reasoning about Hardware and Software Memory Models Abhik Roychoudhury School of Computing National University of Singapore.
CUTE: A Concolic Unit Testing Engine for C Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
1 Software Reliability in Wireless Sensor Networks (WSN) -Xiong Junjie
VMM Based Rootkit Detection on Android
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
Virtual Machines Mr. Monil Adhikari. Agenda Introduction Classes of Virtual Machines System Virtual Machines Process Virtual Machines.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
Hello world !!! ASCII representation of hello.c.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Android Mobile Application Development
A Review of Software Testing - P. David Coward
Chapter 2: Operating-System Structures
Dr.K.Venkata Subba Reddy Professor-CSE Department
Chapter 8 – Software Testing
Linux Operating System Architecture
Specifying Multithreaded Java semantics for Program Verification
A Survey on Virtualization Technologies
CUTE: A Concolic Unit Testing Engine for C
Predicate Abstraction
Presentation transcript:

Testing and Analysis of Device Drivers Supervisor: Abhik Roychoudhury Author: Pham Van Thuan 1

Agenda 2  Problem statement  Literature review  Open research problems  RQ-1. Subsystem aware test case generation  RQ-2. Testing device protocol violation bugs  Preliminary work

Problem statement  Device driver bugs are the main cause of OS crashes (85% crashes of Windows XP, 53% out of 1000 defects in Linux kernel 2.6.9).  How to find these bugs and/or prevent their negative effects. 3 Software model checking Testing and analysis Isolating and tolerating Modifying current driver architectures Static analysis + code transformation Dynamic symbolic execution based testing

Linux device driver architecture 4

Classification of common device driver bugs 5  Incorrect use of kernel-internal APIs  Incorrect implementation of the device’s protocol  Concurrency related bug  Memory access violation  Resource leak

Program analysis and Software model checking 6 Static analysis Composite static analysis Predicate abstraction + CEGAR Software model checking Bounded model checking Lazy abstraction Configurable Software Verification SLAM, SATABSBLAST CPAChecker CBMC CEGAR CBMC Abstract interpretation

7 Symbolic Execution Static symbolic execution (SSE) Dynamic symbolic/concolic execution (DSE) DSE + SSE DSE + Selective symbolic execution DSE + State merging DSE + Interpolation DART, KLEE, MAYHEM Compositional DSE Calysto (ICSE’2008) ISCE’2014 POPL’2007 ASPLOS’2011 PLDI’2012 FSE’2013 L1 L2 L3 L4 L5 L6 L7L8 L4

SymDrive: Testing drivers without devices  Static analyzer + code transformation  Test framework  Symbolic device 8

Open research problems  Scalability problem  Reachability problem  Test oracle – Assertion generation  Driver/Device interface violation testing 9

RQ-1. Subsystem aware test case generation 10 Example of Linux driver subsystems

Subsystem aware test case generation 11 Hierarchical view of a USB keyboard device driver

RQ-1.1. Assertion generation 12  Use static analyzer to detect potential buggy locations  Use code transformation technique to insert calls to run-time checkers.  Design checkers for the interface between the kernel and device drivers (Checker can be used for testing several device drivers)

RQ-1.2. Test program generation 13 Test program C library System call interface + Virtual File System Driver subsystem core Device Driver Libc, system calls invocations Open(…) Read(…) Write(…) … Close(…) Generic interfaces: File_operations, block_device_operations, net_device_ops Subsystem specific functions Driver entry points

Skeleton of a driver subsystem call graph 14  Build the skeleton for each driver subsystem.  Generate test program(s) based on the paths in the skeleton of the driver subsystem under test

Entry points RQ-1.3. Driver entry points and assertions reachability 15 Test program C library System call VFS Driver core Device Driver Assertion Test program C library System call VFS Driver core Device Driver Driver entry points reachabilityAssertions reachability

RQ-2. Testing device protocol violation bugs 16  A device driver may violate the protocol of the corresponding hardware device (packet format, sequence of packet transfer, time …)  A Hardware device may run in unexpected states due to bugs in the device driver. Device driver Bus controller + Bus driver Virtual hardware device

RQ-2.1. Virtual symbolic device modeling 17  Symbolic input/output interfaces  Internal working blocks to emulate real hardware device(s) Virtual Symbolic Device S2E Symbolic Device QEMU Virtual hardware device

RQ-2.2. Assertion & Annotation generation 18  Assertion  Assert valid register settings  Assert a correct working state  Assert a correct packet format (received from device driver)  Annotation  Add constraints for the format of packets to be sent to a device driver informal technical documents (datasheets) Assertion, annotation ?

Preliminary work 19  Control Flow Graph (CFG)  Use profiling information to resolve indirect calls, indirect jumps.  Control Dependency Graph (CDG)  CDG works with CFG and the skeleton of the subsystem call graph to guide path exploration and prune uninteresting paths.

Preliminary work 20  Search algorithm replays a path to reach a predefined location (a driver entry point is an example).  Integrate Z3 constraint solver into S2E framework for checking un-sat core, solving string constraints (Z3-str) … (not supported by STP, the default solver of S2E) Assertion Test program C library System call VFS Driver core Device Driver

21 Q&A