Live data from Hacker News

Mitigating Memory Safety Issues in Open Source Software

security.googleblog.com

131–140 of 244 posts

Re: Mitigating Memory Safety Issues in Open Source Software

#131

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

FWIW, with my contrarian hat firmly affixed, I suspect that C plus tools makes more economic sense than Rust.

https://compcert.org/ > The CompCert project investigates the formal verification of realistic compilers usable for critical embedded software. Such verified compilers come with a mathematical, machine-checked proof that the generated executable code behaves exactly as prescribed by the semantics of the source program.

https://frama-c.com/ > Frama-C gathers several static and dynamic analysis techniques in a single collaborative framework. The collaborative approach of Frama-C allows static analyzers to build upon the results already computed by other analyzers in the framework.

https://www.cprover.org/cbmc/ > CBMC is a Bounded Model Checker for C and C++ programs. ... CBMC verifies memory safety (which includes array bounds checks and checks for the safe use of pointers), checks for ex­cep­tions, checks for various variants of undefined behavior, and user-specified as­ser­tions.

Re: Mitigating Memory Safety Issues in Open Source Software

#132

Nowhere does it call out Rust by name. Go / Zig / Pony / Haskell are all valid contenders.

I suppose D would also fall into this category. Although I find it interesting that Common Lisp gets left off these lists. It's memory-safe (with GC of course), has great integration with existing C libraries via CFFI, has a formal spec, has a solid library ecosystem, supports a "mostly-functional-but-imperative-if-you-need-it" programming style, has optional/gradual compile-time type checking, and at least one open/…

Oh yes, SBCL would also apply, I guess!

Re: Mitigating Memory Safety Issues in Open Source Software

#133
Rewrite 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

Re: Mitigating Memory Safety Issues in Open Source Software

#134
post #72

Earlier quoted context omitted.

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

> dependencies on Amiga or DEC Alpha What about embedded platforms, which tend to remain relevant (i.e. present in large numbers out in the real world) much longer than desktop or server platforms? Don't they matter? Don't they need updates, including for security, as much as any other?

Is it not a bit of a paradox that said embedded platforms matter enormously right up to, but not including the point of having toolchains ported to them and maintained? And yes while gcc can be built to produce binaries for an alpha it's not producing any bugs right?

Re: Mitigating Memory Safety Issues in Open Source Software

#135
post #49

Earlier quoted context omitted.

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

> control over whatever open source projects they target. but if they rewrite the project in rust, why _shouldn't_ they control that project? If other people choose to switch, then it's not wrong for them to move, and not wrong for to google gain control of those users. The original project maintainers is a third party to this whole process, and i would argue, is uninvolved tbh. It is up to the users of the project t…

>> control over whatever open source projects they target.

> but if they rewrite the project in rust, why _shouldn't_ they control that project? If other people choose to switch, then it's not wrong for them to move, and not wrong for to google gain control of those users.

I think the issue is the more critical projects Google controls, the more they can make decisions by fiat. Those decisions will favor Google's interests, and could sacrifice everyone else's interests in some way.

It's sort of like web browsers. My understanding is that Chrome is so dominant that Google can basically dictate HTML standards at this point, or at least effectively push them in directions that are favorable to its ad-based business.

Re: Mitigating Memory Safety Issues in Open Source Software

#136

Nowhere does it call out Rust by name. Go / Zig / Pony / Haskell are all valid contenders.

Pony isn't that well known, here's their home page, for the curious. [0]

I remember a recent HN comment said that if you create a website for your new programming language, you should always ensure there's a meaningful example right there on the landing page. A pity that Pony's page fails to do this. Here's one of their example programs. [1]

[0] https://www.ponylang.io/

[1] https://github.com/ponylang/ponyc/blob/main/examples/timers/...

Re: Mitigating Memory Safety Issues in Open Source Software

#137
post #124

Earlier quoted context omitted.

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

I think you are missing the fact that the solutions are already in place for all of this.

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

crates.io is designed so that dependencies put up on it remain available forever, and that the only other cargo related dependencies also have to be hosted on crates.io - solving the availability problem.

Of course if you're trying to backport a security fix to an old version of a transitive dependency that (like the non-transitive dependency) is no longer supported, you do have to make that backport. Once you make that backport it's easy to update the version of the transitive dependency with a [patch] section in the top level Cargo.toml.

> The second problem is the compiler itself. Any change in libfoo-1.2 might require a newer version of rust.

This is already mitigated in multiple ways. As discussed before, people do make sure to support old versions of compilers, you don't need to have a compiler on your target platform anyways. But moreover, the amount new language features make backporting difficult is dwarfed by the amount that internal library changes do.

Re: Mitigating Memory Safety Issues in Open Source Software

#138
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 couldn't find "Gensim" in the Python top 200 list:

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

Re: Mitigating Memory Safety Issues in Open Source Software

#139

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.

Rust is a nice language for gradual rewrites too, especially when the original language was C. Some examples are Mercurial, librsvg, and Mozilla Firefox.

Re: Mitigating Memory Safety Issues in Open Source Software

#140
post #42

Earlier quoted context omitted.

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

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

The "memory-safe languages" may mean Go, Java and a bunch of other less popular languages.
Post reply on HN