Rust for Linux is officially merged into Linux 6.1

Rust drivers on Linux

The code of Rust for Linux was merged into the main Linux 6.1 Git tree last Monday and this new initial 12 line code only provides very basic infrastructure and integration, while future pull requests will add more subsystem abstractions, various drivers written in Rust, and more.

Linux kernel compilation with Rust support is still optional, as the "Rust for Linux" project is taking another big step, but some developers still seem skeptical about bringing the Rust language into the Linux kernel.

In a message to the kernel community Torvalds said:

“the tree has a recent foundation, but it's basically on linux-next for a year and a half. Updated based on feedback from the Kernel Maintenance Summit.

Miguel is the main maintainer and I help when necessary. Our plan is for the tree to transition to the standard practice of not changing bases once this initial round of infrastructure is complete. The content is the absolute minimum to allow Rust code to be integrated into the kernel, with many more interfaces (and drivers: NVMe, 9p, GPU M1) on the way."

As a reminder, the project "Rust for Linux" aims to introduce a new programming language into the kernel. Rust has a key property that makes it very interesting to consider as the second kernel language: it ensures that no undefined behavior occurs. This includes errors of not using after-free, double frees, data races, etc.

With this, almost after 31 years, a second language will be accepted for kernel development. Related discussions revolve around the possibility of ditching C in favor of the Rust language.

Rust support has been on linux-next for a year and a half, and the short log doesn't do justice to the number of people who have contributed to both the Linux kernel side and the Rust upstream side to support the needs of the kernel. .

Thanks to these 173 people, and many more, who have been involved in all kinds of ways

Torvalds announced within the Kernel mailing lists, that initial support for Rust for Linux is in about 4 areas and which include:

  • kernel internals (kallsyms expansion for Rust symbols, %pA format);
  • Kbuild framework (Rust build rules and supporting scripts)
  • Rust core documentation and samples.

Torvalds recently investigated a potential security issue with the kernel's linked list speculative execution primitives written in ANSI C. It was while troubleshooting this issue that he realized that 'in C99, the iterator passed to the traversal macro list must be declared in a scope outside the loop itself.

It is from this observation that his recent decision to upgrade the Linux kernel to C11, whose standardization was completed in 2011, emerged. These are the sort of technical reasons that could justify abandoning the C language in favor of Rust for a long time, in addition to the basic development term.

The support of Rust for Linux kernel development continues and is considered "an important step to be able to write controllers in a more secure language.” The Rust language, developed by Mozilla Research, is the type of programming language used by those who write code for basic input/output systems (BIOS), boot managers, operating systems, and so on. have an interest

According to some expert observers, it is the future of systems programming rather than the C language. In fact, experts are of the opinion that it offers better software security guarantees than the C/C++ pair. For example, at the world leader in cloud computing AWS, it is specified that choosing Rust for your development projects means adding the energy efficiency and execution performance of C to the advantage of security.

Finally if you are interested in knowing more about it, you can consult the mailing lists in the following link


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Edward Avila said

    What good news. It is something that was seen coming. Especially since rust is gaining a lot of strength. Personally, programming in Rust is fascinating me and I will soon become a professional in Rust.