StarMalloc: Verifying a Modern, Hardened Memory Allocator

被引:1
作者
Reitz, Antonin [1 ]
Fromherz, Aymeric [1 ]
Protzenko, Jonathan [2 ]
机构
[1] Inria, Paris, France
[2] Microsoft Azure Res, Redmond, CA USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / OOPSLA2期
关键词
Formal Verification; Separation Logic; Memory Allocators; VERIFICATION;
D O I
10.1145/3689773
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present StarMalloc, a verified, efficient, security-oriented, and concurrent memory allocator. Using the Steel separation logic framework, we show how to specify and verify a multitude of low-level patterns and delicate security mechanisms, by relying on a combination of dependent types, SMT, and modular abstractions to enable efficient verification. We produce a verified artifact, in C, that implements the entire API surface of an allocator, and as such works as a drop-in replacement for real-world projects, notably the Firefox browser. As part of StarMalloc, we develop several generic datastructures and proof libraries directly reusable in future systems verification projects. We also extend the Steel toolchain to express several low-level idioms that were previously missing. Finally, we show that StarMalloc exhibits competitive performance by evaluating it against 10 state-of-the-art memory allocators, and against a variety of real-world projects, such as Redis, the Lean compiler, and the Z3 SMT solver.
引用
收藏
页数:30
相关论文
共 97 条
[21]   MineSweeper: A "Clean Sweep" for Drop-In Use-after-Free Prevention [J].
Erdos, Marton ;
Ainsworth, Sam ;
Jones, Timothy M. .
ASPLOS '22: PROCEEDINGS OF THE 27TH ACM INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS, 2022, :212-225
[22]   A Verified Generational Garbage Collector for CakeML [J].
Ericsson, Adam Sandberg ;
Myreen, Magnus O. ;
Pohjola, Johannes Aman .
JOURNAL OF AUTOMATED REASONING, 2019, 63 (02) :463-488
[23]   Formal modelling of list based dynamic memory allocators [J].
Fang, Bin ;
Sighireanu, Mihaela ;
Pu, Geguang ;
Su, Wen ;
Abrial, Jean-Raymond ;
Yang, Mengfei ;
Qiao, Lei .
SCIENCE CHINA-INFORMATION SCIENCES, 2018, 61 (12)
[24]  
Felker Rich, 2020, Comparison between hardened_malloc and musl mallocs
[25]   Steel: Proof-Oriented Programming in a Dependently Typed Concurrent Separation Logic [J].
Fromherz, Aymeric ;
Rastogi, Aseem ;
Swamy, Nikhil ;
Gibson, Sydney ;
Martinez, Guido ;
Merigoux, Denis ;
Ramananandro, Tahina .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5
[26]  
GitHub, 2022, The top programming languages
[27]  
glibc, 2017, Bug 22375 (CVE-2017-17426)-malloc returns pointer from tcacheget when should return NULL (CVE-2017-17426)
[28]  
glibc, 2020, Bug 26306-Confusion in malloc.c about the fastbins size check
[29]  
glibc, 2017, Bug 22343 (CVE-2018-6485)-Integer overflow in posixmemalign (CVE-2018-6485)
[30]   Mostly Automated Proof Repair for Verified Libraries [J].
Gopinathan, Kiran ;
Keoliya, Mayank ;
Sergey, Ilya .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (PLDI)