Google has unveiled a fully-fledged and significant driver for the Linux kernel written in Rust, marking a departure from the traditional C programming language.
Alice Ryhl, a key developer and member of Google’s Android security and privacy team, made the announcement on the Linux kernel mailing list. Ryhl, who is deeply involved with Rust for Linux and also oversees the Rust Project Tokyo, has been instrumental in this pioneering development.
This development comes roughly a year after Google announced its ambition to develop Linux drivers in Rust. The driver in question is a reimplementation of the interprocess communication (IPC) Binder, a technology that has been integral to Android for over 15 years. Despite its age and the existence of an alternative that had been in the works for years, Linux’s lead developer, Linus Torvalds, pragmatically merged the original Binder code into the main branch, a decision that was not without its critics.
Google, however, has not been entirely satisfied with the original Binder code, citing its complexity and the myriad of improvement opportunities it presents. Binder’s significance in Android’s security cannot be understated, as it is directly accessed by numerous sandbox processes.
The new Rust-based Binder code aims to address these issues, with a focus on simplifying the codebase and directly implementing some of the planned improvements for the driver. Rust’s advantages over C are numerous, including prevention of common programming errors and a more robust type system that aids in managing various pointers. Error handling is also more streamlined in Rust.
Ryhl has assured that while the Binder’s structure will undergo a significant overhaul in the Rust implementation, its core functionality will remain unchanged. The tests, including those conducted on a Pixel 6 Pro, have been successful.
This innovative stride by Google not only enhances the security and efficiency of the Linux kernel but also paves the way for a new era of programming languages in system-level development.