< Back to previous page

Publication

Sound modular verification of C code executing in an unverified context

Journal Contribution - Journal Article

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.
Journal: PROCEEDINGS OF THE 12TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON HASKELL (HASKELL '19)
ISSN: 0362-1340
Issue: 1
Volume: 50
Pages: 581 - 594
Publication year:2015
BOF-keylabel:yes
IOF-keylabel:yes
BOF-publication weight:0.1
CSS-citation score:1
Authors from:Higher Education
Accessibility:Open