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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper5
- Miri: Practical Undefined Behavior Detection for RustRalf Jung, Benjamin Kimock, Christian Poveda, Eduardo Sánchez Muñoz 等POPL 2026 · 被引用 8 次
- Tree BorrowsNeven Villani, Johannes Hostert, Derek Dreyer, Ralf JungPLDI 2025 · 被引用 8 次
- Securing Mixed Rust with Hardware CapabilitiesJason Zhijingcheng Yu, Fangqi Han, Kaustab Choudhury, Trevor E. Carlson 等CCS 2025 · 被引用 1 次
- Building Bridges: Safe Interactions with Foreign Languages through OmniglotLeon Schuermann, Jack Toubes, Tyler Potyondy, Pat Pannuto 等OSDI 2025
- RustGo: Fairly Directed Greybox Fuzzing for Enforcing Rust Memory SafetyDongyeon Yu, Jiun Min, Yewan Na, Mijung Kim 等CCS 2026
它引用的顶会 Paper10
- Understanding memory and thread safety practices and issues in real-world Rust programsBoqin Qin, Yilun Chen, Zeming Yu, Linhai Song 等PLDI 2020 · 被引用 112 次
- How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller 等OOPSLA 2020 · 被引用 78 次
- Stacked borrows: an aliasing model for RustRalf Jung, Hoang-Hai Dang, Jeehoon Kang, Derek DreyerPOPL 2020 · 被引用 67 次
- MirChecker: Detecting Bugs in Rust Programs via Static AnalysisZhuohua Li, Jincheng Wang, Mingshen Sun, John C. S. LuiCCS 2021 · 被引用 63 次
- Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem ScaleYechan Bae, Youngsuk Kim, Ammar Askar, Jungwon Lim 等SOSP 2021 · 被引用 61 次
相关 Paper
- FRIES: Fuzzing Rust Library Interactions via Efficient Ecosystem-Guided Target GenerationXizhe Yin, Yang Feng, Qingkai Shi, Zixi Liu 等ISSTA 2024 · 被引用 6 次
- Rusted Types: Static Detection of Rust Type Confusion BugsZeyang Zhuang, Wei Meng, Michael R. LyuICSE 2026
- RPG: Rust Library Fuzzing with Pool-based Fuzz Target Generation and Generic SupportZhiwu Xu, Bohao Wu, Cheng Wen, Bin Zhang 等ICSE 2024 · 被引用 9 次
- 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 次
- CULPA: Universal Detection of Memory-Safety Bugs in Unsafe Rust Through the Lens of Safety RequirementsHung-Mao Chen, Bo Lu, Xu He, Xiaokuan Zhang 等USENIX Security 2026
