This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 21295] getaddrinfo: do not overwrite IPv6 IPs with IPv4 when using AF_UNSPEC
- From: Florian Weimer <fweimer at redhat dot com>
- To: kmeaw at kmeaw dot com
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 20 Apr 2017 14:41:26 +0200
- Subject: Re: [PATCH][BZ 21295] getaddrinfo: do not overwrite IPv6 IPs with IPv4 when using AF_UNSPEC
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B13ACC05491C
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B13ACC05491C
- References: <20170323132130.GA25347@kmeaw.com>
On 03/23/2017 02:21 PM, kmeaw@kmeaw.com wrote:
CVE-2016-3706 patch introduces a regression which disrupts connectivity
from IPv6-only to dual-stack hosts. This is caused by
convert_hostent_to_gaih_addrtuple which frees the result opposed to
appending to it (prior to the CVE patch in gaih_inet).
This change replaces free(*result) call with a loop which looks for the
pointer to the end of the linked list (&(*result)->next), so successive
calls append the result to the list instead of overwriting it.
Bugzilla entry #21295 describes a way to reproduce the issue.
I'm trying to write a test for this, but I haven't been successful so
far. What's the exact container setup that shows this? What are its
network interfaces and sysctl settings for IPv6?
I don't think the bug can happen with nss_dns and the upstream sources.
We either use AF_UNSPEC and the name4 lookup function, or we have just a
AF_INET or AF_INET6 lookup, so the current overriding behavior does not
matter. This means that in order to reproduce the bug, we'd need a
custom NSS module which does not implement the name4 lookup function.
It's puzzling that you see a problem on Ubuntu.
Thanks,
Florian