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

03/29/2021
by   Mohan Cui, et al.
0

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 OBRM (ownership-based resource management) and enforces automatic deallocation of unused resources without the garbage collector. It may therefore falsely deallocate reclaimed memory and lead to use-after-free or double-free issues. In this paper, 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 API of a Rust crate iteratively by traversing the control-flow graph and extracting all aliases of each data-flow. To guarantee precision and scalability, we leverage a modified Tarjan algorithm to achieve scalable path-sensitive analysis, and a cache-based strategy to achieve efficient inter-procedural analysis. Our experiment results show that our approach can successfully detect all existing CVEs of such issues with a limited number of false positives. The analysis overhead ranges from 1.0 110.7 tool to several real-world Rust crates and find 8 Rust crates involved with invalid memory deallocation issues.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/27/2022

Fat Pointers for Temporal Memory Safety of C

Temporal memory safety bugs, especially use-after-free and double free b...
research
08/09/2023

rCanary: Detecting Memory Leaks Across Semi-automated Memory Management Boundary in Rust

Rust is an effective system programming language that guarantees memory ...
research
12/14/2019

Conquering the Extensional Scalability Problem for Value-Flow Analysis Frameworks

With an increasing number of value-flow properties to check, existing st...
research
02/10/2021

NumaPerf: Predictive and Full NUMA Profiling

Parallel applications are extremely challenging to achieve the optimal p...
research
06/17/2019

How to Avoid Making a Billion-Dollar Mistake: Type-Safe Data Plane Programming with SafeP4

The P4 programming language offers high-level, declarative abstractions ...
research
07/12/2023

Sound One-Phase Shape Analysis with Biabduction

Biabduction-based shape analysis is a static analysis technique that can...
research
04/24/2023

Protecting Locks Against Unbalanced Unlock()

The lock is a building-block synchronization primitive that enables mutu...

Please sign up or login with your details

Forgot password? Click here to reset