News for hackers. Stuff that matters.
Re:The state of the kernel Rust experiment by AlotOfReading on Friday December 19, 2025 @12:51AM (#46322642)
Where did anyone promise that the Rust bits will never have security issues? That CVE was a fantastic demonstration of just how much better the situation is in Rust code and I don't think there's a realistic argument that the experiment has been anything other than successful.
Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @02:39AM (#46323226)
Was it? It seems more a fantastic demonstration how the same type of errors can also occur in Rust code.
Re:The state of the kernel Rust experiment by jrimbault on Friday December 19, 2025 @02:40AM (#46323240)
In C this kind of issue is so common it wouldn't raise to the status of "CVE". People would just shrug and say "git gud".
Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @02:42AM (#46323251)
This is certainly not true. But also arguments about "common" are completely misleading as long as there is many orders of magnitude more C code than Rust code.
Re:The state of the kernel Rust experiment by Certhas on Friday December 19, 2025 @05:29AM (#46324263)
Maybe you haven't been paying much attention in this space. Google found empirically that error density in _unsafe_ Rust is still much lower than in C/C++. And only a small portion of code is unsafe. So per LOC Rust has orders of magnitudes fewer errors than C/C++ in real world Android development. And these are not small sample sizes. By now more code is being written in Rust than C++ at Google:

https://security.googleblog.com/2025/11/rust-in-android-move...

But don't take my word for it, you can hear about the benefits of Rust directly from GKH:

www.youtube.com/watch?v=HX0GH-YJbGw

There really isn't a good faith argument here. You can make mistakes in Rust? No one denies that. There is more C code so of course there are more mistakes in C code than in Rust? Complete red herring.

Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @07:21AM (#46325042)
Hey, it was my point that the number of CVEs is red herring.

And no, I do not care or even believe what Google says. There are so many influencing factors.

Re:The state of the kernel Rust experiment by tialaramex on Friday December 19, 2025 @08:18AM (#46325488)
I would expect that the largest factor is cultural, and of course it's possible to inculcate safety culture in a team working on a C or C++ codebase, but it seems to me that we've shown it's actually easier to import the culture with a language which supports it.

Essentially Weak Sapir–Whorf but for programming languages rather than natural languages. Which is such a common idea that it's the subject of a Turing Award speech. Because the code you read and write in Rust usually has these desirable safety properties, that's how you tend to end up thinking about the problems expressed in that code. You could think this way in C, or C++ but the provided tooling and standard libraries don't support that way of using them so well.

Re:The state of the kernel Rust experiment by uecker on Monday December 22, 2025 @03:39AM (#46352295)
I also think that the largest factor is cultural. But my conclusion from this is not that one should import it with a new language while pretending achieving similar results is not possible otherwise. This just gives an excuse for not caring for the existing code anymore, which I suspect is one reason some parts of the industry like Rust ("nobody can expect us to care about the legacy code, nothing can be done until it is rewritten in Rust")
Re:The state of the kernel Rust experiment by Certhas on Monday December 22, 2025 @11:42AM (#46355694)
Of course highly correct C code is possible [1]. But ADA makes it easier. Rust makes it easier. You can write anything in any language, that is _not_ the argument. How could you plausibly advocate for a culture that invests a lot of effort [1] into making codes correct, and not also advocate for tools and languages that make it easier to check important aspects of correctness? A craftsman is responsible for his tools. Using subpar tools with the argument that with sufficient knowledge, skill and an appropriate culture you can overcome their shortcomings is absurd.

Rust is also often not the right tool. I looked at it fairly deeply some years ago for my team to transition away from Python/C hybrids, but settled on a fully garbage-collected language in the end. That was definitely the right choice for us.

[1] e.g. MISRA C, or https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Dev...

Re:The state of the kernel Rust experiment by Certhas on Saturday December 20, 2025 @09:29AM (#46336433)
The thing is. There always was a strong theoretical case that Rust should improve software quality (not just because of the fact that you have a lifetime system). The only reasonable counterpoint was that this is theory, and large scale experience is missing. Maybe in high quality code bases the mental overhead of using Rust would outweigh the theoretical guarantees, and the type of mistakes prevented are already caught by C/C++ tooling anyways?

The (in recent years) rapid adoption of Rust in industry clearly shows that this is not the case.

Re:The state of the kernel Rust experiment by bgwalter on Friday December 19, 2025 @05:44AM (#46324349)
That isn't "Google", that is a biased Android subteam who want to push Rust and use the apparently atrocious Android C code as an unfair example.

Why don't they use qmail as an example?

Re:The state of the kernel Rust experiment by inejge on Friday December 19, 2025 @07:10AM (#46324952)
> Why don't they use qmail as an example?

Perhaps because qmail is an anomaly, not Android? To remain relatively bug-free, a sizeable C project seems to require a small team and iron discipline. Unix MTAs are actually pretty good examples. With qmail, for a long time, it was just DJB. Postfix has also fared well, and (AFAIK) has a very small team. Both have been architected to religiously check error conditions and avoid the standard library for structure manipulation.

Android is probably more representative of large C (or C++) projects one may encounter in the wild.

Re:The state of the kernel Rust experiment by 0dayz on Friday December 19, 2025 @06:02AM (#46324450)
What does bias have to do with empirical evidence? Disprove that than driveling about non-tech stuff.
Re:The state of the kernel Rust experiment by bgwalter on Friday December 19, 2025 @06:27AM (#46324617)
If you are not intellectually capable of following an argument about selective samples (there are C code bases with virtually no bugs), perhaps you should refrain from commenting.

But you know that the mob voting will back you up.

Re:The state of the kernel Rust experiment by 0dayz on Friday December 19, 2025 @06:45AM (#46324751)
So you can't, and if a "dumbass" like me can understand the importance of empirical evidence but you can't, maybe read up on rational thinking instead of lashing out emotionally.
Re:The state of the kernel Rust experiment by bgwalter on Friday December 19, 2025 @06:51AM (#46324795)
And this is what happens if a company like MSFT pushes a language to disrupt open source.
Re:The state of the kernel Rust experiment by AlotOfReading on Friday December 19, 2025 @11:53AM (#46327991)
What about qmail? No one runs qmail and no one is writing new C with that kind of insanely hyperconservative style using only world-class security experts.

And it still wasn't enough. qmail has seen RCEs [0, 1] because DJB didn't consider integer and buffer overflows in-scope for the application.

[0] https://www.guninski.com/where_do_you_want_billg_to_go_today...

[1] https://lwn.net/Articles/820969/

Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @03:14AM (#46323456)
The bug of that CVE has undefined behavior, so anything can in principle happen. You and Greg are sorely mistaken. And my post got downvoted.
Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @03:32AM (#46323560)
That is is undefined behavior does not mean it is exploitable. But I also have not seen an argument why a data race should not be exploitable in this context.
Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @03:43AM (#46323627)
I am very wary of going that route. If there is undefined behavior, the compiler is in principle allowed to do anything and everything, unless it promises something beyond what the language promises.

One could then argue that a specific version of a specific compiler with specific settings in a specific case, after investigation of the generated assembly or inspection of what guarantees the compiler provides beyond the language, is not exploitable. But other settings of the compiler and other versions of the compiler and other compilers may have different guarantees and generation of assembly.

The Linux kernel uses, as I understand it, a flag for GCC for C code that disables strict aliasing. That basically means that strict aliasing is no longer undefined behavior, as long as that flag is used. Basically a dialect of C.

Re:The state of the kernel Rust experiment by uecker on Friday December 19, 2025 @03:46AM (#46323648)
It is very common for C implementation to define undefined behavior and also common for C programs to rely on this. For this reason, I think it is very misleading to say that undefined behavior is automatically exploitable or even a bug.
Re:The state of the kernel Rust experiment by johncolanduoni on Friday December 19, 2025 @05:27AM (#46324252)
And the kernel is infamous for being picky about the C compilers it can be successfully built with - clang couldn’t build a working kernel for a long time, and it was mostly relying on subtle GCCisms.
Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @06:27AM (#46324619)
I think defining terminology here might help.

An attempt:

Language-UB (L-UB): UB according to the guarantees of the language.

Project-compiler-UB (PC-UB): The project picks compilers and compiler settings to create a stronger set of guarantees, that turns some language-UB into not being UB. Examples include turning off the strict aliasing requirement in the used compilers, or a compiler by default defining some language-UB as being defined behavior.

I do not know if such terms might catch on, though. Do they seem reasonable to you?

Re:The state of the kernel Rust experiment by testdelacc1 on Friday December 19, 2025 @04:35AM (#46323920)
> You and Greg are sorely mistaken.

Greg Kroah-Hartman has been a Linux kernel developer for 25 years, responsible for large parts of the kernel.

You’ve been a hacker news commenter for 1 day.

Could you pipe down with these wild claims that you know better than him?

Also, please don’t complain about downvotes. It’s tedious to read.

Re:The state of the kernel Rust experiment by yourdetect on Friday December 19, 2025 @06:22AM (#46324580)
Appeal to authority. And an appeal to authority where the authority is blatantly and clearly mistaken. If the code has UB, there is no guarantee from Rust's or rustc's sides that it will only crash.
Re:The state of the kernel Rust experiment by UltraSane on Friday December 19, 2025 @06:52AM (#46324805)
This is a valid appeal to genuine expertise not authority.
Re:The state of the kernel Rust experiment by josephg on Friday December 19, 2025 @06:38AM (#46324693)
Saying "appeal to authority" doesn't refute the point made above. Expertise is real. Someone with 25 years of experience with the linux kernel will know a lot more about linux and C than the average HN commenter. Almost certainly more than me.

Its possible that you might be right about whatever point you're trying to make. But if you are, I can't tell that from your comments. I can't even find a clear claim in your comments, let alone any substantive argument in support of that claim.

I'm unmoved and unimpressed.