15 ms·
Mitigating Memory Safety Issues in Open Source Software
- DrBazza 6y agoIt's buried in there, but it doesn't specifically say Rust: > That’s why we’re expanding our collaboration with the Internet Security Research Group to support the reimplementation of critical open-source software in memory-safe languages.
- KenanSulayman 6y ago> The new Rust-based HTTP and TLS backends for curl and now this new TLS library for Apache httpd are an important starting point in this overall effort.
- DrBazza 6y agoThis item had a different title specifically mentioning rust which had been changed to remove it, before you made your comment
- lrossi 6y agoWhat is left out of the title is that they do not provide funding to the current authors/maintainers of these open source projects. Instead, they fund an organization that will rewrite these tools. Correct me if I’m wrong, but that’s my understanding of the rather terse article. I would rather have the original maintainers funded and still in control of the many pieces that form the basis of the major Linux distributions.
- flohofwoe 6y agoYeah, it sounds a lot like Google is going to "hijack" popular open source projects for the sake of "security". It'll be interesting to watch how this plays out. But I pity the projects where Google's gaze falls upon.
- mfer 6y agoI’m not sure “hijack” is the right word. They are using money to entice projects to rewrite in memory safe languages.
- lullibrulli3 6y ago*to entice projects to rewrite other peoples projects
- Miner49er 6y agoYour missing what the two parent comments are driving at. Google says that's what it is doing, but this money is going to "an organization" that will seemingly get it's money from Google, giving Google control over whatever open source projects they target.
- emteycz 6y agoAnd? Google can't decide to fund organization that rewrites open source projects, or what? How is that different from forking the projects - apart from Google not taking anything at all?
- beckman466 6y agoThe over-arching pattern is that capitalist firms are happy to take from the commons, yet do little to sustain it.
- emteycz 6y agoThey're literally funding an organization that will take software to the next level and share it with the world, what more do you want?
- bachmeier 6y agoA rewrite is not taking it "to the next level". It provides a new version in a new language that does the same things, and if things go according to plan, will have fewer safety issues. There's nothing that binds them to maintain any of these projects. Given Google's history, it's irresponsible to not consider long-term maintenance and other issues.
- jk563 6y agoThey specifically mention rust based backends for curl where the author of curl was funded to integrate as a starting point. I don't see any mention of funding being exclusively for organisations other than the author(s)?
- turminal 6y agoAgreed 100%. Sadly everyone expressing concerns like this will be dismissed and everyone is going to once again hail google for being community friendly and supportive of FOSS.
- gnfargbl 6y agoThe article says that Google is committing funding to the ISRG (https://abetterinternet.org https://abetterinternet.org). It isn't really clear whether that is one-off funding, or the start of an ongoing relationship. The ISRG seems to have two projects of this type mentioned on its website: an improvement to curl (https://www.abetterinternet.org/post/memory-safe-curl/ https://www.abetterinternet.org/post/memory-safe-curl/), in which the ISRG funded the curl author directly; and an improvement to httpd (https://www.abetterinternet.org/post/memory-safe-tls-apache/ https://www.abetterinternet.org/post/memory-safe-tls-apache/), in which Google (via the ISRG) are funding an httpd committer.
- giantandroids 6y agolets encrypt are under the ISRG
- folex 6y ago> The ISRG's approach of working directly with maintainers to support rewriting tools and libraries incrementally falls directly in line with our perspective here at Google. Incrementally – that means in-place. You can't fork and rewrite incrementally since there will be no adoption/users of the fork. Also they talk about maintainers of the projects. I think that largely means original authors and maintainers, not forks. I don't see how you come to that conclusion. Could you clarify? Thanks :)
- the_duke 6y agoAt least for curl the project leadership is closely involved, as evidenced by a related article on Stenbergs blog [1] and the ISRG annoucement [2], which mentions funding Stenberg directly and is actually linked from this anouncement... Please don't make statements like that without doing a minimal amount of effort to verify. [1] https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyper/ https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyp... [2] https://www.abetterinternet.org/post/memory-safe-curl/ https://www.abetterinternet.org/post/memory-safe-curl/
- lrossi 6y agoMaybe I got it backwards, but it’s a PR post, and the burden is on the author to make the point clear. I’ve read it 3 times and still can’t find any sentence where they state clearly what the development strategy is. And from link #2 that you posted, I see they talk about the curl stuff, but also show a bunch of repos with tools rewritten from scratch, e.g. https://github.com/ctz/rustls https://github.com/ctz/rustls So I really cannot draw a conclusion one way or the other. Normally I’m an optimist, but after the recent chromium misunderstandings, I am going to err on the cynical side.
- klelatti 6y agoThe example from the ISRG blog [1] directly contradicts the assumption you're making: > Memory safety vulnerabilities represent one of the biggest threats to Internet security. As such, we at ISRG are interested in finding ways to make the most heavily relied-upon software on the Internet memory safe. Today we’re excited to announce that we’re working with Daniel Stenberg, author of ubiquitous curl software, and WolfSSL, to make critical parts of the curl codebase memory safe. > ISRG is funding Daniel to work on adding support for Hyper as an HTTP back-end for curl. Hyper is a fast and safe HTTP implementation written in Rust. I too found the post terse and the lack of quantification of the financial commitment makes me suspicious but I think they deserve the benefit of the doubt for now. [1] https://www.abetterinternet.org/post/memory-safe-curl/ https://www.abetterinternet.org/post/memory-safe-curl/
- lrossi 6y agoReplying to myself as I cannot edit anymore. As others pointed out, it’s not clear who will do the rewrites. Based on the curl example, it might be the maintainers. It would have been great if they could state that concretely. I’m also wondering why there’s a middle man instead of funding the projects directly, but that’s another story.
- jaas 6y agoI'm the head of ISRG, the "middle man" entity you're referring to. We have a memory safety initiative in which we plan and fund projects to move popular open source software to memory safe languages. For each plan we make we seek a funder - in a couple of cases now that has been Google, but it may be others in the future. We are in the "middle" of the financing in the sense that funding passes through us, but the memory safety initiative is coordinated primarily by us. We select projects and work with maintainers to make plans. Part of that coordination we perform is matching up projects with funders like Google, and then managing the contracts and overseeing the work to completion.
- lrossi 6y agoThank you for your reply. If I understand correctly, this is an initiative that might have multiple sponsors, so it makes sense to have a central entity organizing it, and following up with all the projects involved. This makes perfect sense to me now. Also, I was not aware that your org is behind Let’s Encrypt. This puts things into a very positive light. It might make sense to post a sibling blog post/announcement to explain what this project is about and how it would work. I feel that Google’s post left a lot of questions to be answered. If you don’t mind me asking, is rust the only language that you have in mind? Would go work as well?
- jaas 6y ago(Executive Director of ISRG here) > What is left out of the title is that they do not provide funding to the current authors/maintainers of these open source projects. Instead, they fund an organization that will rewrite these tools. This's not what's happening. Here's what is: ISRG plans and coordinates investments in moving open source software to memory safe languages. We have a strong preference for working on these plans with maintainers and developers, and then funding them to execute the plan. Once we have a plan prepared, and, ideally, maintainers/developers on board, then we pitch it for funding. Once someone (e.g. Google) funds the project, then ISRG handles contracts with the project developers/maintainers to get the work done. In some cases maintainers may be on board but want us to find a contractor to actually do the work. In both of the first two projects, and in most future cases, the money that Google (or another company) provides will largely go to project maintainers / developers.
- lrossi 6y agoThis sounds great, thanks for clarifying! Also, thanks for Let’s Encrypt. I didn’t make the connection between the two names. This initiative looks much better to me now. Is rust the only language that you are considering? Would go make sense as well?
- Cullinet 6y agoso potentially the result is a complete rewrite not involving the original authors in a language the original authors may not be current with, by a contractor code publisher / producer. given the potential for security theater and general fud and the potency that appeals to authorities such as sponsors like Google can create in the minds of the public, how has this been evaluated in terms of the possibility for widespread disintermediation of the open source software community at large?
- enriquto 6y agosemi-conspiracy theory: the main goal of this rewriting is to have less and less infrastructure depending on GPL and AGPL-licensed code
- jsty 6y agoIf all Google wanted was GPL- and AGPL-free code, they're quite capable of assigning their own engineers / contractors to work on it rather than the more tortuous route of going via a 3rd party
- bluGill 6y agoTheir accountants probably prefer this route though. They don't get a competitive advantage by have a proprietary license, so open source is a good choice, but the GPL has issues they want to avoid. By going this route they can use tax breaks that are not available for doing the work in house. Sure it is more complex, but the results matter, and the result they are hoping for is someone else does work that they don't pay for.
- konschubert 6y agoAlso it's probably cheaper to fund an OS developer for a year than paying for lunch alone for their own engineers.
- jononor 6y agoWhat kinds of tax breaks are available for the case of using consultants instead of employees?
- bluGill 6y agoIt isn't consultants it is 501 charities doing the work. The charity hires the consultants. There are a lot of tricks needed to make the above work, and details that you need to consult a lawyer and accountant for.
- enriquto 6y ago
- roel_v 6y agoCan someone please fix the title to the original in the blog ('Mitigating Memory Safety Issues in Open Source Software'), because the current title is not at all representative of what the blog is actually saying.
- praptak 6y agoAlso "for rewriting popular systems in Rust" is just false. The blog is about improving memory safety and gives two pieces of software rewritten in Rust as an example. There's nothing about this effort being focused on rewriting things in Rust.
- wyldfire 6y agoAre you sure? > That’s why we’re expanding our collaboration with the Internet Security Research Group to support the reimplementation of critical open-source software in memory-safe languages. Though the rest of the article doesn't go into detail about this effort beyond http/TLS libs for curl.
- smoyer 6y agoThe quote you provide above doesn't specify that these rewrites are to be in Rust and I don't think you've contradicted the parent in any way. The examples have been in Rust but the foundation doesn't seem to insist on rewrites being done in a specific language. As an aside, the foundation doesn't seem to be much more than a collection of papers at this point.
- praptak 6y agoThe "memory-safe languages" may mean Go, Java and a bunch of other less popular languages.
- oscargrouch 6y agoIn the end of the day only Rust will be chosen because we are talking mostly about system infrastructure.
- stephen82 6y agoWould not be cheaper to fix those unsafe languages, such as C, and offer safe mechanisms that could be used upon need? Why spend thousands, if not millions of dollars, on rewriting existing codebases when they could help fixing the existing toolset and make it safer? I don't get it.
- hypertele-Xii 6y agoHow do you "fix" C?
- wtallis 6y agoThe main strength of a memory-safe language is that the safety mechanisms are opt-out, not opt-in: you can confine the unsafe behavior to a small, manageable portion of the codebase. And trying to "fix" C to become a memory-safe language would probably just result in something like a Rust dialect that merely bears more superficial resemblance to C. In any case, thorough re-writing of existing codebases would be required. You might as well re-write in a language that currently exists, rather than add creating a new language to the top of the to-do list.
- bluGill 6y agoI would call C++ a memory safe language that has more than a superficial resemblance to C. Rust makes is more obvious when/where you are intentionally opting out, but most C++ memory bugs are where someone opted out of the modern C++ way to use the C way. (including new/delete as the C way).
- frumiousirc 6y agoWhat if any requirements are there on the licensing of these reinvented wheels? Specifically would GPL or AGPL be acceptable?
- DesiLurker 6y agoand abandon it right after they become technically uninteresting. seriously aside from not supporting current GPL licence on these open source projects I dont see a reason to not support them.
- wdb 6y agoDo they also have a study what the cost is of reimplementing an existing project in a new project regarding feature parity existing bugs people might depend on?
- Radim 6y agoFor what it's worth, I reached out to the Open Source Security Foundation (OpenSSF) after their press release on "Securing Critical Open Source Projects" [0], because my open source project is on their "critical list" (Python top #200) [1]. After some clicking around, I was directed to the OpenSSF mailing list [2]. …where my request was left to rot, without any response. Made me wonder whether this is just a PR stunt / corporate power grab. [0] https://opensource.googleblog.com/2020/12/finding-critical-open-source-projects.html https://opensource.googleblog.com/2020/12/finding-critical-o... [1] https://news.ycombinator.com/item?id=25381397 https://news.ycombinator.com/item?id=25381397 [2] https://groups.google.com/g/wg-securing-critical-projects https://groups.google.com/g/wg-securing-critical-projects
- ZebusJesus 6y agoI think it is, the maintainers of curl even talked about how C is a secure language and how curl is on almost every system possible which is why it has flaws, not because C is insecure. Debugging your code on almost every hardware out there is not possible which is why it is open source and why they intended you to adapt it not just run it
- twic 6y agoI couldn't find "Gensim" in the Python top 200 list: https://www.googleapis.com/download/storage/v1/b/ossf-criticality-score/o/python_top_200.csv?generation=1609361528959924&alt=media https://www.googleapis.com/download/storage/v1/b/ossf-critic... In the list of all projects, it is 2909th. https://www.googleapis.com/download/storage/v1/b/ossf-criticality-score/o/all.csv?generation=1612987910088811&alt=media https://www.googleapis.com/download/storage/v1/b/ossf-critic... You posted in December that it was #119 for Python. That suggests to me that this list might be quite volatile, which calls into question its usefulness. Regardless of the actual position in the list, your email should have got a response!
- giantandroids 6y ago> …where my request was left to rot, without any response. Hey, I am involved in the OpenSSF and happy to take at least a look. I maintain a popular python OSS project in the security area so we have that in common. Did your email actually go through, I just searched my list archives and there is nothing for gensim. EDIT: see your email now, have msg'ed the WG in slack. > Made me wonder whether this is just a PR stunt / corporate power grab I would not say it is, we have folks from OWASP on the technical advisory panel and many other non profit orgs / individual developers. One thing I would keep in mind, is that being a newly founded org, a lot of time has been spent working out and agreeing how we will operate, so the working groups are all still quite fresh.
- hahahahe 6y agoThe more I look at Rust the more I realize it’s going to become the next standard language.
- arcturus17 6y agoYou mean standard for systems programming? I don't doubt that it will be a popular choice in that area, but even there it has competition from new languages. And above all, I think it might take longer than a century to phase out all the C/C++ legacy code!
- ragnese 6y agoIt'll be interesting to see how it plays out. I could absolutely see C++ devs jumping ship to Rust. I think const generics just stabilized or is about to. That was one of the first shortcomings I noticed when I learned Rust. I think custom allocators is pretty much the next big piece that would give C++ devs pause today. But I don't see Rust picking up a lot of C devs. Rust is significantly more complex than C. You certainly don't have to use traits and Futures, etc, but you also don't have to use a bunch of features of C++ either and C devs still don't jump to C++. Zig certainly gets a lot of buzz here, but I haven't personally looked into it. It does certainly sound like it's designed to appeal to the C crowd.
- cameronhowe 6y agoI know I'm only one person, but I'm a C programmer at my day job and I do all my hobby projects in Rust. For me cargo, rust-analyzer, and lifetimes/borrow checker just makes programming so much more pleasant. edit: I dont go overboard on the more advanced features in the rust language, and probably write more C idiomatic code sometimes, but I still prefer using rust over C
- ragnese 6y agoFor sure. I didn't mean to suggest that nobody from C land would enjoy Rust. Just that I think the trend will be that more C++ people move to Rust than C people. But my point of view is quite biased. I am still baffled that people would start new projects in C instead of just using a strict subset of C++, at least: classes, only trivial templates for generics, references, maybe smart pointers depending on what you're doing, but no STL, no exceptions, no inheritance, etc.
- YesThatTom2 6y agoRust? Not Go? But they finally decided to add Generics! I thought that would fix all the problems, cure cancer, and end world hunger!
- divs1210 6y agoNowhere does it call out Rust by name. Go / Zig / Pony / Haskell are all valid contenders.
- jedisct1 6y agoThis.
- tptacek 6y agoNot really, no: * Languages with significant runtimes are going to be rejected by project maintainers; nobody is going to rube-goldberg a GC into an existing project just to replace a risky component when the option not to do that exists. * Languages with insignificant adoption are going to be rejected by project maintainers because why take a flyer on an unknown quantity (not just technically but in terms of where the community will be 5 years from now) on a project you've been maintaining for decades? Say what you will about the Rust community and its long-term financial viability but the industry is pretty much already committed to it. I'm fine with Rust but, like, not it's biggest fan (strongly prefer Go) but Rust pretty clearly hits the sweet spot being targeted here. I think you can assume safely that most of this work will be done in Rust.
- pjmlp 6y agoF-Secure has decided otherwise for bare metal secure firmware.
- the_duke 6y agoGo, Pony and Haskell all have complex runtimes and a GC, which makes them unsuitable for embedding into other applications or exposing them as widely usable libraries. Rust, Zig, and to a certain extent D or Nim without GC, can easily expose a C API and have a minimal runtime. But the others do not provide the same guarantees as (safe) Rust with the borrow checker. All very cool languages in their own right, but memory safety in a no-GC environment is not one of their defining attributes. Note: a dependency on any of those compilers is still far from trivial for many projects.
- jedisct1 6y agoWhy not contribute to MesaLock Linux, which is already an entire memory-safe Linux distribution instead? Or encourage other memory safe-languages as well?
- fock 6y agoMaybe I am missing something: public-facing systems generally don't build on a shell-like environment and I don't think memory-safety is a big problem anymore in 20 years-old core-utils people use individually on their CLI. So what's the point of reimplementing one-off-tooling with under the same name (like sh?!) in Rust, except adding confusion and new bugs? And in a container, you already can run only your rust/Go-program, which effectively means that the main memory-unsafe attack-surface is actually the kernel (which they don't swap out either).
- saagarjha 6y agoSomeone probably should look at the kernel, too.
- deleted 6y ago[deleted]
- choeger 6y agoWhile rust certainly does a lot of things right, it is still a moving target with a relatively high velocity. There is a python library that recently switched to rust (partially) and now cannot be build on several platforms. This also means that very long-lived platforms will probably be forced to upgrade that library every half year or so in line with the development of rust. I'd say such an initiative needs a long-term supported version of rust, similar to C99 or so. And this does not even account for cargo. I know you don't have to use cargo, but is that practical? How are we going to maintain stable software for, say, ten years or more? Do we have anyone committed to providing a stable rust environment for these cases? Especially considering that rust has no ABI for dynamic libraries. Oh and by the way: We need a way to bootstrap rust as well. The current distribution downloads binaries of the last one to build itself. And it ships with a vendored version of llvm. So in conclusion: I really like the rust language. But I am concerned that it is still way too immature and to "hip" for long-running, stable projects.
- wizzwizz4 6y agoWe have a way to bootstrap Rust: https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc
- sammorrowdrums 6y agoWas this an encryption library by any chance? Generating pgp keys to yubikey with an offline master involved having a system with rust toolchain in order to build a Python lib I required for a Yubikey utility. I could have got around it, but it took me by surprise that a Python dep required it. Not being negative or criticising the fact, just first time I had observed it.
- gpm 6y agoIt was, "cryptography".
- cp9 6y ago> There is a python library that recently switched to rust (partially) and now cannot be build on several platforms. there comes a point where we can't let dependencies on Amiga or DEC Alpha (companies/platforms that haven't existed in literal decades) hold the rest of us back. If someone wants to port rust/llvm to those platforms more power to them, but the rest of us don't need to suffer. The only platform that actually matters that was negatively effected by that change is musl/alpine because there aren't musl wheels available and you have to build the rust part from source.
- tdimitrov 6y agoRust is a nice language for greenfield system software project. But everyone in the software industry knows that you can't just put a project on hold and rewrite completely in new language. I can't see anything good coming from this initiative.
- safercplusplus 6y agoSome solutions aren't that well publicized. Here is an example of an open source png encoder/decoder written in C (mostly) being auto-translated to a memory-safe subset of C++: https://github.com/duneroadrunner/SaferCPlusPlus-AutoTranslation2/tree/master/examples/lodepng https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...
- cesarb 6y agoRust is a nice language for gradual rewrites too, especially when the original language was C. Some examples are Mercurial, librsvg, and Mozilla Firefox.
- galgalesh 6y agoRust is designed to integrate into legacy codebases so security critical code can be rewritten in small steps. See the URL parser I Firefox. Moreover, the initiative this post is talking about uses rust to rewrite small parts of a C codebase. Honestly, I'm getting more and more disappointed by the quality of discussion here on HN.
- tdimitrov 6y agoThanks for the kind words :) There is no such thing as security critical code. If it is out there - it can be expoloited. There are a lot of stories with minor exploit chaining leading to huge compromise.
- rkangel 6y agoWhich is why the word 'incremental' is key here. They didn't rewrite the whole of cURL - they rewrote a key component. Yes, ideally the whole program would be rewritten but security is not about absolutes. For a manageable amount of effort they have reduced the attack surface significantly.
- tediousdemise 6y agoIs there a reason why some developers prefer Rust over C++? I often hear that it’s because of Cargo, but in my experience, universal build systems and package managers end up not really solving the problem they are designed to solve, and are a huge attack vector. Anyone who’s tried to deploy their own complex Maven project knows that it’s a true nightmare. C++, on the other hand, has a variety of choices for build systems. CMake is prevalent, you can use simple makefiles just like C, or you could use countless other custom solutions. I’ve found that languages which support a singular build system are really easy to build simple demo apps, but once you need to build something that the default build system doesn’t support, you’re in big trouble.
- rational_indian 6y ago>Anyone who’s tried to deploy their own complex Maven project knows that it’s a true nightmare. Maven != Cargo > C++, on the other hand, has a variety of choices for build systems. None of which even remotely approach the ease of use and maintainability of the Cargo build system. > once you need to build something that the default build system doesn’t support, you’re in big trouble. Cargo can build arbitrary dependencies using the build.rs build mechanism.
- pjmlp 6y ago> Maven != Cargo Indeeed, Maven supports binary libraries.
- pornel 6y agoVariety of choices for C++ end up causing fragmentation, and all choices are flawed in some way. If you choose Cmake, someone will tell you how much it sucks, and you should have used Meson. You choose Meson, people will complain that it needs Python, or Bazel needs Java, or why bother with any of them if Makefile is good enough, and so on in circles forever. OTOH Cargo is the only option for Rust projects. There's nothing to bikeshed about. Everyone has it and knows how to use it. Apart from that the project is about memory safety. Companies like Google, Microsoft, and Mozilla already have huge C++ codebases, top engineers with lots of C++ experience, spent tons of effort on making it safe, and still weren't happy with the results.
- notpygame 6y agoThe security information about C and curl is a bit outdated in the post, and recent research shows Rust does not solve the memory safety issue. The "recent study" quoted in the article was published at the beginning of 2019, using older data. Current vulnerability data shows that curl has very much limited the risk of memory safety issues. How many reported security vulnerabilities in the last two releases of curl? Zero so far. You have to go back 9 months before you find one expired-pointer derefence issue resulting in potential data being sent to the wrong connection in rare circumstances and configurations. Which is a logic error that could happen in Rust too. To quote from a Oct 2020 study on Rust safety - "Our study results reveal that while Rust successfully limits the risks of memory-safety issues in the realm of unsafe code, it also introduces some side effects. In particular, most of the use-after-free and double-free bugs in our data set are related to the automatic drop scheme associated with the ownership-based memory management model." -- "Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEs" They study 60 Rust memory safety vulnerabilities. As you can see not only does Rust not solve the memory safety problem, it has other issues. Additionally the old research quoted misleads people about the current status of reported memory safety issues in curl.
- duckerude 6y agoRust does not solve the memory safety issue. It does mitigate it, and the post is about mitigation. That study finds that Rust "successfully limits memory-safety risks to the realm of unsafe code". It also finds that Rust has novel patterns of unsafety in unsafe code. That's important! But it's fully compatible with the claim that Rust is much safer than C overall. I don't think it ever says that the sum of safety in safe code and novel unsafety in unsafe code adds up to as much unsafety as C. The paper's overarching claims aren't quantitative. I think you're overstating the claims of both the blog post and the study.
- notpygame 6y agoThe recent track record of curl shows it has zero reported memory safety issues recently. Reading the article and the old linked research you'd be mislead. It also states that Rust completely prevents them - it does not. The article talks about mitigation, but also says: "would have been completely prevented by using a memory-safe language". The "completely prevented" claim in the article is the one not supported by current research. If you only read this article, you'd be mislead about memory safety in Rust.
- trynton 6y ago"bugs would have been completely prevented by using a memory-safe language" Relying on safe languages isn't going to work as the defect resides in the Memory Management Unit. You would think by now these 'integrated' 'innovators' could come up with a MMU that provides total process isolation.
- wtallis 6y agoHave you confused the kind of memory safety that Rust, etc. are about with the Spectre and Meltdown vulnerabilities? Or do you think that each individual array that's potentially subject to a buffer overflow in C should have been allocated by an entirely separate process?
- Cloudef 6y agoPlan9 sort of does the latter (crypto in its own process and so on)
- lovasoa 6y agoThe security issue with memory-unsafe languages is that programs can overwrite their own memory, not the memory of other processes.
- jellyfishfry 6y agohm
- einpoklum 6y agoSoftware written by a party with a proven record of surveillance of its users in the service of governments, and of selling user tracking data en masse to advertisers as its business model - cannot, in general, be trusted. Now, if the codebase is small enough to allow for scrutiny by 3rd-parties, that point may be moot, but even then, Google may have some ulterior motive which will not immediately become apparent. So, I'm kind of suspicious of such an initiative.
- mythz 6y agoWould be nice to see an approved list of "memory safe programming languages" as RTFA just mentions a Rust example. I'm assuming Go will also be an option, what are the others options for core OSS system tools?
- tmotwu 6y agoI wonder what implications this has for C/C++ in big tech backends. Startups, from what I've seen, have already moved away. No doubt, it will still be around in low latency or embedded. However, this is a significant cut of their market share, especially if Google, Microsoft, and Amazon retires its usage in its systems.
- mariusor 6y agoA big chunk of the C++ development is done in game studios. I doubt they would be willing to move away from it just for memory safety's sake.
- kazinator 6y ago> Another analysis on security issues in the ubiquitous `curl` command line tool showed that 53 out of 95 bugs would have been completely prevented by using a memory-safe language. That's not just a command line tool but a library, libcurl, with a command line wrapper. That library is easily used from a myriad of memory-safe languages, which is possible in part because it doesn't foist highly opinionated memory representations onto the caller.
- rurban 6y agoA worthwhile goal. But not in a memory unsafe language, please. There's hype and there are lies: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+stack+overflow https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Ao...
- saagarjha 6y agoThis is flamebait, and you know it. Stack overflows in Rust are perfectly safe because they hit a guard page.
- gpm 6y agoThis is flamebait, ignoring that "nearly perfect detection" and "no detection whatsoever" are very different things. But also, stack overflows aren't memory unsafe in modern rust. The issue search you want to find memory safety issues is: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3A%22I-unsound+%F0%9F%92%A5%22+ https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Ao...
- rurban 6y agoNo flame sit. It is either safe or not. Safer doesn't qualify as safe. Your query searches for type unsafeties. A third query would be for concurrency unsafety: deadlock. All three unsafeties are builtin by design. There's no way to deny it. But they still do repeat the same lies again and again. Stack overflows being memory safe you can tell your grandma or upper management. Problem was rust was once memory safe, but they ripped out the GC. Now it's just better than C++, but not better than Java or really safe languages. Overhype rarely reflects well on a community.
- dexterlemmer 6y ago> No flame sit. It is either safe or not. Safer doesn't qualify as safe. I agree and I often have to try to make this clear to proponents of "modern" C++/Go. > Your query searches for type unsafeties. His query searches for all unsoundness in Rust (including both type- and memory unsoundness). It does not search for unsafeties. Unsoundness can enable unsafety in code written in save Rust. However, unsoundness is fixable w/o redesigning the language (though may be very hard in practice) and usually doesn't cause significant breakage when fixed (in Rust at least). Unsafety in code enabled by fixing unsoundness often disappears when the unoundness is fixed but will result in a compiler error or -lint when the unsoundness is fixed if it doesn't disappear. Unsafety in the language is not fixable w/o major redesign and ecosystem wide breakage. It should be noted that most remaining unsoundness in rustc is suspected to have very low impact in practice and are very hard to fix but they are being steadily fixed. > A third query would be for concurrency unsafety: deadlock. All three unsafeties are builtin by design. There's no way to deny it. But they still do repeat the same lies again and again. Deadlocks are theoretically impossible to eliminate in any Turing complete language. In Rust there are often ways to prove your program doesn't contain any deadlocks but indeed some academic research languages (mostly dealing with effect types) makes this easier in more cases. At least in Rust a deadlock results in the lack of stuff happening that you would've preferred happen (which is bad enough), not in UB like in C++ (which is considerably worse). Memory leaks in Rust are a similar situation to deadlocks although admittedly authors of unsafe Rust need to take some care to ensure it remains similar and not a way that worse memory safety issue could occur. The Rust designers wanted to make it very clear that they consider memory leaks bad but not part of Rust's memory safety guarantees and even went so far as to add a safe function to std that leaks memory (i.e. not as a side-effect, leaking memory is what it is for). On this note. No language can ever be save in all respects. But save doesn't mean no bugs. It means you have explicit guarantees and enforced contracts. Save rust explicitly guarantees concurrency safety except that deadlocks can occur and the compiler enforces the guarantee unless an unsoundness bug causes the compiler to fail in its explicit contract to enforce it. Similar with memory safety, which is guaranteed (and enforced except sometimes in the precence of unsoundness bugs) but the guarantees explicitly exclude memory leaks. That still leaves a lot less to worry about than in "modern" C++ where absolutely no concurrency- or memory safety is in any way guaranteed nor enforced. Rust is all about eliminating all compromises it can and where the cost/benefit ratio makes sense but to still be pragmatic when and where appropriate. > Stack overflows being memory safe you can tell your grandma or upper management. Problem was rust was once memory safe, but they ripped out the GC. Now it's just better than C++, but not better than Java or really safe languages. Overhype rarely reflects well on a community. Stack overflows are memory safe in Rust. Rust's safety guarantees don't say stack overflows will not occur only that they would not cause specific issues if they do occur (like double free or UAF or ...). Again. Sometimes it is possible to prove they cannot occur but in general this is an impossible problem to solve in any Turing complete language. EDIT: Also: GC's don't prevent stack overflows either. Therefore I don't get your point.
- adsharma 6y agoRewrite vs Transpile I see references to "fixing" C and rewriting. An alternative would be to transpile a memory safe, easy to program language such as python3 and generate code in a memory safe language. Since I don't know which one of these is the best, I have implemented basic (as in fibonacci and a simple class) in several languages. I hope more effort is spent on writing code in small statically typed languages and generating memory safe code. https://github.com/adsharma/py2many https://github.com/adsharma/py2many
- andagainagain 6y agoFrom the title my first thought was "RUSTLANG!". Then I saw it was a google article and thought "well, that's not going to be rust-lang at all". I guess the answer was somewhere in between. It would be nice if there was more meat on the article though, like what types of things to do, or how each memory error happens, etc.
- deleted 6y ago[deleted]
- bobcallme 6y agoThe more pressing issue is the fact that critical tools that we depend upon are not properly funded or the incentive to properly maintain them is simply not there. Many of these projects were started as pet projects in peoples spare time. Sure, Google gives a lot of money and contributes to some of these projects but their contributions do not match how much they depend upon them. This is all compounded by the fact that Google is actively working to undermine many of these same projects because they can't get a license change or projects don't want to bend to their will. Rewriting the world in Rust or other "memory safe" languages is not going to be the silver bullet that is being claimed. In the case of Rust, I am tired of people evangelizing it when it's plagued with issues that undermine its goals and rewrites will bring about more nasty bugs. "Unsafe" code will still need to be written and not being able to use or have stable toolchains to work with is a non-starter for a lot of projects. Until all of these languages have set standards and stable toolchains, hopefully the Rust Foundation will push, these languages are a non-starter.
- kbenson 6y ago> In the case of Rust, I am tired of people evangelizing it when it's plagued with issues that undermine its goals Do you mind explaining what you mean here? You seem to be alluding to something different than an unstable toolchain which you mention after.
- deleted 6y ago[deleted]
- oscargrouch 6y ago> The ISRG's approach of working directly with maintainers to support REWRITING tools and libraries incrementally falls directly in line with our perspective here at Google. So, its not enough that anybody that don't want to rewrite millions of lines of code in Rust because its just pure insanity, need to be constantly harassed and forced to feel ashamed (or feel even feel guilt) because "how in the world you did not did this code in Rust" Now there's a whole INSTITUTION to funnel the scarce resources, not by fixing the security bugs but by forcing others to Rewrite Everything In Rust® or else they will have their popular projects hijacked by highly paid engineers from companies with unlimited financial resources to rewrite the whole thing in Rust leaving the maintainers of the original project eating dust if the don't conceive? If this is not going to support the source code maintainers to patch the bugs in whatever technology they are using, this is the Rust bullying that used to be just annoying social dynamics, being take into another level. Daniel Stenberg and libcurl will be exemplary nailed so others feel more inclined to follow or else see their projects being taken out of their hands if they do not consent. Imagine if you are a open source maintainer with scarce resources, being approached by an institution that promise you to give you some funds, but only if you show a plan to rewrite the whole thing in Rust? Edit: Just follow the Stenberg tweeter if you are curious https://twitter.com/bagder https://twitter.com/bagder to see all the pressure this guy have being taken lately.
- jaas 6y agoExecutive Director of ISRG here. To provides some more clarity on how this partnership works... ISRG plans and coordinates investments in moving open source software to memory safe languages. We have a strong preference for working on these plans with maintainers and developers, and then funding them to execute the plan. Once we have a plan prepared, and, ideally, maintainers/developers on board, then we pitch it for funding. Once someone (e.g. Google) funds the project, then ISRG handles contracts with the project developers/maintainers to get the work done. In some cases maintainers may be on board but want us to find a contractor to actually do the work. In both of the first two projects, and in most future cases, the money that Google (or another company) provides will largely go to project maintainers / developers.
- oreally 6y agoHave you considered the downsides of this shift? For example c++, with these initiatives I'm thoroughly expecting the compile times to bloat up along with increasingly bloated code in the effort to make the code safer.
- WalterBright 6y agoMost memory safety issues are buffer overflows, which is easily solved in D by using pointer/length pairs as a builtin type.