SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-flow Analysis


연구 분야: Strategies



학회: ACM Transactions on Software Engineering and Methodology, Volume 32, Issue 4


초록

Rust is an emerging programming language that aims to prevent memory-safety bugs. However, the current design of Rust also brings side effects, which may increase the risk of memory-safety issues. In particular, it employs ownership-based resource management and enforces automatic deallocation of unused resources without using the garbage collector. It may therefore falsely deallocate reclaimed memory and lead to use-after-free or double-free issues. In this article, we study the problem of invalid memory deallocation and propose SafeDrop, a static path-sensitive data-flow analysis approach to detect such bugs. Our approach analyzes each function of a Rust crate iteratively in a flow-sensitive and field-sensitive way. It leverages a modified Tarjan algorithm to achieve scalable path-sensitive analysis and a cache-based strategy for efficient inter-procedural analysis. We have implemented our approach and integrated it into the Rust compiler. Experiment results show that the approach can successfully detect all such bugs in our experiments with a limited number of false positives and incurs a very small overhead compared to the original compilation time.


Author Profile
Mohan Cui

School of Computer Science Fudan University China

China
Author Profile
Chengjun Chen

School of Computer Science Fudan University China

China
Author Profile
Hui Xu

School of Computer Science Fudan University China

China

📄 논문 정보

발행 연도 2023년
인용수 30
출판 국가 Andorra, China
사이트 ACM
좋아요 수 0

연관 논문 목록 (110건)