arrow
Return

Detecting Memory Errors in Rust Programs Including Unsafe Foreign Code

delete2026-01-01
delete0
PRE
AI
A
Andrea Franceschi *
L
Letterio Galletta
P
Pierpaolo Degano
DOI:10.1007/978-3-032-10444-1_11delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Memory corruption is one of the oldest and most disruptive problems in computer security, through which attackers may maliciously alter the program control flow. Unsafe languages, such as C and C++, are prone to these types of vulnerability. A promising alternative is Rust, which ensures memory safety through proper compile-time checks with no penalties at run-time. However, the Rust compiler is not able to provide these guarantees when programmers use Rust unsafe features or integrate code written in an unsafe language through the Foreign Function Interface mechanism. If the unsafe features and the integration of unsafe code are not handled with extreme care, the memory errors that Rust aims to eliminate may be reintroduced. Here, we define a static taint analysis that targets both Rust and foreign code to detect the common memory errors use-after-free, never-free, and double-free, and implement it in the tool crema. Our experimental evaluation on real cases from GitHub shows that crema detects memory errors effectively.
Keywords:
Bug Detection
Unsafe Rust
Static Taint Analysis

Journal

S
SOFTWARE ENGINEERING AND FORMAL METHODS, SEFM 2025
IF:
0
Papers:
16
Citations:
0

Organization

I
IMT School for Advanced Studies Lucca
Scholars:
676
Papers: 701
Citations: 693
Cited Papers

Cited Papers

TAJ
err2009-06-15
err0
PREAI
errOmer Tripp; Marco Pistoia; Stephen J. Fink; Manu Sridharan; Omri Weisman
errShare
errSave
Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEs
err2021-09-28
err21
errOAAI
errXu, Hui; Chen, Zhuangbin; Sun, Mingshen; Zhou, Yangfan; Lyu, Michael R.
errShare
errSave
Abstract Interpretation Frameworks
err1992-01-01
err0
errOAAI
errPATRICK COUSOT; RADHIA COUSOT
errShare
errSave
Cross-Language Attacks
err2022-01-01
err0
errOAAI
errSamuel Mergendahl; Nathan Burow; Hamed Okhravi
errShare
errSave
researcher View more