8 ms·
Out of bounds access, uninitialized stack data with an extremely weak language that doesn’t check any of that and happily compiles that hidden footgun gives you
by rvz 5y ago
Out of bounds access, uninitialized stack data with an extremely weak language that doesn’t check any of that and happily compiles that hidden footgun gives you an escalation of privileges vulnerability.
Perhaps Rust would have prevented this in the first place. But the entirety of Linux and the ancient UNIX philosophy is a giant labyrinth full of cobwebs riddled with hidden traps, landmines and trip-wires beyond exploring.
Must be the worlds largest and endless minesweeper game discovering all those C style vulnerabilities in the Linux kernel.
- pjmlp 5y agoPlenty of languages older than C would have caught that.
- nyberg 5y agoRust doesn't provide integer overflow safety unless explicitly requested. This is something refinement types which ATS2 provides would catch.
- mustache_kimono 5y agoThis isn't exactly true. Rust doesn't include such checks when compiled in '--release' mode. And Rust provides plenty of methods to make the programmer's intent clear and perform 'safer' arithmetic ops. See: https://doc.rust-lang.org/book/ch03-02-data-types.html?highlight=integer%20overflow#integer-overflow https://doc.rust-lang.org/book/ch03-02-data-types.html?highl...
- staticassertion 5y agoAnd unless there's an unsafe block integer overflow can not lead to a memory safety issue.
- chjj 5y agoI'm starting to get sick of the neverending "rust good, c bad" sentiment on HN. Bugs occur in rust code too. It's not a silver bullet to fix all problems associated with software development. Each language will have its own set of issues and quirks. It's easy to pick on C because it's been around far longer than most things. Give it 40 years and people will be saying "rust bad, new thing good".
- adgjlsfhk1 5y agowhile rust probably wouldn't have caught this bug, it is worth noting that the class is memory bugs C and C++ have are especially pernicious. bugs caused by manual memory allocation in these languages are often highly exploitable, and come from a common and necessary part of the language. As a result you end up with somewhere around 70% of security vulnerabilities being caused by a feature that just doesn't exist in other languages. the reason Rust gets so much hype is that it removes the last excuse of C/C++ (GC time).
- chjj 5y agoYes. I understand the argument. It's only been reiterated on HN hundreds of times now. > it removes the last excuse of C/C++ Odd way of looking at it. I never ask myself "what _excuse_ can I give myself for using this tool"? I'll continue using C and I don't need an excuse. I prefer C.
- UncleMeat 5y agoBut do your users prefer C? For software engineering to be a professional discipline, we really need to make choices based on the product outcome rather than based on what feels fun to program.
- chjj 5y agoI imagine they do. If they didn't, they wouldn't be using it. They would instead be using some equivalent piece of software written in a trendy language.
- UncleMeat 5y agoThe large majority of users cannot make well informed security risk decisions like this. Engineers should do the right thing and help these users. In the same way, I can't make some meaningful risk assessment for using a bridge or riding an elevator. Civil Engineers don't just get to say "well, if users are concerned about the safety of my bridge then they can make a different choice so I'm going with the stuff I personally like working with." Why do Software Engineers get away with this? Outside of small hobbyist projects, the industry has an obligation to provide users with safe software.
- account-5 5y agoI know, like why didn't they just write everything in rust from the start! Oh yeah, rust wasn't about. Well they should all stop what they're doing and rewrite everything in rust. Oh hang on, that's millions of lines of code. Is not Unix philosophy, its legacy. And it predates rust.
- sanxiyn 5y agoUninitialized stack is just negligence. Compilers can trivially initialize all stack variables. Yes, it's slower, but Android and Windows already chose slow but secure default. Linux just decided to be insecure.
- azinman2 5y agoUnix philosophy has plenty of problems: https://web.mit.edu/~simsong/www/ugh.pdf https://web.mit.edu/~simsong/www/ugh.pdf
- anthk 5y agoThat book as trully outdated. By ~1999-2000 most BSD's and GNU/Linux since 1996 solved all the issues with better shells, faster tools and toolkits like Motif (and later QT), and multimedia thanks to SDL, DRI and FFMPEG. It's like noticing Windows 9x's lack of security and stability on Windows 10 times. Absurd. Heck, that book praised Mac OS back in the day, and just look what Mac OS has been turned into since Mac OS X. Also, thanks to Unix philosphy my Fluxbox+Rox+Roxlib combo based "DE" it's much faster and featureful than most light desktops out there.