News for hackers. Stuff that matters.
Re:The state of the kernel Rust experiment by rtpg on Friday December 19, 2025 @12:54AM (#46322659)
> And a few days ago a security vulnerability was found in the Rust Linux kernel code.

was it a security vulnerability? I'm pretty sure it was "just" a crash. Though maybe someone smarter than me could have turned that into something more.

I have no dog in this race, I really like the idea of Rust drivers but can very much understand retiscience at getting Rust to be handling more core parts of the kernel, just because Rust's value seems to pay off way more in higher level code where you have these invariants to maintain across large code paths (meanwhile writing a bunch of doubly-linked lists in unsafe Rust seems a bit like busy work, modulo the niceties Rust itself can give you)

Re:The state of the kernel Rust experiment by taneliv on Friday December 19, 2025 @02:36AM (#46323213)
> was it a security vulnerability? I'm pretty sure it was "just" a crash.

It's a race condition resulting in memory corruption.[1][2] That corruption is shown to result in a crash. I don't think the implication is that it can result only in crashes, but this is not mentioned in the CVE.

Whether it is a vulnerability that an attacker can crash a system depends on your security model, I guess. In general it is not expected to happen and it stops other software from running, and can be controlled by entities or software who should not have that level of control, so it's considered a vulnerability.

[1] https://www.cve.org/CVERecord/?id=CVE-2025-68260 [2] https://lore.kernel.org/linux-cve-announce/2025121614-CVE-20...

Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @03:19AM (#46323479)
It is entertaining to observe that how - after the bullshit and propaganda phase - Rust now slowly enters reality and the excuses for problems that did not magically disappear are now exactly the same as what we saw before from C programmers and which Rust proponents would have completely dismissed as unacceptable in the past ("this CVE is not exploitable", "all programmers make mistakes", "unwrap should never been used in production", "this really is an example how fantastic Rust is").
Re:The state of the kernel Rust experiment by simonask on Friday December 19, 2025 @04:47AM (#46323990)
You have a wild amount of confirmation bias going on here, though.

Of course, this bug was in an `unsafe` block, which is exactly what you would expect given Rust's promises.

The promise of Rust was never that it is magical. The promise is that it is significantly easier to manage these types of problems.

Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @06:30AM (#46324638)
> Of course, this bug was in an `unsafe` block, which is exactly what you would expect given Rust's promises.

The fix was outside of any Rust unsafe blocks. Which confused a lot of Rust developers on Reddit and elsewhere. Since fans of Rust have often repeated that only unsafe blocks have to be checked. Despite the Rustonomicon clearly spelling out that much more than the unsafe blocks might need to be checked in order to avoid UB.

Re:The state of the kernel Rust experiment by simonask on Friday December 19, 2025 @07:38AM (#46325163)
Rust fanboys on Reddit are not contributing to the Linux kernel. What matters here is that Rust helps serious people deliver great code.
Re:The state of the kernel Rust experiment by yencabulator on Sunday December 21, 2025 @06:21PM (#46349673)
The unsafe code relied on an assumption that was not true; the chosen fix was to make that assumption be true. Makes perfect sense to me.
Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @05:15AM (#46324170)
There were certainly a lot of people running around claiming that "Rust eliminates the whole class of memory safety bugs." Of course, not everybody made such claims, but some did.

Whether it is "significantly easier" to manage these types of problems and at what cost remains to be seen.

I do not understand you comment about "confirmation bias" as did not make a quantitative prediction that could have bias.

Re:The state of the kernel Rust experiment by ivanbakel on Friday December 19, 2025 @05:53AM (#46324396)
> There were certainly a lot of people running around claiming that "Rust eliminates the whole class of memory safety bugs."

Safe Rust does do this. Dropping into unsafe Rust is the prerogative of the programmer who wants to take on the burden of preventing bugs themselves. Part of the technique of Rust programming is minimising the unsafe part so memory errors are eliminated as much as possible.

If the kernel could be written in 100% safe Rust, then any memory error would be a compiler bug.

Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @07:23AM (#46325057)
Yes, but this is the marketing bullshit I am calling out. "Safe Rust" != "Rust" and it is not "Safe Rust" which is competing with C it is "Rust".
Re:The state of the kernel Rust experiment by simonask on Friday December 19, 2025 @07:36AM (#46325146)
This is just so obtuse. Be serious.

Even if you somehow manage to ignore the very obvious theoretical argument why it works, the amount of quantitative evidence at this point is staggering: Rust, including unsafe warts and all, substantially improve the ability of any competent team to deliver working software. By a huge margin.

This is the programming equivalent of vaccine denialism.

Re:The state of the kernel Rust experiment by uecker on Monday December 22, 2025 @03:23AM (#46352225)
There is a lot of science showing vaccines work. For Rust showing that it is better this is still lacking. And no Google's blog posts are not science.
Re:The state of the kernel Rust experiment by Daishiman on Tuesday December 23, 2025 @10:30AM (#46366101)
So kernel devs claiming Rust works isn't good enough? CloudFlare? Mozilla? Your're raising the bar to a place where no software will be good enough for you.
Re:The state of the kernel Rust experiment by ivanbakel on Friday December 19, 2025 @12:53PM (#46328755)
> it is not "Safe Rust" which is competing with C it is "Rust".

It is intended that Safe Rust be the main competitor to C. You are not meant to write your whole program in unsafe Rust using raw pointers - that would indicate a significant failure of Rust’s expressive power.

Its true that many Rust programs involve some element of unsafe Rust, but that unsafety is meant to be contained and abstracted, not pervasive throughout the program. That’s a significant difference from how C’s unsafety works.

Re:The state of the kernel Rust experiment by uecker on Monday December 22, 2025 @03:24AM (#46352233)
But there are more than 2000 uses of "unsafe" even in the tiny amount of Rust use in the Linux kernel. And you would need to compare to C code where an equally amount of effort was done to develop safe abstractions. So essentially this is part of the fallacy Rust marketing exploits: comparing an idealized "Safe Rust" scenario compared to real-word resource-constrained usage of C by overworked maintainers.
Re:The state of the kernel Rust experiment by Daishiman on Tuesday December 23, 2025 @11:21AM (#46366567)
The C code comparison exists because people have written DRM drivers in Rust that were of exceedengly high quality and safety compared to the C equivalents.
Re:The state of the kernel Rust experiment by UltraSane on Friday December 19, 2025 @06:53AM (#46324816)
Safe Rust absolutely eliminates entire categories of bugs
Re:The state of the kernel Rust experiment by dwattttt on Friday December 19, 2025 @05:29AM (#46324262)
Is it any more or less amusimg, or perhaps tedious, watching the first Rust Linux kernel CVE be pounced on as evidence that "problems .. did not magically disappear"?

Does anyone involved in any of this work believe that a CVE in an unsafe block could not happen?

Re:The state of the kernel Rust experiment by chironjit on Friday December 19, 2025 @03:33AM (#46323566)
In case anyone is keen for an explanation of the vulnerability, LowLevelTV has done a video on this:

https://youtu.be/dgPI7NfKCiQ?si=BVBQ0MxuDpsbCvOk

The TLDR is that this race condition happened with unsafe code, which was needed to interact with existing C code. This was not a vulnerability with Rust's model.

That said, you can absolutely use bad coding practices in Rust that can cause issues, even for a regular programmer.

Using unwrap without dealing with all return cases is one example. Of course, there is a right way to dealing with return methods, but it's up to the programmer to follow it

Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @03:16AM (#46323474)
The bug of that CVE has undefined behavior, so anything can in principle happen. Greg is sorely mistaken. And my post got downvoted.

I do not blame you, for you had the competence and honesty to ask instead of incompetently and dishonestly jumping to incorrect conclusions.