David Weston, a vice president at Microsoft responsible for the security of the Windows operating system, shared insights on the development of Windows security mechanisms in his report at the BlueHat IL 2023 conference. Among other things, he mentioned progress in utilizing the Rust language to enhance the security of the Windows kernel. Moreover, it was stated that Rust code may be added to the Windows 11 kernel in a matter of months or even weeks.
The main motivations for using Rust include leveraging tools for safe memory operations and efforts to reduce code errors. The initial goal is to replace some internal C++ data types with equivalent types provided in Rust. Currently, about 36,000 lines of Rust code have been prepared for inclusion in the kernel. Testing the system with the new code showed no negative impact on performance in the PCMark 10 benchmark (office application tests), and in some microbenchmarks, the new code was even faster.

The first area where Rust was implemented is in the DWriteCore code, which handles font parsing. Two developers worked for six months on the rewrite. The new implementation in Rust improved glyph rendering performance for text by 5-15%. The second area of application for Rust was the implementation of the REGION data type in Win32k GDI (Graphics Driver Interface). The Rust-rewritten components of the GDI interface have already successfully passed all tests while being used in Windows, and the new code is planned to be included by default in the upcoming Windows 11 Insider test builds. Other achievements related to Rust include the translation of specific Windows system calls to this language.


Forrás: opennet.ru
