Live data from Hacker News

Mitigating Memory Safety Issues in Open Source Software

security.googleblog.com

121–130 of 244 posts

Re: Mitigating Memory Safety Issues in Open Source Software

#121
post #87

Earlier quoted context omitted.

A 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.

No, C and Rust definitely don't do the same things. If the project is open source, I don't see how any maintenance concerns are relevant - everybody can judge for themselves.

It's not that smart to mistake the purpose or specification of a program, with its implementation.

Anyway, if everybody can judge for themselves, then I guess it's cool to judge that giving Google an inch over many critical open source projects is a horrible idea.

Re: Mitigating Memory Safety Issues in Open Source Software

#122

Earlier quoted context omitted.

You 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!

It'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 c…

I 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

Re: Mitigating Memory Safety Issues in Open Source Software

#123
post #87

Earlier quoted context omitted.

No, C and Rust definitely don't do the same things. If the project is open source, I don't see how any maintenance concerns are relevant - everybody can judge for themselves.

It's not that smart to mistake the purpose or specification of a program, with its implementation. Anyway, if everybody can judge for themselves, then I guess it's cool to judge that giving Google an inch over many critical open source projects is a horrible idea.

Sure, nobody says you have to use their software. But don't claim that they don't give back or that it's purposeless.

Re: Mitigating Memory Safety Issues in Open Source Software

#124
post #57

While 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-…

> 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.

As a security library... you really ought to be updating it every half year of so.

This has nothing to do with rust though. Rust maintains full backwards compatibility, so even if you upgrade the compiler (which is unlikely on long lived platforms) and not the library nothing breaks.

Nor is it necessarily the case that upgrading the library will require updating rust (though this isn't what you appear to be complaining about). Not only is it a build time dependency (that you don't even need to install if you are on common platforms which ave prebuilt binaries), but they are explicitly testing against a particular fixed old version of rust as well as recent ones: https://github.com/pyca/cryptography/blob/main/.github/workf...

> I'd say such an initiative needs a long-term supported version of rust, similar to C99 or so.

This describes every version of rust since 1.0. Rust is fully backwards compatible, unlike new C standards.

> Do we have anyone committed to providing a stable rust environment for these cases?

Yes, the entire rust team...

> Especially considering that rust has no ABI for dynamic libraries.

This is... rather irrelevant? Technically it does have support for the C abi for dynamic libraries though.

Re: Mitigating Memory Safety Issues in Open Source Software

#125
post #57

While 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-…

Was 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.

It was, "cryptography".

Re: Mitigating Memory Safety Issues in Open Source Software

#127

Rust 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.

Some 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-AutoTransla...

Re: Mitigating Memory Safety Issues in Open Source Software

#128

Earlier quoted context omitted.

It'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 c…

I 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

For 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.

Re: Mitigating Memory Safety Issues in Open Source Software

#129
post #24

For 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…

I 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

Re: Mitigating Memory Safety Issues in Open Source Software

#130
post #124
post #57

While 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-…

> 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. As a security library... you really ought to be updating it every half year of so. This has nothing to do with rust though. Rust maintains full backwards compatibility, so even if you upgrade the compiler (which is unlikely on long lived platforms) and not the li…

I think you should reconsider the actual problem, if you do not understand it.

The fact that rustc is backwards compatible is great, sure. But it does not solve the problem of distributors.

Say you have libfoo-1.0 that uses rust and cargo 1.2 . A distributor that now releases their linux version and wants to ship libfoo-1.0 must consider the requirements for supporting it. This support usually outlives the upstream support.

If libfoo-1.0 uses C, for instance, it is highly likely that a distributor can backport any security-relevant changes from libfoo-1.1, 1.2, and later into 1.0.

In the case of rust there are two uncertainties creeping in: One is the highly dynamic nature of cargo dependencies. libfoo might depend on a myriad of crates transitively and rust simply is too young to provide any experience in how long they will be available or supported. And no, it is generally not a good idea to update to new feature releases for security updates. This is something that stable distributions explicitly try to avoid.

So our distributor now must consider if changes in libfoo-1.2 pulled in changes via cargo that cannot be easily backported because they are feature releases or have a dependency on a newer version of rust.

The second problem is the compiler itself. Any change in libfoo-1.2 might require a newer version of rust. It is great that they want to be backwards compatible but now our distributor must consider upgrading a substantial piece of software during the support period (and testing the backwards compatibility, of course) just to backport a security fix.

Please don't get me wrong, I really like rust and I think these problems can be solved. But I also like stable software and all these languages with their package repositories seem to simply ignore everything that's older than one or two years. If rust wants to become a new C, which I would very much like, it needs to demonstrate a certain stability.

Post reply on HN