*getaddrinfo* no longer accessing uninitialised data
On systems with the *nscd* daemon enabled, the `getaddrinfo()` function in the *glibc* library could access uninitialized data and consequently could return false address information. This update prevents uninitialized data access and ensures that correct addresses are returned.
Description of problem:
getent ahostsv4 www.google.com
216.58.213.132 STREAM www.google.com
216.58.213.132 DGRAM
216.58.213.132 RAW
(null) STREAM
(null) DGRAM
(null) RAW
Version-Release number of selected component (if applicable):
glibc-2.17-106.el7_2.4.x86_64
How reproducible:
mostly
Steps to Reproduce:
1. ensure upstream nameserver does not have cached result.
2. systemctl stop nscd ; rm -f /var/db/nscd/hosts ; nscd -i hosts ; systemctl start nscd
3. getent ahostsv4 www.google.com
Actual results:
getent ahostsv4 www.google.com
216.58.213.132 STREAM www.google.com
216.58.213.132 DGRAM
216.58.213.132 RAW
(null) STREAM
(null) DGRAM
(null) RAW
or a multiple response
64.15.112.44 STREAM www.google.com
64.15.112.44 DGRAM
64.15.112.44 RAW
64.15.112.55 STREAM
64.15.112.55 DGRAM
64.15.112.55 RAW
64.15.112.40 STREAM
64.15.112.40 DGRAM
64.15.112.40 RAW
64.15.112.25 STREAM
64.15.112.25 DGRAM
64.15.112.25 RAW
64.15.112.49 STREAM
64.15.112.49 DGRAM
64.15.112.49 RAW
64.15.112.50 STREAM
64.15.112.50 DGRAM
64.15.112.50 RAW
64.15.112.39 STREAM
64.15.112.39 DGRAM
64.15.112.39 RAW
64.15.112.24 STREAM
64.15.112.24 DGRAM
64.15.112.24 RAW
64.15.112.34 STREAM
64.15.112.34 DGRAM
64.15.112.34 RAW
64.15.112.59 STREAM
64.15.112.59 DGRAM
64.15.112.59 RAW
64.15.112.54 STREAM
64.15.112.54 DGRAM
64.15.112.54 RAW
64.15.112.30 STREAM
64.15.112.30 DGRAM
64.15.112.30 RAW
64.15.112.45 STREAM
64.15.112.45 DGRAM
64.15.112.45 RAW
64.15.112.35 STREAM
64.15.112.35 DGRAM
64.15.112.35 RAW
64.15.112.29 STREAM
64.15.112.29 DGRAM
64.15.112.29 RAW
64.15.112.20 STREAM
64.15.112.20 DGRAM
64.15.112.20 RAW
(null) STREAM
(null) DGRAM
(null) RAW
Expected results:
getent ahostsv4 www.google.com
216.58.213.132 STREAM www.google.com
216.58.213.132 DGRAM
216.58.213.132 RAW
Additional info:
A hack of the getent source indicates that the call to inet_ntop is failing (return code not checked), printing the error gives
inet_ntop FAILED 97/Address family not supported by protocol
where the address family is some garbage value.
Capturing the DNS traffic confirms that there is only the normal A & AAAA queries with valid replies.
(In reply to Thomas Oulevey from comment #17)
> Any news on a target release ?
The intent is to fix this for the upcoming RHEL 7.4. This is not a guarantee though. Thank you for your patience.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2017:1916