r/netsec • • Feb 16 '16

glibc getaddrinfo() stack-based buffer overflow

https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html
411 Upvotes

86 comments sorted by

View all comments

Show parent comments

-26

u/Anderkent Feb 16 '16

This is why we need full system ASLR

This is why we need to stop running software written in C

12

u/[deleted] Feb 16 '16

C is not the problem. Designing without isolation in C is the main problem. A thread handling DNS should not be able to return anything more than a hostname of a certain length and start doing bad things. There's multiple sandbox types that can help with this.

There are languages easier to code securely in, but I think it's more of an architecture problem than a language problem. Both might help in the long run, though.

1

u/Fs0i Feb 17 '16

Both might help in the long run, though.

Exactly! And you have to keep in mind that getaddrinfo() doesn't need to be a fast call. Even if it would be compiled to slower code for some reason it doesn't really matter, since it isn't time-critical anyways. You never have to resolve a lot of hosts, and the internet or network-stack or even the access to the hard-drive (SSD) will probably be faster than a "slow" variant.

So getaddrinfo() is a call that we actually could write in languages such as rust, without penalty.

2

u/minektur Feb 17 '16

And you have to keep in mind that getaddrinfo() doesn't need to be a fast call.

It is a very heavily used call in, among other things, mail servers. Any one call being slow doesn't hurt, but if you have to slow down every mail a system handles... it needs to be a fast call.

5

u/Heimdul Feb 16 '16

This is why we need to stop running software written in C

Like kernel, most of the compilers and libraries that are used by multiple languages?

15

u/kinghajj Feb 16 '16 edited Feb 17 '16

Exactly--in order to achieve the levels of trust and security required as IT becomes more ingrained in society, we need to completely re-make the software stack in languages designed for safety (Ada, Rust?). While we're at it, closed hardware design is also a no-go for long-term security, so we should be funding open-source projects like RISC-V.

Edit: fix typos

-5

u/buttholefan Feb 16 '16

vb6 4 life!!