4 ms·
Nearly every piece of networked hardware has critical software running written in C, and the consequences are not nearly as disastrous as reading HN would make
by varjag 7y ago
Nearly every piece of networked hardware has critical software running written in C, and the consequences are not nearly as disastrous as reading HN would make us believe.
- pjmlp 7y agoThe CVE database proves otherwise. Unfortunately liability is not yet a thing across the industry.
- rightbyte 7y agoWhat does that site prove? https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=stack https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=stack 3496 entries https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=pointer https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=pointer 2389 entries https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=java https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=java 2034 entries A possible outcome is that you would trade pointer bugs etc. for "Java bugs" if Java embedded were used everywhere. Embedding a complete runtime increases the attack surface alot.
- pjmlp 7y agoContrary to urban myths, C has a runtime as well. Many of those Java exploits are on C and C++ written code layer, yet another reason to get rid of them in security critical code. According to Microsoft Security Research Center and Google's driven Linux Kernel Self Protection project, the industry losses due to memory corruptions in C written software goes up to billions of dollars per year. Several reports are available.
- jstimpfle 7y ago> Contrary to urban myths, C has a runtime as well. Would you like to tell us how it compares to e.g. Java's runtime as well?
- pjmlp 7y agoFor starters, easier to exploit. Then, unless we are speaking about a non-conformant ISO C implementation for bare metal deployments, it provides the initialization before main() starts, floating point emulation, handling of signals on non-UNIX OSes, VLAs.
- jstimpfle 7y agoSo basically all the stuff that noone cares about? Maybe it's only a runtime if you really want to win a pointless argument?
- deleted 7y ago[deleted]
- pjmlp 7y agoHow Apple, Google, Microsoft, Sony, ARM are now steering the industry regarding their OS SDKs has already proven who is on the right side. I have been at this since the BBS days, I don't care about Internet brownie points. The only thing left is actually having some liabily in place for business damages caused by exploits, I am fairly confident that it will eventually happen, even if it takes a couple of more years or decades to arrive there.
- jstimpfle 7y agoClaiming that a little process startup code (that isn't really part of a particular language, but is much more part of the OS ABI) was easier to exploit than an entire JRE is just dishonest. I would never think of "floating point emulation, handling of signals on non-UNIX OSes, VLAs" as anything resembling a "runtime". These are mostly irrelevant anyway, but apart from that they are just little library nuggets or a few assembly instructions that get inserted as part of the regular compilation. By "runtime", I believe most people mean a runtime system (like the JRE), and that is an entirely different world. It runs your "compiled" byte code because that can't run on its own.
- varjag 7y agoMost of the notorious security breaches in practice (Stuxnet, NSA, IoT mega-botnets…) had nothing to do with buffer overflows.
- pjmlp 7y agoA few stars don't hide the impact of billions of dollars in fixing buffer overflows and their related exploits. > 70% of the vulnerabilities Microsoft assigns a CVE each year continue to be memory safety issues https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-systems-programming-language/ https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-s... If you are going to argue that is 'cause Windows, there are similar reports from Google regarding Linux.