一句话:对 Rust 标准库 unsafe API 文档中的安全需求进行系统研究,揭示其不一致与不足,并建议统一规范。
Rust 是一种强调效率与内存安全的强类型语言,但 Unsafe Rust 的正确使用对安全性至关重要。当前标准库中的 unsafe API 文档在安全需求描述上存在不一致和不完整的问题,缺乏统一规范。本文对 Unsafe Rust 编程中的安全需求进行了全面研究,分析了标准库 unsafe API 文档中安全需求描述的变化模式与缺陷。研究发现,这些文档在安全需求的表述上差异较大,且往往不够充分,可能导致用户误用 unsafe 代码。基于此,作者建议 unsafe API 文档应系统性地列出安全需求,为用户提供统一、明确的指导,以增强 Rust 的整体安全性。该研究为改善 Rust 不安全代码的文档规范提供了实证依据。
Rust is an emerging, strongly-typed programming language focusing on efficiency and memory safety. With increasing projects adopting Rust, knowing how to use Unsafe Rust is crucial for Rust security. We observed that the description of safety requirements needs to be unified in Unsafe Rust programming. Current unsafe API documents in the standard library exhibited variations, including inconsistency and insufficiency. To enhance Rust security, we suggest unsafe API documents to list systematic descriptions of safety requirements for users to follow.
@inproceedings{paperbot11365,
title = {Is unsafe an Achilles' Heel? A Comprehensive Study of Safety Requirements in Unsafe Rust Programming},
author = {Mohan Cui and Shuran Sun and Hui Xu and Yangfan Zhou},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3597503.3639136}
}