一句话:提出 VIP 内存模型,用显式 provenance 构造简化整数-指针转换,并实现可验证真实 C 代码的 RefinedC-VIP。
系统代码常需对指针值做底层操作,这超出 C 基本指针算术,需借助整数-指针转换。已有内存对象模型(如 PNVI)虽现实但复杂,难以用于验证,且尚无工具能在 PNVI 下验证 C 程序。本文提出 VIP:面向 C 验证的新内存对象模型,增加构造让程序员显式表达整数-指针转换的预期 provenance,从而绕开 PNVI 复杂性,并证明 VIP 与 PNVI 兼容,使基于 VIP 的验证受益于 PNVI 的实践检验。作者实现 RefinedC-VIP,扩展 RefinedC 并生成 Coq 基础证明,在多种系统代码惯用法上评估,并通过 Cerberus 实现验证 VIP 的表达能力。
Systems code often requires fine-grained control over memory layout and pointers, expressed using low-level ( e.g. , bitwise) operations on pointer values. Since these operations go beyond what basic pointer arithmetic in C allows, they are performed with the help of integer-pointer casts . Prior work has explored increasingly realistic memory object models for C that account for the desired semantics of integer-pointer casts while also being sound w.r.t. compiler optimisations, culminating in PNVI, the preferred memory object model in ongoing discussions within the ISO WG14 C standards committee. However, its complexity makes it an unappealing target for verification, and no tools currently exist to verify C programs under PNVI. In this paper, we introduce VIP, a new memory object model aimed at supporting C verification. VIP sidesteps the complexities of PNVI with a simple but effective idea: a new construct that lets programmers express the intended provenances of integer-pointer casts explicitly. At the same time, we prove VIP compatible with PNVI, thus enabling verification on top of VIP to benefit from PNVI’s validation with respect to practice. In particular, we build a verification tool, RefinedC-VIP, for verifying programs under VIP semantics. As the name suggests, RefinedC-VIP extends the recently developed RefinedC tool, which is automated yet also produces foundational proofs in Coq. We evaluate RefinedC-VIP on a range of systems-code idioms, and validate VIP’s expressiveness via an implementation in the Cerberus C semantics.
@article{paperbot1587,
title = {VIP: verifying real-world C idioms with integer-pointer casts},
author = {Rodolphe Lepigre and Michael Sammler and Kayvan Memarian and Robbert Krebbers and Derek Dreyer and Peter Sewell},
journal = {Proceedings of the ACM on Programming Languages},
volume = {6},
number = {POPL},
year = {2022},
doi = {10.1145/3498681}
}