论文标题
被认为解决的记忆安全挑战?所有Rust CVE的深入研究
Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEs
论文作者
论文摘要
Rust是一种新兴的编程语言,旨在防止内存安全错误而不牺牲太大的效率。声称的财产对开发人员非常有吸引力,许多项目开始使用该语言。但是,生锈可以实现记忆安全的承诺吗?本文通过调查从几个起源收集的186个现实世界错误报告来研究这个问题,这些报告包含所有现有的Rust CVE(常见的脆弱性和暴露),到2020-12-31。我们手动分析每个错误并提取其罪魁祸首。我们的分析结果表明,RUST可以保证所有内存安全的错误都需要不安全的代码,并且数据集中的许多内存安全错误都是轻度的健全问题,只能在没有不安全代码的情况下编写内存安全错误。此外,我们总结了三个典型的内存安全错误类别,包括自动内存回收,不符合功能以及不符合的通用或特质。虽然自动内存声明错误与生锈新装备的资源管理方案的副作用有关,但不符合的功能揭示了生锈开发避免不符合代码的基本挑战,并且不符合的通用或特质加剧了引入不符合性的风险。基于这些发现,我们提出了两个有希望的方向,以改善生锈的开发安全性,包括使用特定API和方法检测涉及不安全代码的特定错误的几种最佳实践。我们的工作旨在提出有关生锈的记忆安全问题的更多讨论,并促进语言的成熟度。
Rust is an emerging programing language that aims at preventing memory-safety bugs without sacrificing much efficiency. The claimed property is very attractive to developers, and many projects start using the language. However, can Rust achieve the memory-safety promise? This paper studies the question by surveying 186 real-world bug reports collected from several origins which contain all existing Rust CVEs (common vulnerability and exposures) of memory-safety issues by 2020-12-31. We manually analyze each bug and extract their culprit patterns. Our analysis result shows that Rust can keep its promise that all memory-safety bugs require unsafe code, and many memory-safety bugs in our dataset are mild soundness issues that only leave a possibility to write memory-safety bugs without unsafe code. Furthermore, we summarize three typical categories of memory-safety bugs, including automatic memory reclaim, unsound function, and unsound generic or trait. While automatic memory claim bugs are related to the side effect of Rust newly-adopted ownership-based resource management scheme, unsound function reveals the essential challenge of Rust development for avoiding unsound code, and unsound generic or trait intensifies the risk of introducing unsoundness. Based on these findings, we propose two promising directions towards improving the security of Rust development, including several best practices of using specific APIs and methods to detect particular bugs involving unsafe code. Our work intends to raise more discussions regarding the memory-safety issues of Rust and facilitate the maturity of the language.