]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoMerge branch '2037-confidential-issue' into 'security-main'
Michał Kępień [Wed, 5 Aug 2020 13:54:14 +0000 (13:54 +0000)] 
Merge branch '2037-confidential-issue' into 'security-main'

[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used

See merge request isc-private/bind9!187

5 years agoAdd CHANGES and release note for GL #2037
Ondřej Surý [Tue, 21 Jul 2020 13:24:21 +0000 (15:24 +0200)] 
Add CHANGES and release note for GL #2037

5 years agoDon't strip the SOFTHSM2_CONF and SLOT environment variables when using ./run.sh
Ondřej Surý [Tue, 21 Jul 2020 14:03:44 +0000 (16:03 +0200)] 
Don't strip the SOFTHSM2_CONF and SLOT environment variables when using ./run.sh

5 years agoFix crash in pk11_numbits() when native-pkcs11 is used
Ondřej Surý [Tue, 21 Jul 2020 12:42:47 +0000 (14:42 +0200)] 
Fix crash in pk11_numbits() when native-pkcs11 is used

When pk11_numbits() is passed a user provided input that contains all
zeroes (via crafted DNS message), it would crash with assertion
failure.  Fix that by properly handling such input.

5 years agoMerge branch '2028-unexpectedend-and-tsig' into 'security-main'
Michał Kępień [Wed, 5 Aug 2020 13:50:27 +0000 (13:50 +0000)] 
Merge branch '2028-unexpectedend-and-tsig' into 'security-main'

[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries

See merge request isc-private/bind9!185

5 years agoAdd CHANGES and release notes for GL #2028
Mark Andrews [Wed, 15 Jul 2020 23:15:20 +0000 (09:15 +1000)] 
Add CHANGES and release notes for GL #2028

5 years agoAlways keep a copy of the message
Mark Andrews [Wed, 15 Jul 2020 06:07:51 +0000 (16:07 +1000)] 
Always keep a copy of the message

this allows it to be available even when dns_message_parse()
returns a error.

5 years agoMerge branch '1997-confidential-issue' into 'security-main'
Michał Kępień [Wed, 5 Aug 2020 13:46:23 +0000 (13:46 +0000)] 
Merge branch '1997-confidential-issue' into 'security-main'

[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding

See merge request isc-private/bind9!184

5 years agoAdd CHANGES and release note for GL #1997
Evan Hunt [Fri, 10 Jul 2020 21:14:07 +0000 (14:14 -0700)] 
Add CHANGES and release note for GL #1997

5 years agopermanently disable QNAME minimization in a fetch when forwarding
Evan Hunt [Fri, 10 Jul 2020 20:53:30 +0000 (13:53 -0700)] 
permanently disable QNAME minimization in a fetch when forwarding

QNAME minimization is normally disabled when forwarding. if, in the
course of processing a fetch, we switch back to normal recursion at
some point, we can't safely start minimizing because we may have
been left in an inconsistent state.

5 years agoMerge branch '1996-confidential-issue' into 'security-main'
Michał Kępień [Wed, 5 Aug 2020 13:31:59 +0000 (13:31 +0000)] 
Merge branch '1996-confidential-issue' into 'security-main'

[CVE-2020-8620] Fix TCP DNS buffer sizes

See merge request isc-private/bind9!181

5 years agoAdd CHANGES and release note for GL #1996
Ondřej Surý [Fri, 31 Jul 2020 07:39:46 +0000 (09:39 +0200)] 
Add CHANGES and release note for GL #1996

5 years agoUse different allocators for UDP and TCP
Evan Hunt [Thu, 2 Jul 2020 14:27:38 +0000 (16:27 +0200)] 
Use different allocators for UDP and TCP

Each worker has a receive buffer with space for 20 DNS messages of up
to 2^16 bytes each, and the allocator function passed to uv_read_start()
or uv_udp_recv_start() will reserve a portion of it for use by sockets.
UDP can use recvmmsg() and so it needs that entire space, but TCP reads
one message at a time.

This commit introduces separate allocator functions for TCP and UDP
setting different buffer size limits, so that libuv will provide the
correct buffer sizes to each of them.

5 years agoMerge branch 'michal/remove-arm64-jobs-from-gitlab-ci' into 'main'
Michał Kępień [Wed, 5 Aug 2020 10:07:20 +0000 (10:07 +0000)] 
Merge branch 'michal/remove-arm64-jobs-from-gitlab-ci' into 'main'

Remove arm64 jobs from GitLab CI

See merge request isc-projects/bind9!3920

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.

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

Set "max-cache-size" in the "geoip2" system test

Closes #2065

See merge request isc-projects/bind9!3919

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 e24bc324b455d9cad7b51acd3d5c7b4e40c66187 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.

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

Resolve "BIND ARM incorrectly documents the processing of forwarders (still has the pre 9.3.0 explanation)"

Closes #2030

See merge request isc-projects/bind9!3881

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

5 years agoMerge branch 'michal/add-placeholder-for-1475' into 'main'
Michał Kępień [Tue, 4 Aug 2020 13:49:37 +0000 (13:49 +0000)] 
Merge branch 'michal/add-placeholder-for-1475' into 'main'

Add placeholder for #1475

See merge request isc-projects/bind9!3916

5 years agoAdd placeholder for #1475
Michał Kępień [Tue, 4 Aug 2020 13:46:34 +0000 (15:46 +0200)] 
Add placeholder for #1475

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

Map DNS_R_BADTSIG to FORMERR

See merge request isc-projects/bind9!3877

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

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.

5 years agoMerge branch 'ondrej/serve-stale-improvements' into 'main'
Matthijs Mekking [Tue, 4 Aug 2020 12:17:57 +0000 (12:17 +0000)] 
Merge branch 'ondrej/serve-stale-improvements' into 'main'

Serve-stale improvements

Closes #1712 and #1829

See merge request isc-projects/bind9!3872

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

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.

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".

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.

5 years agoMerge branch '2026-readme-md-typo' into 'main'
Mark Andrews [Tue, 4 Aug 2020 02:23:54 +0000 (02:23 +0000)] 
Merge branch '2026-readme-md-typo' into 'main'

Resolve "README.md -- typo"

Closes #2026

See merge request isc-projects/bind9!3912

5 years agoFixup typo in 'xcode-select --install'
Mark Andrews [Tue, 4 Aug 2020 02:19:15 +0000 (12:19 +1000)] 
Fixup typo in 'xcode-select --install'

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

Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3910

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

5 years agoMerge branch 'ondrej/add-isc_lex-fuzzing-test' into 'main'
Ondřej Surý [Fri, 31 Jul 2020 15:55:58 +0000 (15:55 +0000)] 
Merge branch 'ondrej/add-isc_lex-fuzzing-test' into 'main'

Re-enable tests in fuzz directory and add isc_lex_gettoken() and isc_lex_getmastertoken() tests

See merge request isc-projects/bind9!3908

5 years agoAdd fuzzing for the isc_lex (isc_lex_gettoken,isc_lex_getmastertoken) API
Ondřej Surý [Fri, 31 Jul 2020 11:53:38 +0000 (13:53 +0200)] 
Add fuzzing for the isc_lex (isc_lex_gettoken,isc_lex_getmastertoken) API

In this commit, the simple fuzzing tests for the isc_lex_gettoken() and
isc_lex_getmastertoken() functions have been added.

As part of this commit, the initialization has been moved from fuzz.h
constructor/destructor to LLVMFuzzerInitialize() in each fuzz test.  The
main.c of no-fuzzing and AFL modes have been modified to run the
LLVMFuzzerInitialize() at the start of the main() function mimicking
the libfuzzer mode of operation.

5 years agoRe-enable the fuzzing tests
Ondřej Surý [Fri, 31 Jul 2020 13:20:56 +0000 (15:20 +0200)] 
Re-enable the fuzzing tests

The fuzzing tests were temporarily disabled when the build system has been
converted to automake.  This commit restores the functionality to run the
fuzzing tests as part of the `make check`.  When the afl or libfuzzer
is enabled via ./configure, it uses a custom LOG_DRIVER (fuzz/<fuzzer.sh>).

Currently only libfuzzer.sh has been implemented that runs each fuzz
test for 5 seconds each.

5 years agoMerge branch '2038-use-freebind-when-bind-fails' into 'main'
Ondřej Surý [Fri, 31 Jul 2020 11:32:40 +0000 (11:32 +0000)] 
Merge branch '2038-use-freebind-when-bind-fails' into 'main'

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

Closes #2038

See merge request isc-projects/bind9!3873

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

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.

5 years agoMerge branch 'ondrej/remove-distros-near-eol' into 'main'
Ondřej Surý [Fri, 31 Jul 2020 10:27:03 +0000 (10:27 +0000)] 
Merge branch 'ondrej/remove-distros-near-eol' into 'main'

Remove CentOS 6 from GitLab CI, it will EOL before BIND 9.18 is released

See merge request isc-projects/bind9!3799

5 years agoRemove CentOS 6 from GitLab CI
Ondřej Surý [Thu, 2 Jul 2020 09:27:39 +0000 (11:27 +0200)] 
Remove CentOS 6 from GitLab CI

CentOS 6 will reach EoL on November 30th, 2020, i.e. before BIND 9.18
will be released.  Remove it from GitLab CI.

5 years agoMerge branch 'ondrej/documentation-rebuild' into 'main'
Ondřej Surý [Fri, 31 Jul 2020 08:52:28 +0000 (08:52 +0000)] 
Merge branch 'ondrej/documentation-rebuild' into 'main'

Rebuild the documentation

See merge request isc-projects/bind9!3905

5 years agoRebuild the documentation
Ondřej Surý [Fri, 31 Jul 2020 07:54:57 +0000 (09:54 +0200)] 
Rebuild the documentation

5 years agoMerge branch 'ondrej/august-release-placeholders-1' into 'main'
Ondřej Surý [Fri, 31 Jul 2020 07:28:38 +0000 (07:28 +0000)] 
Merge branch 'ondrej/august-release-placeholders-1' into 'main'

Add placeholders for August release

See merge request isc-projects/bind9!3903

5 years agoAdd CHANGES placeholder for [GL #2055]
Ondřej Surý [Fri, 31 Jul 2020 07:27:00 +0000 (09:27 +0200)] 
Add CHANGES placeholder for [GL #2055]

5 years agoAdd CHANGES placeholder for [GL #1997]
Ondřej Surý [Fri, 31 Jul 2020 07:24:56 +0000 (09:24 +0200)] 
Add CHANGES placeholder for [GL #1997]

5 years agoAdd CHANGES placeholder for [GL #1996]
Ondřej Surý [Fri, 31 Jul 2020 07:23:52 +0000 (09:23 +0200)] 
Add CHANGES placeholder for [GL #1996]

5 years agoAdd CHANGES placeholder for [GL #2037]
Ondřej Surý [Fri, 31 Jul 2020 07:21:32 +0000 (09:21 +0200)] 
Add CHANGES placeholder for [GL #2037]

5 years agoMerge branch '2020-configure-call-needs-to-be-cleaned-up-main-gcc-centos6-amd64'...
Mark Andrews [Fri, 31 Jul 2020 06:26:11 +0000 (06:26 +0000)] 
Merge branch '2020-configure-call-needs-to-be-cleaned-up-main-gcc-centos6-amd64' into 'main'

Resolve "configure call needs to be cleaned up main: gcc:centos6:amd64"

Closes #2020

See merge request isc-projects/bind9!3853

5 years agoremove --with-python from summary
Mark Andrews [Fri, 31 Jul 2020 05:16:20 +0000 (15:16 +1000)] 
remove --with-python from summary

5 years agoremove references to --with-libtool
Mark Andrews [Thu, 30 Jul 2020 01:53:17 +0000 (11:53 +1000)] 
remove references to --with-libtool

5 years agoRemove --with-libtool comment from README
Mark Andrews [Thu, 30 Jul 2020 01:50:32 +0000 (11:50 +1000)] 
Remove --with-libtool comment from README

5 years agoRemove no longer valid configure flags from configure calls:
Mark Andrews [Tue, 14 Jul 2020 02:32:40 +0000 (12:32 +1000)] 
Remove no longer valid configure flags from configure calls:

--with-libtool, --without-make-clean, --with-python

5 years agoMerge branch '1456-always-check-return-from-isc_refcount_decrement' into 'main'
Mark Andrews [Fri, 31 Jul 2020 00:56:45 +0000 (00:56 +0000)] 
Merge branch '1456-always-check-return-from-isc_refcount_decrement' into 'main'

Resolve "always check return from isc_refcount_decrement"

Closes #1456

See merge request isc-projects/bind9!2707

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.

5 years agoMerge branch '2033-rndc-dnstap-roll-fix-was-incomplete' into 'main'
Mark Andrews [Thu, 30 Jul 2020 23:59:42 +0000 (23:59 +0000)] 
Merge branch '2033-rndc-dnstap-roll-fix-was-incomplete' into 'main'

Resolve "'rndc dnstap --roll' fix was incomplete"

Closes #2033

See merge request isc-projects/bind9!3868

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].

5 years agoMerge branch '48-drop-systemtesttop-from-bin-tests-system' into 'main'
Michal Nowak [Thu, 30 Jul 2020 14:14:39 +0000 (14:14 +0000)] 
Merge branch '48-drop-systemtesttop-from-bin-tests-system' into 'main'

Drop $SYSTEMTESTTOP from bin/tests/system/

Closes #48

See merge request isc-projects/bind9!3623

5 years agoMake sure we don't introduce SYSTEMTESTTOP anymore
Michal Nowak [Tue, 28 Jul 2020 12:42:55 +0000 (14:42 +0200)] 
Make sure we don't introduce SYSTEMTESTTOP anymore

':!.gitlab-ci.yml' is a pathspec pattern used to limit paths in the "git
grep" command to all but the .gitlab-ci.yml file which includes the
checked word itself. This requires Git 2.13.

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 agoSource config.guess from source root
Michal Nowak [Tue, 21 Jul 2020 14:29:14 +0000 (16:29 +0200)] 
Source config.guess from source root

It seems that config.guess gets always created in source root, so for
that sake of out-of-tree system test, we should expect the file there
instead of where configure was run.

5 years agoDrop $SYSTEMTESTTOP from bin/tests/system/
Michal Nowak [Tue, 21 Jul 2020 10:12:59 +0000 (12:12 +0200)] 
Drop $SYSTEMTESTTOP from bin/tests/system/

The $SYSTEMTESTTOP shell variable if often set to .. in various shell
scripts inside bin/tests/system/, but most of the time it is only
used one line later, while sourcing conf.sh. This hardly improves
code readability.

$SYSTEMTESTTOP is also used for the purpose of referencing
scripts/files living in bin/tests/system/, but given that the
variable is always set to a short, relative path, we can drop it and
replace all of its occurrences with the relative path without adversely
affecting code readability.

5 years agoMerge branch 'michal/only-run-system-tests-as-root-in-developer-mode' into 'main'
Michał Kępień [Thu, 30 Jul 2020 13:45:00 +0000 (13:45 +0000)] 
Merge branch 'michal/only-run-system-tests-as-root-in-developer-mode' into 'main'

Only run system tests as root in developer mode

See merge request isc-projects/bind9!3894

5 years agoOnly run system tests as root in developer mode
Michał Kępień [Thu, 30 Jul 2020 12:07:49 +0000 (14:07 +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).

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

Fix idle timeout for connected TCP sockets

Closes #2024

See merge request isc-projects/bind9!3854

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

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.

5 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Wed, 29 Jul 2020 23:39:16 +0000 (23:39 +0000)] 
Merge branch 'marka-placeholder' into 'main'

placeholder for [GL #2028]

See merge request isc-projects/bind9!3893

5 years agoplaceholder for [GL #2028]
Mark Andrews [Wed, 29 Jul 2020 23:34:58 +0000 (09:34 +1000)] 
placeholder for [GL #2028]

5 years agoMerge branch '2050-libuv-version' into 'main'
Evan Hunt [Tue, 28 Jul 2020 02:49:19 +0000 (02:49 +0000)] 
Merge branch '2050-libuv-version' into 'main'

report libuv version string in `named -V`

Closes #2050

See merge request isc-projects/bind9!3887

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`

5 years agoMerge branch '2031-win32-fix' into 'main'
Evan Hunt [Mon, 27 Jul 2020 21:33:07 +0000 (21:33 +0000)] 
Merge branch '2031-win32-fix' into 'main'

Resolve "Windows crashes with netmgr-based statschannel"

Closes #2031

See merge request isc-projects/bind9!3888

5 years agoinitialize, rather than invalidating, new http buffers
Evan Hunt [Mon, 27 Jul 2020 18:03:33 +0000 (11:03 -0700)] 
initialize, rather than invalidating, new http buffers

when building without ISC_BUFFER_USEINLINE (which is the default on
Windows) an assertion failure could occur when setting up a new
isc_httpd_t object for the statistics channel.

5 years agoMerge branch '1619-rpz-wildcard-passthru-ignored' into 'main'
Diego dos Santos Fronza [Mon, 27 Jul 2020 14:34:08 +0000 (14:34 +0000)] 
Merge branch '1619-rpz-wildcard-passthru-ignored' into 'main'

Resolve "RPZ wildcard passthru ignored"

Closes #1619

See merge request isc-projects/bind9!3682

5 years agoAdd CHANGES entry
Diego Fronza [Fri, 12 Jun 2020 18:14:53 +0000 (15:14 -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 '1999-add-a-regular-make-dist-job-to-ci' into 'main'
Michal Nowak [Fri, 24 Jul 2020 13:53:54 +0000 (13:53 +0000)] 
Merge branch '1999-add-a-regular-make-dist-job-to-ci' into 'main'

Add a regular "make dist" job to CI

Closes #1999

See merge request isc-projects/bind9!3803

5 years agoAdd a regular "make dist" job to CI
Michal Nowak [Fri, 3 Jul 2020 08:41:53 +0000 (10:41 +0200)] 
Add a regular "make dist" job to CI

It's easy to break "make dist" by adding and moving files around.
We should test this scenario regularly, to prevent release-time
surprises.

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:19:45 +0000 (05:19 +0000)] 
Merge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time' into 'main'

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

Closes #2043

See merge request isc-projects/bind9!3880

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

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.

5 years agoMerge branch 'marka-add-fallthrough' into 'main'
Mark Andrews [Fri, 24 Jul 2020 04:15:03 +0000 (04:15 +0000)] 
Merge branch 'marka-add-fallthrough' into 'main'

Add fallthrough and braces

See merge request isc-projects/bind9!3884

5 years agoAdd fallthrough and braces
Mark Andrews [Fri, 24 Jul 2020 03:49:56 +0000 (13:49 +1000)] 
Add fallthrough and braces

5 years agoMerge branch 'feature/master/unix-cleanup' into 'main'
Mark Andrews [Fri, 24 Jul 2020 03:02:07 +0000 (03:02 +0000)] 
Merge branch 'feature/master/unix-cleanup' into 'main'

Remove few lines in unix socket handling

See merge request isc-projects/bind9!2687

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.

5 years agoMerge branch 'dstlib-failure-abort' into 'main'
Mark Andrews [Thu, 23 Jul 2020 00:46:12 +0000 (00:46 +0000)] 
Merge branch 'dstlib-failure-abort' into 'main'

Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3876

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.

5 years agoMerge branch '1727-drop-use-of-featuretest-have-dlopen' into 'main'
Michal Nowak [Tue, 21 Jul 2020 09:24:38 +0000 (09:24 +0000)] 
Merge branch '1727-drop-use-of-featuretest-have-dlopen' into 'main'

Drop feature test for dlopen()

Closes #1727

See merge request isc-projects/bind9!3625

5 years agoDrop feature test for dlopen()
Michal Nowak [Tue, 2 Jun 2020 16:50:49 +0000 (18:50 +0200)] 
Drop feature test for dlopen()

With libtool being mandatory from 9.17 on, so is dlopen() (via libltdl).

5 years agoMerge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing...
Ondřej Surý [Tue, 21 Jul 2020 08:38:26 +0000 (08:38 +0000)] 
Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries' into 'main'

Fix the rbt hashtable and grow it when setting max-cache-size

Closes #1775

See merge request isc-projects/bind9!3865

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

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.

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.

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.

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.

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/

5 years agoMerge branch 'mnowak/try-harder-to-analyze-cores' into 'main'
Michal Nowak [Mon, 20 Jul 2020 08:13:37 +0000 (08:13 +0000)] 
Merge branch 'mnowak/try-harder-to-analyze-cores' into 'main'

Rationalize backtrace logging, fail on core file presence

See merge request isc-projects/bind9!3867