Imagine if there was a hack so bad that it caused everyone to become unable to develop in C and C++.
Classic “let’s just make the cure worse than the disease” mindset among security enthusiasts.
Imagine if there was a hack so bad that it caused everyone to become unable to develop in C and C++.
Well, there is one that will imply you can only develop using anything that you have bootstrapped yourself, using hardware that you have designed and manufactured yourself, using tools that you have designed and manufactured yourself, using tools that you have designed and manufactured yourself …
… with your own bare hands.
Why the swipe at Linus? He’s been supportive of rust in the Linux kernel.
There’s no shortage of reasons to not like Linus.
Maybe read the article…
I did - it says he’s supporting rust in the kernel.
I do know that Linus is on record with low opinion of C++. I have heard of him compare the cult-like following Rust has with the whole Vim/Emacs tribalism thing.
I didn’t understand this. He said the bickering between C and rust devs reminds him of the vim/emacs debate.
I have heard of him compare the cult-like following Rust has with the whole Vim/Emacs tribalism thing.
Heh.
I do think the worst thing going for Rust, right now, is the Rust community.
It feels like few specific jackasses from the Java community made the jump to Rust, and no one had the sense to slap them with a newspaper.
Java sucked so much though (and still does).
yeah No.
But there is context to it:
The report on Product Security Bad Practices warns software manufacturers about developing “new product lines for use in **service of critical infrastructure or [national critical functions] **NCFs in a memory-unsafe language (eg, C or C++) where there are readily available alternative memory-safe languages that could be used is dangerous and significantly elevates risk to national security, national economic security, and national public health and safety.”
It’s for new products that are very important to critical infrastructure and need to be safe as possible. The article writer seem not to be aware of this context:
Take Rust in Linux, for example. Even with support from Linux’s creator, Linus Torvalds, Rust is moving into Linux at a snail’s pace.
Because Linux is the biggest software in the entire world and they do lot of stuff their own way. Rust is integrated slowly for future new projects. It makes sense to move in snail pace. The government doesn’t suggest the Linux project to stop using C entirely. The government “recommends” to start new projects in memory safe languages, if it is a critical software. That makes sense to me.
You see, people who’ve spent years and sometimes decades mastering C don’t want to master the very different Rust. They don’t see the point.
No, totally wrong. C programmers in Linux do not NEED to learn or master Rust. They just need to cooperate. The problem is, that some C programmers refuse to cooperate with Rust. They just want Rust to disappear. That has nothing to do with mastering the language. They refuse to make changes to their C code, so it can cooperate with Rust code via bindings.
After all, they can write memory-safe code in C, so why can’t you?
Nonsense argument, and false too. If that was the case, why do we have memory safe languages? Clearly people make mistake, old and new. Besides Linux is not the only software in the world.
Converting existing large codebases to memory-safe languages can be an enormous undertaking.
Nobody says old code should be rewritten in Rust. Neither the government, nor the Rust programmers in Linux suggest that. It’s not about rewriting code in memory-safe languages, its about new projects.
Either this article is a misrepresentation or misunderstanding. Or I misunderstand the article or government. I don’t know anymore…
Take Rust in Linux, for example. Even with support from Linux’s creator, Linus Torvalds, Rust is moving into Linux at a snail’s pace.
Because Linux is the biggest software in the entire world and they do lot of stuff their own way. Rust is integrated slowly for future new projects. It makes sense to move in snail pace. The government doesn’t suggest the Linux project to stop using C entirely. The government “recommends” to start new projects in memory safe languages, if it is a critical software. That makes sense to me.
Doubly so… Don’t care what the language is, or what the advantages are… Even if there’s a considerable security advantage to a new language… There’s no such thing as a language that’s advantages outweigh the security risks of rushed development to convert decades of tested code.
They refuse to make changes to their C code, so it can cooperate with Rust code via bindings.
I don’t even think the rust devs where asking for that. They are refusing changes by rust devs that help with rust while making the c code clearer and even refuse to answer questions about the semantics behind the c code. At least as far as I can see from the outside.
The Rust kernel devs are …
- …asking the maintainers to lock down APIs which the C devs purposefully leave malleable, in part, to avoid binary blob drivers being feasible.
- …asking maintainers to accept code into their subsystem whilst being told, you don’t need to know Rust to an expert level…trust us. Cross language interfaces always have nuance and make good attack vectors. Understandable that maintainers are cautious.
- …creating quite a lot of hassle for no a lot of improvement. Systems are only as resilient as their weakest components. The cross language interface is always going to be weak. Introducing a weakness to get improvements probably only succeeds at making the whole weaker.
asking the maintainers to lock down APIs which the C devs purposefully leave malleable, in part, to avoid binary blob drivers being feasible.
No, they were asking them to define the semantics of the filesystem APIs. Those semantics are not encoded in the C API but the Rust devs wanted to encode them in the Rust API to avoid making mistakes.
The C devs didn’t want to, not because of concerns about binary drivers, but because the semantics are already broken. Apparently different filesystem drivers assume different semantics for the same functions and it’s a whole mess. They don’t want to face up to this and certainly don’t want anyone pointing it out, so clearly it must be the Rust devs’ fault for wanting APIs to have consistent semantics.
The rest of your comment is nonsense.
What’s the reason to avoid binary blob drivers being feasible? Is that about not being able to use non-free binary blobs in kernel? I don’t quite understand what it even is about
Having binary blobs linked into your kernel is a maintainability nightmare. You’re allowing a third party to link their buggy drivers into the heart of your platform. It breaks any security model you have, and brings with a bunch of bugs that are impossible to debug.
Nvidia were the worst offender and it culminated in this:
https://arstechnica.com/information-technology/2012/06/linus-torvalds-says-f-k-you-to-nvidia/
Got it. I agree that their drivers are (were?) of exemplary bad quality
But I don’t think that it is realistically possible to drop all the proprietary firmware blobs, and if it’s not maybe it’s better to not actively sabotage something to ‘avoid those being feasible’?
Firmware don’t link to the kernel tho, and the kernel functions aren’t stable so a firmware today would stop working tomorrow because a function was refactored(and all the code in the kernel that depend on that function) for performance or security, and the binary can’t be refactored so it become useless
IIRC They were also trying to get kernel devs to let official structure definitions live in Rust instead of C, and got upset when they didn’t want to do that.
the rust devs wanted to CREATE official structure definitions that don’t exist in C so that there was more semantic meaning to the APIs
No, totally wrong. C programmers in Linux do not NEED to learn or master Rust. They just need to cooperate. The problem is, that some C programmers refuse to cooperate with Rust. They just want Rust to disappear. That has nothing to do with mastering the language. They refuse to make changes to their C code, so it can cooperate with Rust code via bindings.
I would argue that’s not the biggest problem, the biggest problem is that for you to refactor a function to work with rust, you need to refactor all the subsystems that rely on that function, and that take time, and you need to explain for the C dev why it need to be done, try to explain that for the amount of C devs in the kernel
If only it were that easy to snap your fingers and magically transform your code base from C to Rust. Spoiler alert: It’s not.
How utterly disingenuous. That’s not what the CISA recommendation says, at all.
well, i’m glad the US government is at least aware what C and C++ are!
Need more carrot
The comment thread in that article is interesting. Grep for Ada.
My friend from university sends me his Rust code snippets sometimes. Ngl it looks like a pretty cool language.
There was also that tldr reimplemention in Rust that is a gatrillion times faster than the original.
I really want to give it a try but I have executive dysfunction and don’t have any ideas of what I could use it for.
The main issue I have with rust is the lack of a rust abi for shared libraries, which makes big dependencies shitty to work with. Another is a lot of the big, nearly ubiquitous libraries don’t have great documentation, what’s getting put up on crates.io is insufficient to quickly get an understanding of the library. It’d also be nice if the error messages coming out of rust analyzer were as verbose as what the compiler will give you. Other than that it’s a really interesting language with a lot of great ideas. The iterator paradigm is really convenient, and the way enums work leads to really expressive code.
Documentation is generally considered one of the stronger points of rust libraries. Crates.io is not a documentation site you want https://docs.rs/ for that though it is generally linked to on crates.io. A lot of bigger crates also have their own online books for more in depth stuff. It is not that common to find a larger crate with bad documentation.
One specific example I encountered was ndarray. I couldn’t figure out how to make a function take an array and an arrayslice without rewriting the function for both types. This could be because I’m novice with the language, but it didn’t seem obvious. I ended up giving up after trying to dig through the docs for a few hours and went back to C++.
Rust is definitely a really cool language (as someone who has played with it just a little) but it’s quite headache inducing, at least for me at the moment.
It has a steep learning curve, but it’s super nice to use once you’re over the initial bump
fn executive() {}
Because they want to replace them with more corporate-controlled languages.
Just add
@safe:
after yourmodule
declaration, and you’ll be safe by default if you don’t want to wait until D3.Also, unlike in Rust, you can opt-out from RAII with
int foo = void;
, although it primarily has a performance advantage with arrays, not singleton variables (might be also useful for aquiring an RNG seed in a dumb way).Jep, you got em, it’s all a conspiracy so they poison our mind with the evil tongues and make us corpo slaves with the help of Rust.
Eventually, painfully, slowly, we’ll move to memory-safe languages. It really is a good idea. Personally, though, I don’t expect it to happen this decade. In the 2030s? Yes, 2020s? No.
This. Unless the government starts introducing fines or financial incentives (like fines) to force the use of memory-safe languages, ain’t nothing gonna happen.