Lune

ICSE2025顶会

A Study of Undefined Behavior Across Foreign Function Boundaries in Rust Libraries

Ian McCormack, Joshua Sunshine, Jonathan Aldrich

摘要

Developers rely on the static safety guarantees of the Rust programming language to write secure and performant applications. However, Rust is frequently used to interoperate with other languages which allow design patterns that conflict with Rust's evolving aliasing models. Miri is currently the only dynamic analysis tool that can validate applications against these models, but it does not support finding bugs in foreign functions, indicating that there may be a critical correctness gap across the Rust ecosystem. We conducted a large-scale evaluation of Rust libraries that call foreign functions to determine whether Miri's dynamic analyses remain useful in this context. We used Miri and an LLVM interpreter to jointly execute applications that call foreign functions, where we found 46 instances of undefined or undesired behavior in 37 libraries. Three bugs were found in libraries that had more than 10,000 daily downloads on average during our observation period, and one was found in a library maintained by the Rust Project. Many of these bugs were violations of Rust's aliasing models, but the latest Tree Borrows model was significantly more permissive than the earlier Stacked Borrows model. The Rust community must invest in new, production-ready tooling for multi-language applications to ensure that developers can detect these errors.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Miri: Practical Undefined Behavior Detection for Rust 引用了 Tree Borrows
  • Miri: Practical Undefined Behavior Detection for Rust 引用了 Stacked borrows: an aliasing model for Rust
  • MirChecker: Detecting Bugs in Rust Programs via Static Analysis 引用了 Understanding memory and thread safety practices and issues in real-world Rust programs
  • Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale 引用了 Understanding memory and thread safety practices and issues in real-world Rust programs
  • Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale 引用了 How do programmers use unsafe rust?
  • Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale 引用了 Stacked borrows: an aliasing model for Rust
  • Understanding memory and thread safety practices and issues in real-world Rust programs 引用了 Stacked borrows: an aliasing model for Rust
  • How do programmers use unsafe rust? 引用了 Understanding memory and thread safety practices and issues in real-world Rust programs
  • Tree Borrows 引用了 Stacked borrows: an aliasing model for Rust
  • RustGo: Fairly Directed Greybox Fuzzing for Enforcing Rust Memory Safety 引用了 MirChecker: Detecting Bugs in Rust Programs via Static Analysis
  • RustGo: Fairly Directed Greybox Fuzzing for Enforcing Rust Memory Safety 引用了 Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale
  • RustGo: Fairly Directed Greybox Fuzzing for Enforcing Rust Memory Safety 引用了 How do programmers use unsafe rust?
  • Securing Mixed Rust with Hardware Capabilities 引用了 How do programmers use unsafe rust?
  • Securing Mixed Rust with Hardware Capabilities 引用了 Stacked borrows: an aliasing model for Rust
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Miri: Practical Undefined Behavior Detection for RustRalf Jung, Benjamin Kimock, Christian Poveda, Eduardo Sánchez Muñoz 等POPL 2026 · 8 次引用
  2. Tree BorrowsNeven Villani, Johannes Hostert, Derek Dreyer, Ralf JungPLDI 2025 · 8 次引用
  3. Securing Mixed Rust with Hardware CapabilitiesJason Zhijingcheng Yu, Fangqi Han, Kaustab Choudhury, Trevor E. Carlson 等CCS 2025 · 1 次引用
  4. Building Bridges: Safe Interactions with Foreign Languages through OmniglotLeon Schuermann, Jack Toubes, Tyler Potyondy, Pat Pannuto 等OSDI 2025
  5. RustGo: Fairly Directed Greybox Fuzzing for Enforcing Rust Memory SafetyDongyeon Yu, Jiun Min, Yewan Na, Mijung Kim 等CCS 2026

它引用的 Paper10

  1. Understanding memory and thread safety practices and issues in real-world Rust programsBoqin Qin, Yilun Chen, Zeming Yu, Linhai Song 等PLDI 2020 · 112 次引用
  2. How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller 等OOPSLA 2020 · 78 次引用
  3. Stacked borrows: an aliasing model for RustRalf Jung, Hoang-Hai Dang, Jeehoon Kang, Derek DreyerPOPL 2020 · 67 次引用
  4. MirChecker: Detecting Bugs in Rust Programs via Static AnalysisZhuohua Li, Jincheng Wang, Mingshen Sun, John C. S. LuiCCS 2021 · 63 次引用
  5. Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem ScaleYechan Bae, Youngsuk Kim, Ammar Askar, Jungwon Lim 等SOSP 2021 · 61 次引用

相关 Paper

  1. FRIES: Fuzzing Rust Library Interactions via Efficient Ecosystem-Guided Target GenerationXizhe Yin, Yang Feng, Qingkai Shi, Zixi Liu 等ISSTA 2024 · 6 次引用
  2. Rusted Types: Static Detection of Rust Type Confusion BugsZeyang Zhuang, Wei Meng, Michael R. LyuICSE 2026
  3. RPG: Rust Library Fuzzing with Pool-based Fuzz Target Generation and Generic SupportZhiwu Xu, Bohao Wu, Cheng Wen, Bin Zhang 等ICSE 2024 · 9 次引用
  4. An Empirical Study of Bugs in the rustc CompilerZixi Liu, Yang Feng, Yunbo Ni, Shaohua Li 等OOPSLA 2025 · 5 次引用
  5. Place Capability Graphs: A General-Purpose Model of Rust's Ownership and Borrowing GuaranteesZachary Grannan, Aurel Bílý, Jonás Fiala, Jasper Geer 等OOPSLA 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖