this post was submitted on 06 May 2024
128 points (96.4% liked)
Linux
48310 readers
645 users here now
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
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The biggest lie of programming these days is just because something is coded in [trendy "secure" language of the day, including Rust] means it's secure. Bullcrap. It's how you code things that make it secure or not. You can be proficient enough in C to make programs that are much more secure vs. rust. The fact that everyone makes mistakes and programming is an enormous beast to wrangle with makes things insecure and needs to be monitored and fixed.
You're just partially correct.
With Rust you get compile time guarantees that your code doesn't have a specific class of vulnerabilities. Can you do that with C?
Yes, it's called "not being a shit programmer."
Ahah, I'm pretty sure many of the programmers on Linux et al, that worked on code with CVEs are still better programmers than you will ever be. The fact is that a lot of projects are just complex and they are hard to reason about on languages like C.
But I guess you know that. Keep trolling.
ALL CODE CAN HAVE BUGS BECAUSE WE ARE ALL HUMAN. NO ONE IS DENYING THAT.
But thinking that Rust is inherently safer is actually trolling. I don't care what you're doing or who you are, you can make a gigantic security hole in ANY language, including Rust, and there's zero difference. If you really think people are going around screwing up in C more than people are screwing up in Rust, particularly because they feel like "RUST IS SAFER I CAN DO ANYTHING", you're delusional.
You are not very consistent, first you imply that not "being a shitty programmer" is the fix for security issues in C. And then you say that any programmer can and will make mistakes...
Again you refuse to see my argument: yes I agree that viewing Rust, or any other language, as being a panaceia is wrong and following the hype. But Rust is provably better than C w.r.t to memory safety issues because it, provably, finds memory issues during compile time. I'm not discussing other types of security issues.
Yes C needs all that "freedom" with memory due to its low level use cases, but Rust is proving that it can also cover those cases (with the unsafe keyword) and cover the opposite cases where you want more strict memory usage and safety, so much so that you see now operating systems and firmware being developed in it. I won't argue and compare performance as I don't know enough.
You could argue that Rust by providing the "unsafe", keyword can and will have memory issues, but IMO the fact that you need to enclose unsafe operations in a scope allows for more focused reviewing and auditing
Sick of debating you people on this. You can't understand basic logic which tells me right away that you're either not a programmer or a really bad one, or, more likely, you have some sort of investment in the language's success.
There's no conflict in the statements that you need to be a good C programmer and that it's impossible to be a perfect programmer. This non-argument is you either not understanding common sense and logic, or you grasping at straws in the vain hope that people will think you're right because you're so obsessed with your language of the year that will be forgotten soon enough and replaced with, again, C and other traditional, good, useful languages.
I don't know which is the case, but the frenzied, unhinged way you're trying to defend rust makes me think you have an investment in the language in some way, which makes your argument invalid. I have no such attachments.
If you can't understand such common sense arguments, I can't believe that you even know how to write "Hello World" in any language.
You keep coming up with insults or inflamatory comments instead of answering the points, when I'm just trying to have a discussion of ideas. I don't understand why I am being unhinged when I even agreed with you partially.
I'm not a Rust programmer, I just play occasionally with it on pet projects. The languages I'm most experienced in are C++ and then C, I have no "horse in the race" of Rust, and I don't see c/c++ going away anytime soon, I just see what the language improves on them
Nope, rust is ideal for kernel code, it really is an improvement.
Writing kernel in C is like building a house with a hammer on loosen handle, there is too much give and the builder has to tap it a few times before every strike. You could say the builder knows how to build and secure a house, but hes still a human. The loosen handle adds too much difficulty result in errors which would otherwise be avoided.
Right here, is what I'm talking about. People believe that the code/language itself is inherently safe/secure or unsafe depending on what you choose and that's wrong. It's what the programmer does with that code that makes it safe or unsafe, secure or insecure. You can have the best designed and engineered materials on the planet and people are still going to be able to make things that will fall over and cause massive disasters with it. Stop bowing down to freaking Rust as if it's the damn savior of computing and programming. In the end, it's just another language and one another step removed from low level computing where it's easiest to deal with hardware-level and basic functionality systems at a huge cost.
This means there are C functions that are documented and used, but insecure.
In Rust there is simply an enforcement of certain conventions, which will make code cleaner and prevent a whole class of errors.
No one who knows anything about C uses insecure functions without having a good reason and a good foundation around them to keep them secure. The functions are there to allow C to have maximum flexibility and low-level access to a system. For the most part, these shouldn't be used, and any decent C programmer knows that. Comparing that with Rust where people think the entire language is inherently safe and has zero awareness of what they might be doing is laughably insecure is the heart of the problem.
Been programming longer than most of you have been alive, kids. Keep on defending your hacked together tricycle language and then crying when you manage to tip it over because of your overconfidence.
The rust standard lib uses
unsafe
in various places too. Even if you avoided every other category of error in your code logic, you could still end up with UB.madaidan and a lot of security clowns in FOSS/privacy community unironically claim that is how security works. However, it is true Rust is far better than C/C++ for security, if thousands of people are coding. Not everyone is going to be the best security programmer in the world.
Well, guess who shouldn't be programming then?
https://youtu.be/StLzsDU2-oo?t=1427