]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoRemove arm64 jobs from GitLab CI
Michał Kępień [Wed, 5 Aug 2020 10:04:59 +0000 (12:04 +0200)] 
Remove arm64 jobs from GitLab CI

The only arm64 runner we have at our disposal is suffering from
intermittent connectivity issues which make it unusable for extended
periods of time.  Remove arm64 jobs from GitLab CI until we manage to
set up an arm64 runner with more reliable connectivity.

(cherry picked from commit 49f245f7c00faf1d85bc4eab81904cf742ad2cc3)

5 years agoMerge branch '2065-set-max-cache-size-in-the-geoip2-system-test-v9_16' into 'v9_16'
Michał Kępień [Wed, 5 Aug 2020 09:43:19 +0000 (09:43 +0000)] 
Merge branch '2065-set-max-cache-size-in-the-geoip2-system-test-v9_16' into 'v9_16'

[v9_16] Set "max-cache-size" in the "geoip2" system test

See merge request isc-projects/bind9!3921

5 years agoSet "max-cache-size" in the "geoip2" system test
Michał Kępień [Wed, 5 Aug 2020 07:04:53 +0000 (09:04 +0200)] 
Set "max-cache-size" in the "geoip2" system test

The named configuration files used in the "geoip2" system test cause a
rather large number of views (6-8) to be set up in each tested named
instance.  Each view has its own cache.

Commit aa72c31422bf04c34afd539dc9986a9bac976901 caused the RBT hash
table to be pre-allocated to a size derived from "max-cache-size", so
that it never needs to be rehashed.  The size of that hash table is not
expected to be significant enough to cause memory use issues in typical
conditions even for large "max-cache-size" settings.

However, these two factors combined can cause memory exhaustion issues
in GitLab CI, where we run multiple "instances" of the test suite in
parallel on the same runner, each test suite executes multiple system
tests concurrently, and each system test may potentially start multiple
named instances at the same time.  In practice, this problem currently
only seems to be affecting the "geoip2" system test, which is failing
intermittently due to named instances used by that test getting killed
by oom-killer.

Prevent the "geoip2" system test from failing intermittently by setting
"max-cache-size" in named configuration files used in that test to a low
value in order to keep memory usage at bay even with a large number of
views configured.

(cherry picked from commit 4292d5bdfe6a0ff1de64e0aee6cb3975dd7ef085)

5 years agoMerge branch 'ondrej-serve-stale-improvements-v9_16' into 'v9_16'
Matthijs Mekking [Wed, 5 Aug 2020 08:16:10 +0000 (08:16 +0000)] 
Merge branch 'ondrej-serve-stale-improvements-v9_16' into 'v9_16'

Serve stale improvements (9.16)

See merge request isc-projects/bind9!3913

5 years agokeyword 'primaries' is unknown in 9.16
Matthijs Mekking [Tue, 4 Aug 2020 14:42:57 +0000 (16:42 +0200)] 
keyword 'primaries' is unknown in 9.16

In 9.17 we introduced 'primaries' as a synonym for 'masters' in the
configuration file. This synonym has not been backported so change
the serve-stale test to make use of the 'masters' keyword.

5 years agostale-cache-enable is enabled by default
Matthijs Mekking [Tue, 4 Aug 2020 12:40:15 +0000 (14:40 +0200)] 
stale-cache-enable is enabled by default

Because this is a backport, the option should default to keep the
serve-stale caching enabled.

5 years agoAdd CHANGES and release notes for GL #1712 and GL #1829
Ondřej Surý [Thu, 30 Jul 2020 13:10:49 +0000 (15:10 +0200)] 
Add CHANGES and release notes for GL #1712 and GL #1829

(cherry picked from commit dd622751523b4744be06d1050b573a4b3d11e49f)

5 years agoAdd tests with stale-cache-disabled into serve-stale system test
Ondřej Surý [Thu, 30 Jul 2020 11:55:13 +0000 (13:55 +0200)] 
Add tests with stale-cache-disabled into serve-stale system test

Add a fifth named (ns5) that runs with `stale-cache-enable no;` and
check that there are no stale records in the cache.

(cherry picked from commit abc2ab92232f07b626849a993bf3dd74110a3057)

5 years agoExpire the 0 TTL RRSet quickly rather using them for serve-stale
Ondřej Surý [Tue, 21 Jul 2020 09:35:42 +0000 (11:35 +0200)] 
Expire the 0 TTL RRSet quickly rather using them for serve-stale

When a received RRSet has TTL 0, they would be preserved for
serve-stale (default `max-stale-cache` is 12 hours) rather than expiring
them quickly from the cache database.

This commit makes sure the RRSet didn't have TTL 0 before marking the
entry in the database as "stale".

(cherry picked from commit 6ffa2ddae0bc31271492481ec50f99d68263b25b)

5 years agoAdd stale-cache-enable option and disable serve-stable by default
Ondřej Surý [Tue, 21 Jul 2020 08:38:55 +0000 (10:38 +0200)] 
Add stale-cache-enable option and disable serve-stable by default

The current serve-stale implementation in BIND 9 stores all received
records in the cache for a max-stale-ttl interval (default 12 hours).

This allows DNS operators to turn the serve-stale answers in an event of
large authoritative DNS outage.  The caching of the stale answers needs
to be enabled before the outage happens or the feature would be
otherwise useless.

The negative consequence of the default setting is the inevitable
cache-bloat that happens for every and each DNS operator running named.

In this MR, a new configuration option `stale-cache-enable` is
introduced that allows the operators to selectively enable or disable
the serve-stale feature of BIND 9 based on their decision.

The newly introduced option has been disabled by default,
e.g. serve-stale is disabled in the default configuration and has to be
enabled if required.

(cherry picked from commit ce53db34d601b107d268889893e3f40693bd8d35)

5 years agoMerge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still...
Michał Kępień [Tue, 4 Aug 2020 19:50:56 +0000 (19:50 +0000)] 
Merge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still-has-the-pre-9-3-0-explanation-v9_16' into 'v9_16'

[v9_16] Update description of forwarding behavior in ARM

See merge request isc-projects/bind9!3917

5 years agoUpdate description of forwarding behavior in ARM
Suzanne Goldlust [Thu, 23 Jul 2020 13:05:43 +0000 (13:05 +0000)] 
Update description of forwarding behavior in ARM

(cherry picked from commit 30e126ad02c703e51e6df58ec1e84bdb72884426)

5 years agoMerge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR-v9_16' into 'v9_16'
Mark Andrews [Tue, 4 Aug 2020 13:30:51 +0000 (13:30 +0000)] 
Merge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR-v9_16' into 'v9_16'

Marka dns r badtsig map to formerr v9 16

See merge request isc-projects/bind9!3914

5 years agoCheck rcode is FORMERR
Mark Andrews [Fri, 31 Jul 2020 10:36:14 +0000 (20:36 +1000)] 
Check rcode is FORMERR

(cherry picked from commit 88ff6b846c652ea903913d58787fb4fe4c82ab91)

5 years agoMap DNS_R_BADTSIG to FORMERR
Mark Andrews [Wed, 22 Jul 2020 23:47:49 +0000 (09:47 +1000)] 
Map DNS_R_BADTSIG to FORMERR

Now that the log message has been printed set the result code to
DNS_R_FORMERR.  We don't do this via dns_result_torcode() as we
don't want upstream errors to produce FORMERR if that processing
end with DNS_R_BADTSIG.

(cherry picked from commit 20488d6ad36c7b48f043e583ff32eb14ca52f035)

5 years agoMerge branch '1719-observed-stats-underflow-in-multiple-stats-v9_16' into 'v9_16'
Diego dos Santos Fronza [Mon, 3 Aug 2020 23:20:43 +0000 (23:20 +0000)] 
Merge branch '1719-observed-stats-underflow-in-multiple-stats-v9_16' into 'v9_16'

Resolve "Observed stats underflow in multiple stats"

See merge request isc-projects/bind9!3866

5 years agoAdd CHANGES and release note for #1719
Diego Fronza [Thu, 16 Jul 2020 18:24:48 +0000 (15:24 -0300)] 
Add CHANGES and release note for #1719

5 years agoFix ns_statscounter_recursclients underflow
Diego Fronza [Wed, 8 Jul 2020 14:42:32 +0000 (11:42 -0300)] 
Fix ns_statscounter_recursclients underflow

The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857

5 years agoMerge branch 'michal/restore-placeholder-entry-at-sequence-number-5481-v9_16' into...
Michał Kępień [Mon, 3 Aug 2020 20:15:19 +0000 (20:15 +0000)] 
Merge branch 'michal/restore-placeholder-entry-at-sequence-number-5481-v9_16' into 'v9_16'

[v9_16] Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3911

5 years agoRestore placeholder entry at sequence number 5481
Michał Kępień [Mon, 3 Aug 2020 20:09:47 +0000 (22:09 +0200)] 
Restore placeholder entry at sequence number 5481

(cherry picked from commit 029e32c01af7fd1260c33ee48094be633aac3511)

5 years agoMerge branch '2038-use-freebind-when-bind-fails-v9_16' into 'v9_16'
Ondřej Surý [Fri, 31 Jul 2020 15:55:53 +0000 (15:55 +0000)] 
Merge branch '2038-use-freebind-when-bind-fails-v9_16' into 'v9_16'

Resolve "Bind not handling interfaces changes correctly when listen-on-v6  any  specified"

See merge request isc-projects/bind9!3907

5 years agoAdd CHANGES and release note for GL #2038
Witold Kręcicki [Tue, 21 Jul 2020 12:56:45 +0000 (14:56 +0200)] 
Add CHANGES and release note for GL #2038

(cherry picked from commit 94eda43ab28383c59df21280d6c06fc84260cc4f)

5 years agonetmgr: retry binding with IP_FREEBIND when EADDRNOTAVAIL is returned.
Witold Kręcicki [Tue, 21 Jul 2020 11:29:14 +0000 (13:29 +0200)] 
netmgr: retry binding with IP_FREEBIND when EADDRNOTAVAIL is returned.

When a new IPv6 interface/address appears it's first in a tentative
state - in which we cannot bind to it, yet it's already being reported
by the route socket. Because of that BIND9 is unable to listen on any
newly detected IPv6 addresses. Fix it by setting IP_FREEBIND option (or
equivalent option on other OSes) and then retrying bind() call.

(cherry picked from commit a0f7d28967f95c904614bbe44efde789e430a80e)

5 years agoMerge branch 'michal/only-run-system-tests-as-root-in-developer-mode-v9_16' into...
Michał Kępień [Fri, 31 Jul 2020 05:47:20 +0000 (05:47 +0000)] 
Merge branch 'michal/only-run-system-tests-as-root-in-developer-mode-v9_16' into 'v9_16'

[v9_16] Only run system tests as root in developer mode

See merge request isc-projects/bind9!3897

5 years agoOnly run system tests as root in developer mode
Michał Kępień [Fri, 31 Jul 2020 05:46:27 +0000 (07:46 +0200)] 
Only run system tests as root in developer mode

Running system tests with root privileges is potentially dangerous.
Only allow it when explicitly requested (by building with
--enable-developer).

(cherry picked from commit 3ef106f69df076340914257df4bdd1a1c22a9440)

5 years agoMerge branch '1456-always-check-return-from-isc_refcount_decrement-v9_16' into 'v9_16'
Mark Andrews [Fri, 31 Jul 2020 03:32:51 +0000 (03:32 +0000)] 
Merge branch '1456-always-check-return-from-isc_refcount_decrement-v9_16' into 'v9_16'

Always check the return from isc_refcount_decrement.

See merge request isc-projects/bind9!3901

5 years agoAlways check the return from isc_refcount_decrement.
Mark Andrews [Thu, 5 Dec 2019 02:29:45 +0000 (13:29 +1100)] 
Always check the return from isc_refcount_decrement.

Created isc_refcount_decrement_expect macro to test conditionally
the return value to ensure it is in expected range.  Converted
unchecked isc_refcount_decrement to use isc_refcount_decrement_expect.
Converted INSIST(isc_refcount_decrement()...) to isc_refcount_decrement_expect.

(cherry picked from commit bde5c7632ad62f5a9e7d2165695e6db2fc654e46)

5 years agoMerge branch '2033-rndc-dnstap-roll-fix-was-incomplete-v9_16' into 'v9_16'
Mark Andrews [Fri, 31 Jul 2020 00:25:59 +0000 (00:25 +0000)] 
Merge branch '2033-rndc-dnstap-roll-fix-was-incomplete-v9_16' into 'v9_16'

Refactor the code that counts the last log version to keep

See merge request isc-projects/bind9!3900

5 years agoRefactor the code that counts the last log version to keep
Mark Andrews [Mon, 20 Jul 2020 01:53:40 +0000 (11:53 +1000)] 
Refactor the code that counts the last log version to keep

When silencing the Coverity warning in remove_old_tsversions(), the code
was refactored to reduce the indentation levels and break down the long
code into individual functions.  This improve fix for [GL #1989].

(cherry picked from commit aca18b8b5ba5133c087fc9cbfc3901b6351bfaaf)

5 years agoMerge branch 'mnowak/various-system-test-fixes-v9_16' into 'v9_16'
Michal Nowak [Thu, 30 Jul 2020 14:57:48 +0000 (14:57 +0000)] 
Merge branch 'mnowak/various-system-test-fixes-v9_16' into 'v9_16'

[v9_16] Various system test fixes

See merge request isc-projects/bind9!3898

5 years agoRemove cross-test dependency on ckdnsrps.sh
Michal Nowak [Tue, 28 Jul 2020 11:19:08 +0000 (13:19 +0200)] 
Remove cross-test dependency on ckdnsrps.sh

5 years agoFix name of the test directory of stop.pl in masterformat test
Michal Nowak [Tue, 28 Jul 2020 10:58:51 +0000 (12:58 +0200)] 
Fix name of the test directory of stop.pl in masterformat test

5 years agoEnsure test fails if packet.pl does not work as expected
Michal Nowak [Tue, 28 Jul 2020 10:45:31 +0000 (12:45 +0200)] 
Ensure test fails if packet.pl does not work as expected

5 years agoMerge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing...
Ondřej Surý [Thu, 30 Jul 2020 11:47:32 +0000 (11:47 +0000)] 
Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries-v9_16' into 'v9_16'

Resolve "Resizing (growing) of cache hash tables causes delays in processing of client queries"

See merge request isc-projects/bind9!3871

5 years agoAdd CHANGES and release note for #1775
Ondřej Surý [Mon, 20 Jul 2020 09:31:05 +0000 (11:31 +0200)] 
Add CHANGES and release note for #1775

(cherry picked from commit 2b4f0f03f5ca7933e6a6728350edf89d253b2c0c)

5 years agoChange the dns_name hashing to use 32-bit values
Ondřej Surý [Thu, 16 Jul 2020 15:30:44 +0000 (17:30 +0200)] 
Change the dns_name hashing to use 32-bit values

Change the dns_hash_name() and dns_hash_fullname() functions to use
isc_hash32() as the maximum hashtable size in rbt is 0..UINT32_MAX
large.

(cherry picked from commit a9182c89a666a9aa772c770c7f9f9ea39b98f328)

5 years agoAdd isc_hash32() and rename isc_hash_function() to isc_hash64()
Ondřej Surý [Thu, 16 Jul 2020 15:29:44 +0000 (17:29 +0200)] 
Add isc_hash32() and rename isc_hash_function() to isc_hash64()

As the names suggest the original isc_hash64 function returns 64-bit
long hash values and the isc_hash32() returns 32-bit values.

(cherry picked from commit f59fd49fd88e6efa966fd9c91a6ad319e1388679)

5 years agoAdd HalfSipHash 2-4 reference implementation
Ondřej Surý [Thu, 16 Jul 2020 15:26:44 +0000 (17:26 +0200)] 
Add HalfSipHash 2-4 reference implementation

The HalfSipHash implementation has 32-bit keys and returns 32-bit
value.

(cherry picked from commit 344d66aaff462d399b5c33cec602a71cb691e804)

5 years agoRemove OpenSSL based SipHash 2-4 implementation
Ondřej Surý [Thu, 16 Jul 2020 14:48:39 +0000 (16:48 +0200)] 
Remove OpenSSL based SipHash 2-4 implementation

Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, so until we fix the code
to reuse the OpenSSL contexts and keys we'll use our own implementation of
siphash instead of trying to integrate with OpenSSL.

(cherry picked from commit 21d751dfc72f02134e573687dc393938e9980388)

5 years agoFix the rbt hashtable and grow it when setting max-cache-size
Ondřej Surý [Thu, 16 Jul 2020 08:29:54 +0000 (10:29 +0200)] 
Fix the rbt hashtable and grow it when setting max-cache-size

There were several problems with rbt hashtable implementation:

1. Our internal hashing function returns uint64_t value, but it was
   silently truncated to unsigned int in dns_name_hash() and
   dns_name_fullhash() functions.  As the SipHash 2-4 higher bits are
   more random, we need to use the upper half of the return value.

2. The hashtable implementation in rbt.c was using modulo to pick the
   slot number for the hash table.  This has several problems because
   modulo is: a) slow, b) oblivious to patterns in the input data.  This
   could lead to very uneven distribution of the hashed data in the
   hashtable.  Combined with the single-linked lists we use, it could
   really hog-down the lookup and removal of the nodes from the rbt
   tree[a].  The Fibonacci Hashing is much better fit for the hashtable
   function here.  For longer description, read "Fibonacci Hashing: The
   Optimization that the World Forgot"[b] or just look at the Linux
   kernel.  Also this will make Diego very happy :).

3. The hashtable would rehash every time the number of nodes in the rbt
   tree would exceed 3 * (hashtable size).  The overcommit will make the
   uneven distribution in the hashtable even worse, but the main problem
   lies in the rehashing - every time the database grows beyond the
   limit, each subsequent rehashing will be much slower.  The mitigation
   here is letting the rbt know how big the cache can grown and
   pre-allocate the hashtable to be big enough to actually never need to
   rehash.  This will consume more memory at the start, but since the
   size of the hashtable is capped to `1 << 32` (e.g. 4 mio entries), it
   will only consume maximum of 32GB of memory for hashtable in the
   worst case (and max-cache-size would need to be set to more than
   4TB).  Calling the dns_db_adjusthashsize() will also cap the maximum
   size of the hashtable to the pre-computed number of bits, so it won't
   try to consume more gigabytes of memory than available for the
   database.

   FIXME: What is the average size of the rbt node that gets hashed?  I
   chose the pagesize (4k) as initial value to precompute the size of
   the hashtable, but the value is based on feeling and not any real
   data.

For future work, there are more places where we use result of the hash
value modulo some small number and that would benefit from Fibonacci
Hashing to get better distribution.

Notes:
a. A doubly linked list should be used here to speedup the removal of
   the entries from the hashtable.
b. https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/

(cherry picked from commit e24bc324b455d9cad7b51acd3d5c7b4e40c66187)

5 years agoMerge branch '2024-fix-idle-timeout-for-connected-tcp-sockets-v9_16' into 'v9_16'
Michał Kępień [Thu, 30 Jul 2020 09:49:50 +0000 (09:49 +0000)] 
Merge branch '2024-fix-idle-timeout-for-connected-tcp-sockets-v9_16' into 'v9_16'

[v9_16] Fix idle timeout for connected TCP sockets

See merge request isc-projects/bind9!3896

5 years agoAdd CHANGES for GL #2024
Michał Kępień [Thu, 30 Jul 2020 08:58:39 +0000 (10:58 +0200)] 
Add CHANGES for GL #2024

(cherry picked from commit 18efb2456f58d53a96f001a02a871cf47db82198)

5 years agoFix idle timeout for connected TCP sockets
Michał Kępień [Thu, 30 Jul 2020 08:58:39 +0000 (10:58 +0200)] 
Fix idle timeout for connected TCP sockets

When named acting as a resolver connects to an authoritative server over
TCP, it sets the idle timeout for that connection to 20 seconds.  This
fixed timeout was picked back when the default processing timeout for
each client query was hardcoded to 30 seconds.  Commit
000a8970f840a0c27c5cc404826853c4674362ac made this processing timeout
configurable through "resolver-query-timeout" and decreased its default
value to 10 seconds, but the idle TCP timeout was not adjusted to
reflect that change.  As a result, with the current defaults in effect,
a single hung TCP connection will consistently cause the resolution
process for a given query to time out.

Set the idle timeout for connected TCP sockets to half of the client
query processing timeout configured for a resolver.  This allows named
to handle hung TCP connections more robustly and prevents the timeout
mismatch issue from resurfacing in the future if the default is ever
changed again.

(cherry picked from commit 953d704bd25627d1d83294a8b11fc7c78d6e8a78)

5 years agoMerge branch '2050-libuv-version-v9_16' into 'v9_16'
Evan Hunt [Tue, 28 Jul 2020 03:01:58 +0000 (03:01 +0000)] 
Merge branch '2050-libuv-version-v9_16' into 'v9_16'

report libuv version string in `named -V`

See merge request isc-projects/bind9!3890

5 years agoreport libuv version string in `named -V`
Evan Hunt [Sat, 25 Jul 2020 00:04:02 +0000 (17:04 -0700)] 
report libuv version string in `named -V`

(cherry picked from commit 1036338a1082cf945399ee19751db64dba42f170)

5 years agoMerge branch '1619-rpz-wildcard-passthru-ignored-v9_16' into 'v9_16'
Evan Hunt [Tue, 28 Jul 2020 02:50:38 +0000 (02:50 +0000)] 
Merge branch '1619-rpz-wildcard-passthru-ignored-v9_16' into 'v9_16'

Resolve "RPZ wildcard passthru ignored"

See merge request isc-projects/bind9!3889

5 years agoAdd CHANGES entry
Diego Fronza [Mon, 27 Jul 2020 20:18:11 +0000 (17:18 -0300)] 
Add CHANGES entry

5 years agoAdd test for RPZ wildcard passthru ignored fix
Diego Fronza [Fri, 12 Jun 2020 18:09:02 +0000 (15:09 -0300)] 
Add test for RPZ wildcard passthru ignored fix

5 years agoFix rpz wildcard name matching
Diego Fronza [Tue, 9 Jun 2020 23:45:21 +0000 (20:45 -0300)] 
Fix rpz wildcard name matching

Whenever an exact match is found by dns_rbt_findnode(),
the highest level node in the chain will not be put into
chain->levels[] array, but instead the chain->end
pointer will be adjusted to point to that node.

Suppose we have the following entries in a rpz zone:
example.com     CNAME rpz-passthru.
*.example.com   CNAME rpz-passthru.

A query for www.example.com would result in the
following chain object returned by dns_rbt_findnode():

chain->level_count = 2
chain->level_matches = 2
chain->levels[0] = .
chain->levels[1] = example.com
chain->levels[2] = NULL
chain->end = www

Since exact matches only care for testing rpz set bits,
we need to test for rpz wild bits through iterating the nodechain, and
that includes testing the rpz wild bits in the highest level node found.

In the case of an exact match, chain->levels[chain->level_matches]
will be NULL, to address that we must use chain->end as the start point,
then iterate over the remaining levels in the chain.

5 years agoMerge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time...
Mark Andrews [Fri, 24 Jul 2020 05:47:50 +0000 (05:47 +0000)] 
Merge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time-v9_16' into 'v9_16'

Resolve "dns_rdata_hip_next() fails to return ISC_R_NOMORE at the right time."

See merge request isc-projects/bind9!3885

5 years agoAdd CHANGES note
Mark Andrews [Wed, 22 Jul 2020 07:49:27 +0000 (17:49 +1000)] 
Add CHANGES note

(cherry picked from commit bcd049f116291ee809a6c5cd234874c936d67367)

5 years agoCheck walking the hip rendezvous servers.
Mark Andrews [Wed, 22 Jul 2020 07:02:47 +0000 (17:02 +1000)] 
Check walking the hip rendezvous servers.

Also fixes extraneous white space at end of record when
there are no rendezvous servers.

(cherry picked from commit 78db46d746fd4296a45f0094279c1330b95d8001)

5 years agoMerge branch 'feature/master/unix-cleanup-v9_16' into 'v9_16'
Mark Andrews [Fri, 24 Jul 2020 04:05:53 +0000 (04:05 +0000)] 
Merge branch 'feature/master/unix-cleanup-v9_16' into 'v9_16'

Remove few lines in unix socket handling

See merge request isc-projects/bind9!3882

5 years agoRemove few lines in unix socket handling
Petr Menšík [Tue, 12 Mar 2019 12:20:11 +0000 (13:20 +0100)] 
Remove few lines in unix socket handling

Reuse the same checks two times, make difference minimal.

(cherry picked from commit 72d81c4768a4731a1dd6a7c50a29286193105980)

5 years agoMerge branch 'dstlib-failure-abort-v9_16' into 'v9_16'
Mark Andrews [Thu, 23 Jul 2020 03:01:09 +0000 (03:01 +0000)] 
Merge branch 'dstlib-failure-abort-v9_16' into 'v9_16'

Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3878

5 years agoPrevent crash on dst initialization failure
Petr Menšík [Wed, 22 Jul 2020 16:55:02 +0000 (18:55 +0200)] 
Prevent crash on dst initialization failure

server might be created, but not yet fully initialized, when fatal
function is called. Check both server and task before attaching
exclusive task.

(cherry picked from commit c5e7152cf04f75d0fe00163f076f4cc3cafce259)

5 years agoMerge branch 'mnowak/try-harder-to-analyze-cores-v9_16' into 'v9_16'
Michal Nowak [Mon, 20 Jul 2020 14:48:32 +0000 (14:48 +0000)] 
Merge branch 'mnowak/try-harder-to-analyze-cores-v9_16' into 'v9_16'

[v9_16] Rationalize backtrace logging

See merge request isc-projects/bind9!3869

5 years agoCheck tests for core files regardless of test status
Michal Nowak [Mon, 22 Jun 2020 17:55:40 +0000 (19:55 +0200)] 
Check tests for core files regardless of test status

Failed test should be checked for core files et al. and have
backtrace generated.

5 years agoRationalize backtrace logging
Michal Nowak [Mon, 22 Jun 2020 13:56:50 +0000 (15:56 +0200)] 
Rationalize backtrace logging

GDB backtrace generated via "thread apply all bt full" is too long for
standard output, lets save them to .txt file among other log files.

5 years agoFold stop_servers_failed() to stop_servers()
Michal Nowak [Mon, 20 Jul 2020 08:56:20 +0000 (10:56 +0200)] 
Fold stop_servers_failed() to stop_servers()

5 years agoMerge branch 'v9_16_5-release' into 'v9_16'
Michał Kępień [Wed, 15 Jul 2020 21:23:33 +0000 (21:23 +0000)] 
Merge branch 'v9_16_5-release' into 'v9_16'

Merge 9.16.5 release branch

See merge request isc-projects/bind9!3861

5 years agoSet up release notes for BIND 9.16.6
Michał Kępień [Wed, 15 Jul 2020 21:19:58 +0000 (23:19 +0200)] 
Set up release notes for BIND 9.16.6

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Wed, 15 Jul 2020 21:19:58 +0000 (23:19 +0200)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoMerge branch 'prep-release' into v9_16_5-release
Tinderbox User [Fri, 3 Jul 2020 10:39:06 +0000 (10:39 +0000)] 
Merge branch 'prep-release' into v9_16_5-release

5 years agoprep 9.16.5
Tinderbox User [Fri, 3 Jul 2020 10:37:08 +0000 (10:37 +0000)] 
prep 9.16.5

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.16.5' into v9_16_5-release
Michał Kępień [Fri, 3 Jul 2020 09:41:04 +0000 (11:41 +0200)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.16.5' into v9_16_5-release

5 years agoReorder release notes
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Reorder release notes

5 years agoAdd release note for #1938
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Add release note for #1938

5 years agoAdd release note for #1937
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Add release note for #1937

5 years agoTweak and reword release notes
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Tweak and reword release notes

5 years agoPrepare release notes for BIND 9.16.5
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Prepare release notes for BIND 9.16.5

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Fri, 3 Jul 2020 09:10:39 +0000 (11:10 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMerge branch '2006-coverity-checked-return-keymgr-v9_16' into 'v9_16'
Matthijs Mekking [Wed, 15 Jul 2020 09:04:13 +0000 (09:04 +0000)] 
Merge branch '2006-coverity-checked-return-keymgr-v9_16' into 'v9_16'

Check return value of dst_key_getbool()

See merge request isc-projects/bind9!3859

5 years agoCheck return value of dst_key_getbool()
Matthijs Mekking [Mon, 6 Jul 2020 10:07:24 +0000 (12:07 +0200)] 
Check return value of dst_key_getbool()

Fix Coverity CHECKED_RETURN reports for dst_key_getbool().  In most
cases we do not really care about its return value, but it is prudent
to check it.

In one case, where a dst_key_getbool() error should be treated
identically as success, cast the return value to void and add a relevant
comment.

(cherry picked from commit e645d2ef1e6fb08287f36c6872f4f88850cbc26f)

5 years agoMerge branch 'michal/use-image-key-in-qemu-based-ci-job-templates-v9_16' into 'v9_16'
Michał Kępień [Tue, 14 Jul 2020 08:32:44 +0000 (08:32 +0000)] 
Merge branch 'michal/use-image-key-in-qemu-based-ci-job-templates-v9_16' into 'v9_16'

[v9_16] Use "image" key in QEMU-based CI job templates

See merge request isc-projects/bind9!3856

5 years agoUse "image" key in QEMU-based CI job templates
Michał Kępień [Tue, 14 Jul 2020 07:58:04 +0000 (09:58 +0200)] 
Use "image" key in QEMU-based CI job templates

Our GitLab Runner Custom executor scripts now use the "image" key
instead of the job name for determining the QCOW2 image to use for a
given CI job.  Update .gitlab-ci.yml to reflect that change.

(cherry picked from commit 72201badf0c6c57d1a5632a47bfb8f789182a760)

5 years agoMerge branch 'u/fanf2/fix-signing-v9_16' into 'v9_16'
Mark Andrews [Tue, 14 Jul 2020 03:09:57 +0000 (03:09 +0000)] 
Merge branch 'u/fanf2/fix-signing-v9_16' into 'v9_16'

U/fanf2/fix signing v9 16

See merge request isc-projects/bind9!3852

5 years agoAdd release note for [GL !3735]
Mark Andrews [Thu, 25 Jun 2020 04:51:19 +0000 (14:51 +1000)] 
Add release note for [GL !3735]

(cherry picked from commit 3ff60b881fcc38fe6393ad6872237915ae077aa3)

5 years agoAdd CHANGES note for [GL !3735]
Mark Andrews [Thu, 25 Jun 2020 04:50:16 +0000 (14:50 +1000)] 
Add CHANGES note for [GL !3735]

(cherry picked from commit f4fbca6e1661920a7f5bb8039486827d1f729018)

5 years agoAdd regression test for [GL !3735]
Mark Andrews [Thu, 25 Jun 2020 11:27:29 +0000 (21:27 +1000)] 
Add regression test for [GL !3735]

Check that resign interval is actually in days rather than hours
by checking that RRSIGs are all within the allowed day range.

(cherry picked from commit 11ecf7901b3ae8bbc37ec3f78ef8ae55ae495845)

5 years agoFix re-signing when `sig-validity-interval` has two arguments
Tony Finch [Mon, 22 Jun 2020 19:23:29 +0000 (20:23 +0100)] 
Fix re-signing when `sig-validity-interval` has two arguments

Since October 2019 I have had complaints from `dnssec-cds` reporting
that the signatures on some of my test zones had expired. These were
zones signed by BIND 9.15 or 9.17, with a DNSKEY TTL of 24h and
`sig-validity-interval 10 8`.

This is the same setup we have used for our production zones since
2015, which is intended to re-sign the zones every 2 days, keeping
at least 8 days signature validity. The SOA expire interval is 7
days, so even in the presence of zone transfer problems, no-one
should ever see expired signatures. (These timers are a bit too
tight to be completely correct, because I should have increased
the expiry timers when I increased the DNSKEY TTLs from 1h to 24h.
But that should only matter when zone transfers are broken, which
was not the case for the error reports that led to this patch.)

For example, this morning my test zone contained:

        dev.dns.cam.ac.uk. 86400 IN RRSIG DNSKEY 13 5 86400 (
                                20200701221418 20200621213022 ...)

But one of my resolvers had cached:

        dev.dns.cam.ac.uk. 21424 IN RRSIG DNSKEY 13 5 86400 (
                                20200622063022 20200612061136 ...)

This TTL was captured at 20200622105807 so the resolver cached the
RRset 64976 seconds previously (18h02m56s), at 20200621165511
only about 12h before expiry.

The other symptom of this error was incorrect `resign` times in
the output from `rndc zonestatus`.

For example, I have configured a test zone

        zone fast.dotat.at {
                file "../u/z/fast.dotat.at";
                type primary;
                auto-dnssec maintain;
                sig-validity-interval 500 499;
        };

The zone is reset to a minimal zone containing only SOA and NS
records, and when `named` starts it loads and signs the zone. After
that, `rndc zonestatus` reports:

        next resign node: fast.dotat.at/NS
        next resign time: Fri, 28 May 2021 12:48:47 GMT

The resign time should be within the next 24h, but instead it is
near the signature expiry time, which the RRSIG(NS) says is
20210618074847. (Note 499 hours is a bit more than 20 days.)
May/June 2021 is less than 500 days from now because expiry time
jitter is applied to the NS records.

Using this test I bisected this bug to 09990672d which contained a
mistake leading to the resigning interval always being calculated in
hours, when days are expected.

This bug only occurs for configurations that use the two-argument form
of `sig-validity-interval`.

(cherry picked from commit 030674b2a3249a06055c9cdd283c226c21065f5a)

5 years agoMerge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoin...
Mark Andrews [Tue, 14 Jul 2020 01:25:55 +0000 (01:25 +0000)] 
Merge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoindex-undefined-on-illumos-v9_16' into 'v9_16'

Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined

See merge request isc-projects/bind9!3850

5 years agoMark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined
Mark Andrews [Thu, 9 Jul 2020 05:04:31 +0000 (15:04 +1000)] 
Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined

Also 'zone' should be initialised to zero.

(cherry picked from commit e7662c4c6347648e95606338ce98f360e5afb5a7)

5 years agoMerge branch 'each-lmdb-lock-fix-v9_16' into 'v9_16'
Evan Hunt [Tue, 14 Jul 2020 00:17:16 +0000 (00:17 +0000)] 
Merge branch 'each-lmdb-lock-fix-v9_16' into 'v9_16'

ensure new_zone_lock is released after count_newzones()

See merge request isc-projects/bind9!3845

5 years agomake sure new_zone_lock is locked before unlocking it
Evan Hunt [Sun, 12 Jul 2020 04:30:53 +0000 (21:30 -0700)] 
make sure new_zone_lock is locked before unlocking it

it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.

(cherry picked from commit ed37c63e2bbc4afe299dbe38ae98871dcc1d3470)

5 years agoMerge branch '1993-check-c-1576-37-error-expected-identifier-before-numeric-constant...
Mark Andrews [Mon, 13 Jul 2020 23:37:19 +0000 (23:37 +0000)] 
Merge branch '1993-check-c-1576-37-error-expected-identifier-before-numeric-constant-on-illumos-v9_16' into 'v9_16'

Handle namespace clash over 'SEC' on illumos.

See merge request isc-projects/bind9!3849

5 years agoHandle namespace clash over 'SEC' on illumos.
Mark Andrews [Thu, 9 Jul 2020 04:49:47 +0000 (14:49 +1000)] 
Handle namespace clash over 'SEC' on illumos.

(cherry picked from commit 18eef2024187bd0c7fcb95bcec14b068a564b1c1)

5 years agoMerge branch '2005-coverity-is-reporting-double-unlock-v9_16' into 'v9_16'
Mark Andrews [Mon, 13 Jul 2020 23:04:06 +0000 (23:04 +0000)] 
Merge branch '2005-coverity-is-reporting-double-unlock-v9_16' into 'v9_16'

Resolve "Coverity is reporting double unlock."

See merge request isc-projects/bind9!3848

5 years agoAdd CHANGES for [GL #2005]
Mark Andrews [Tue, 7 Jul 2020 01:13:43 +0000 (11:13 +1000)] 
Add CHANGES for [GL #2005]

(cherry picked from commit 4e03bfac862d39102e7d199633623896fc8e0eb3)

5 years agoAddress potential double unlock in process_fd
Mark Andrews [Tue, 7 Jul 2020 01:11:15 +0000 (11:11 +1000)] 
Address potential double unlock in process_fd

(cherry picked from commit cc0089c66b692d554e8fc927e4f47e3d7dcda371)

5 years agoMerge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed-v9_16' into...
Mark Andrews [Mon, 13 Jul 2020 06:49:03 +0000 (06:49 +0000)] 
Merge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed-v9_16' into 'v9_16'

Fallback to built in trust-anchors, managed-keys, or trusted-keys

See merge request isc-projects/bind9!3843

5 years agoFallback to built in trust-anchors, managed-keys, or trusted-keys
Mark Andrews [Thu, 9 Jul 2020 03:35:37 +0000 (13:35 +1000)] 
Fallback to built in trust-anchors, managed-keys, or trusted-keys

if the bind.keys file cannot be parsed.

(cherry picked from commit d02a14c79580de1888e96f32617d8123be1be060)

5 years agoMerge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer...
Mark Andrews [Mon, 13 Jul 2020 05:00:19 +0000 (05:00 +0000)] 
Merge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer-overflow-v9_16' into 'v9_16'

Resolve "'rndc dnstap --roll' with too big a argument (>128) can cause a buffer overflow."

See merge request isc-projects/bind9!3842

5 years agoAdd changes for [GL #1989]
Mark Andrews [Thu, 2 Jul 2020 03:35:27 +0000 (13:35 +1000)] 
Add changes for [GL #1989]

(cherry picked from commit 42b2290c3a20c09663a8145e0ea8938def62a56e)

5 years agoAddress overrun in remove_old_tsversions
Mark Andrews [Thu, 2 Jul 2020 03:26:06 +0000 (13:26 +1000)] 
Address overrun in remove_old_tsversions

If too many versions of log / dnstap files to be saved where requests
the memory after to_keep could be overwritten.  Force the number of
versions to be saved to a save level.  Additionally the memmove length
was incorrect.

(cherry picked from commit 6ca78bc57dece45029ee56a73161db7b68140286)

5 years agoMerge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in...
Mark Andrews [Mon, 13 Jul 2020 04:00:27 +0000 (04:00 +0000)] 
Merge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in-tsig_test-c-v9_11-v9_16' into 'v9_16'

Assert tsigout is non-NULL

See merge request isc-projects/bind9!3841

5 years agoAssert tsigout is non-NULL
Mark Andrews [Tue, 7 Jul 2020 09:12:35 +0000 (19:12 +1000)] 
Assert tsigout is non-NULL

(cherry picked from commit 827746e89b4b1b72d6d3dccb849f98d6918c03a2)

5 years agoMerge branch '2014-statschannel-system-test-failed-at-setup-stage-v9_16' into 'v9_16'
Mark Andrews [Mon, 13 Jul 2020 03:18:07 +0000 (03:18 +0000)] 
Merge branch '2014-statschannel-system-test-failed-at-setup-stage-v9_16' into 'v9_16'

Don't verify the zone when setting expire to "now+1s" as it can fail

See merge request isc-projects/bind9!3839

5 years agoDon't verify the zone when setting expire to "now+1s" as it can fail
Mark Andrews [Wed, 8 Jul 2020 03:18:31 +0000 (13:18 +1000)] 
Don't verify the zone when setting expire to "now+1s" as it can fail

as too much wall clock time may have elapsed.

Also capture signzone output for forensic analysis

(cherry picked from commit a0e8a11cc6f61ec5f16370cfd9888e5758a3f391)

5 years agoMerge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c-v9_16' into 'v9_16'
Mark Andrews [Mon, 13 Jul 2020 02:37:06 +0000 (02:37 +0000)] 
Merge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c-v9_16' into 'v9_16'

check returns from inet_pton()

See merge request isc-projects/bind9!3837