Title: Automatic formal verification for Windows device drivers
1Automatic formal verification for Windows device
drivers
Byron Cook bycook_at_microsoft.com
2Windows OS and device drivers
HW
Operating System Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
DD
HW
HW
DD
DD
HW
HW
3Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
4Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
5Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
6Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
7Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
- Example While running at raised interrupt
request level (IRQL), calling KeWaitForSingleObje
ct or KeWaitForMultipleObjects with
Kernel-defined dispatcher object(s) to wait for a
nonzero interval causes a fatal error. Only
driver routines that run in a nonarbitrary thread
context at IRQL PASSIVE_LEVEL, such as
driver-created threads, the DriverEntry and
Reinitialize routines, or Dispatch routines for
inherently synchronous I/O operations, such as
most device I/O control requests, can safely wait
on events, semaphores, mutexes, or timers for a
nonzero interval.
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
8Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
9Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
10Windows OS and device drivers
HW
DD
Kernel
DD
- Examples
- Outlook mail system
- HTTP web server
- Performance monitoring tools
- VM tools
- New networking technologies
- Firewalls
- Virus protection
- Drawing tools
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
11Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
12Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
13Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
14Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
15Windows OS and device drivers
HW
DD
Kernel
DD
HW
DD
HW
DD
DD
DD
DD
DD
DD
HW
DD
DD
DD
DD
DD
HW
HW
DD
DD
DD
DD
DD
HW
HW
16Windows OS device drivers
Nvidia
Symantec
Fujitsu
HW
DD
Nvidia
Kernel
Adaptec
DD
HW
Microsoft
Microsoft
DD
HW
DD
DD
DD
DD
DD
Adaptec
Intel
Microsoft
AOL
DD
HW
Epson
DD
Logitech
??????????
DD
??????????
DD
DD
Sony
DD
HW
HW
Techsoft
McAfee
DD
Sony
??????????
Logitech
DD
DD
Creative
DD
DD
HW
HW
ADI
University student
??????????
Creative
17Windows OS device drivers
Nvidia
Symantec
Fujitsu
HW
DD
Nvidia
Kernel
Adaptec
DD
HW
Microsoft
Microsoft
DD
HW
DD
DD
DD
DD
DD
Adaptec
Intel
Microsoft
AOL
DD
HW
Epson
DD
Logitech
??????????
DD
??????????????????????????????
DD
DD
Sony
DD
HW
HW
Techsoft
McAfee
DD
Sony
??????????
Logitech
DD
DD
Creative
DD
DD
HW
HW
ADI
University student
??????????
Creative
18Static Driver Verifier
- Static Driver Verifier (SDV) is a formal
verification tool for finding bugs in Windows
device drivers - SDV operates on the drivers source code
- SDV is completely automatic
- SDV checks that drivers do not violate a set of
kernel API usage rules - Attempts to prove the correctness of the driver
with the SLAM software model checker
19Static Driver Verifier
- Static Driver Verifier (SDV) is a formal
verification tool for finding bugs in Windows
device drivers - SDV operates on the drivers source code
- SDV is completely automatic
- SDV checks that drivers do not violate a set of
kernel API usage rules - Attempts to prove the correctness of the driver
with the SLAM software model checker
20Static Driver Verifier
ü
Driver sources
SDV
other.h
driver.h
ü
driver.c
ü
ü
21Static Driver Verifier
22Static Driver Verifier
23(No Transcript)
24(No Transcript)
25(No Transcript)
26(No Transcript)
27(No Transcript)
28(No Transcript)
29(No Transcript)
30(No Transcript)
31(No Transcript)
32(No Transcript)
33(No Transcript)
34(No Transcript)
35(No Transcript)
36(No Transcript)
37(No Transcript)
38(No Transcript)
39(No Transcript)
40(No Transcript)
41(No Transcript)
42(No Transcript)
43(No Transcript)
44Static Driver Verifier
- SDV beta is now available on the Windows device
driver development kit (DDK) - This bug would be a really hard bug to find
other than with a tool like SDV. There are just
too many details to keep track of to have a good
chance of finding it. - This looks like a bug to me. This is AWESOME!!
SDV rocks! - These are all real, difficult to discover bugs.
Good work! - This bug would have been very difficult to find
by inspection and it was one of those bugs that
would be near-impossible to reproduce - Fixing this bug will definitely stop some
unexplainable and hard to debug random system
crashes in the future.
45Outline
- Introduction to Static Driver Verifier
- Static Driver Verifier internals
- Conclusion Discussion
46Outline
- Introduction to Static Driver Verifier
- Static Driver Verifier internals
- Conclusion Discussion
47Static Driver Verifier
ü
Driver sources
SDV
other.h
driver.h
ü
driver.c
ü
ü
48Static Driver Verifier
ü
SDV
Driver sources
Rules
other.h
driver.h
ü
SLAM
driver.c
OS model
ü
ü
49Static Driver Verifier Rules
- Expressed in an event-based language
- Possible events
- Function entry
- Function exit
- The code associated with events call the function
error() to indicate a violation - IoCallDriver.entry
-
- if (2-gtTail.Overlay.CurrentStackLocation-
gtMajorFunction - IRP_MJ_POWER)
- error()
-
-
50Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
51Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
52Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
53Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
54Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
55Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
56Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
57Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
58Static Driver Verifier Rules
state int LowerDriverReturn 0 bool
LowerDriverCalled 0 bool PerformCheck
1 with guard (sdv_main,irp) PoCallDriver,IoCa
llDriver.exitguard 2 LowerDriverCalled
1 LowerDriverReturn return IoComple
teRequest,IoMarkIrpPending.entryguard 1
PerformCheck 0 stub_dispatch_end.entry
if ( PerformCheck LowerDriverCalled
LowerDriverReturn ! 1 )
error
Environment
Our Driver
Lower Driver
59Static Driver Verifier
ü
SDV
Rules
other.h
driver.h
ü
SLAM
driver.c
OS model
ü
ü
60Static Driver Verifier OS model
- Provides the main function
- Abstract implementations of kernel APIs (like
IoCallDriver) - Models some aspects of the OS state, like the
interrupt request level (IRQL) - Uses non-deterministic choice
61Static Driver Verifier OS model
NTSTATUS IoCreateDevice( IN PDRIVER_OBJECT
DriverObject, IN ULONG DeviceExtensionSize,
IN PUNICODE_STRING DeviceName OPTIONAL, IN
DEVICE_TYPE DeviceType, IN ULONG
DeviceCharacterisitcs, IN BOOLEAN Exclusive,
OUT PDEVICE_OBJECT DeviceObject )
ULONG Choice SdvChoice() switch (Choice)
case 0 (DeviceObject)
SDV_devobj2 return
STATUS_SUCCESS case 1 return
STATUS_INSUFFICIENT_RESOURCES case 2
return STATUS_OBJECT_NAME_EXISTS
default return STATUS_OBJECT_NAME_COLLISION
62Static Driver Verifier OS model
NTSTATUS IoCreateDevice( IN PDRIVER_OBJECT
DriverObject, IN ULONG DeviceExtensionSize,
IN PUNICODE_STRING DeviceName OPTIONAL, IN
DEVICE_TYPE DeviceType, IN ULONG
DeviceCharacterisitcs, IN BOOLEAN Exclusive,
OUT PDEVICE_OBJECT DeviceObject )
ULONG Choice SdvChoice() switch (Choice)
case 0 (DeviceObject)
SDV_devobj2 return
STATUS_SUCCESS case 1 return
STATUS_INSUFFICIENT_RESOURCES case 2
return STATUS_OBJECT_NAME_EXISTS
default return STATUS_OBJECT_NAME_COLLISION
63Static Driver Verifier
ü
SDV
Rules
other.h
driver.h
ü
SLAM
driver.c
OS model
ü
ü
64Static Driver Verifier SLAM
- Symbolic model checker for C
- Strategy throw away as much irrelevant detail
from the driver as possible through abstraction
search - Algorithm Predicate Abstraction
Counter-example based refinement Symbolic
reachability for Boolean programs - Simplifying (unsound) assumptions
- C unions are ignored
- Memory layout is not known pointer arithmetic is
largely ignored - Coincidental pointer aliasing is ignored,
purposeful aliasing is not - Functions cannot be called both by name and
pointer - The OS model does not exercise all paths possible
in practice
65Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
Assume that f1, f2, f3 and g do not call
AcquireLock or ReleaseLock
66Static Driver Verifier SLAM
int locked 0 AcquireLock.entry if
(locked1) error() else
locked1 ReleaseLock.entry if
(locked0) error() else
locked0
67Static Driver Verifier SLAM
SLAM
68Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Check Step
Instrument Step
Refine Step
Rule violation found
OS model
69Static Driver Verifier SLAM
void AcquireLock()
void ReleaseLock()
void main()
int locked 0 if (locked1)
error() else locked1
if (locked0) error()
else locked0
int locked 0 AcquireLock.entry if
(locked1) error() else
locked1 ReleaseLock.entry
if (locked0) error() else
locked0
void AcquireLock()
void ReleaseLock()
void main()
Are these reachable?
70Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Check Step
Instrument Step
Refine Step
Rule violation found
OS model
71Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1()
f2() f3() if (
)
ReleaseLock()
g()
int a,b,c,rst,cnt cnt 0
rst0 !rst
a b c
altb bltc rst1
72Static Driver Verifier SLAM
void AcquireLock() if ( )
error() else
void ReleaseLock() if ( )
error() else
bool g0 1 // locked0 bool g1 0 //
locked1
int locked 0
locked1
locked1 locked0
locked0
g1 g1 1
g0 0 g0
g0 1 g1 0
State space 2(2 bits(pc)) stack
73Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Instrument Step
Check Step
Refine Step
Rule violation found
OS model
74Static Driver Verifier SLAM
Reachable state-space for steps lt1
75Static Driver Verifier SLAM
Reachable state-space for steps lt1
Reachable state-space for steps lt2
Reachable state-space for steps lt3
76Static Driver Verifier SLAM
Reachable state-space for steps lt1
Reachable state-space for steps lt2
Reachable state-space for steps lt3
Reachable state-space for steps lt4
Reachable state-space for steps lt5
Reachable state-space for steps lt6
77Static Driver Verifier SLAM
Reachable state-space for steps lt8
Reachable state-space for steps lt1
Reachable state-space for steps lt2
Reachable state-space for steps lt3
Reachable state-space for steps lt4
Reachable state-space for steps lt5
Reachable state-space for steps lt7
Reachable state-space for steps lt6
78Static Driver Verifier SLAM
Reachable state-space for steps lt8
Reachable state-space for steps lt9
Reachable state-space for steps lt1
Reachable state-space for steps lt2
Reachable state-space for steps lt3
Reachable state-space for steps lt4
Reachable state-space for steps lt5
Reachable state-space for steps lt7
Reachable state-space for steps lt6
State where PC is at a call to error()
79Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
80Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
81Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
82Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
83Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
84Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
85Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
86Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
87Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
88Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1() f2()
f3() if (
)
ReleaseLock()
g()
89Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Check Step
Instrument Step
Refine Step
Rule violation found
OS model
90Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
91Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
92Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
93Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
94Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
95Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
96Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
97Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
98Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
99Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
100Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
!(rst0)
101Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
!(rst0)
New predicate to track main rst0
102Static Driver Verifier SLAM
void main() int a,b,c,rst,cnt cnt
0 for() AcquireLock()
rst0 while(!rst) a
f1() b f2() c
f3() if (altb bltc)
rst1 ReleaseLock()
g()
cnt0
rst0
!(rst0)
New predicate to track main rst0
103Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Check Step
Instrument Step
Refine Step
Rule violation found
OS model
104Static Driver Verifier SLAM
void main() for()
AcquireLock() while(
) f1()
f2() f3() if (
)
ReleaseLock()
g()
int a,b,c,rst,cnt cnt 0
rst0 !rst
a b c
altb bltc rst1
bool v0 // represents rst0
v01 v0
v00
State space 2(3 bits(pc)) stack
105Static Driver Verifier SLAM
Driver passes rule
Rule
SLAM
Abstract Step
Driver sources
Instrument Step
Check Step
Refine Step
Rule violation found
OS model
106Static Driver Verifier SLAM
Reachable state-space for steps ltn
107Static Driver Verifier SLAM
Reachable state-space for steps ltn
Reachable state-space for steps ltn1
Reachable state-space for steps ltn2
108Static Driver Verifier SLAM
Reachable state-space for steps ltn
Reachable state-space for steps ltn1
Reachable state-space for steps ltn2
Reachable state-space for steps ltn3
Reachable state-space for steps ltn4
Reachable state-space for steps ltn5 and ltn4
109Static Driver Verifier SLAM
Reachable state-space for steps ltn
Reachable state-space for steps ltn1
Reachable state-space for steps ltn2
Reachable state-space for steps ltn3
Reachable state-space for steps ltn4
Reachable state-space for steps ltn5 and ltn4
110Static Driver Verifier SLAM
- The abstraction contains only the PC and these
three state bits - locked1
- locked0
- rst0
- Abstracted away
- Much of f1(), f2(), f3(), g(),
- cnt,
- a, b, c
- Potential values from rst
- From this abstraction we can reasons that the
original C program is also correct
111Static Driver Verifier SLAM
- Developing using
- Pointer analysis
- Weakest pre-conditions
- A symbolic first-order logic theorem prover
with uninterpreted functions
Instrument Step
- Developed using
- A lazy first-order logic theorem prover with
uninterpreted functions based on a propositional
satisfiability solver (SAT)
- Developed using
- CFL-reachability
- Boolean decision diagrams (BDDs)
OS model
112Static Driver Verifier SLAM
- Soup of combined techniques, tools, ideas, etc
- Abstraction (justified in the literature by a
simulation-relation argument) - First-order logic to propositional logic
- C programs to Boolean programs
- BDDs for propositional logic with quantifiers
- CFL-reachability / pushdown automata
- SAT-solving for propositional logic
- Decision procedures for congruence closure and
linear arithmetic - Nelson-Oppen style combination of decision
procedures with axiom instantiation - Proof-generation within automatic theorem provers
- Axioms specifying a logic (of sorts) for pure C
expressions - Pointer analysis
- Weakest preconditions
- Symbolic simulation
- etc
113Outline
- Introduction to Static Driver Verifier
- Static Driver Verifier internals
- Conclusion Discussion
114Outline
- Introduction to Static Driver Verifier
- Static Driver Verifier internals
- Conclusion Discussion
115Conclusion
- SDV
- An automatic formal verification tool that finds
bugs in device drivers - Kernel API usage rules the SLAM model checker
- Beta release available (but only interesting if
you write device drivers)
116Conclusion
- Whats next for SDV-like tools within Microsoft?
- More work on formal API specifications
(contracts). - Liveness termination properties
117Conclusion
- Whats next for SDV-like tools within Microsoft?
- Application of SLAM-like checkers to additional
software - Better handling of loops
- Better handling of deep heap structures
118Conclusion
- Whats next for SDV-like tools within Microsoft?
- Boogie/Spec Extended Static Checking
- Based on classic verification condition
generation - Separation logic or shape analysis?
119Conclusion
- Whats next for SDV-like tools within Microsoft?
- Concurrency
- Zing (explicit-state model checking for
asynchronous programs) - Extending the SLAM approach to modeling
asynchronous threads
120Discussion
- Questions?
- More information available at
- http//www.microsoft.com/whdc/devtools/tools/SDV.m
spx - http//www.microsoft.com/slam
- Pointers to technical papers about SLAM
- Pointers to people involved in the project
- http//www.microsoft.com/bycook
- About me