RustHornBelt: A Semantic Foundation for Functional Verification of Rust Programs with Unsafe Code

被引:11
|
作者
Matsushita, Yusuke [1 ]
Denis, Xavier [2 ]
Jourdan, Jacques-Henri [2 ]
Dreyer, Derek [3 ]
机构
[1] Univ Tokyo, Tokyo, Japan
[2] Univ Paris Saclay, CNRS, ENS Paris Saclay, INRIA,Lab Methodes Formelles, Gif Sur Yvette, France
[3] MPI SWS, Saarbrucken, Germany
基金
欧洲研究理事会;
关键词
Rust; separation logic; verification; type systems; prophecy variables; Iris;
D O I
10.1145/3519939.3523704
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Rust is a systems programming language that offers both low-level memory operations and high-level safety guarantees, via a strong ownership type system that prohibits mutation of aliased state. In prior work, Matsushita et al. developed RustHorn, a promising technique for functional verification of Rust code: it leverages the strong invariants of Rust types to express the behavior of stateful Rust code with first-order logic (FOL) formulas, whose verification is amenable to off-the-shelf automated techniques. RustHorn's key idea is to use prophecies to describe the behavior of mutable borrows. However, the soundness of RustHorn was only established for a safe subset of Rust, and it has remained unclear how to extend it to support various safe APIs that encapsulate unsafe code (i.e., code where Rust's aliasing discipline is relaxed). In this paper, we present RustHornBelt, the first machine-checked proof of soundness for RustHorn-style verification which supports giving FOL specs to safe APIs implemented with unsafe code. RustHornBelt employs the approach of semantic typing used in Jung et al.'s RustBelt framework, but it extends RustBelt's model to reason not only about safety but also functional correctness. The key challenge in RustHornBelt is to develop a semantic model of RustHorn-style prophecies, which we achieve via a new separation-logic mechanism we call parametric prophecies.
引用
收藏
页码:841 / 856
页数:16
相关论文
共 50 条
  • [1] Securing UnSafe Rust Programs with XRust
    Liu, Peiming
    Zhao, Gang
    Huang, Jeff
    [J]. 2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 234 - 245
  • [2] Fidelius Charm: Isolating Unsafe Rust Code
    Almohri, Hussain M. J.
    Evans, David
    [J]. PROCEEDINGS OF THE EIGHTH ACM CONFERENCE ON DATA AND APPLICATION SECURITY AND PRIVACY (CODASPY'18), 2018, : 248 - 255
  • [3] On the Dual Nature of Necessity in Use of Rust Unsafe Code
    Zhang, Yuchen
    Kundu, Ashish
    Portokalidis, Georgios
    Xu, Jun
    [J]. PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 2032 - 2037
  • [4] Unsafe code detection in Rust and metamorphic testing of autonomous driving systems
    Le Traon, Yves
    Xie, Tao
    [J]. SOFTWARE TESTING VERIFICATION & RELIABILITY, 2024, 34 (05):
  • [5] No Panic! Verification of Rust Programs by Symbolic Execution
    Lindner, Marcus
    Aparicius, Jorge
    Lindgren, Per
    [J]. 2018 IEEE 16TH INTERNATIONAL CONFERENCE ON INDUSTRIAL INFORMATICS (INDIN), 2018, : 108 - 114
  • [6] Aeneas: Rust Verification by Functional Translation
    Ho, Son
    Protzenko, Jonathan
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (ICFP):
  • [7] Repairing Programs with Semantic Code Search
    Ke, Yalin
    Stolee, Kathryn T.
    Le Goues, Claire
    Brun, Yuriy
    [J]. 2015 30TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2015, : 295 - 306
  • [8] RustHorn: CHC-based Verification for Rust Programs
    Matsushita, Yusuke
    Tsukada, Takeshi
    Kobayashi, Naoki
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS ( ESOP 2020): 29TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2020, 12075 : 484 - 514
  • [9] RustHorn: CHC-based Verification for Rust Programs
    Matsushita, Yusuke
    Tsukada, Takeshi
    Kobayashi, Naoki
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2021, 43 (04):
  • [10] AUTOMATIC VERIFICATION OF FUNCTIONAL PROGRAMS
    DROBUSHEVICH, GA
    ZUBOVICH, KA
    [J]. CYBERNETICS, 1990, 26 (04): : 491 - 502