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 dangling pointers. In particular, it employs OBRM (ownership-based resource management) and enforces automatic deallocation of unused resources base on a static lifetime inference mechanism. It may therefore falsely reclaim memory and lead to use-after-free or double-free issues. In this paper, we study the problem of false memory deallocation and propose SafeDrop, a static path-sensitive data-flow analysis approach to detect such bugs. Our approach analyzes each public 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 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 4.4% to 87.2% in comparison with the original program compilation time. We further apply our tool to several real-world Rust crates and find 15 previously-unknown bugs from nine crates.


翻译:鲁斯特是一个新兴的编程语言,目的是防止记忆安全错误。 但是,鲁斯特目前的设计也会产生副作用,可能会增加悬浮点点的风险。 特别是, 它使用基于自有的资源管理, 在静态寿命周期推算机制下强制自动分配未使用的资源基。 因此, 它可能错误地收回记忆, 导致使用免费或无双重的问题。 在本文件中, 我们研究错误的内存交易定位问题, 并提出一个静态的路径敏感数据流分析方法, 以探测此类错误。 我们的方法通过穿行控制流图和提取每项数据流的所有别名, 来反复分析鲁斯特箱的每个公开 API 。 为了保证精确和可缩放性, 我们利用塔然的算法实现可缩放路径敏感分析, 并采用基于缓存的战略, 实现高效的跨程序分析。 我们的实验结果表明, 我们的方法能够成功地检测出所有现有的此类问题CVE, 并且检测出数量有限的假正数。 我们的方法从4.4%到87. 2 和我们已知的Rust 15号原始程序汇编中, 我们的原始程序比了我们最初的Rust 15 。

0
下载
关闭预览

相关内容

Rust 是一种注重高效、安全、并行的系统程序语言。
专知会员服务
17+阅读 · 2020年9月6日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
时序数据异常检测工具/数据集大列表
极市平台
65+阅读 · 2019年2月23日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
0+阅读 · 2021年5月18日
Memory-Gated Recurrent Networks
Arxiv
12+阅读 · 2020年12月24日
Arxiv
24+阅读 · 2020年3月11日
Augmentation for small object detection
Arxiv
11+阅读 · 2019年2月19日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
时序数据异常检测工具/数据集大列表
极市平台
65+阅读 · 2019年2月23日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员