]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoMerge branch 'ondrej/call-failed_read-from-tls_error' into 'main'
Ondřej Surý [Fri, 19 Mar 2021 14:57:53 +0000 (14:57 +0000)] 
Merge branch 'ondrej/call-failed_read-from-tls_error' into 'main'

Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket

See merge request isc-projects/bind9!4824

5 years agoCall isc__nm_tlsdns_failed_read on tls_error to cleanup the socket
Ondřej Surý [Fri, 19 Mar 2021 14:08:14 +0000 (15:08 +0100)] 
Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket

In tls_error(), we now call isc__nm_tlsdns_failed_read() instead of just
stopping timer and reading from the socket.  This allows us to properly
cleanup any pending operation on the socket.

5 years agoMerge branch 'treysis-filter-a' into 'main'
Matthijs Mekking [Fri, 19 Mar 2021 09:41:02 +0000 (09:41 +0000)] 
Merge branch 'treysis-filter-a' into 'main'

filter-a plugin

Closes #2585

See merge request isc-projects/bind9!4816

5 years agoAdd changes for filter-a plugin
Matthijs Mekking [Thu, 18 Mar 2021 10:20:17 +0000 (11:20 +0100)] 
Add changes for filter-a plugin

5 years agoAdd filter-a plugin for IPv6-dominant environments
treysis [Wed, 3 Mar 2021 10:33:55 +0000 (11:33 +0100)] 
Add filter-a plugin for IPv6-dominant environments

(cherry picked from commit 78f6cd57e1cc166823415438fe2d19a324cf7a67)

5 years agoMerge branch '2581-oldsize-assertion' into 'main'
Ondřej Surý [Thu, 18 Mar 2021 22:03:25 +0000 (22:03 +0000)] 
Merge branch '2581-oldsize-assertion' into 'main'

Fix memory accounting bug in TLSDNS

Closes #2581

See merge request isc-projects/bind9!4809

5 years agoCall the isc__nm_failed_connect_cb() early when shutting down
Ondřej Surý [Thu, 18 Mar 2021 20:37:12 +0000 (21:37 +0100)] 
Call the isc__nm_failed_connect_cb() early when shutting down

When shutting down, calling the isc__nm_failed_connect_cb() was delayed
until the connect callback would be called.  It turned out that the
connect callback might not get called at all when the socket is being
shut down.  Call the failed_connect_cb() directly in the
tlsdns_shutdown() instead of waiting for the connect callback to call it.

5 years agoFix typo in processbuffer() - tcpdns vs tlsdns
Ondřej Surý [Thu, 18 Mar 2021 20:19:18 +0000 (21:19 +0100)] 
Fix typo in processbuffer() - tcpdns vs tlsdns

The processbuffer() would call isc__nm_tcpdns_processbuffer() instead of
isc__nm_tlsdns_processbuffer() for the isc_nm_tlsdnssocket type of
socket.

5 years agoFix memory accounting bug in TLSDNS
Ondřej Surý [Thu, 18 Mar 2021 17:14:38 +0000 (18:14 +0100)] 
Fix memory accounting bug in TLSDNS

After a partial write the tls.senddata buffer would be rearranged to
contain only the data tha wasn't sent and the len part would be made
shorter, which would lead to attempt to free only part of a socket's
tls.senddata buffer.

5 years agoMerge branch 'ondrej/fix-dangling-uvreq-in-tlsdns' into 'main'
Ondřej Surý [Thu, 18 Mar 2021 17:02:18 +0000 (17:02 +0000)] 
Merge branch 'ondrej/fix-dangling-uvreq-in-tlsdns' into 'main'

Fix dangling uvreq when data is sent from tlsdns_cycle()

See merge request isc-projects/bind9!4820

5 years agoFix dangling uvreq when data is sent from tlsdns_cycle()
Ondřej Surý [Fri, 29 Jan 2021 12:00:46 +0000 (13:00 +0100)] 
Fix dangling uvreq when data is sent from tlsdns_cycle()

The tlsdns_cycle() might call uv_write() to write data to the socket,
when this happens and the socket is shutdown before the callback
completes, the uvreq structure was not freed because the callback would
be called with non-zero status code.

5 years agoMerge branch '2573-dont-timeout-when-sending-data' into 'main'
Ondřej Surý [Thu, 18 Mar 2021 16:01:01 +0000 (16:01 +0000)] 
Merge branch '2573-dont-timeout-when-sending-data' into 'main'

Resolve "Fix TCPDNS and TLSDNS timers"

Closes #2583 and #2573

See merge request isc-projects/bind9!4807

5 years agoMerge branch 'v9_17_11-release' into 'main'
Michal Nowak [Thu, 18 Mar 2021 15:38:54 +0000 (15:38 +0000)] 
Merge branch 'v9_17_11-release' into 'main'

Merge 9.17.11 release branch

See merge request isc-projects/bind9!4818

5 years agoAdd CHANGES and release note for GL #2573
Ondřej Surý [Wed, 17 Mar 2021 12:42:19 +0000 (13:42 +0100)] 
Add CHANGES and release note for GL #2573

5 years agoChange the isc_nm_(get|set)timeouts() to work with milliseconds
Ondřej Surý [Thu, 18 Mar 2021 10:16:45 +0000 (11:16 +0100)] 
Change the isc_nm_(get|set)timeouts() to work with milliseconds

The RFC7828 specifies the keepalive interval to be 16-bit, specified in
units of 100 milliseconds and the configuration options tcp-*-timeouts
are following the suit.  The units of 100 milliseconds are very
unintuitive and while we can't change the configuration and presentation
format, we should not follow this weird unit in the API.

This commit changes the isc_nm_(get|set)timeouts() functions to work
with milliseconds and convert the values to milliseconds before passing
them to the function, not just internally.

5 years agoMerge the common parts between udp, tcpdns and tlsdns protocol
Ondřej Surý [Thu, 18 Mar 2021 08:27:38 +0000 (09:27 +0100)] 
Merge the common parts between udp, tcpdns and tlsdns protocol

The udp, tcpdns and tlsdns contained lot of cut&paste code or code that
was very similar making the stack harder to maintain as any change to
one would have to be copied to the the other protocols.

In this commit, we merge the common parts into the common functions
under isc__nm_<foo> namespace and just keep the little differences based
on the socket type.

5 years agoFix TCPDNS and TLSDNS timers
Ondřej Surý [Tue, 16 Mar 2021 08:03:02 +0000 (09:03 +0100)] 
Fix TCPDNS and TLSDNS timers

After the TCPDNS refactoring the initial and idle timers were broken and
only the tcp-initial-timeout was always applied on the whole TCP
connection.

This broke any TCP connection that took longer than tcp-initial-timeout,
most often this would affect large zone AXFRs.

This commit changes the timeout logic in this way:

  * On TCP connection accept the tcp-initial-timeout is applied
    and the timer is started
  * When we are processing and/or sending any DNS message the timer is
    stopped
  * When we stop processing all DNS messages, the tcp-idle-timeout
    is applied and the timer is started again

5 years agoAdd TCP timeouts system test
Ondřej Surý [Wed, 17 Mar 2021 11:20:40 +0000 (12:20 +0100)] 
Add TCP timeouts system test

The system tests were missing a test that would test tcp-initial-timeout
and tcp-idle-timeout.

This commit adds new "timeouts" system test that adds:

  * Test that waits longer than tcp-initial-timeout and then checks
    whether the socket was closed

  * Test that sends and receives DNS message then waits longer than
    tcp-initial-timeout but shorter time than tcp-idle-timeout than
    sends DNS message again than waits longer than tcp-idle-timeout
    and checks whether the socket was closed

  * Similar test, but bursting 25 DNS messages than waiting longer than
    tcp-initial-timeout and shorter than tcp-idle-timeout than do second
    25 DNS message burst

  * Check whether transfer longer than tcp-initial-timeout succeeds

5 years agoSet up release notes for BIND 9.17.12
Michal Nowak [Thu, 18 Mar 2021 14:58:15 +0000 (15:58 +0100)] 
Set up release notes for BIND 9.17.12

5 years agoUpdate BIND version to 9.17.11
Michal Nowak [Tue, 9 Mar 2021 10:44:13 +0000 (11:44 +0100)] 
Update BIND version to 9.17.11

5 years agoAdd a CHANGES marker
Michal Nowak [Tue, 9 Mar 2021 10:42:48 +0000 (11:42 +0100)] 
Add a CHANGES marker

5 years agoMerge branch 'mnowak/prepare-documentation-for-bind-9.17.11' into 'v9_17_11-release'
Michal Nowak [Tue, 9 Mar 2021 09:17:19 +0000 (09:17 +0000)] 
Merge branch 'mnowak/prepare-documentation-for-bind-9.17.11' into 'v9_17_11-release'

Prepare documentation for BIND 9.17.11

See merge request isc-private/bind9!252

5 years agoPrepare release notes for BIND 9.17.11
Michal Nowak [Mon, 8 Mar 2021 10:57:02 +0000 (11:57 +0100)] 
Prepare release notes for BIND 9.17.11

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.