News for hackers. Stuff that matters.
Re:Glibc getaddrinfo stack-based buffer overflow by cft on Tuesday February 16, 2016 @12:02PM (#11111260)
>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..

Re:Glibc getaddrinfo stack-based buffer overflow by asveikau on Tuesday February 16, 2016 @12:17PM (#11111406)
Unless you are linking statically (and I don't really understand why you would) you update glibc and that's it.

This question had me feeling kind of old. Does nobody learn what shared libraries are anymore?

Re:Glibc getaddrinfo stack-based buffer overflow by rspeer on Tuesday February 16, 2016 @03:19PM (#11112843)
Well, now, a lot of people are making containers, which are static linking turned up to 11.

I bet this bug will live on forever in people's Docker stacks.

Re:Glibc getaddrinfo stack-based buffer overflow by peterwwillis on Tuesday February 16, 2016 @06:30PM (#11113951)
The past four years of modern development practices have run screaming from the concept. Learning why the systems used to work they way they did was, like, super hard, so they reinvented the wheel and are running into the same problems that caused us to make shared libraries/COW/etc in the first place.
Re:Glibc getaddrinfo stack-based buffer overflow by XorNot on Wednesday February 17, 2016 @03:20AM (#11116205)
You've pretty fundamentally misunderstood them if you think immutable practices in anyway damage the ability to deploy fixes. Years of shared library hell is what causes things like this to go unfixed.
Re:Glibc getaddrinfo stack-based buffer overflow by peterwwillis on Wednesday February 17, 2016 @06:25PM (#11122406)
Immutability in software development & deployment is, for the vast majority of use cases, completely unnecessary. The only reason people talk about it now is everyone has a fetish over using simple software rather than designing software that works well.

And 'immutable practices' don't damage anything - they simply make things take longer, duplicate effort, make inefficient use of resources, and make everything generally more inflexible. The only benefit seems to be high level abstraction at the cost of everything else.

Re:Glibc getaddrinfo stack-based buffer overflow by strictfp on Tuesday February 16, 2016 @03:40PM (#11112968)
Nope, the pendulum is at it's other extreme. Go is going all in on static builds, docker containers freeze ALL THE THINGS \@/ and "immutable" package managers like Nix which in effect is like static linking without the speed benefits.
Re:Glibc getaddrinfo stack-based buffer overflow by mentat on Tuesday February 16, 2016 @01:10PM (#11111843)
That isn't it, see siblings here. You have to restart all processes that load glibc and interact with the affected services.
Re:Glibc getaddrinfo stack-based buffer overflow by w8rbt on Tuesday February 16, 2016 @02:52PM (#11112650)
Debian does this automatically and alerts the user what services are being restarted.
Re:Glibc getaddrinfo stack-based buffer overflow by drummer32 on Tuesday February 16, 2016 @06:38PM (#11113994)
It doesnt't. There's the needsrestart package that does this though.
Re:Glibc getaddrinfo stack-based buffer overflow by muppetman on Tuesday February 16, 2016 @06:13PM (#11113882)
I updated this morning and nothing got restarted. Shouldn't pretty much every network service I have gotten a restart? sshd, postfix, apache, icecast2, dovecot

None of them restarted. So I restarted them all myself...

Re:Glibc getaddrinfo stack-based buffer overflow by yxhuvud on Tuesday February 16, 2016 @03:36PM (#11112950)
Does libc even support static linking?
Re:Glibc getaddrinfo stack-based buffer overflow by steveklabnik on Tuesday February 16, 2016 @03:40PM (#11112970)
glibc is generally not statically linked. MUSL libc generaly is.

You _can_ statically link glibc, but then you lose some stuff. https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked...

Re:Glibc getaddrinfo stack-based buffer overflow by cdelsolar on Tuesday February 16, 2016 @01:32PM (#11112034)
Go?
Re:Glibc getaddrinfo stack-based buffer overflow by kyrra on Tuesday February 16, 2016 @01:06PM (#11111822)
For Go, depending on your compile settings, you don't need to recompile. Go 1.5+ uses a pure Go DNS resolver [1], you have to force Go to use glibc. And even if you use glibc, it is not statically linked.

[0] https://golang.org/pkg/net/ (see "netdns" setting)

[1] https://go-review.googlesource.com/#/c/11584/

Re:Glibc getaddrinfo stack-based buffer overflow by nitrogen on Tuesday February 16, 2016 @12:17PM (#11111405)
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]
Re:Glibc getaddrinfo stack-based buffer overflow by the_why_of_y on Tuesday February 16, 2016 @02:27PM (#11112456)
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.
Re:Glibc getaddrinfo stack-based buffer overflow by Xylakant on Tuesday February 16, 2016 @12:25PM (#11111482)
you need to restart all processes that might do a network address lookup. That's pretty much every daemon.
Re:Glibc getaddrinfo stack-based buffer overflow by noselasd on Tuesday February 16, 2016 @02:12PM (#11112342)
You don't need to reboot to restart systemd, you can run systemctl daemon-reexec
Re:Glibc getaddrinfo stack-based buffer overflow by peterwwillis on Tuesday February 16, 2016 @06:38PM (#11113991)
Here's how to find packages on your system with statically linked applications (that probably use glibc):

  [root@server ~]# find /bin/ /sbin/ /usr/bin/ /usr/sbin/ /usr/lib* /usr/local/bin/ /usr/local/sbin/ /usr/local/lib* -type f -perm /u+x -exec file {} \; | grep statically | cut -d : -f 1 | xargs rpm -qf | sort -u
  busybox-1.2.0-7.el5.x86_64
  cryptsetup-luks-1.0.3-5.el5.i386
  cryptsetup-luks-1.0.3-5.el5.x86_64
  device-mapper-1.02.39-1.el5.i386
  device-mapper-1.02.39-1.el5.x86_64
  device-mapper-multipath-0.4.7-34.el5_5.1.x86_64
  dmraid-1.0.0.rc13-63.el5.x86_64
  dump-0.4b41-4.el5.x86_64
  e2fsprogs-1.39-23.el5.x86_64
  glibc-2.5-123.el5_11.1.i686
  glibc-2.5-123.el5_11.1.x86_64
  glibc-common-2.5-123.el5_11.1.x86_64
  grub-0.97-13.5.x86_64
... etc. And yes, it can be a lot of work. It's easier to only use your distro's official packages and update the patched ones they release. Luckily most software devs are smart and compile dynamically.
Re:Glibc getaddrinfo stack-based buffer overflow by msbarnett on Tuesday February 16, 2016 @12:18PM (#11111420)
You patch glibc. Everything else is dynamically linking it.
Re:Glibc getaddrinfo stack-based buffer overflow by muraiki on Tuesday February 16, 2016 @12:26PM (#11111492)
I think it's possible to statically link glibc in Go, but I don't recall the particular compiler incantations offhand.
Re:Glibc getaddrinfo stack-based buffer overflow by saturn_vk on Wednesday February 17, 2016 @02:05AM (#11115903)
But go dynamically links against libc by default
Re:Glibc getaddrinfo stack-based buffer overflow by r1ch on Tuesday February 16, 2016 @12:17PM (#11111404)
Unless you statically link glibc, updating glibc is enough.