3 ms·
All the major operating systems these browsers are running on, are written in c and c++. How can you have a real memory safe application when the memory itself
by eknkc 2y ago
All the major operating systems these browsers are running on, are written in c and c++.
How can you have a real memory safe application when the memory itself is managed by a shit ton of code written in an unsafe language?
- parl_match 2y ago> How can you have a real memory safe application when the memory itself is managed by a shit ton of code written in an unsafe language? It turns out actually pretty effectively? There are going to be more bugs and boundary issues of the OS, but memory unsafety isn't some goop that oozes into your runtime.
- dmurray 2y agoRight, or equivalently, you can rely on the million eyeballs and the million developer-years poured into those OSes, while developing your project with a much smaller team.
- eknkc 2y agoYeah just a hyperbole. My point is, people act like anything built with non memory safe languages is shit ever since Rust became the Jesus. We have the actual operating systems written in C, working ok. It is fine. Yeah maybe Rust would be better but it is not a magic bullet and memory safety comes with many caveats in design of the code and possible performance issues when you are building something low level like a browser.
- deleted 2y ago[deleted]
- Sayrus 2y agoIn many cases, you'd need to escape the browser before exploiting the OS itself. Security is not an all or nothing, layers and layers are effective at mitigating or increasing the time it takes for exploit to work. For instance ASLR is absolutely not a bulletproof solution, but many exploits are order of magnitude more complex to execute when enabled. In addition to that, the browser is executing third-party code all the time while making it a good point of entry.
- eknkc 2y agoMy remark was a little more abstract and frankly, absurd though. I mean, the most memory safe language will invoke syscalls. It will ask for memory pages and stuff. If we assume the app is running on a pile of shit because the OS is written in C, how can we be sure that the language is memory safe? I understand the value of memory safe languages but people bashing on C/C++ code does not make sense to me when everything is essentially running on C. That’s all. > In addition to that, the browser is executing third-party code all the time while making it a good point of entry. This made me curious about something. Has there been many exploits stemming from JavaScript engines? I honestly do not know but as far as I can tell, most of the issues originate from faulty image decoders screwing up memory and tls implementations etc.
- heinrich5991 2y agoAFAIK most of modern web browser vulnerabilities come from JavaScript engines.