Why Microsoft Is Rewriting the Windows Kernel in Rust – A Security Game‑Changer
Microsoft is integrating Rust into the Windows kernel to replace legacy C++ code, aiming to eliminate whole classes of memory‑safety bugs, boost performance, and set a new standard for secure system‑level development.
Introduction
Rust, developed by Mozilla Research, is designed to prevent memory‑access errors and buffer overflows that lead to security issues while delivering performance comparable to C++.
Microsoft, together with AWS, Huawei, Google and Mozilla, is a founding member of the Rust Foundation, established on February 8, 2021.
Microsoft Starts Rewriting the Windows Kernel
Microsoft is using Rust to rewrite core Windows libraries, delivering memory‑safe code to the first batch of developers.
At the BlueHat IL 2023 conference in Tel Aviv, Windows security director David "dwizzle" Weston announced that Rust has officially entered the Windows kernel.
In the coming weeks and months, Rust will be used in the kernel to replace certain C++ data types with equivalent Rust constructs.
The goal is to "kill bug classes" by adopting a memory‑safe language, CPU‑architecture changes, and safer language subsets.
Key Projects and Progress
Microsoft has focused on two projects: DWriteCore and Win32 GDI, both containing legacy code from the 1980s‑1990s.
DWriteCore, part of the Windows App SDK for text analysis, layout and rendering, began integrating Rust in 2020 and now contains about 152,000 lines of Rust alongside 96,000 lines of C++.
The private API uses COM‑like interfaces, making integration of C++ and Rust straightforward.
Two developers spent six months writing and testing the Rust code, which is now available to software developers.
Performance improvements include a 5%‑15% boost in shaping performance via the OpenType Library Service (OTLS).
Win32 GDI now has roughly 36,000 lines of Rust code; the Rust version is used in the latest Windows 11 builds, though the Rust interface remains disabled by a feature flag.
Weston noted that a SysCall in the Windows kernel is already implemented in Rust.
Microsoft does not plan to rewrite the entire kernel in Rust immediately; a strategic approach will balance native code preservation with Rust adoption.
Industry Impact
Microsoft’s endorsement strengthens Rust’s position in the open‑source community and highlights its security benefits.
Since 2006, about 70% of Windows security patches addressed memory‑safety vulnerabilities.
Major players like Google have also expressed support for Rust.
Microsoft Azure CTO Mark Russinovich recently advocated using Rust for new software projects instead of C/C++.
Author: 手扶拖拉斯基 Source: https://www.theregister.com/2023/04/27/microsoft_windows_rust/
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
