Using Rust in the binder driver
summary
A Rust reimplementation of the binder driver reaches feature parity with the C driver, boots a device, passes the test suite, and matches microbenchmark throughput after targeted optimizations. Unsafe is limited mainly to C interop and binderfs, and Rust prevents memory-safety bugs that C allowed so a reported logic bug produced no use-after-free though it remained exploitable. Code size is roughly equal overall with more deletions than additions, and some tiny refcount functions were rewritten for inlining to recover performance.
AI-written summary · about
chapters (11)
- 0:00Introduction to binder
- 3:33Problems with C binder
- 7:07Rust implementation benefits
- 10:57Rust binder performance
- 14:13Unsafe code in Rust binder
- 16:20Vulnerability comparison
- 18:55Optimization learnings
- 20:23Community contributions
- 21:53API changes and maintenance
- 23:40Maintainer collaboration
- 26:10Future of Rust in kernel
related talks
51mRust in the Linux kernel
31mGetting Something for Nothing
40mWhy Rust?
39mFrom C to Rust: Bringing Rust Abstractions to Embedded Linux
20mAn Empirical Study of Rust-for-Linux: The Success, Dissatisfaction, and Compromise
42mRewrite It In Rust: Can We RIIR Everything?
37mRust and Other Interesting Things
15mNon-binary Rust: Between Safe and Unsafe
