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:
673
Papers: 699
Citations: 693