Skip to content (access key 's')
Logo of Technion
Logo of CS Department
Events

The Taub Faculty of Computer Science Events and Talks

BorrowSanitizer: Securing Rust Across Foreign Function Boundaries
event speaker icon
Joshua Sunshine (CMU)
event date icon
Monday, 30.11.2026, 12:30
event location icon
Auditorium 012, Floor 0, Taub

The Rust programming language is increasingly popular for its static safety guarantees, which rely on strict aliasing rules. However, real-world Rust code frequently uses “unsafe” blocks and C/C++ foreign function interfaces (FFI) that can violate these rules and cause undefined behavior. While interpreters like Miri can detect such violations, their high overhead and limited FFI compatibility hinder testing in the multilanguage legacy systems where Rust is rapidly being adopted. We present BorrowSanitizer (BSan), an LLVM-based sanitizer that detects Tree Borrows violations via native instrumentation. BSan lowers minimal Rust type information into LLVM IR, inserts instrumentation to track pointer provenance, and prunes allocation metadata at runtime using hybrid deferred reference counting. In evaluations comparing BSan with Miri, MiriLLI, and CapsLock, BSan is 7x faster than Miri in wall-clock time with 78% less memory—reproducing 96% of the original Tree Borrowsviolations—and over 2x faster than CapsLock with 44% less memory, reproducing every cross-language bug found by CapsLock and MiriLLI. On real-world code, BSan uncovered 120 previously unreported aliasing violations, including new cross-language bugs in Hurl, CXX, Bun, and AWS’s LibCrypto—demonstrating that native instrumentation scales rich, allocation-level aliasing models to production systems.

Bio: Joshua Sunshine is an Associate Professor of Computer Science at Carnegie Mellon University. His home department is the Software and Societal Systems Department (S3D) and he has an additional appointment in the Human-Computer Interaction Institute. His research focuses on better understanding of the factors that influence the usability of reusable software components.