Rust relies on its unique ownership mechanism to ensure thread and memory safety. However, numerous potential security vulnerabilities persist in practical applications. New language features in Rust pose new challenges for vulnerability detection. This paper proposes a static deadlock detection method tailored for Rust programs, aiming to identify various deadlock types, including double lock, conflict lock, and deadlock associated with conditional variables. With due consideration for Rust's ownership and lifetimes, we first complete the pointer analysis. Then, based on the obtained points-to information, we analyze dependencies among variables to identify potential deadlocks. We develop a tool and conduct experiments based on the proposed method. The experimental results demonstrate that our method outperforms existing deadlock detection methods in precision.
翻译:Rust依赖其独特的所有权机制来确保线程与内存安全。然而在实际应用中,众多潜在安全漏洞依然存在。Rust的新语言特性为漏洞检测带来了新的挑战。本文提出一种针对Rust程序的静态死锁检测方法,旨在识别包括双重锁定、冲突锁定以及与条件变量相关的死锁在内的多种死锁类型。在充分考虑Rust所有权与生命周期的前提下,我们首先完成指针分析。随后基于获得的指向信息,通过分析变量间的依赖关系来识别潜在死锁。我们基于该方法开发了检测工具并进行实验验证。实验结果表明,本方法在检测精度上优于现有死锁检测方法。