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."

-2 points
*

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.

permalink
report
reply
4 points

C is crap for anything where security matters. I’ll happily take that debate with anyone who thinks differently.

permalink
report
parent
reply
12 points

What debate? You offered zero arguments and “C bad tho” isn’t one.

permalink
report
parent
reply
-3 points

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

permalink
report
parent
reply
42 points
*

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.

permalink
report
parent
reply
-35 points

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?

permalink
report
parent
reply
21 points
*

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.

permalink
report
parent
reply
-4 points

having to go out of your way to learn it and religiously implement it.

Look! I painted the mona lisa in ketchup.

permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
10 points
*

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.

permalink
report
parent
reply
12 points

Maybe when you build some little application or whatever. When building the most used kernel in the world, there are probably some considerations that very few people can even try to understand.

permalink
report
parent
reply
22 points
*
Deleted by creator
permalink
report
parent
reply
15 points

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.

permalink
report
parent
reply
7 points

such a weird dichotomy in Windows – secure kernel space and privacy-nightmare user space … “we’re the only ones allowed to steal your data”

permalink
report
parent
reply
24 points

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.

permalink
report
parent
reply
6 points

If the timeline is long enough then it’s always worth the refactor.

permalink
report
parent
reply
18 points

Isn’t that exactly the strawman the maintainer got tired of?

permalink
report
parent
reply
2 points

Seeing as how 40% of the security issues that have been found over the years wouldn’t exist in a memory-safe language, I would say a re-write is extremely worth it.

permalink
report
parent
reply
129 points

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”).

permalink
report
parent
reply
-3 points
*

They said it wasn’t going to happen but their plan will result in it happening, how do you square that?

permalink
report
parent
reply
1 point

You tell me how it will result in it happening. Who even has the power to force people to learn Rust?

permalink
report
parent
reply
17 points

Better in what ways? Rust’s strong points are not to just make a program more stable, but more secure from a memory standpoint and I don’t think Linux keeps improving on that

permalink
report
parent
reply
1 point

Some next level deaf going on. That’s not what was being discussed.

The defensiveness proves just how out of touch and unqualified to comment some people are.

permalink
report
parent
reply
5 points
*

at every chance they get, sell it as C is crap, this is better

For ‘sendmail’ values of $C, this resembles another argument. Also, of course for $C=sysvinit.

permalink
report
parent
reply
78 points

Most reasonable people say c is good, rust is better

permalink
report
parent
reply
10 points

From other discussions I’ve seen, the guy stepping down was frustrated by having C code rejected that made lifetime guarantees more explicit. No rust involved. The patch was in service of rust bindings, but there was 0 rust code being reviewed by maintainers.

permalink
report
parent
reply
-13 points

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.

permalink
report
reply
1 point

Arch people tell you “I use arch BTW”

Rust people make PRs rewriting your code in rust.

Rust people are worse.

permalink
report
parent
reply
1 point

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).

permalink
report
parent
reply
22 points

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.

permalink
report
parent
reply
-14 points

if you were right they’d replace it with Java.

permalink
report
parent
reply
-10 points

I feel like the time to hide information behind YouTube links is over. Feels like a link to a paywall article at this point.

permalink
report
reply
64 points

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

permalink
report
reply
83 points

It’s Ted Ts’o, the maintainer of the ext4 filesystem amongst other things.

little shit

Though you’re still accurate despite his seniority.

permalink
report
parent
reply
71 points
*

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

permalink
report
parent
reply
1 point

How many vulnerabilities have the kernel Rust team introduced in the same time period on the same code?

permalink
report
parent
reply
30 points

You seem really invested in pointing out those shortcomings. I respect that.

permalink
report
parent
reply
25 points

permalink
report
parent
reply
6 points

Somebody needs to send a public email to the kernel mailing lists with this

permalink
report
parent
reply
34 points

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?

permalink
report
reply
-22 points

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.

permalink
report
parent
reply
38 points

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.

permalink
report
parent
reply
12 points

Nobody is proposing rewriting the whole kernel in Rust.

permalink
report
parent
reply
35 points

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?

permalink
report
parent
reply
12 points

Isn’t Linux still Linux even though probably a lot of the original code is gone?

The Kernel of Theseus.

permalink
report
parent
reply
13 points

Ship of Theseus

permalink
report
parent
reply
11 points

Is a single line of code in the kernel completely unchanged since its birth?

permalink
report
parent
reply
0 points

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.

permalink
report
parent
reply
2 points

Linux is a development ecosystem. If everyone agrees to switch to Rust it can switch to Rust with continuity. But they won’t.

permalink
report
parent
reply
7 points

Linux is whatever the Linux Mark Institute says it is.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 7.2K

    Monthly active users

  • 6.6K

    Posts

  • 179K

    Comments