Microsoft Encourages Windows Driver Development in Rust for Better Security
The Rust programming language has gained quite a bit of popularity over the past few years. In May 2023, Microsoft promised to include Rust in the Windows 11 kernel, and they delivered on that promise very quickly with Dev Channel build 25905 in July 2023. Linux has also tried to adopt Rust, but it has been a bit more bumpy. Now, with the improvements Rust brings to the development process, Microsoft has officially announced that it is encouraging Windows driver authors to use Rust.
In a blog post, Microsoft stressed that writing secure code for drivers is extremely important because they are low-level components that communicate directly with the hardware. The Surface team is actively contributing to the windows-drivers-rs open source project, which is also being leveraged to distribute Rust drivers for Surface devices. The team says this approach not only improves the security and reliability of Surface devices, but also 'raises the security bar for the entire Windows ecosystem.'
Using Rust to write Windows drivers has many benefits. The main one is memory safety, which is a major problem in traditional languages like C++ and C (which are often used to write drivers). Other benefits include strict type checking, concurrency safety, static analysis, compile-time abstractions, and interoperability with traditional programming languages.
This is why Microsoft also wants other developers to contribute to the windows-drivers-rs initiative on GitHub. The project contains crates, code samples, documentation, and tutorials, and is supported by an active community. As for the next steps in the initiative, Microsoft has promised platform improvements, progress toward feature parity between Rust and the Windows Driver Kit (WDK), and expanded availability of open source abstractions. It will be interesting to see whether Rust becomes mainstream in writing drivers for Windows across its diverse hardware ecosystem.
You should read it
- Asynchronous Programming in Rust
- Documenting a Rust project with mdBook
- Rust - A programming language created from a broken elevator, can 'surpass' both C and C++
- Rust - A programming language created by a broken elevator, can 'surpass' both C and C ++
- Ways to handle errors in Rust
- How to containerize a Rust app with Docker