0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

38 Commits

Author SHA1 Message Date
XadillaX
4cc9b5f285 deps: patch to fix *.onion MX query on c-ares
c-ares rejects *.onion MX query but forgot to set `*bufp` to NULL. This
will occur SegmentFault when free `*bufp`.

I make this quick fix and then will make a PR for c-ares either.

PR-URL: https://github.com/nodejs/node/pull/25840
Fixes: https://github.com/nodejs/node/issues/25839
Refs: https://github.com/c-ares/c-ares/blob/955df98/ares_create_query.c#L97-L103
Refs: https://github.com/c-ares/c-ares/blob/955df98/ares_query.c#L124
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-06 06:15:18 +01:00
Ben Noordhuis
7b1297d856
deps: c-ares float, version number patch
Not yet upstream.

Refs: https://github.com/c-ares/c-ares/issues/229

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
Ben Noordhuis
3a25b174aa
deps: upgrade to c-ares v1.15.0
Our out-of-tree patch from 2b6bb9f588 ("deps: c-ares float, win ipv6 bad
fec0 prefix") should no longer be necessary, c-ares now blacklists such
addresses itself.

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
Ben Noordhuis
50f951c90f
deps: remove old c-ares configure files
Remove leftover files that were added in commit 58e4edaf68 from 2013
to help with standalone builds of the c-ares fork that we maintained
at the time.

PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-06 11:29:22 +00:00
cjihrig
1d5aba1a78
deps: add missing ares_android.h file
This file was left out of the c-ares 1.14.0 update.

PR-URL: https://github.com/nodejs/node/pull/23682
Fixes: https://github.com/nodejs/node/issues/23681
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-19 08:29:23 -04:00
Rod Vagg
2b6bb9f588
deps: c-ares float, win ipv6 bad fec0 prefix
Was 72c5458aee:

  PR-URL: https://github.com/nodejs/node/pull/5090
  Reviewed-By: Fedor Indutny <fedor@indutny.com>

Reimplemented for c-ares 1.13.0

PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/19939
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-16 04:39:43 +02:00
Rod Vagg
de66bd34b9
deps: c-ares float, manual ares_ssize_t definition
c-ares switched to using ares_ssize_t for platform-independent ssize_t,
our GYP usage to include config/<platform>/ares_config.h causes problems
when including gyp as a library in core, i.e. in env.h and cares_wrap.h,
where the defines don't get pulled in properly. This, so far, is the
easiest approach to just making it work nicely--explicitly defining
ares_ssize_t for the different Windows variants and ssize_t for
non-Windows where we don't have a configured type from an ares_config.h.
In all of our non-Windows platforms it is ssize_t anyway so this is
safe.

PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/19939
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-16 04:39:43 +02:00
Rod Vagg
b0b7afcfbe
deps: upgrade to c-ares v1.14.0
* Fix patch for CVE-2017-1000381 to not be overly aggressive.
 * win32: Preserve DNS server order returned by Windows when sorting and
   exclude DNS servers in legacy subnets.
 * win32: Support most recent Visual Studio 2017.
 * gethostbyaddr should fail with ECANCELLED not ENOTFOUND when
   ares_cancel is called.
 * win32: Exclude legacy ipv6 subnets.
 * android: Applications compiled for Oreo can no longer use
   __system_property_get and must use Java calls to retrieve DNS
   servers.
 * win32: Force use of ANSI functions.
 * CMake minimum version is now 3.1.
 * ares_gethostbyname.3: fix callback status values.
 * docs: Document WSAStartup requirement.
 * Fix a typo in init_by_resolv_conf.
 * Android JNI code leaks local references in some cases.
 * Force using the ANSI versions of WinAPI functions.

The most important changes have already been included via

 * 50e580df21 deps: cherry-pick 0ef4a0c64b6 from c-ares upstream
 * 9a0631dffe deps: cherry-pick 18ea996 from c-ares upstream

PR-URL: https://github.com/nodejs/node/pull/19939
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-16 04:36:40 +02:00
Anna Henningsen
50e580df21
deps: cherry-pick 0ef4a0c64b6 from c-ares upstream
Original commit message:

  gethostbyaddr: fail with `ECANCELLED` for `ares_cancel()`

  When `ares_cancel()` was invoked, `ares_gethostbyaddr()`
  queries would fail with `ENOTFOUND` instead of `ECANCELLED`.

  It seems appropriate to treat `ares_cancel()` like `ares_destroy()`,
  but I would appreciate review of the correctness of this change.

  Ref: https://github.com/nodejs/node/issues/14814

Fixes: https://github.com/nodejs/node/issues/14814

PR-URL: https://github.com/nodejs/node/pull/15023
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-02 01:16:22 -03:00
Anna Henningsen
9a0631dffe
deps: cherry-pick 18ea996 from c-ares upstream
Original commit message:

    ares_parse_naptr_reply: make buffer length check more accurate

    9478908a490a6bf009ba58d81de8c1d06d50a117 introduced a length check
    for records parsed by `ares_parse_naptr_reply()`. However, that
    function is designed to parse replies which also contain non-NAPTR
    records; for A records, the `rr_len > 7` check will fail as there
    are only 4 bytes of payload.
    In particular, parsing ANY replies for NAPTR records was broken
    by that patch.

    Fix that by moving the check into the case in which it is already
    known that the record is a NAPTR record.

Ref: 18ea99693d
PR-URL: https://github.com/nodejs/node/pull/13883
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-02 01:16:12 -03:00
Rod Vagg
34d125f16c
deps: c-ares float, win ipv6 bad fec0 prefix
Was 72c5458aee:

  PR-URL: https://github.com/nodejs/node/pull/5090
  Reviewed-By: Fedor Indutny <fedor@indutny.com>

Reimplemented for c-ares 1.13.0

PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-02 01:16:12 -03:00
Rod Vagg
af171b7ba2
deps: c-ares float, manual ares_ssize_t definition
c-ares switched to using ares_ssize_t for platform-independent ssize_t,
our GYP usage to include config/<platform>/ares_config.h causes problems
when including gyp as a library in core, i.e. in env.h and cares_wrap.h,
where the defines don't get pulled in properly. This, so far, is the
easiest approach to just making it work nicely--explicitly defining
ares_ssize_t for the different Windows variants and ssize_t for
non-Windows where we don't have a configured type from an ares_config.h.
In all of our non-Windows platforms it is ssize_t anyway so this is
safe.

PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-02 01:16:11 -03:00
Rod Vagg
13c74706ef
deps: upgrade to c-ares v1.13.0
PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-02 01:16:11 -03:00
Rod Vagg
a9f125449e
deps: upgrade to c-ares v1.12.0
Updated with manual config for Android
Updated with automatic for sunos, *bsd, darwin, linux, aix

PR-URL: https://github.com/nodejs/node/pull/15378
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-02 01:16:06 -03:00
Anna Henningsen
a26be6866b deps: cherry-pick 0ef4a0c64b6 from c-ares upstream
Original commit message:

  gethostbyaddr: fail with `ECANCELLED` for `ares_cancel()`

  When `ares_cancel()` was invoked, `ares_gethostbyaddr()`
  queries would fail with `ENOTFOUND` instead of `ECANCELLED`.

  It seems appropriate to treat `ares_cancel()` like `ares_destroy()`,
  but I would appreciate review of the correctness of this change.

  Ref: https://github.com/nodejs/node/issues/14814

Fixes: https://github.com/nodejs/node/issues/14814

PR-URL: https://github.com/nodejs/node/pull/15023
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-29 09:51:44 -07:00
Anna Henningsen
e76c49de33
deps: cherry-pick 18ea996 from c-ares upstream
Original commit message:

    ares_parse_naptr_reply: make buffer length check more accurate

    9478908a490a6bf009ba58d81de8c1d06d50a117 introduced a length check
    for records parsed by `ares_parse_naptr_reply()`. However, that
    function is designed to parse replies which also contain non-NAPTR
    records; for A records, the `rr_len > 7` check will fail as there
    are only 4 bytes of payload.
    In particular, parsing ANY replies for NAPTR records was broken
    by that patch.

    Fix that by moving the check into the case in which it is already
    known that the record is a NAPTR record.

Ref: 18ea99693d
PR-URL: https://github.com/nodejs/node/pull/13883
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-23 16:20:58 +02:00
David Drysdale
a73142524b
deps: cherry-pick 9478908a49 from cares upstream
Original commit message:

  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.

This patch fixes CVE-2017-1000381

The c-ares function ares_parse_naptr_reply(), which is used for
parsing NAPTR responses, could be triggered to read memory outside
of the given input buffer if the passed in DNS response packet was
crafted in a particular way.

Refs: https://c-ares.haxx.se/adv_20170620.html
Refs: https://c-ares.haxx.se/CVE-2017-1000381.patch
PR-URL: https://github.com/nodejs/node-private/pull/88
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-07-11 17:46:16 +01:00
Aaron Bieber
40fd69668d deps: back port OpenBSD fix in c-ares/c-ares
Original PR: https://github.com/c-ares/c-ares/pull/68

PR-URL: https://github.com/nodejs/node/pull/9232
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-28 09:14:40 -07:00
Daniel Stenberg
68c4c71f7f ares_create_query: avoid single-byte buffer overwrite
Incorrect string length calculation when passing escaped dot.

- CVE: CVE-2016-5180
- Upstream bug: https://c-ares.haxx.se/adv_20160929.html

PR-URL: https://github.com/nodejs/node/pull/8849
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2016-10-02 20:40:48 -03:00
Ben Noordhuis
05c15a057f build: fix dependency on missing header file
Depend on include/ares_rules.h, src/ares_rules.h does not exist.

The typo didn't break the build but it made some of the gyp-based
tooling complain.

PR-URL: https://github.com/nodejs/node/pull/7945
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-08-03 11:12:53 +02:00
Gireesh Punathil
40ede46690 cares: Support malloc(0) scenarios for AIX
Many places in cares library, when the stream data arrives
from the network with respect to dns and reverse dns
resolution, they are populated into data structures created
dymaically based on the size of the data. Malloc is heavily
used for such cases.

Often, based on the data length, malloc(0) is invoked. Linux
behavior on zero byte allocation is to return a valid pointer
where in AIX, it always return NULL.

This manifestst as test failure of test/internet/test-dns.js

Solution is to build cares with Linux compatible malloc behavior

PR-URL: https://github.com/nodejs/node/pull/6305
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Michael Dawson <michael_dawson@ca.ibm.com>
2016-04-21 19:20:37 -04:00
Ben Noordhuis
72c5458aee deps: reapply c-ares floating patch
PR-URL: https://github.com/nodejs/node/pull/5090
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2016-02-11 22:23:48 -05:00
Fedor Indutny
cc192f0eb3 deps: sync with upstream c-ares/c-ares@4ef6817
PR-URL: https://github.com/nodejs/node/pull/5199
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-02-11 22:23:48 -05:00
Ben Noordhuis
791eef0cbb deps: reapply c-ares floating patch
PR-URL: https://github.com/nodejs/node/pull/5090
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2016-02-08 14:44:41 -05:00
Cheng Zhao
cfafba68c6 src,deps: replace LoadLibrary by LoadLibraryW
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes
`LoadLibraryW`. When an ASCII string is passed to that function it
crashes.

PR-URL: https://github.com/iojs/io.js/pull/226
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2016-02-08 14:44:40 -05:00
Fedor Indutny
1258b0166d deps: sync with upstream bagder/c-ares@2bae2d5
PR-URL: https://github.com/nodejs/node/pull/5090
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-02-08 14:44:19 -05:00
Michael Dawson
2a17c7f65e build: Updates to enable AIX support
These are the core changes that allow AIX to compile.  There
are still some test failures as there are some patches needed for
libuv and npm that we'll need to contribute through those
communities but this set allows node to be built on AIX and
pass most of the core tests

The change in js2c is because AIX does not support $ in
identifier names.  See the discussion/agreement in
https://github.com/nodejs/node/issues/2272

PR-URL: https://github.com/nodejs/node/pull/2364
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Reviewed-By: Rod Vagg <r@va.gg>
2015-09-15 13:17:28 -04:00
Cheng Zhao
08d08668c9 src,deps: replace LoadLibrary by LoadLibraryW
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes
`LoadLibraryW`. When an ASCII string is passed to that function it
crashes.

PR-URL: https://github.com/iojs/io.js/pull/226
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-05-12 10:47:51 +02:00
Fedor Indutny
0f850f7ae7 deps: provide TXT chunk info in c-ares
Provide more information in `ares_txt_reply` to coalesce chunks from the
same record into one string.

fix #7367
2015-05-12 10:47:51 +02:00
Ben Noordhuis
7e1c0e75ed deps: sync with upstream bagder/c-ares@bba4dc5
Fixes: https://github.com/iojs/io.js/issues/1676
PR-URL: https://github.com/iojs/io.js/pull/1678
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-05-12 10:46:57 +02:00
Cheng Zhao
604b876147 src,deps: replace LoadLibrary by LoadLibraryW
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes
`LoadLibraryW`. When an ASCII string is passed to that function it
crashes.

PR-URL: https://github.com/iojs/io.js/pull/226
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-07 23:38:28 +01:00
Fedor Indutny
a60a9b0dbd deps: provide TXT chunk info in c-ares
Provide more information in `ares_txt_reply` to coalesce chunks from the
same record into one string.

fix #7367
2014-04-24 10:40:35 +04:00
Ben Noordhuis
58e4edaf68 deps: upgrade c-ares to piscisaureus/cares@805d153
This should fix the Android build.
2013-07-06 22:20:29 +02:00
Ben Noordhuis
6902f6536c deps: fix up header files in cares.gyp
Please msbuild, update the header list.
2013-05-15 22:47:42 +02:00
Ben Noordhuis
3afa5e6b71 deps: reapply c-ares floating patch 2013-05-15 21:25:11 +02:00
Ben Noordhuis
9498fd15c7 deps: upgrade c-ares to 1.10.0 2013-05-14 02:07:35 +02:00
Ben Noordhuis
815a181d03 deps: upgrade cares to 213f2b7 2012-11-20 22:44:23 +01:00
Bert Belder
81791ff33c Add c-ares dependency
This is the c-ares code that used to live in the libuv source tree.
It is based on c-ares 1.9.0.
2012-08-07 01:49:02 +02:00