Wedson Almeida Filho is a Microsoft engineer who has been prolific in his contributions to the Rust for the Linux kernel code over the past several years. Wedson has worked on many Rust Linux kernel features and even did a experimental EXT2 file-system driver port to Rust. But he’s had enough and is now stepping away from the Rust for Linux efforts.
From Wedon’s post on the kernel mailing list:
I am retiring from the project. After almost 4 years, I find myself lacking the energy and enthusiasm I once had to respond to some of the nontechnical nonsense, so it’s best to leave it up to those who still have it in them.
…
I truly believe the future of kernels is with memory-safe languages. I am no visionary but if Linux doesn’t internalize this, I’m afraid some other kernel will do to it what it did to Unix.
Lastly, I’ll leave a small, 3min 30s, sample for context here: https://youtu.be/WiPp9YEBV0Q?t=1529 – and to reiterate, no one is trying force anyone else to learn Rust nor prevent refactorings of C code."
The kernel is mostly written in C, by C developers… understandably they’re rather refactor C code to make it better instead of rewritting everything in the current fancy language that’ll save the world this time (especially considering proponents of said language always, at every chance they get, sell it as C is crap, this is better).
Linux is over 30yo and keeps getting better and more stable, that’s the power of open-source.
C is crap for anything where security matters. I’ll happily take that debate with anyone who thinks differently.
Do you believe C isn’t crap when it comes to security? Please explain why and I’ll happily debate you.
/fw hacker, reverse engineer
No idea what you’re being downvoted. Just take a look at all the critical CVSS scored vulnerabilities in the Linux kernel over the past decade. They’re all overwhelmingly due to pitfalls of the C language - they’re rarely architectural issues but instead because some extra fluff wasn’t added to double check the size of an int or a struct etc resulting in memory corruption. Use after frees, out of bounds reads, etc.
These are pretty much wiped out entirely by Rust and caught at compile time (or at runtime with a panic).
The cognitive load of writing safe C, and the volume of extra code it requires, is the problem of C.
You can write safe C, if you know what you’re doing (but as shown by the volume of vulns, even the world’s best C programmers still make slip ups).
Rust forces safe® code without any of the cognitive load of C and without having to go out of your way to learn it and religiously implement it.
The cognitive load of writing safe C, and the volume of extra code it requires, is the problem of C.
Oh no, i’m having a meltdown with all the cognitive load…
Build all the fancy tools you want. At the end of the day if you put a monkey at the wheel of a Ferrari you’ll still have problems.
Nice that Rust is memory-safe, use it if you want, but why the insistence on selling Rust via C is crap? Doesn’t earn you any points.
How about rustaceans fork the kernel and once it’s fully Rust-only then try and get it to be used instead of the current one… win-win, eh?
They’re being downvoted because it’s a silly comment that is basically unrelated and also extremely unhelpful. Everyone can agree that C has footguns and isn’t memory safe, but writing a kernel isn’t memory safe. A kernel written in Rust will have tons of unsafe, just look at Redox: https://github.com/search?q=repo%3Aredox-os%2Fkernel unsafe&type=code That doesn’t mean it isn’t safer, even in kernel space, but the issues with introducing Rust into the kernel, which is already written in C and a massive project, are more nuanced than “C bad”. The religious “C bad” and “C good” arguments are kinda exactly the issue on display in the OP.
I say this as someone who writes mostly Rust instead of C and is in favor of Rust in the kernel.
C is crap for anything where security matters.
True for people misusing it. If you want to argue the ease of mis-use, it’s a fun talk.
Yea, it’s not C that is crap, but that it has zero guard rails. Like blaming a knife for not having a guard… Is it a bad knife without a guard? Depends on how sharp it is. The guard is orthogonal to the knife’s purpose, but might still be important when the knife is used.
Just because something doesn’t help prevent accidents does not mean it cannot serve its actual purpose well, unless its actual purpose is safety.
Agree. I’m an absolutely awesome software dev myself - and I know C by heart (being my favorite language after assembler). However, with age comes humility and the ability to recognize that I will write buggy code every now and then.
Better the language saves me when I can’t, in security critical situations.
such a weird dichotomy in Windows – secure kernel space and privacy-nightmare user space … “we’re the only ones allowed to steal your data”
I think most people would agree with you, but that isn’t really the issue. Rather the question is where the threshold for rewriting in Rust vs maintaining in C lies. Rewriting in any language is costly and error-prone, so at what point do the benefits outweigh that cost and risk? For a legacy, battle-tested codebase (possibly one of the most widely tested codebases out there), the benefit is probably on the lower side.
This sounds exactly like the type of nontechnical nonsense they’re complaining about: attacking a strawman (“they’re trying to prevent people from refactoring C code and making them rewrite everything in the current fancy language”) even after explicitly calling out that that was not going to happen (“and to reiterate, no one is trying force anyone else to learn Rust nor prevent refactorings of C code”).
They said it wasn’t going to happen but their plan will result in it happening, how do you square that?
You tell me how it will result in it happening. Who even has the power to force people to learn Rust?
RUST ppl feel like ARCH ppl. yes it might be better than some other setup yadda yadda, but they are so enervating.i’d rather switch back to windows11 than read another post/blog on how som crustians replaced this or that c library. just shut up already.
The sad thing is, there are other languages better at replacing C/C++ due to closer resemblance, except they’re rarely used due to lack of trendy technology that is being hyped in Rust. D lost a lot of ground due to its maintainers didn’t make it an “immutable by default” language at the time when functional programming paradigm was the next big thing in programming (which D can still do, as long as you’re not too fussy about using const
everywhere).
It was never about replacing C with a new language for the sake of novelty, it was about solving the large majority of security vulnerabilities that are inherent in memory-unsafe languages.
If Rust were to implode tomorrow, some other memory-safe language would come along and become equally annoying to developers who think they’re the first and only person to suggest just checking the code really hard for memory issues before merge.
I feel like the time to hide information behind YouTube links is over. Feels like a link to a paywall article at this point.
Who the fuck is this little shit? Can’t they even be a little considerate towards rust? Just because they have 15 years worth of inertia for C doesn’t mean they can close their eyes and say “nope, I’m not interested”. I do not see how the kernel can survive without making rust a first class citizen
It’s Ted Ts’o, the maintainer of the ext4 filesystem amongst other things.
little shit
Though you’re still accurate despite his seniority.
There’s really only one valid response to Ted Ts’o:
If you think you can do better with C, prove it.
CVE-2024-42304 — crash from undocumented function parameter invariants
CVE-2024-40955 — out of bounds read
CVE-2024-0775 — use-after-free
CVE-2023-2513 — use-after-free
CVE-2023-1252 — use-after-free
CVE-2022-1184 — use-after-free
CVE-2020-14314 — out of bounds read
CVE-2019-19447 — use-after-free
CVE-2018-10879 — use-after-free
CVE-2018-10878 — out of bounds write
CVE-2018-10881 — out of bounds read
CVE-2015-8324 — null pointer dereference
CVE-2014-8086 — race condition
CVE-2011-2493 — call function pointer in uninitialized struct
CVE-2009-0748 — null pointer dereference
How many vulnerabilities have the kernel Rust team introduced in the same time period on the same code?
You seem really invested in pointing out those shortcomings. I respect that.
The video attached is a perfect example of the kind of “I’m not prepared to learn anything new so everyone else is wrong” attitude that is eating away at Linux like a cancer.
If memory safety isn’t adopted into the kernel, and C fanaticism discarded, Linux will face the same fate as the kernels it once replaced. Does the Linux foundation want to drag its heels and stuff millions into AI ventures whilst sysadmins quietly shift to new kernels that offer memory safety, or does it want to be part of that future?
If Linux gets rewritten in Rust it will be a new kernel, not Linux. You can make new kernels, even in Rust but they aren’t Linux. You can advertise them at Linux conferences but you can’t force every Linux dev to work on your new Rust kernel.
There is no “your” new rust kernel. There is a gigantic ship of Theseus that is the Linux kernel, and many parts of it are being rewritten, refactored, removed an added all the time by god knows how many different people. Some of those things will be done in rust.
Can we stop reacting to this the way conservatives react to gay people? Just let some rust exist. Nobody is forcing everyone to be gay, and nobody is forcing everybody to immediately abandon C and rewrite everything in rust.
Isn’t Linux still Linux even though probably a lot of the original code is gone? Why would slowly rewriting it whole, or just parts, in Rust make it stop being Linux?
Isn’t Linux still Linux even though probably a lot of the original code is gone?
The Kernel of Theseus.
the crew on the Ship of Theseus would like a word with you. Because if you strip out every subsystem and replace them with a different language, everyone would still call it Linux and it would still work as Linux.
Linux isn’t “a bunch of C code” it’s an API, an ABI, and a bunch of drivers bundled into a monorepo.
Linux is whatever the Linux Mark Institute says it is.