]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoAdd release notes for GL #2472
Michal Nowak [Mon, 8 Mar 2021 12:44:22 +0000 (13:44 +0100)] 
Add release notes for GL #2472

5 years agoAdd release note for GL #2504
Michal Nowak [Mon, 8 Mar 2021 12:47:45 +0000 (13:47 +0100)] 
Add release note for GL #2504

5 years agoAdd release note for GL #2041
Michal Nowak [Mon, 8 Mar 2021 12:47:30 +0000 (13:47 +0100)] 
Add release note for GL #2041

5 years agoReorder release notes
Michal Nowak [Fri, 5 Mar 2021 15:21:51 +0000 (16:21 +0100)] 
Reorder release notes

5 years agoTweak and reword release notes
Michal Nowak [Fri, 26 Feb 2021 12:07:08 +0000 (13:07 +0100)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michal Nowak [Fri, 26 Feb 2021 11:19:57 +0000 (12:19 +0100)] 
Tweak and reword recent CHANGES entries

5 years agoRelease template: update the -S edition delivery tickets
Michal Nowak [Wed, 3 Mar 2021 17:35:55 +0000 (18:35 +0100)] 
Release template: update the -S edition delivery tickets

Change requested by the Support team.

5 years agoMerge branch '2580-does-not-compile-without-deprecated-openssl-apis' into 'main'
Mark Andrews [Wed, 17 Mar 2021 20:10:11 +0000 (20:10 +0000)] 
Merge branch '2580-does-not-compile-without-deprecated-openssl-apis' into 'main'

Resolve "Does not compile without deprecated OpenSSL APIs"

Closes #2580

See merge request isc-projects/bind9!4806

5 years agoStop using deprecated calls in lib/isc/tls.c
Mark Andrews [Tue, 16 Mar 2021 21:58:55 +0000 (21:58 +0000)] 
Stop using deprecated calls in lib/isc/tls.c

from Rosen Penev @neheb

5 years agoMerge branch '2523-thaw-dnssec-policy-zone' into 'main'
Matthijs Mekking [Wed, 17 Mar 2021 10:11:13 +0000 (10:11 +0000)] 
Merge branch '2523-thaw-dnssec-policy-zone' into 'main'

Resolve "Unable to thaw a frozen dynamic zone when KASP is configured."

Closes #2523

See merge request isc-projects/bind9!4777

5 years agoAdd test for thaw dynamic kasp zone
Matthijs Mekking [Fri, 5 Mar 2021 10:29:06 +0000 (11:29 +0100)] 
Add test for thaw dynamic kasp zone

Add a test for freezing, manually updating, and then thawing a dynamic
zone with "dnssec-policy". In the kasp system test we add parameters
to the "update_is_signed" check to signal the indicated IP addresses
for the labels "a" and "d". If set to '-', the test is skipped.

After nsupdating the dynamic.kasp zone, we revert the update (with
nsupdate) and update the zone again, but now with the freeze/thaw
approach.

5 years agoFully sign a thawed zone
Matthijs Mekking [Fri, 5 Mar 2021 10:27:59 +0000 (11:27 +0100)] 
Fully sign a thawed zone

When thawing a zone, we don't know what changes have been made. If we
do DNSSEC maintenance on this zone, schedule a full sign.

5 years agoFix "unable to thaw dynamic kasp zone"
Matthijs Mekking [Fri, 5 Mar 2021 10:22:01 +0000 (11:22 +0100)] 
Fix "unable to thaw dynamic kasp zone"

Dynamic zones with dnssec-policy could not be thawed because KASP
zones were considered always dynamic. But a dynamic KASP zone should
also check whether updates are disabled.

5 years agoMerge branch '2561-dnssec-guide-signing-type' into 'main'
Matthijs Mekking [Tue, 16 Mar 2021 13:37:32 +0000 (13:37 +0000)] 
Merge branch '2561-dnssec-guide-signing-type' into 'main'

Fix typo in DNSSEC Guide

Closes #2561

See merge request isc-projects/bind9!4791

5 years agoFix typo in DNSSEC Guide
Matthijs Mekking [Tue, 9 Mar 2021 08:14:18 +0000 (09:14 +0100)] 
Fix typo in DNSSEC Guide

The "dnssec-policy" example should say "keys" instead of "key".

5 years agoMerge branch '2514-tls-cert-chain' into 'main'
Artem Boldariev [Tue, 16 Mar 2021 10:33:35 +0000 (10:33 +0000)] 
Merge branch '2514-tls-cert-chain' into 'main'

Load full certificate chain from a certificate chain file

Closes #2514

See merge request isc-projects/bind9!4792

5 years agoAdd change entry for [#2514]
Matthijs Mekking [Fri, 12 Mar 2021 08:18:01 +0000 (09:18 +0100)] 
Add change entry for [#2514]

5 years agoLoad full certificate chain from a certificate chain file
Artem Boldariev [Tue, 9 Mar 2021 12:45:03 +0000 (14:45 +0200)] 
Load full certificate chain from a certificate chain file

This commit fixes loading the certificate chain files so that the full
chain could be sent to the clients which require that for
verification. Before that fix only the top most certificate would be
loaded from the chain and sent to clients preventing some of them to
perform certificate validation (e.g. Windows 10 DoH client).

5 years agoMerge branch '2562-xot-crash' into 'main'
Matthijs Mekking [Tue, 16 Mar 2021 09:42:18 +0000 (09:42 +0000)] 
Merge branch '2562-xot-crash' into 'main'

Fix a XoT crash

Closes #2562

See merge request isc-projects/bind9!4803

5 years agoFix a XoT crash
Matthijs Mekking [Mon, 15 Mar 2021 14:08:04 +0000 (15:08 +0100)] 
Fix a XoT crash

The transport should also be detached when we skip a master, otherwise
named will crash when sending a SOA query to the next master over TLS,
because the transport must be NULL when we enter
'dns_view_gettransport'.

5 years agoMerge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected...
Mark Andrews [Tue, 16 Mar 2021 00:11:02 +0000 (00:11 +0000)] 
Merge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected' into 'main'

Resolve "nsupdate on Solaris produces different failure text than expected"

Closes #2569

See merge request isc-projects/bind9!4804

5 years agoIgnore the actual error code returned by getaddrinfo
Mark Andrews [Mon, 15 Mar 2021 22:49:52 +0000 (09:49 +1100)] 
Ignore the actual error code returned by getaddrinfo

when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.

5 years agoMerge branch '2567-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Mark Andrews [Mon, 15 Mar 2021 03:33:21 +0000 (03:33 +0000)] 
Merge branch '2567-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'

Resolve "warning: array subscript is of type 'char' on NetBSD 9"

Closes #2567

See merge request isc-projects/bind9!4794

5 years agoAdd CHANGES for [GL #2567]
Mark Andrews [Thu, 11 Mar 2021 00:12:06 +0000 (11:12 +1100)] 
Add CHANGES for [GL #2567]

5 years agocast (char) to (unsigned char) when calling is*()
Mark Andrews [Thu, 11 Mar 2021 00:08:54 +0000 (11:08 +1100)] 
cast (char) to (unsigned char) when calling is*()

5 years agoMerge branch '2565-servestale-fetchlimits-crash' into 'main'
Michal Nowak [Thu, 11 Mar 2021 12:14:47 +0000 (12:14 +0000)] 
Merge branch '2565-servestale-fetchlimits-crash' into 'main'

Fix servestale fetchlimits crash

Closes #2565

See merge request isc-projects/bind9!4797

5 years agoFix servestale fetchlimits crash
Matthijs Mekking [Wed, 10 Mar 2021 14:14:56 +0000 (15:14 +0100)] 
Fix servestale fetchlimits crash

When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'main' by commit
8bcd7fe69e5343071fc917738d6092a8b974ef3f.

5 years agoMerge branch '2568-test_client-c-error-static-declaration-of-yield-follows-non-static...
Ondřej Surý [Thu, 11 Mar 2021 06:09:49 +0000 (06:09 +0000)] 
Merge branch '2568-test_client-c-error-static-declaration-of-yield-follows-non-static-declaration-on-solaris' into 'main'

Resolve "test_client.c: error: static declaration of 'yield' follows non-static declaration on Solaris"

Closes #2568

See merge request isc-projects/bind9!4795

5 years agoRename 'yield' to 'waitforsignal' due to namespace clash
Mark Andrews [Thu, 11 Mar 2021 00:34:15 +0000 (11:34 +1100)] 
Rename 'yield' to 'waitforsignal' due to namespace clash

5 years agoMerge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option' into 'main'
Michał Kępień [Mon, 8 Mar 2021 11:28:37 +0000 (11:28 +0000)] 
Merge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option' into 'main'

Fix documentation for the "max-ixfr-ratio" option

Closes #2556

See merge request isc-projects/bind9!4787

5 years agoFix documentation for the "max-ixfr-ratio" option
Michał Kępień [Mon, 8 Mar 2021 11:27:39 +0000 (12:27 +0100)] 
Fix documentation for the "max-ixfr-ratio" option

Commit 9fb6d11abbdb10ded128f0ee5c004f24b4030ede (which converted BIND 9
documentation from DocBook to Sphinx) inadvertently removed a paragraph
from the description of the "max-ixfr-ratio" option.  Add the missing
paragraph back.

5 years agoMerge branch 'ondrej/disable-github-pr-fix' into 'main'
Ondřej Surý [Mon, 8 Mar 2021 11:25:15 +0000 (11:25 +0000)] 
Merge branch 'ondrej/disable-github-pr-fix' into 'main'

Fix syntax error in GitHub Actions lockdown.yml file

See merge request isc-projects/bind9!4789

5 years agoFix syntax error in GitHub Actions lockdown.yml file
Ondřej Surý [Mon, 8 Mar 2021 11:24:17 +0000 (12:24 +0100)] 
Fix syntax error in GitHub Actions lockdown.yml file

5 years agoMerge branch 'ondrej/disable-github-pr' into 'main'
Ondřej Surý [Mon, 8 Mar 2021 11:13:24 +0000 (11:13 +0000)] 
Merge branch 'ondrej/disable-github-pr' into 'main'

Add GitHub Action that immediately closes issue / PRs

See merge request isc-projects/bind9!4788

5 years agoAdd GitHub Action that immediately closes issue / PRs
Ondřej Surý [Mon, 8 Mar 2021 11:09:14 +0000 (12:09 +0100)] 
Add GitHub Action that immediately closes issue / PRs

Unfortunately, it's not possible to disable Pull Requests on the
mirrored repository on the GitHub, so this commit adds external action
that closes any new open Issue or Pull Requests instead letting them rot
unnoticed.

5 years agoMerge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows' into ...
Ondřej Surý [Mon, 8 Mar 2021 08:42:14 +0000 (08:42 +0000)] 
Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows' into 'main'

Resolve "journal test fails on Windows"

Closes #2555

See merge request isc-projects/bind9!4784

5 years agofix automatic journal upgrade on windows
Evan Hunt [Fri, 5 Mar 2021 22:28:33 +0000 (14:28 -0800)] 
fix automatic journal upgrade on windows

- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.

5 years agoadd start and end serial numbers to 'named-printjournal -x'
Evan Hunt [Mon, 8 Mar 2021 04:50:56 +0000 (20:50 -0800)] 
add start and end serial numbers to 'named-printjournal -x'

add the starting and ending serial number from the journal
header to the output of dns_journal_print().

5 years agoMerge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c' into 'main'
Mark Andrews [Mon, 8 Mar 2021 05:25:17 +0000 (05:25 +0000)] 
Merge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c' into 'main'

Resolve "CID 329159: Logically dead code in lib/dns/journal.c"

Closes #2559

See merge request isc-projects/bind9!4780

5 years agoSilence CID 329159: Logically dead code in lib/dns/journal.c
Mark Andrews [Sun, 7 Mar 2021 19:53:30 +0000 (06:53 +1100)] 
Silence CID 329159: Logically dead code in lib/dns/journal.c

    *** CID 329159:    (DEADCODE)
    /lib/dns/journal.c: 1719 in dns_journal_print()
    1713      }
    1714      CHECK(dns_difftuple_create(
    1715      diff.mctx, n_soa == 1 ? DNS_DIFFOP_DEL : DNS_DIFFOP_ADD,
    1716      name, ttl, rdata, &tuple));
    1717      dns_diff_append(&diff, &tuple);
    1718
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach the expression "printxhdr" inside this statement: "if (++n_put != 0U || printx...".
    1719      if (++n_put != 0 || printxhdr) {
    1720      result = dns_diff_print(&diff, file);
    1721      dns_diff_clear(&diff);
    1722      n_put = 0;
    1723      if (result != ISC_R_SUCCESS) {
    1724      break;
    /lib/dns/journal.c: 1734 in dns_journal_print()
    1728      if (result == ISC_R_NOMORE) {
    1729      result = ISC_R_SUCCESS;
    1730      }
    1731      CHECK(result);
    1732
    1733      if (!printxhdr && n_put != 0) {
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach this statement: "result = dns_diff_print(&di...".
    1734      result = dns_diff_print(&diff, file);
    1735      dns_diff_clear(&diff);
    1736      }
    1737      goto cleanup;
    1738
    1739     failure:

5 years agoMerge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c...
Mark Andrews [Mon, 8 Mar 2021 05:06:06 +0000 (05:06 +0000)] 
Merge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c' into 'main'

Resolve "CID 329157: Dereference before null check in lib/dns/journal.c"

Closes #2560

See merge request isc-projects/bind9!4779

5 years agoSilence CID 329157: Dereference before null check in lib/dns/journal.c
Mark Andrews [Sun, 7 Mar 2021 20:06:57 +0000 (07:06 +1100)] 
Silence CID 329157: Dereference before null check in lib/dns/journal.c

    *** CID 329157:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/journal.c: 754 in journal_open()
    748          j->header.index_size * sizeof(journal_rawpos_t));
    749      }
    750      if (j->index != NULL) {
    751      isc_mem_put(j->mctx, j->index,
    752          j->header.index_size * sizeof(journal_pos_t));
    753      }
       CID 329157:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "j->filename" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    754      if (j->filename != NULL) {
    755      isc_mem_free(j->mctx, j->filename);
    756      }
    757      if (j->fp != NULL) {
    758      (void)isc_stdio_close(j->fp);
    759      }

5 years agoMerge branch 'marka-add-journal-to-conf-sh-common' into 'main'
Mark Andrews [Mon, 8 Mar 2021 01:12:54 +0000 (01:12 +0000)] 
Merge branch 'marka-add-journal-to-conf-sh-common' into 'main'

Add journal to conf.sh.common

See merge request isc-projects/bind9!4781

5 years agoadd journal to conf.sh.common
Mark Andrews [Mon, 8 Mar 2021 00:36:00 +0000 (11:36 +1100)] 
add journal to conf.sh.common

5 years agoMerge branch '1641-doh-dig' into 'main'
Artem Boldariev [Fri, 5 Mar 2021 16:46:02 +0000 (16:46 +0000)] 
Merge branch '1641-doh-dig' into 'main'

Resolve "RFC8484, DoH support in DIG (and any other relevant utilities)"

Closes #2464 and #1641

See merge request isc-projects/bind9!4672

5 years agoCHANGES, release notes
Evan Hunt [Fri, 12 Feb 2021 21:01:10 +0000 (13:01 -0800)] 
CHANGES, release notes

5 years agoadd basic DoH system tests
Evan Hunt [Fri, 12 Feb 2021 02:42:00 +0000 (18:42 -0800)] 
add basic DoH system tests

- rename dot to doth, as it now covers both dot and doh.
- merge xot into doth as it's closely related.
- added long-lived key and cert files (expiring 2121).
- add tests with https-get, https-post, http-plain, alternate
  endpoints, and both static and ephemeral TLS configuration.
- incidentally fixed a memory leak in dig that occurred if +https
  was specified more than once.

5 years agoDisable Nagle's algorithm for HTTP/2 connections
Artem Boldariev [Sun, 28 Feb 2021 17:33:16 +0000 (19:33 +0200)] 
Disable Nagle's algorithm for HTTP/2 connections

It is advisable to disable Nagle's algorithm for HTTP/2 connections
because multiple HTTP/2 streams could be multiplexed over one
transport connection. Thus, delays when delivering small packets could
bring down performance for the whole session. HTTP/2 is meant to be
used this way.

5 years agoFix deadlock in isc_nm_tlsconnect()
Artem Boldariev [Thu, 11 Feb 2021 13:03:44 +0000 (15:03 +0200)] 
Fix deadlock in isc_nm_tlsconnect()

when called from within the context of a network thread,
isc_nm_tlsconnect() hangs. it is waiting for the socket's
result code to be updated, but that update is supposed to happen
asynchronously in the network thread, and if we're already blocking
in the network thread, it can never occur.

we can kluge around this by setting the socket result code
early; this works for most clients (including "dig"), but it causes
inconsistent behaviors that manifest as test failures in the DoH unit
test.

so we kluged around it even more by setting the socket result code
early *only when running in the network thread*. we need a better
solution for this problem, but this will do for now.

5 years agoDoH: call send callbacks after data was actually sent
Artem Boldariev [Sun, 28 Feb 2021 14:11:49 +0000 (16:11 +0200)] 
DoH: call send callbacks after data was actually sent

5 years agoPut sane limitations in place to handle bad requests gracefully
Artem Boldariev [Tue, 16 Feb 2021 14:54:51 +0000 (16:54 +0200)] 
Put sane limitations in place to handle bad requests gracefully

This commit makes the server-side code polite.

It fixes the error handling code on the server side and fixes
returning error code in responses (there was a nasty bug which could
potentially crash the server).

Also, in this commit we limit max size POST request data to 96K, max
processed data size in headers to 128K (should be enough to handle any
GET requests).

If these limits are surpassed, server will terminate the request with
RST_STREAM without responding with error code. Otherwise it politely
responds with error code.

This commit also limits number of concurrent HTTP/2 streams per
transport connection on server to 100 (as nghttp2 advises by default).

Ideally, these parameters should be configurable both globally and per
every HTTP endpoint description in the configuration file, but for now
putting sane limits should be enough.

5 years agorefactor outgoing HTTP connection support
Evan Hunt [Thu, 4 Feb 2021 00:59:49 +0000 (16:59 -0800)] 
refactor outgoing HTTP connection support

- style, cleanup, and removal of unnecessary code.
- combined isc_nm_http_add_endpoint() and isc_nm_http_add_doh_endpoint()
  into one function, renamed isc_http_endpoint().
- moved isc_nm_http_connect_send_request() into doh_test.c as a helper
  function; remove it from the public API.
- renamed isc_http2 and isc_nm_http2 types and functions to just isc_http
  and isc_nm_http, for consistency with other existing names.
- shortened a number of long names.
- the caller is now responsible for determining the peer address.
  in isc_nm_httpconnect(); this eliminates the need to parse the URI
  and the dependency on an external resolver.
- the caller is also now responsible for creating the SSL client context,
  for consistency with isc_nm_tlsdnsconnect().
- added setter functions for HTTP/2 ALPN. instead of setting up ALPN in
  isc_tlsctx_createclient(), we now have a function
  isc_tlsctx_enable_http2client_alpn() that can be run from
  isc_nm_httpconnect().
- refactored isc_nm_httprequest() into separate read and send functions.
  isc_nm_send() or isc_nm_read() is called on an http socket, it will
  be stored until a corresponding isc_nm_read() or _send() arrives; when
  we have both halves of the pair the HTTP request will be initiated.
- isc_nm_httprequest() is renamed isc__nm_http_request() for use as an
  internal helper function by the DoH unit test. (eventually doh_test
  should be rewritten to use read and send, and this function should
  be removed.)
- added implementations of isc__nm_tls_settimeout() and
  isc__nm_http_settimeout().
- increased NGHTTP2 header block length for client connections to 128K.
- use isc_mem_t for internal memory allocations inside nghttp2, to
  help track memory leaks.
- send "Cache-Control" header in requests and responses. (note:
  currently we try to bypass HTTP caching proxies, but ideally we should
  interact with them: https://tools.ietf.org/html/rfc8484#section-5.1)

5 years agoadd preliminary DoH client support to dig
Ondřej Surý [Wed, 27 Jan 2021 14:49:27 +0000 (15:49 +0100)] 
add preliminary DoH client support to dig

add options "+https", "+https-get" and "+http-plain" to
allow dig to connect over HTTP/2 channels.

5 years agoMerge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer...
Ondřej Surý [Thu, 4 Mar 2021 15:25:00 +0000 (15:25 +0000)] 
Merge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer-clean' into 'main'

Resolve "Add ThreadSanitizer core dumping flags when we are ThreadSanitizer-clean"

Closes #1529

See merge request isc-projects/bind9!4774

5 years agoDisable allow_failure for ThreadSanitizer jobs
Ondřej Surý [Thu, 4 Mar 2021 14:21:28 +0000 (15:21 +0100)] 
Disable allow_failure for ThreadSanitizer jobs

Since the main branch is now TSAN-clean, it's a good opportunity to
enable hard failures for the TSAN system test jobs.

5 years agoAdd ThreadSanitizer core dumping flags
Michal Nowak [Mon, 19 Oct 2020 14:01:42 +0000 (16:01 +0200)] 
Add ThreadSanitizer core dumping flags

This should let us have core dumps from crashed system test when
ThreadSanitizer is enabled.

5 years agoMerge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type...
Ondřej Surý [Thu, 4 Mar 2021 14:28:11 +0000 (14:28 +0000)] 
Merge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type-uint64_t' into 'main'

Assigning uint64_t from buffer might be misaligned in netmgr tests

Closes #2455

See merge request isc-projects/bind9!4769

5 years agoAssigning uint64_t from buffer might be misaligned in netmgr tests
Ondřej Surý [Fri, 29 Jan 2021 12:16:38 +0000 (13:16 +0100)] 
Assigning uint64_t from buffer might be misaligned in netmgr tests

Resolve possible 8-byte unaligned access when assigning the magic
value from the received buffer.

5 years agoMerge branch '2533-mdig-move-cleanup' into 'main'
Ondřej Surý [Thu, 4 Mar 2021 14:01:15 +0000 (14:01 +0000)] 
Merge branch '2533-mdig-move-cleanup' into 'main'

Move cleanup of queries to later in the shutdown sequence

Closes #2533

See merge request isc-projects/bind9!4768

5 years agoMove cleanup of queries to later in the shutdown sequence
Mark Andrews [Thu, 4 Mar 2021 06:22:01 +0000 (17:22 +1100)] 
Move cleanup of queries to later in the shutdown sequence

to avoid TSAN report

    WARNING: ThreadSanitizer: data race
      Write of size 8 at 0x000000000001 by main thread:
        #0 free <null>
        #1 default_memfree lib/isc/mem.c:440
        #2 mem_put lib/isc/mem.c:363
        #3 isc__mem_free lib/isc/mem.c:1012
        #4 main bin/tools/mdig.c:2231

      Previous read of size 1 at 0x000000000005 by thread T1:
        #0 dns_name_fromtext lib/dns/name.c:1121
        #1 sendquery bin/tools/mdig.c:596
        #2 sendqueries bin/tools/mdig.c:779
        #3 dispatch lib/isc/task.c:1153
        #4 run lib/isc/task.c:1345
        #5 isc__trampoline_run lib/isc/trampoline.c:184
        #6 <null> <null>

      Thread T1 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create pthreads/thread.c:79
        #2 isc_taskmgr_create lib/isc/task.c:1435
        #3 main bin/tools/mdig.c:2148

    SUMMARY: ThreadSanitizer: data race in __interceptor_free

5 years agoMerge branch '2357-add-CHANGES-entry' into 'main'
Michal Nowak [Thu, 4 Mar 2021 11:45:06 +0000 (11:45 +0000)] 
Merge branch '2357-add-CHANGES-entry' into 'main'

Add CHANGES entry for GL #2357

Closes #2357

See merge request isc-projects/bind9!4770

5 years agoAdd CHANGES entry for GL #2357
Michal Nowak [Thu, 4 Mar 2021 11:26:58 +0000 (12:26 +0100)] 
Add CHANGES entry for GL #2357

5 years agoMerge branch '2552-comparison-between-signed-and-unsigned-on-arm7' into 'main'
Ondřej Surý [Thu, 4 Mar 2021 10:24:00 +0000 (10:24 +0000)] 
Merge branch '2552-comparison-between-signed-and-unsigned-on-arm7' into 'main'

Fix comparison between signed and unsigned integer expressions

Closes #2552

See merge request isc-projects/bind9!4766

5 years agoFix comparison between signed and unsigned integer expressions
Ondřej Surý [Thu, 4 Mar 2021 09:47:56 +0000 (10:47 +0100)] 
Fix comparison between signed and unsigned integer expressions

Simple typecast to size_t should be enough to silence the warning on
ARMv7, even though the code is in fact correct, because the readlen is
checked for being < 0 in the block before the warning.

5 years agoMerge branch '2551-char-is-unsigned-on-arm64' into 'main'
Ondřej Surý [Thu, 4 Mar 2021 10:20:18 +0000 (10:20 +0000)] 
Merge branch '2551-char-is-unsigned-on-arm64' into 'main'

Use int type to store result from isc_commandline_parse()

Closes #2551

See merge request isc-projects/bind9!4765

5 years agoUse int type to store result from isc_commandline_parse()
Ondřej Surý [Thu, 4 Mar 2021 09:43:00 +0000 (10:43 +0100)] 
Use int type to store result from isc_commandline_parse()

The C standard actually doesn't define char as signed or unsigned, and
it could be either according to underlying architecture.  It turns out
that while it's usually signed type, it isn't on arm64 where it's
unsigned.

isc_commandline_parse() return int, just use that instead of the char.

5 years agoMerge branch '2298-multiple-definition-of-librpz_dnsrpzd_path' into 'main'
Mark Andrews [Thu, 4 Mar 2021 08:22:16 +0000 (08:22 +0000)] 
Merge branch '2298-multiple-definition-of-librpz_dnsrpzd_path' into 'main'

Resolve "multiple definition of `librpz_dnsrpzd_path'"

Closes #2298

See merge request isc-projects/bind9!4703

5 years agoAdd CHANGES for [GL #2298]
Mark Andrews [Thu, 18 Feb 2021 04:40:13 +0000 (15:40 +1100)] 
Add CHANGES for [GL #2298]

5 years agoFixed librpz_dnsrpzd_path being a duplicate symbol
Mark Andrews [Thu, 18 Feb 2021 04:33:17 +0000 (15:33 +1100)] 
Fixed librpz_dnsrpzd_path being a duplicate symbol

librpz_dnsrpzd_path should have been declared extern in dns/librpz.h

5 years agoMerge branch '2505-journal-compatibility' into 'main'
Evan Hunt [Thu, 4 Mar 2021 03:18:42 +0000 (03:18 +0000)] 
Merge branch '2505-journal-compatibility' into 'main'

allow dns_journal_rollforward() to read old journal files

Closes #2505

See merge request isc-projects/bind9!4720

5 years agoCHANGES, release note
Evan Hunt [Tue, 23 Feb 2021 03:13:04 +0000 (19:13 -0800)] 
CHANGES, release note

5 years agocreate 'journal' system test
Evan Hunt [Mon, 22 Feb 2021 23:17:54 +0000 (15:17 -0800)] 
create 'journal' system test

tests that version 1 journal files containing version 1 transaction
headers are rolled forward correctly on server startup, then updated
into version 2 journals. also checks journal file consistency and
'max-journal-size' behavior.

5 years agoprint journal index data and test for consistency
Evan Hunt [Wed, 3 Mar 2021 22:59:30 +0000 (14:59 -0800)] 
print journal index data and test for consistency

'named-journalprint -x' now prints the journal's index table and
the offset of each transaction in the journal, so that index consistency
can be confirmed.

5 years agoextend named-journalprint to be able to force the journal version
Mark Andrews [Wed, 3 Mar 2021 06:07:15 +0000 (17:07 +1100)] 
extend named-journalprint to be able to force the journal version

named-journalprint can now upgrade or downgrade a journal file
in place; the '-u' option upgrades and the '-d' option downgrades.

5 years agoallow dns_journal_rollforward() to read old journal files
Evan Hunt [Fri, 19 Feb 2021 23:04:50 +0000 (15:04 -0800)] 
allow dns_journal_rollforward() to read old journal files

when the 'max-ixfr-ratio' option was added, journal transaction
headers were revised to include a count of RR's in each transaction.
this made it impossible to read old journal files after an upgrade.

this branch restores the ability to read version 1 transaction
headers. when rolling forward, printing journal contents, if
the wrong transaction header format is found, we can switch.

when dns_journal_rollforward() detects a version 1 transaction
header, it returns DNS_R_RECOVERABLE.  this triggers zone_postload()
to force a rewrite of the journal file in the new format, and
also to schedule a dump of the zone database with minimal delay.
journal repair is done by dns_journal_compact(), which rewrites
the entire journal, ignoring 'max-journal-size'. journal size is
corrected later.

newly created journal files now have "BIND LOG V9.2" in their headers
instead of "BIND LOG V9". files with the new version string cannot be
read using the old transaction header format. note that this means
newly created journal files will be rejected by older versions of named.

named-journalprint now takes a "-x" option, causing it to print
transaction header information before each delta, including its
format version.

5 years agoMerge branch 'ondrej/call-isc__initialize-shutdown-from-DllMain' into 'main'
Ondřej Surý [Tue, 2 Mar 2021 07:48:19 +0000 (07:48 +0000)] 
Merge branch 'ondrej/call-isc__initialize-shutdown-from-DllMain' into 'main'

Call isc__initialize()/isc__shutdown() from win32 DllMain

See merge request isc-projects/bind9!4759

5 years agoCall isc__initialize()/isc__shutdown() from win32 DllMain
Ondřej Surý [Mon, 1 Mar 2021 13:21:05 +0000 (14:21 +0100)] 
Call isc__initialize()/isc__shutdown() from win32 DllMain

Call the libisc isc__initialize() constructor and isc__shutdown()
destructor from DllMain instead of having duplicate code between
those and DllMain() code.

5 years agoMerge branch 'ondrej/improve-mempool-AddressSanitizer-integration' into 'main'
Evan Hunt [Fri, 26 Feb 2021 18:26:28 +0000 (18:26 +0000)] 
Merge branch 'ondrej/improve-mempool-AddressSanitizer-integration' into 'main'

Improve allocation-deallocation tracking with AddressSanitizer

See merge request isc-projects/bind9!4748

5 years agoAdd mempool get/put tracking with AddressSanitizer
Ondřej Surý [Thu, 25 Feb 2021 10:08:34 +0000 (11:08 +0100)] 
Add mempool get/put tracking with AddressSanitizer

When AddressSanitizer is in use, disable the internal mempool
implementation and redirect the isc_mempool_get to isc_mem_get
(and similarly for isc_mempool_put).  This is the method recommended
by the AddressSanitizer authors for tracking allocations and
deallocations instead of custom poison/unpoison code (see
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning).

5 years agoMerge branch '2396-add-thread-trampoline-for-thread-accounting' into 'main'
Ondřej Surý [Fri, 26 Feb 2021 12:44:15 +0000 (12:44 +0000)] 
Merge branch '2396-add-thread-trampoline-for-thread-accounting' into 'main'

Resolve "BIND 9.16 unit tests failing reliably on x86_64 NUMA machines"

Closes #2396

See merge request isc-projects/bind9!4687

5 years agoAdd CHANGES note for GL #2396
Ondřej Surý [Tue, 16 Feb 2021 20:43:04 +0000 (21:43 +0100)] 
Add CHANGES note for GL #2396

5 years agoChange the isc_thread_self() return type to uintptr_t
Ondřej Surý [Tue, 16 Feb 2021 18:54:04 +0000 (19:54 +0100)] 
Change the isc_thread_self() return type to uintptr_t

The pthread_self(), thrd_current() or GetCurrentThreadId() could
actually be a pointer, so we should rather convert the value into
uintptr_t instead of unsigned long.

5 years agoUse globally assigned thread_id in the isc_hp API
Ondřej Surý [Tue, 16 Feb 2021 15:02:51 +0000 (16:02 +0100)] 
Use globally assigned thread_id in the isc_hp API

Convert the isc_hp API to use the globally available isc_tid_v instead
of locally defined tid_v.  This should solve most of the problems on
machines with many number of cores / CPUs.

5 years agoAdd isc_trampoline API to have simple accounting around threads
Ondřej Surý [Tue, 16 Feb 2021 14:57:39 +0000 (15:57 +0100)] 
Add isc_trampoline API to have simple accounting around threads

The current isc_hp API uses internal tid_v variable that gets
incremented for each new thread using hazard pointers.  This tid_v
variable is then used as a index to global shared table with hazard
pointers state.  Since the tid_v is only incremented and never
decremented the table could overflow very quickly if we create set of
threads for short period of time, they finish the work and cease to
exist.  Then we create identical set of threads and so on and so on.
This is not a problem for a normal `named` operation as the set of
threads is stable, but the problematic place are the unit tests where we
test network manager or other APIs (task, timer) that create threads.

This commits adds a thin wrapper around any function called from
isc_thread_create() that adds unique-but-reusable small digit thread id
that can be used as index to f.e. hazard pointer tables.  The trampoline
wrapper ensures that the thread ids will be reused, so the highest
thread_id number doesn't grow indefinitely when threads are created and
destroyed and then created again.  This fixes the hazard pointer table
overflow on machines with many cores. [GL #2396]

5 years agoMerge branch '2503-stale-answer-client-timeout-crash' into 'main'
Matthijs Mekking [Thu, 25 Feb 2021 11:03:13 +0000 (11:03 +0000)] 
Merge branch '2503-stale-answer-client-timeout-crash' into 'main'

Resolve "New stale-answer-client-timeout crashes BIND 9.16 and 9.17"

Closes #2503

See merge request isc-projects/bind9!4714

5 years agoAdd CHANGES and release notes for GL #2503
Matthijs Mekking [Thu, 18 Feb 2021 15:22:32 +0000 (16:22 +0100)] 
Add CHANGES and release notes for GL #2503

5 years agoDon't servfail on staleonly lookups
Matthijs Mekking [Mon, 22 Feb 2021 11:08:49 +0000 (12:08 +0100)] 
Don't servfail on staleonly lookups

When a staleonly lookup doesn't find a satisfying answer, it should
not try to respond to the client.

This is not true when the initial lookup is staleonly (that is when
'stale-answer-client-timeout' is set to 0), because no resolver fetch
has been created at this point. In this case continue with the lookup
normally.

5 years agoDon't allow recursion on staleonly lookups
Matthijs Mekking [Thu, 18 Feb 2021 15:09:41 +0000 (16:09 +0100)] 
Don't allow recursion on staleonly lookups

Fix a crash that can happen in the following scenario:

A client request is received. There is no data for it in the cache,
(not even stale data). A resolver fetch is created as part of
recursion.

Some time later, the fetch still hasn't completed, and
stale-answer-client-timeout is triggered. A staleonly lookup is
started. It will also find no data in the cache.

So 'query_lookup()' will call 'query_gotanswer()' with ISC_R_NOTFOUND,
so this will call 'query_notfound()' and this will start recursion.

We will eventually end up in 'ns_query_recurse()' and that requires
the client query fetch to be NULL:

    REQUIRE(client->query.fetch == NULL);

If the previously started fetch is still running this assertion
fails.

The crash is easily prevented by not requiring recursion for
staleonly lookups.

Also remove a redundant setting of the staleonly flag at the end of
'query_lookup_staleonly()' before destroying the query context.

Add a system test to catch this case.

5 years agoMerge branch '2498-nsec3-dynamic-update-dnssec-policy' into 'main'
Matthijs Mekking [Thu, 25 Feb 2021 09:49:29 +0000 (09:49 +0000)] 
Merge branch '2498-nsec3-dynamic-update-dnssec-policy' into 'main'

Resolve "Regression in BIND 9.16.10, DNSSEC fails due to improper NSEC3 creation witihin named"

Closes #2498

See merge request isc-projects/bind9!4739

5 years agoAdd changes and notes for [#2498]
Matthijs Mekking [Wed, 24 Feb 2021 09:23:14 +0000 (10:23 +0100)] 
Add changes and notes for [#2498]

5 years agoFix dnssec-policy NSEC3 on dynamic zones
Matthijs Mekking [Wed, 24 Feb 2021 08:35:06 +0000 (09:35 +0100)] 
Fix dnssec-policy NSEC3 on dynamic zones

When applying dnssec-policy on a dynamic zone (e.g. that allows Dynamic
Updates), the NSEC3 parameters were put on the queue, but they were
not being processed (until a reload of the zone or reconfiguration).

Process the NSEC3PARAM queue on zone postload when handling a
dynamic zone.

5 years agoAdd tests for NSEC3 on dynamic zones
Matthijs Mekking [Tue, 23 Feb 2021 14:35:47 +0000 (15:35 +0100)] 
Add tests for NSEC3 on dynamic zones

GitLab issue #2498 is a bug report on NSEC3 with dynamic zones. Tests
for it in the nsec3 system test directory were missing.

5 years agoMerge branch '2507-cid-320483-api-usage-errors-lock' into 'main'
Mark Andrews [Thu, 25 Feb 2021 05:54:20 +0000 (05:54 +0000)] 
Merge branch '2507-cid-320483-api-usage-errors-lock' into 'main'

Resolve "CID 320483:  API usage errors  (LOCK)"

Closes #2507

See merge request isc-projects/bind9!4721

5 years agoAddress unbalanced lock/unlock
Mark Andrews [Sun, 21 Feb 2021 21:44:31 +0000 (08:44 +1100)] 
Address unbalanced lock/unlock

Also address race between reading and testing mpctx->allocated
and incrementing mpctx->allocated.

5 years agoMerge branch '2519-disable-assertion-in-DLL_THREAD_ATTACH-DLL_THREAD_DETACH' into...
Ondřej Surý [Wed, 24 Feb 2021 08:03:16 +0000 (08:03 +0000)] 
Merge branch '2519-disable-assertion-in-DLL_THREAD_ATTACH-DLL_THREAD_DETACH' into 'main'

Disable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH

Closes #2519

See merge request isc-projects/bind9!4738

5 years agoDisable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH
Ondřej Surý [Wed, 24 Feb 2021 05:55:36 +0000 (06:55 +0100)] 
Disable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH

The BIND 9 libraries on Windows define DllMain() optional entry point
into a dynamic-link library (DLL).  When the system starts or terminates
a process or thread, it calls the entry-point function for each loaded
DLL using the first thread of the process.

When the DLL is being loaded into the virtual address space of the
current process as a result of the process starting up, we make a call
to DisableThreadLibraryCalls() which should disable the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified
dynamic-link library (DLL).

This seems not be the case because we never check the return value of
the DisableThreadLibraryCalls() call, and it could in fact fail.  The
DisableThreadLibraryCalls() function fails if the DLL specified by
hModule has active static thread local storage, or if hModule is an
invalid module handle.

In this commit, we remove the safe-guard assertion put in place for the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH events and we just ignore them.
BIND 9 doesn't create/destroy enough threads for it actually to make any
difference, and in fact we do use static thread local storage in the
code.

5 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Tue, 23 Feb 2021 22:53:34 +0000 (22:53 +0000)] 
Merge branch 'marka-placeholder' into 'main'

add placeholder

See merge request isc-projects/bind9!4737

5 years agoadd placeholder
Mark Andrews [Tue, 23 Feb 2021 22:49:27 +0000 (09:49 +1100)] 
add placeholder

5 years agoMerge branch '2446-query-c-5430-16-runtime-error' into 'main'
Michal Nowak [Tue, 23 Feb 2021 15:43:50 +0000 (15:43 +0000)] 
Merge branch '2446-query-c-5430-16-runtime-error' into 'main'

Initialize checknames field in dns_view_create()

Closes #2446

See merge request isc-projects/bind9!4706

5 years agoInitialize checknames field in dns_view_create()
Michal Nowak [Mon, 22 Feb 2021 12:50:11 +0000 (13:50 +0100)] 
Initialize checknames field in dns_view_create()

The 'checknames' field wasn't initialized in dns_view_create(), but it
should otherwise AddressSanitizer identifies the following runtime error
in query_test.c.

    runtime error: load of value 190, which is not a valid value for type '_Bool'