A Scalable Memory Model for Low-Level Code

VMCAI 2009 screenshot

Abstract

Because of its critical importance underlying all other software, low-level system software is among the most important targets for formal verification. Low-level systems software must sometimes make type-unsafe memory accesses, but because of the vast size of available heap memory in today's computer systems, faithfully representing each memory allocation and access does not scale when analyzing large programs. Instead, verification tools rely on abstract memory models to represent the program heap. This paper reports on two related investigations to develop an accurate (i.e., providing a useful level of soundness and precision) and scalable memory model: First, we compare a recently introduced memory model, specifically designed to more accurately model low-level memory accesses in systems code, to an older, widely adopted memory model. Unfortunately, we find that the newer memory model scales poorly compared to the earlier, less accurate model. Next, we investigate how to improve the soundness of the less accurate model. A direct approach is to add assertions to the code that each memory access does not break the assumptions of the memory model, but this causes verification complexity to blow-up. Instead, we develop a novel, extremely lightweight static analysis that quickly and conservatively guarantees that most memory accesses safely respect the assumptions of the memory model, thereby eliminating almost all of these extra type-checking assertions. Furthermore, this analysis allows us to create automatically memory models that flexibly use the more scalable memory model for most of memory, but resorting to a more accurate model for memory accesses that might need it.

Citation

Zvonimir Rakamaric, Alan J. Hu
A Scalable Memory Model for Low-Level Code
Proceedings of the 10th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI), 5403: 290--304, doi:10.1007/978-3-540-93900-9_24, 2009.

BibTeX

@inproceedings{2009_vmcai_rh,
  title = {A Scalable Memory Model for Low-Level Code},
  author = {Zvonimir Rakamaric and Alan J. Hu},
  booktitle = {Proceedings of the 10th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI)},
  series = {Lecture Notes in Computer Science},
  volume = {5403},
  publisher = {Springer},
  editor = {Neil D. Jones and Markus M{\"u}ller-Olm},
  pages = {290--304},
  doi = {10.1007/978-3-540-93900-9_24},
  year = {2009}
}

Acknowledgements

This work was supported by a research grant from the Natural Sciences and Engineering Research Council of Canada and a University of British Columbia Graduate Fellowship.