debian/0000775000000000000000000000000013124446356007200 5ustar debian/control0000664000000000000000000000303212775456223010606 0ustar Source: c-ares Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Andreas Schuldei Uploaders: Gregor Jasny Build-Depends: debhelper (>= 9), autotools-dev, dh-autoreconf Standards-Version: 3.9.4 Section: libs Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/c-ares.git Vcs-Git: git://anonscm.debian.org/collab-maint/c-ares.git Homepage: http://c-ares.haxx.se/ Package: libc-ares-dev Section: libdevel Architecture: any Conflicts: libares-dev Depends: libc-ares2 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Multi-Arch: same Description: asynchronous name resolver - development files c-ares is a C library that performs DNS requests and name resolution asynchronously. . It is a fork of the library named "ares", with additional features: * IPv6 support; * extended cross-platform portability; * 64-bit clean sources. . This package contains development files (headers and static libraries). Package: libc-ares2 Conflicts: libcares2 Architecture: any Replaces: libc-ares1 Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Description: asynchronous name resolver c-ares is a C library that performs DNS requests and name resolution asynchronously. . It is a fork of the library named "ares", with additional features: * IPv6 support; * extended cross-platform portability; * 64-bit clean sources. . This package provides the shared libraries. debian/docs0000664000000000000000000000003111501167206010034 0ustar NEWS README README.cares debian/changelog0000664000000000000000000001353713124445773011065 0ustar c-ares (1.10.0-2ubuntu0.2) trusty-security; urgency=medium * SECURITY UPDATE: NAPTR parser out of bounds access - debian/patches/CVE-2017-1000381.patch: check for sufficient data in ares_parse_naptr_reply.c. - CVE-2017-1000381 -- Marc Deslauriers Tue, 27 Jun 2017 08:13:47 -0400 c-ares (1.10.0-2ubuntu0.1) trusty-security; urgency=medium * SECURITY UPDATE: denial of service and possible execution via hostname with an escaped trailing dot (LP: #1629085) - debian/patches/CVE-2016-5180.patch: properly handle escaped dot in ares_create_query.c. - CVE-2016-5180 -- Marc Deslauriers Thu, 06 Oct 2016 10:15:41 -0400 c-ares (1.10.0-2) unstable; urgency=low * Bump standards to v3.9.4 (no changes needed) * Canonicalize Git VCS URL * Prevent autoconf from mangling passed cflags * Depend on debhelper 9 -- Gregor Jasny Sun, 16 Jun 2013 13:38:58 +0200 c-ares (1.10.0-1) unstable; urgency=low * Imported Upstream version 1.10.0 * Add Upstream Metadata * Fix package description (Closes: #680640) * Dropped deprecated DM-Upload-Allowed flag * Remove patches that were applied upstream * Add new 1.10.0 symbols -- Gregor Jasny Tue, 14 May 2013 22:19:12 +0200 c-ares (1.9.1-3) unstable; urgency=low * Moved ares_build.h to arch dependent include dir (Closes: #678996) -- Gregor Jasny Mon, 25 Jun 2012 19:37:00 +0200 c-ares (1.9.1-2) unstable; urgency=low * Remove ares_free_soa declaration from ares.h -- Gregor Jasny Tue, 19 Jun 2012 09:43:09 +0200 c-ares (1.9.1-1) unstable; urgency=low * Imported Upstream version 1.9.1 * Update homepage field (Closes: #674406) * Mark dev package as Multi-Arch: same -- Gregor Jasny Mon, 18 Jun 2012 23:06:40 +0200 c-ares (1.8.0-1) unstable; urgency=low * Imported Upstream version 1.8.0 * Fix typo in package description (Closes: #638923) * Bump standards to v3.9.3 (no changes needed) -- Gregor Jasny Thu, 10 May 2012 21:46:27 +0200 c-ares (1.7.5-1) unstable; urgency=low * Imported Upstream version 1.7.5 * Update watch file location * Fix typo in Uploaders field * Update SCM Browser URL * Convert to Multiarch * Bump standards to v3.9.2 (no changes needed) -- Gregor Jasny Sun, 21 Aug 2011 15:19:21 +0200 c-ares (1.7.4-1) unstable; urgency=low [ Gregor Jasny ] * Imported Upstream version 1.7.4 * Fix typo in package description (Closes: #600309) * Bump standards to v3.9.1 (no changes needed) * Unapply patches after build * Add new symbols [ Andreas Schuldei ] * added Gregor Jasny as uploader -- Andreas Schuldei Thu, 03 Mar 2011 21:48:00 +0100 c-ares (1.7.3-1) unstable; urgency=low [ Gregor Jasny ] * Imported Upstream version 1.7.3 * Add ares_parse_mx_reply symbol -- Andreas Schuldei Fri, 11 Jun 2010 18:33:50 +0200 c-ares (1.7.1-0) unstable; urgency=low [ Gregor Jasny ] * Remove quilt dir * Imported Upstream version 1.7.0 * Bump standards to v3.8.3 (no changes needed) * Hide private symbols and add Debian symbols file * Use separate build dir * Tightened debhelper dependency * Revert "Use separate build dir" * Imported Upstream version 1.7.1 * Add new ares_{get,set}_servers symbols * Bump standards to v3.8.4 (no changes needed) * Switch to dpkg-source 3.0 (quilt) format -- Andreas Schuldei Fri, 30 Apr 2010 21:27:20 +0200 c-ares (1.6.0-2) unstable; urgency=low [ Gregor Jasny ] * Add git-buildpackage config * Imported Upstream version 1.6.0 * New Upstream Version 1.6.0 * Removed no_maxhostnamelen patch * Add Vcs-* fields to control file * Make package binNMUable (lintian: not-binnmuable-any-depends-any) * Add watch file (lintian: debian-watch-file-is-missing) * Updated standards to 3.8.1 (no changes needed) * Remove duplicate section (lintian: binary-control-field-duplicates- source) * Use debhelper 7 and its tiny rules script * Use copyright sign instead of (c) to make lintian happy * Add some words to the -dev package (lintian: duplicate-short- description) -- Andreas Schuldei Mon, 25 May 2009 13:23:43 +0200 c-ares (1.6.0-1) unstable; urgency=low * New Upstream Version -- Gregor Jasny Mon, 04 May 2009 22:01:20 +0200 c-ares (1.5.2-4) unstable; urgency=low * fixing linitan warnings: standards versions, clean target in rules * fix memory leak in MAXHOSTNAMELEN patch -- Andreas Schuldei Mon, 30 Jun 2008 16:33:20 +0200 c-ares (1.5.2-3) unstable; urgency=low * remove the need to have MAXHOSTNAMELEN, to make hurd build -- Andreas Schuldei Sun, 29 Jun 2008 01:55:35 +0200 c-ares (1.5.2-2) unstable; urgency=low * file conflicts (Closes: #484574) -- Andreas Schuldei Thu, 05 Jun 2008 10:00:56 +0200 c-ares (1.5.2-1) unstable; urgency=low * missing copyright information in debian/copyright (Closes: #484517) -- Andreas Schuldei Wed, 04 Jun 2008 20:22:59 +0200 c-ares (1.5.2-0) unstable; urgency=low * new upstream release: 1.5.2 * Conflict with libcares2 (Closes: #478588) * libc-ares1 contains libcares.2.so (Closes: #480589) -- Andreas Schuldei Sat, 31 May 2008 01:08:35 +0200 c-ares (1.5.1-0) unstable; urgency=low * new upstream release: 1.5.1 * file conflicts between packages (Closes: #451343) * switch to pkgconfig, disable .la -- Andreas Schuldei Mon, 26 Nov 2007 14:09:46 +0100 c-ares (1.4.0-1) unstable; urgency=low * Initial release (Closes: #359794) packaging c-ares -- Andreas Schuldei Sat, 21 Jul 2007 17:44:06 +0200 debian/libc-ares2.dirs0000664000000000000000000000001011501167206011764 0ustar usr/lib debian/source/0000775000000000000000000000000011753012751010472 5ustar debian/source/format0000664000000000000000000000001411501167206011675 0ustar 3.0 (quilt) debian/compat0000664000000000000000000000000211753012751010370 0ustar 9 debian/patches/0000775000000000000000000000000013124445767010634 5ustar debian/patches/series0000664000000000000000000000010713124445767012047 0ustar disable-cflags-rewrite.diff CVE-2016-5180.patch CVE-2017-1000381.patch debian/patches/disable-cflags-rewrite.diff0000664000000000000000000000077512157317722016010 0ustar From: Gregor Jasny Description: Prevent autoconf from mangling passed cflags These flags are passed by dpkg-buildflags for hardening. Forwarded: not-needed --- a/configure.ac +++ b/configure.ac @@ -147,8 +147,8 @@ CARES_CHECK_COMPILER CARES_SET_COMPILER_BASIC_OPTS -CARES_SET_COMPILER_DEBUG_OPTS -CARES_SET_COMPILER_OPTIMIZE_OPTS +#CARES_SET_COMPILER_DEBUG_OPTS +#CARES_SET_COMPILER_OPTIMIZE_OPTS CARES_SET_COMPILER_WARNING_OPTS if test "$compiler_id" = "INTEL_UNIX_C"; then debian/patches/CVE-2017-1000381.patch0000664000000000000000000000225213124445767013474 0ustar From e1f43d4d7e89ef8db479d6efd0389c6b6ee1d116 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Mon, 22 May 2017 10:54:10 +0100 Subject: [PATCH 5/5] ares_parse_naptr_reply: check sufficient data Check that there is enough data for the required elements of an NAPTR record (2 int16, 3 bytes for string lengths) before processing a record. --- ares_parse_naptr_reply.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ares_parse_naptr_reply.c b/ares_parse_naptr_reply.c index 11634df9847c..717d35577811 100644 --- a/ares_parse_naptr_reply.c +++ b/ares_parse_naptr_reply.c @@ -110,6 +110,12 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, status = ARES_EBADRESP; break; } + /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */ + if (rr_len < 7) + { + status = ARES_EBADRESP; + break; + } /* Check if we are really looking at a NAPTR record */ if (rr_class == C_IN && rr_type == T_NAPTR) @@ -185,4 +191,3 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, return ARES_SUCCESS; } - -- 2.13.0.303.g4ebf302169-goog debian/patches/CVE-2016-5180.patch0000664000000000000000000001130412775456211013247 0ustar Backport of: From 115fe381c75147352d7a8d21aa3ffb85ca367219 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 23 Sep 2016 14:44:11 +0200 Subject: [PATCH] ares_create_query: avoid single-byte buffer overwrite ... when the name ends with an escaped dot. CVE-2016-5180 Bug: https://c-ares.haxx.se/adv_20160929.html --- ares_create_query.c | 84 +++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 45 deletions(-) Index: c-ares-1.10.0/ares_create_query.c =================================================================== --- c-ares-1.10.0.orig/ares_create_query.c 2016-10-06 10:10:59.589689075 -0400 +++ c-ares-1.10.0/ares_create_query.c 2016-10-06 10:12:38.930587109 -0400 @@ -85,57 +85,31 @@ */ int ares_create_query(const char *name, int dnsclass, int type, - unsigned short id, int rd, unsigned char **buf, - int *buflen, int max_udp_size) + unsigned short id, int rd, unsigned char **bufp, + int *buflenp, int max_udp_size) { - int len; + size_t len; unsigned char *q; const char *p; + size_t buflen; + unsigned char *buf; /* Set our results early, in case we bail out early with an error. */ - *buflen = 0; - *buf = NULL; + *buflenp = 0; + *bufp = NULL; - /* Compute the length of the encoded name so we can check buflen. - * Start counting at 1 for the zero-length label at the end. */ - len = 1; - for (p = name; *p; p++) - { - if (*p == '\\' && *(p + 1) != 0) - p++; - len++; - } - /* If there are n periods in the name, there are n + 1 labels, and - * thus n + 1 length fields, unless the name is empty or ends with a - * period. So add 1 unless name is empty or ends with a period. + /* Allocate a memory area for the maximum size this packet might need. +2 + * is for the length byte and zero termination if no dots or ecscaping is + * used. */ - if (*name && *(p - 1) != '.') - len++; - - /* Immediately reject names that are longer than the maximum of 255 - * bytes that's specified in RFC 1035 ("To simplify implementations, - * the total length of a domain name (i.e., label octets and label - * length octets) is restricted to 255 octets or less."). We aren't - * doing this just to be a stickler about RFCs. For names that are - * too long, 'dnscache' closes its TCP connection to us immediately - * (when using TCP) and ignores the request when using UDP, and - * BIND's named returns ServFail (TCP or UDP). Sending a request - * that we know will cause 'dnscache' to close the TCP connection is - * painful, since that makes any other outstanding requests on that - * connection fail. And sending a UDP request that we know - * 'dnscache' will ignore is bad because resources will be tied up - * until we time-out the request. - */ - if (len > MAXCDNAME) - return ARES_EBADNAME; - - *buflen = len + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0); - *buf = malloc(*buflen); - if (!*buf) - return ARES_ENOMEM; + len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ + + (max_udp_size ? EDNSFIXEDSZ : 0); + buf = malloc(len); + if (!buf) + return ARES_ENOMEM; /* Set up the header. */ - q = *buf; + q = buf; memset(q, 0, HFIXEDSZ); DNS_HEADER_SET_QID(q, id); DNS_HEADER_SET_OPCODE(q, QUERY); @@ -159,8 +133,10 @@ q += HFIXEDSZ; while (*name) { - if (*name == '.') + if (*name == '.') { + free (buf); return ARES_EBADNAME; + } /* Count the number of bytes in this label. */ len = 0; @@ -170,8 +146,10 @@ p++; len++; } - if (len > MAXLABEL) + if (len > MAXLABEL) { + free (buf); return ARES_EBADNAME; + } /* Encode the length and copy the data. */ *q++ = (unsigned char)len; @@ -195,14 +173,30 @@ DNS_QUESTION_SET_TYPE(q, type); DNS_QUESTION_SET_CLASS(q, dnsclass); + q += QFIXEDSZ; if (max_udp_size) { - q += QFIXEDSZ; memset(q, 0, EDNSFIXEDSZ); q++; DNS_RR_SET_TYPE(q, T_OPT); DNS_RR_SET_CLASS(q, max_udp_size); + q += (EDNSFIXEDSZ-1); } + buflen = (q - buf); + + /* Reject names that are longer than the maximum of 255 bytes that's + * specified in RFC 1035 ("To simplify implementations, the total length of + * a domain name (i.e., label octets and label length octets) is restricted + * to 255 octets or less."). */ + if (buflen > (MAXCDNAME + HFIXEDSZ + QFIXEDSZ + + (max_udp_size ? EDNSFIXEDSZ : 0))) { + free (buf); + return ARES_EBADNAME; + } + + /* we know this fits in an int at this point */ + *buflenp = (int) buflen; + *bufp = buf; return ARES_SUCCESS; } debian/dirs0000664000000000000000000000002111501167206010044 0ustar usr/bin usr/sbin debian/libc-ares2.install0000664000000000000000000000002411753012751012501 0ustar usr/lib/*/lib*.so.* debian/copyright0000664000000000000000000000625111501167206011126 0ustar This package was debianized by Andreas Schuldei on Sat, 21 Jul 2007 17:06:22 +0200. It was downloaded from http://daniel.haxx.se/projects/c-ares/ Upstream Author: Daniel Stenberg Copyright: © 2000-2009 Daniel Stenberg, Dominick Meglio, liren at vivisimo.com, James Bursa, Duncan Wilcox, Dirk Manske, Dan Fandrich, Gisle Vanem, Gunter Knauf, Henrik Stoerner, Yang Tse, Nick Mathewson, Alexander Lazic, Andreas Rieke, Guilherme Balena Versiani, Brad Spencer, Ravi Pratap, William Ahern, Bram Matthys, Michael Wallner, Vlad Dinulescu, Brad House, Shmulik Regev, Ashish Sharma, Brad Spencer © 1998-2000 Massachusetts Institute of Technology, Greg Hudson License: The project in general is under the MIT License: ====================================================================== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ====================================================================== Some source files (bitncmp.c, inet_net_pton.c, inet_ntop.c) contain this copyright notice: Copyright © 1996 by Internet Software Consortium. Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ====================================================================== The file mkinstalldirs is in the Public domain. ====================================================================== The Debian packaging is © 2007, Andreas Schuldei and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. debian/libc-ares-dev.dirs0000664000000000000000000000002411501167206012463 0ustar usr/lib usr/include debian/watch0000664000000000000000000000010311753012751010215 0ustar version=3 http://c-ares.haxx.se/download/ c-ares-([\d\.]*).tar.gz debian/gbp.conf0000664000000000000000000000022411753012751010607 0ustar [DEFAULT] upstream-branch = upstream debian-branch = master upstream-tag = upstream/%(version)s debian-tag = debian/%(version)s pristine-tar = True debian/upstream0000664000000000000000000000035512045447621010763 0ustar Name: c-ares Contact: c-ares@cool.haxx.se Homepage: http://c-ares.haxx.se/ Repository: git://github.com/bagder/c-ares.git Repository-Browse: https://github.com/bagder/c-ares Watch: http://c-ares.haxx.se/download/ c-ares-([\d\.]*).tar.gz debian/libc-ares2.symbols0000664000000000000000000000262412144515422012531 0ustar libcares.so.2 libc-ares2 #MINVER# ares_cancel@Base 1.7.0 ares_create_query@Base 1.10.0 ares_destroy@Base 1.7.0 ares_destroy_options@Base 1.7.0 ares_dup@Base 1.7.0 ares_expand_name@Base 1.7.0 ares_expand_string@Base 1.7.0 ares_fds@Base 1.7.0 ares_free_data@Base 1.7.0 ares_free_hostent@Base 1.7.0 ares_free_string@Base 1.7.0 ares_get_servers@Base 1.7.1 ares_gethostbyaddr@Base 1.7.0 ares_gethostbyname@Base 1.7.0 ares_gethostbyname_file@Base 1.7.0 ares_getnameinfo@Base 1.7.0 ares_getsock@Base 1.7.0 ares_inet_ntop@Base 1.10.0 ares_inet_pton@Base 1.10.0 ares_init@Base 1.7.0 ares_init_options@Base 1.7.0 ares_library_cleanup@Base 1.7.0 ares_library_init@Base 1.7.0 ares_mkquery@Base 1.7.0 ares_parse_a_reply@Base 1.7.0 ares_parse_aaaa_reply@Base 1.7.0 ares_parse_mx_reply@Base 1.7.3 ares_parse_naptr_reply@Base 1.8.0 ares_parse_ns_reply@Base 1.7.0 ares_parse_ptr_reply@Base 1.7.0 ares_parse_soa_reply@Base 1.9.1 ares_parse_srv_reply@Base 1.7.0 ares_parse_txt_reply@Base 1.7.0 ares_process@Base 1.7.0 ares_process_fd@Base 1.7.0 ares_query@Base 1.7.0 ares_save_options@Base 1.7.0 ares_search@Base 1.7.0 ares_send@Base 1.7.0 ares_set_local_dev@Base 1.7.4 ares_set_local_ip4@Base 1.7.4 ares_set_local_ip6@Base 1.7.4 ares_set_servers@Base 1.7.1 ares_set_servers_csv@Base 1.7.4 ares_set_socket_callback@Base 1.7.0 ares_strerror@Base 1.7.0 ares_timeout@Base 1.7.0 ares_version@Base 1.7.0 debian/rules0000775000000000000000000000061212157317722010256 0ustar #!/usr/bin/make -f DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ --with autoreconf override_dh_auto_configure: dh_auto_configure -- --enable-shared --enable-symbol-hiding override_dh_auto_install: dh_auto_install -- mkdir debian/tmp/usr/include/$(DEB_HOST_MULTIARCH) mv debian/tmp/usr/include/ares_build.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/ debian/libc-ares-dev.install0000664000000000000000000000012711753012751013177 0ustar usr/include/* usr/lib/*/lib*.a usr/lib/*/lib*.so usr/lib/*/pkgconfig/* usr/share/man/*