News for hackers. Stuff that matters.
Re:Deciding to rewrite getaddrinfo in rust by pcwalton on Tuesday February 23, 2016 @12:36PM (#11160614)
> New Rust code will have undiscovered issues too, even if they're not memory or stack related.

Memory issues have a tendency to be the most severe types of issues from a security perspective. (Not always, but with a high frequency.) Other issues that may occur with a rewrite may be security problems as well, but the security track records of network-facing software written in old-timey C speak for themselves: memory safety issues make up a huge fraction of their vulnerabilities.

> I feel that this effort might be better spent fixing and finding problems with glibc---and continuing the development of tools to find those problems, to benefit _all_ of our old C libraries and programs---than rewriting for the sake of rewriting.

So we've been trying that for the past 35 years since C was released in 1978, and we've completely failed to move beyond making the same basic memory management errors again and again and again. I think that if we couldn't do it in 35 years, we aren't likely to be able to by just trying a little harder this one time.

Re:Deciding to rewrite getaddrinfo in rust by gpderetta on Tuesday February 23, 2016 @05:06PM (#11162737)
One problem with rewriting libc in a safer language is that interfaces will still be memory unsafe. No matter how many times you rewrite 'gets' it will still be broken, str* will still be problematic, the heap can be still trivially corrupted by the application, etc.

As long as the public interfaces are still unsafe, it doesn't seem to me that there is significant latitude to qualitatively improve the security of a libc implementation.

Re:Deciding to rewrite getaddrinfo in rust by pcwalton on Wednesday February 24, 2016 @12:13AM (#11164695)
> As long as the public interfaces are still unsafe, it doesn't seem to me that there is significant latitude to qualitatively improve the security of a libc implementation.

Of course there is. The glibc bug we're talking about would not have happened if libresolv were memory safe.

Re:Deciding to rewrite getaddrinfo in rust by gpderetta on Wednesday February 24, 2016 @05:20AM (#11165704)
I was too negative in my last message.

To be more precise: I claim that, for a library for an unsafe interface, if the ratio of library interface area over the library implementation volume is high enough, it is not worth re-implementing in a safe language. I also claim that a libc implementation is generally well above this threshold.

I agree that this might not be the case for selected subsets of the library like libresolv.

Re:Deciding to rewrite getaddrinfo in rust by pcwalton on Wednesday February 24, 2016 @12:39PM (#11168558)
We can resolve this empirically, by looking at the list of glibc CVEs: https://www.cvedetails.com/vulnerability-list/vendor_id-72/p...

The vast majority of the memory safety issues here are not at the public interface boundaries.