Sound Modular Verification of C Code Executing in an Unverified Context
Author(s) -
Pieter Agten,
Bart Jacobs,
Frank Piessens
Publication year - 2014
Publication title -
lirias (ku leuven)
Language(s) - English
Resource type - Conference proceedings
ISSN - 0362-1340
DOI - 10.1145/2676726.2676972
Subject(s) - computer science , runtime verification , separation logic , programming language , memory model , modular design , memory safety , control flow , assertion , soundness , memory footprint , context (archaeology) , formal verification , parallel computing , shared memory , compiler , paleontology , biology
Over the past decade, great progress has been made in the static modular verification of C code by means of separation logic-based program logics. However, the runtime guarantees offered by such verification are relatively limited when the verified modules are part of a whole program that also contains unverified modules. In particular, a memory safety error in an unverified module can corrupt the runtime state leading to assertion failures or invalid memory accesses, even in the verified modules. This paper develops runtime checks to be inserted at the boundary between the verified and the unverified part of a program, to guarantee that no assertion failures or invalid memory accesses can occur at runtime in any verified module. One of the key challenges is enforcing the separation logic frame rule, which we achieve by checking the integrity of the footprint of the verified part of the program on each control flow transition from the unverified to the verified part. This in turn requires the presence of some support for module-private memory at runtime. We formalize our approach and prove soundness. We implement the necessary runtime checks by means of a program transformation that translates C code with separation logic annotations into plain C, and that relies on a protected module architecture for providing module-private memory and restricted module entry points. Benchmarks show the performance impact of this transformation depends on the choice of boundary between the verified and unverified parts of the program, but is below 4% for real-world applications.status: publishe
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom