r/linux • • Dec 10 '25

Kernel "Rust in the kernel is no longer experimental — it is now a core part of the kernel and is here to stay."

https://lwn.net/Articles/1049831/
1.5k Upvotes

353 comments sorted by

View all comments

Show parent comments

23

u/Xaeroxe3057 Dec 10 '25

Rust for Linux is considered beneficial for three reasons

  1. Rust is more appealing to younger contributors. The Linux kernel dev community is looking for ways to pass the torch.

  2. Rust has a stronger security posture. This is supported by security researchers and statistics from rust adoption programs.

  3. Rust is generally more predictable. This makes it easier to avoid writing bugs.

3

u/AWonderingWizard Dec 10 '25

Thank you for the explanation. I think that point one is a really powerful point considering Linux is completely driven by people who are dedicating their own time to a large project such as this.

The only concern I have is if the security posture has been tested in an implementation such as this before? Most of the research I have seen regarding secure rust code, which is extremely impressive, are coded nearly completely in rust. Unsafe/FFI will have to be used in order to integrate rust with the c present in the kernel right?

Rust is great, but I guess I am asking is Rust + C great, secure, etc? Does it not lose practicability, safety, etc?

12

u/Xaeroxe3057 Dec 10 '25

It’s a good question. In the modern world it’s essentially impossible for a low-level language such as Rust to get anything done without FFI. All Rust software today makes extensive use of FFI, whether the developers are consciously aware of it or not. I’ve been a Rust developer for 11 years and it became apparent to me pretty quickly that I wouldn’t be able to get anything done with it unless I also knew C and C++. Rust plays nice with C. It wouldn’t be where it is today if it didn’t.

In particular FFI is required in order to interact with operating system APIs, and to integrate with large pre-existing libraries. So, in a sense the pure Rust application is actually pretty niche. It would have to be built for a system whose kernel contains no C code. I don’t see many of those systems around these days.

4

u/AWonderingWizard Dec 10 '25

Thanks a lot for taking the time to clarify that for me. I'll definitely be adding Rust to my language repertoire then.

1

u/ParserXML Dec 10 '25

Considering that writing FFI code is obviously essential for the kernel, which features from Rust would you consider to be more beneficial in terms of stability/predictability?

Not having many of the C/C++ oddities (a product of their time) comes to mind.

7

u/steveklabnik1 Dec 10 '25

The only concern I have is if the security posture has been tested in an implementation such as this before?

Android has been using Rust for a while now, here's their results https://security.googleblog.com/2025/11/rust-in-android-move-fast-fix-things.html

1

u/ULTRAFORCE Dec 11 '25

While it's not a true benefit isn't one of the elements that is a positive is that it can lead to re-evaluating and improving older C code that works but was written in a hacked together way?