Live data from Hacker News

Glibc getaddrinfo stack-based buffer overflow

googleonlinesecurity.blogspot.com

241–250 of 480 posts

Re: Glibc getaddrinfo stack-based buffer overflow

#241

Can someone explain in layman's terms how will this affects me as a Linux user who works on Ubuntu?

Update your machines and you should probably restart too so any running processes link to the new libc.

This. Far too often I see libraries updated by a security patch but without a restart of affected dependent processes, meaning you're not protected.

  sudo lsof -n | grep DEL
is your friend in this matter.

Re: Glibc getaddrinfo stack-based buffer overflow

#242
post #116

Earlier quoted context omitted.

>Patch ASAP What exactly do you patch? Say you have a TCP server, written in Python or in Go. Do you have to update Python and Go ASAP then and recompile the Go server? Custom compiled Apache, Nginx? Recompile those? That's a lot of work..

If you have dynamically linked libc (which you should), you only need to upgrade libc and restart all network processes. [Does anyone know if systemd in pid1 calls getaddrinfo? If so, this is another good reason for a minimal pid1, as you will need to reboot]

You don't need to reboot to restart systemd, you can run systemctl daemon-reexec

Re: Glibc getaddrinfo stack-based buffer overflow

#243

> "The glibc DNS client side resolver is vulnerable to a stack-based buffer overflow when the getaddrinfo() library function is used. Software using this function may be exploited with attacker-controlled domain names, attacker-controlled DNS servers, or through a man-in-the-middle attack." > "The vectors to trigger this buffer overflow are very common and can include ssh, sudo, and curl. We are confident that the ex…

All this "Let's replace everything with Rust" is extremely childish. Be wary of making programming languages a religion. The Java zealots did it, and you can see the results where full Java projects are used in places where a 20 line Python script would have been easier. If you're serious, one of your pet projects should be trying to implement BSD sockets with Rust. Then try compiling some C apps against your impleme…

The parent actually said "Rust or pretty much anything else", which means any memory safe language. It just happens that Rust came to his/her mind as the first choice probably because it's been talked a lot about lately on HN and memory safety is its explicit focus.

I see no "programming languages a religion zealotry" in parents post, but I see a lot of bitterness in yours. Perhaps it's time to reflect.

Re: Glibc getaddrinfo stack-based buffer overflow

#244
post #183
post #156

Earlier quoted context omitted.

Ubuntu - http://people.canonical.com/~ubuntu-security/cve/2015/CVE-20...

Just out of interest: How is this classified medium by Ubuntu? If someone manages to bypass ASLR this is a remote exploit on every SSH server running glibc out there? Or did I misunderstood something? Out of the box SSH seems to use getaddrinfo: reverse mapping checking getaddrinfo for [ ] failed - POSSIBLE BREAK-IN ATTEMPT!

Fairly sure the default changed to not doing this, although I'm not sure as of what release.

Re: Glibc getaddrinfo stack-based buffer overflow

#245
post #207
post #101

Earlier quoted context omitted.

> Repeat after me: there is no silver bullet! Nonsense. How many buffer overflows - a vulnerability that simply doesn't happen in any modern language - would it take to convince you that the language is the problem? > Languages like Ruby have had their host of ridiculous security errors. Ruby isn't great, but it's not had anything like the same defect rate as C. > One advantage of legacy code is that it is battle-tes…

If it was "embarassingly basic", wouldn't it have been found way sooner? not YEARS down the line, even DECADES ? Since you mention ruby: https://exchange.xforce.ibmcloud.com/vulnerabilities/89191 What was that about not having buffer overflows in "modern" languages?

That Ruby bug is a bug in the C implementation of the language. Surely this bug supports the point that modern languages don't have these problems, since you have to look at the bits written in C to find them.

As for "embarrassingly basic," it takes years or decades to find these bugs because we're using tools that hide them. Basic runtime bounds checking would have turned up this bug pretty much immediately. If you use a language where a buffer overflow often causes no runtime error, then of course it's going to be hard to notice when you've made one.

Re: Glibc getaddrinfo stack-based buffer overflow

#246
post #140

Earlier quoted context omitted.

You are missing the forest for the trees. Grandparent is saying "replace all C with Rust" and you replied with "but look, Rust programs rely on glibc! It's unsafe!" Yes, Rust programs can be affected by this. But only because they call into C at a lower level, for the libc layer. If glibc was in Rust it would provide security to all application, including ssh or curl which aren't in Rust. Also, extern "C" is for C FF…

Do some low level Rust programming and then do some low level C programming. It's hardly any safer, because it can't be safe at such a low level without a performance penalty. In the capitalist reality we live in, that is a cost no one will pay. You're talking about the forrest - while we're talking about how making trees from scratch is difficult and messed up no matter how you go about it. At some point, you have t…

> Do some low level Rust programming and then do some low level C programming. It's hardly any safer, because it can't be safe at such a low level without a performance penalty. In the capitalist reality we live in, that is a cost no one will pay.

I do a lot of low-level Rust programming and a lot of low-level C programming. I don't know what the performance penalty you're claiming exists comes from. Can you elaborate as to the specific Rust features that you claim are slow?

(Incidentally, the project I'm working on right now in Rust beats all of the existing C competitors in performance by a lot.) :)

Re: Glibc getaddrinfo stack-based buffer overflow

#247

Earlier quoted context omitted.

Not that I can see

Thanks.

Latest version I can see from here - https://launchpad.net/ubuntu/trusty/+source/eglibc

Is - https://launchpad.net/ubuntu/+source/eglibc/2.19-0ubuntu6.6

  apt-get update
  apt-cache show libc6
  *snip*
  Version: 2.19-0ubuntu6.6
This was released on 2015-02-25

Re: Glibc getaddrinfo stack-based buffer overflow

#249

> "The glibc DNS client side resolver is vulnerable to a stack-based buffer overflow when the getaddrinfo() library function is used. Software using this function may be exploited with attacker-controlled domain names, attacker-controlled DNS servers, or through a man-in-the-middle attack." > "The vectors to trigger this buffer overflow are very common and can include ssh, sudo, and curl. We are confident that the ex…

All this "Let's replace everything with Rust" is extremely childish. Be wary of making programming languages a religion. The Java zealots did it, and you can see the results where full Java projects are used in places where a 20 line Python script would have been easier. If you're serious, one of your pet projects should be trying to implement BSD sockets with Rust. Then try compiling some C apps against your impleme…

It doesn't have to be a big rewrite of "everything" to Rust. It would at the very least be a slow successive rewrite whenever a major change is needed.

For this particular piece of code one would hope that the fix we'll see now would also include around 100 new lines of comments, splitting of hundred-line functions into a dozen smaller ones etc. I suspect that just by doing that someone would notice another flaw of this magnitude. Also, the updated code would be easier to maintain or rewrite in the future. The whole idea that all changes are kept as small as possible because of concerns that refactoring might break something says something about how brittle it is and how much of the testing is just battle hardening and not proper tests.

Re: Glibc getaddrinfo stack-based buffer overflow

#250
post #116

Earlier quoted context omitted.

>Patch ASAP What exactly do you patch? Say you have a TCP server, written in Python or in Go. Do you have to update Python and Go ASAP then and recompile the Go server? Custom compiled Apache, Nginx? Recompile those? That's a lot of work..

If you have dynamically linked libc (which you should), you only need to upgrade libc and restart all network processes. [Does anyone know if systemd in pid1 calls getaddrinfo? If so, this is another good reason for a minimal pid1, as you will need to reboot]

No reboot needed:

man systemctl

       daemon-reexec
           Reexecute the systemd manager. This will serialize the manager
           state, reexecute the process and deserialize the state again. This
           command is of little use except for debugging and package upgrades.
           Sometimes, it might be helpful as a heavy-weight daemon-reload.
           While the daemon is being reexecuted, all sockets systemd listening
           on behalf of user configuration will stay accessible.
Post reply on HN