80 likes | 201 Views
Compositional Verifiers for Mobile Code Safety. Bor-Yuh Evan Chang Adam Chlipala George C. Necula May 12, 2005 OSQ Retreat Santa Cruz, California. code. OR. type checker. Type Safety as an Assurance Mechanism. Type checking is a well-accepted safety assurance mechanism
E N D
Compositional Verifiers for Mobile Code Safety Bor-Yuh Evan Chang Adam Chlipala George C. Necula May 12, 2005 OSQ Retreat Santa Cruz, California
code OR type checker Type Safety as an Assurance Mechanism • Type checking is a well-accepted safety assurance mechanism • Most checkers today: • source-level (e.g. ML, C#, Java) • bytecode-level (e.g. CLI, JVML) • not assembly-level Want: a straightforward extension to assembly-level checking … pushl %ebp movl %esp, %ebp subl $8, %esp movl 12(%ebp), %eax subl $8, %esp movl (%eax), %edx addl $28, %edx pushl $3 pushl %eax movl (%edx), %eax call *%eax … Compositional Verifiers for Mobile Code Safety
Problem • Verifiers for lower-level code are more difficult and tedious to build • Observation 1: Many verification tasks are common to large classes of verifiers • stack overflow checks, adherence to the calling convention (almost all) • dynamic dispatch (object-oriented languages) • Observation 2: Various intermediate-level languages abstract various details Compositional Verifiers for Mobile Code Safety
Basic Idea mem[sp] := 6 sp := sp – 4 jumpfunc push 6 jumpfunc callfunc(6) Stack verifier Call verifier Type verifier Compositional Verifiers for Mobile Code Safety
jumpfunc state Verifier Construction • Verifiers are typically phrased as abstract interpreters or data-flow analyses Call verifier state’ Compositional Verifiers for Mobile Code Safety
callfunc(6) state Verifier Construction Call verifier Type verifier state’ Compositional Verifiers for Mobile Code Safety
Decompile Decompile jumpfunc state Step Step Composing Flow Functions Call verifier Type verifier callfunc(6) callfunc(6) callfunc(6) state state’’ state’’ state’ state’ Compositional Verifiers for Mobile Code Safety
Summary • Intermediate languages seem useful for interfacing between abstract interpreters • Re-use of existing higher-level verifiers (e.g. JBV) • Decomposed abstract transition into • a decompilation phase • a transition phase to expose the abstraction to “higher-level” verifiers • Local decomposition of abstract transition hopefully makes soundness proofs of a composed verifier compositional Compositional Verifiers for Mobile Code Safety