The tenth version of patches for the Linux kernel with Rust language support

Miguel Ojeda, author of the Rust-for-Linux project, has proposed the v10 release of components for Rust device driver development for Linux kernel developers to consider. This is the eleventh edition of the patches, taking into account the first version published without a version number. The inclusion of Rust support has been approved by Linusum Torvalds for inclusion in the Linux 6.1 kernel, unless unforeseen issues crop up. The development is funded by Google and the ISRG (Internet Security Research Group), which is the founder of the Let's Encrypt project and promotes HTTPS and the development of technologies to increase the security of the Internet.

Like the last version of the patches, the v10 release is stripped down to the bare minimum, sufficient to build a simple kernel module written in Rust. The differences from the previous version come down to minor fixes, replacing sizeof with ARRAY_SIZE in kallsyms.c and adapting patches to the v6.0-rc7 kernel. The minimal patch, which has been reduced from 40k to 13k lines of code from XNUMX to XNUMX lines of code, is expected to make it easier to incorporate Rust support into the mainstream. After providing minimal support, it is planned to gradually increase the existing functionality, transferring other changes from the Rust-for-Linux branch.

The proposed changes make it possible to use Rust as a second language for developing drivers and kernel modules. Rust support is presented as an option that is not enabled by default and does not result in the inclusion of Rust among the required build dependencies for the kernel. Using Rust to develop drivers will allow you to create safer and better drivers with minimal effort, free from problems such as accessing a memory area after it is freed, dereferencing null pointers, and buffer overruns.

Memory-safe handling is provided in Rust at compile time through reference checking, keeping track of object ownership and object lifetime (scope), as well as through evaluation of the correctness of memory access during code execution. Rust also provides protection against integer overflows, requires mandatory initialization of variable values ​​before use, handles errors better in the standard library, applies the concept of immutable references and variables by default, offers strong static typing to minimize logical errors.

Source: opennet.ru

Add a comment