The Static Driver Verifier Research Platform

Slides:



Advertisements
Similar presentations
Advanced programming tools at Microsoft
Advertisements

The SLAM Project: Debugging System Software via Static Analysis
Demand-driven inference of loop invariants in a theorem prover
The Dafny program verifier
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.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Finding bugs: Analysis Techniques & Tools Comparison of Program Analysis Techniques CS161 Computer Security Cho, Chia Yuan.
Lecture #21 Software Model Checking: predicate abstraction Thomas Ball Testing, Verification and Measurement Microsoft Research.
Bebop: A Symbolic Model Checker for Boolean Programs Thomas Ball Sriram K. Rajamani
1 Thorough Static Analysis of Device Drivers Byron Cook – Microsoft Research Joint work with: Tom Ball, Vladimir Levin, Jakob Lichtenberg,
Chair of Software Engineering Software Verification Stephan van Staden Lecture 10: Model Checking.
Thomas Ball, Rupak Majumdar, Todd Millstein, Sriram K. Rajamani Presented by Yifan Li November 22nd In PLDI 01: Programming Language.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Upcoming Changes in the WDK Upcoming Changes in the Windows Driver Kit Griffin Cole Program Manager WDK Craig Ziegler Test Lead WDK Ted Hudek Documentation.
Lazy Abstraction Thomas A. Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre UC Berkeley.
Synergy: A New Algorithm for Property Checking
Secrets of Software Model Checking Thomas Ball Sriram K. Rajamani Software Productivity Tools Microsoft Research
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball and Sriram K. Rajamani Software Productivity Tools, Microsoft Research Presented.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
Using Static Analysis Tools When Developing Drivers Adam Shapiro Senior Program Manager Devices and Storage Technologies
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Lazy Abstraction Tom Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Caltech Pasadena, CA 12 November 2009.
Static Analysis And Verification Of Drivers Donn Terry Software Development Engr. Microsoft Corporation Vlad Levin Software Development Engr. Microsoft.
Automated Tools for Software Reliability Suhabe Bugrara Stanford University.
©2005 GE Fanuc Automation, Inc. All Rights Reserved PACSystems Training Programmer’s Toolkit.
10th TTCN-3 User Conference, 7-9 June 2011, Bled, Slovenia AUTOSAR Conformance Tests - Feedback on their development and utilization Alain Feudjio-Vouffo,
CSC2108 Lazy Abstraction on Software Model Checking Wai Sum Mong.
Verifying Concurrent Message- Passing C Programs with Recursive Calls Sagar Chaki, Edmund Clarke, Nicholas Kidd, Thomas Reps, and Tayssir Touili.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Towards Scalable Modular Checking of User-defined Properties Thomas Ball, MSR Brian Hackett, Mozilla Shuvendu Lahiri, MSR Shaz Qadeer, MSR Julien Vanegue,
How to Add WMI Interfaces to SCSIPort and Storport Miniports
Mining Windows Kernel API Rules Jinlin Yang 09/28/2005CS696.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
1 Lecture 19 Configuration Management Software Engineering.
1 Specialization Tools and Techniques for Systematic Optimization of System Software McNamee, Walpole, Pu, Cowan, Krasic, Goel, Wagle, Consel, Muller,
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 3: Modular Verification with Magic, Predicate Abstraction.
Rule Checking SLAM Checking Temporal Properties of Software with Boolean Programs Thomas Ball, Sriram K. Rajamani Microsoft Research Presented by Okan.
Aditya V. Nori, Sriram K. Rajamani Microsoft Research India.
Newton: A tool for generating abstract explanations of infeasibility1 The Problem P (C Program) BP (Boolean Program of P) CFG(P) CFG(BP)
16 October Reminder Types of Testing: Purpose  Functional testing  Usability testing  Conformance testing  Performance testing  Acceptance.
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball, Sriram K. MSR Presented by Xin Li.
1 Splint: A Static Memory Leakage tool Presented By: Krishna Balasubramanian.
Model Checking C Programs Zijiang (James) Yang Department of Computer Science Western Michigan University In collaboration with NEC Laboratories America.
Jakob Lichtenberg Software Development Engineer SDV Adam Shapiro Program Manager Donn Terry Software Development Engineer PFD.
The Yogi Project Software property checking via static analysis and testing Aditya V. Nori, Sriram K. Rajamani, Sai Deep Tetali, Aditya V. Thakur Microsoft.
4 th SDL and MSC Workshop SAM’04 Ottawa 1st-4th June 2004 Alkiviadis Yiannakoulias NTUA
Customer and Partner Connections Design and Develop Assess and Certify.
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
1 Automatically Validating Temporal Safety Properties of Interfaces - Overview of SLAM Parts of the slides are from
1 Static Driver Verifier Byron Cook – Microsoft Research Joint work with: Tom Ball, Vladimir Levin, Jakob Lichtenberg, Con McGarvey,
Software Testing Strategies for building test group
Static Analysis And Verification Of Drivers
Working with Java.
Static Analysis And Verification Of Drivers
Developing Drivers in Visual Studio
High Coverage Detection of Input-Related Security Faults
null, true, and false are also reserved.
Design and Programming
Over-Approximating Boolean Programs with Unbounded Thread Creation
Chapter 10 – Software Testing
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CSE 1020:Software Development
Course: CS60030 Formal Systems
C# Language & .NET Platform 10th Lecture
Presentation transcript:

The Static Driver Verifier Research Platform Thomas Ball1, Ella Bounimova1, Vladimir Levin2, Rahul Kumar2, and Jakob Lichtenberg2 1Microsoft Research 2Microsoft Windows http://research.microsoft.com/slam/

Plan Static Driver Verifier (SDV) SDV Research Platform Conclusion Creating SDVRP Plugins Boolean Program repository SLAM2 verification engine Conclusion

The Static Driver Verifier Static Driver Verifier (SDV): Compile-time verification tool Ships with Windows 7 Driver Kit (WDK) Less than 4% false alarms on real drivers Supports many driver APIs (WDM, KMDF, NDIS, …) Uses SLAM as the verification engine Based on CEGAR loop Boolean abstraction of input C programs API-specific components: environment model API rules in SLIC language

Static Driver Verifier Rules Precise API Usage Rules (SLIC) Static Driver Verifier Environment model Defects 100% path coverage Driver’s Source Code in C

SDV Research Platform Academic release of SDV, based on the code that ships with Windows 7 WDK Write custom plugins for APIs other than device drivers and custom API rules Apply SDV to verify modules (clients) written in C that use the APIs Based on the new, robust SLAM2 engine [see upcoming FMCAD2010 paper]

New in This Release: Boolean Program Test Suite About 2,800 Boolean programs (BPs) from SDV runs on Windows 7 Device Drivers BP size: 1 - 31 Mb Results from running SDV Boolean program model checker Bebop on these programs Test scripts used to run Bebop – substitute your BP model checker in place of Bebop!

Driver and Operating System: A Module and an Environment Device Driver Interface KeAcquire SpinLock KeRelease SpinLock Driver Entry Point I/O Manager

Replace Environment by Environment Model Device Driver Interface Model KeAcquire SpinLock KeRelease SpinLock Driver Entry Point I/O Manager Model

API SLIC Rule I/O Manager state { Model Device Driver InterfaceModel KeAcquire SpinLock KeRelease SpinLock Driver Entry Point I/O Manager Model state { enum {unlocked, locked} s = unlocked; } RunDispatchFunction.exit { if (s != unlocked) abort; KeAcquireSpinLock.entry else s = locked; KeReleaseSpinLock.entry if (s != locked) abort; else s = unlocked;

Generalized to Arbitrary Module API Stubs Module Entry Point Harness state { ... } Your Rule Here

SDVRP Plugin: Two Parts Platform model (in C) Harness API stubs API usage rules (in SLIC)

Plugin Examples in SDVRP Plugins for driver platforms: WDM, KMDF, NDIS – can be extended Custom platform and plugin – a simple, but complete example

Example: Custom Platform and Plugin Custom Platform (what to verify) Platform implementation Sample driver (with a bug) Custom Plugin (what to write) sample platform rule platform model

Platform APIs and Data Types Data: CUSTOM_IRP: request packet CUSTOM_LOCK: int CUSTOM_STATUS: return status for APIs APIs: CUSTOM_READ CUSTOM_WRITE CustomAcquireLock CustomReleaseLock CustomMemMove

The Rule: CustomLock.slic ... state{ enum {unlocked, locked} s = unlocked;} watch CustomAcquireLock.exit.$1; CustomAcquireLock.exit[guard $1] { if(s==locked) { abort "The driver is calling $fname after already acquiring the lock.“; } else { s=locked;}} CustomReleaseLock.exit[guard $1] { if(s==unlocked) { abort "The driver is calling $fname without first acquiring the lock.“; } else { s=unlocked;}} sdv_stub_custom_main_end.entry { if(s==locked) { abort "The driver has returned from an entry point without releasing the lock.";}}

Sample Driver Entry points: CUSTOM_STATUS DriverWrite(PCUSTOM_IRP irp) {…} CUSTOM_STATUS DriverRead(PCUSTOM_IRP irp) { CUSTOM_STATUS status; CustomAcquireLock(&(DriverData.Lock)); /* Left out: read DriverData.buffer from disk. */ status=CustomMemMove(irp->buffer, DriverData.buffer, 512); if (status==CUSTOM_STATUS_UNSUCCESSFUL) return CUSTOM_STATUS_UNSUCCESSFUL; } CustomReleaseLock(&(DriverData.Lock)); return CUSTOM_STATUS_SUCCESS;

Platform API model CustomMemMove stub: CUSTOM_STATUS CustomMemMove(char *dst, char *src, int bytes) { int choice = SdvMakeChoice(); switch (choice) { case 0: return CUSTOM_STATUS_SUCCESS; default: return CUSTOM_STATUS_UNSUCCESSFUL; }

Platform model: test harness int sdv_main() { CUSTOM_STATUS status; int choice = SdvMakeChoice(); switch (choice) { case 0: status=fun_CUSTOM_READ(sdv_pcustom_irp); break; case 1: status=fun_CUSTOM_WRITE(sdv_pcustom_irp); default: status=sdv_DoNothing(); }}

Defect in sample driver

SLAM2 Verification Engine Improvements include Boolean abstraction on basic blocks Error Trace validation: combination of forward and backwards symbolic execution Optimized predicate discovery Uses Z3, new axiomatization of pointers Only if I have time

SLAM2 Verification Engine SLAM 2.0 released with SDV 2.0, part of Windows 7 WDK Parameter for WDM drivers SDV 2.0 (SLAM2) SDV 1.6 (SLAM1) False defects 0.4% (2/512) 19.7% (31/157) Give-up results 3.2% (187/5727) 6% (285/4692)

Download/Installation Download and installation instructions on http://research.microsoft.com/slam/ SDVRP requires that the (freely available) Windows Driver Kit Version 7.1.0 (WDK) be installed first Install the SDVRP on top of WDK TODO: edit item (2)

Conclusion SDVRP toolkit for customizable verification of client code against API rules SDV for Windows 7 based on SLAM2 Boolean program repository Licensed for research purposes SDVRP discussion alias: sdvrpdis@microsoft.com