arXiv論文メモ
新着一覧
cs.CR · 査読状況未確認

C言語からRustへの自動変換とメモリ安全性の食い違い

C-to-Rust Fallacy: Automatic Refactoring != Memory Security

Hung-Mao Chen, Xu He, Bo Lu, Xiaokuan Zhang, Kun Sun

この論文をやさしく読む

ひとことで言うと

CからRustへ自動変換したコードが、実際にメモリの脆弱性を減らすかを複数ツールで調べた。

何に役立つ?

自動変換後のコードを採用する際に、コンパイル確認や脆弱性の再検査が必要か判断する材料になる。

この研究の面白いところ

464個の生成コードのうち342個がコンパイルに失敗し、元の脆弱性の継承や新たな欠陥も見つかった。

どこまで分かった?

NIST Julietの116個のCプログラムと4ツールに基づく評価であり、すべての実プログラムや変換ツールの結果ではない。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

Rustは性能を損なわずに強いメモリ安全性と型安全性を提供する主要なシステムプログラミング言語となり、メモリの脆弱性が生じ得るCやC++の代替として注目されている。しかし、CからRustへの手動変換にはRustの機能について深い知識が必要で、開発者の負担が大きい。これに対し、静的解析や大規模言語モデルを利用する自動変換ツールは、安全なRustコードを生成しようとする。これらはunsafeなRustの使用を減らすことによる安全性を主張するが、それがセキュリティ改善とどう関係するかは明確でない。本稿は、複数のCからRustへの変換方法について、信頼性、安全性、正しさを実証的に調べる。NIST Juliet Test Suiteのメモリの脆弱性を持つ116個のCプログラムを用い、C2Rust-analyze、CROWN、C2SaferRust、FLOURINEを評価した。生成された464個のRustプログラムについて、コンパイルの成否、元のCの脆弱性を軽減できるか、新たなRustの欠陥を導入するかを調べた。342個はコンパイルに失敗し、177個は元のCプログラムのメモリ脆弱性を引き継ぎ、新たなRustの欠陥が77個導入された。ツール設計の根拠を調べ、変換方法ごとのエラー原因を分析した。現行の自動変換ツールは、各ツールが定義する意味でのメモリ安全性は実現しても、導入時に求められるより広いメモリのセキュリティは実現しないことが示された。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-22(UTC)
最新改訂
2026-09-22 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Rust has emerged as the leading system programming language, offering strong memory and type safety guarantees without compromising performance. This positions it as a compelling alternative to traditional languages like C and C++, which are susceptible to memory security bugs. However, manually transforming C to Rust requires in-depth domain knowledge of the Rust language features, which requires significant effort for developers. To address this, tools for automatic C-to-Rust refactoring aim to generate safe Rust code leveraging static analysis and Large Language Models (LLMs). While these tools claim to achieve safety by reducing the unsafe Rust, the correlation with improving security is not clear. In this paper, we conduct a comprehensive empirical study on the reliability, safety, and correctness of various C-to-Rust refactoring methods. Specifically, we evaluate C2Rust-analyze, CROWN, C2SaferRust, and FLOURINE using a dataset of 116 C programs with memory security bugs from the NIST Juliet Test Suite. Based on 464 Rust programs generated by these tools, our evaluation focuses on three key aspects: the compilation correctness of the refactored programs, the effectiveness in mitigating original C bugs, and the tendency to introduce additional Rust bugs. The results indicate that 342 Rust programs fail to compile, 177 Rust programs inherit memory security bugs from the original C programs, and 77 new Rust bugs are introduced. We examine the rationale behind tool design and analyze the root cause of errors across various refactoring methods. Our findings indicate that current automated refactoring tools deliver memory safety as they define it, but not the broader memory security when adopting them.

arXiv ID: 2609.25682 / 要約の誤りについて