Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 432020

Summary: <sys-libs/glibc-2.21: /var/db/services.db causes infinite loop in getaddrinfo()
Product: Gentoo Linux Reporter: Maxim Kammerer <mk>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: ahudson.news, barzog, holger, leho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://sourceware.org/bugzilla/show_bug.cgi?id=14498
See Also: http://sourceware.org/bugzilla/show_bug.cgi?id=14498
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /var/db/services.db
getaddrinfo.c example
emerge --info

Description Maxim Kammerer 2012-08-20 03:11:39 UTC
glibc 2.15 provides /var/db/Makefile, which creates various databases for plaintext files using makedb:

  make -C /var/db

If /var/db/services.db is created, service name lookup using getaddrinfo() (but not getservbyname()) results in an infinite loop (full CPU load and no system calls).

This happens, e.g., if iptables is supplied named --sport / --dport parameters. An example program (to be attached) uses relevant code from iptables-1.4.13.
Comment 1 Maxim Kammerer 2012-08-20 03:13:51 UTC
Created attachment 321734 [details]
/var/db/services.db
Comment 2 Maxim Kammerer 2012-08-20 03:16:10 UTC
Created attachment 321736 [details]
getaddrinfo.c example

# ./getaddrinfo
getservbyname: 67
before
^C
Comment 3 Maxim Kammerer 2012-08-20 03:21:28 UTC
Created attachment 321738 [details]
emerge --info

This is a hardened system, but the problem appears both under hardened and regular kernel (in a chroot).
Comment 4 SpanKY gentoo-dev 2012-08-20 03:28:03 UTC
nice test case -- doesn't really need iptables setup.  i've moved this upstream.
Comment 5 SpanKY gentoo-dev 2016-03-30 19:54:58 UTC
glibc-2.21+ should be fixed, and that's stable now, so closing out