]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoDefer read of zl->server and zl->reconfig until
Mark Andrews [Fri, 21 Aug 2020 09:51:59 +0000 (19:51 +1000)] 
Defer read of zl->server and zl->reconfig until

the reference counter has gone to zero and there is
no longer a possibility of changes in other threads.

5 years agoMerge branch '2120-the-dynamic-load-flags-are-inconsistent-with-thread-analysis'...
Mark Andrews [Mon, 7 Sep 2020 22:20:26 +0000 (22:20 +0000)] 
Merge branch '2120-the-dynamic-load-flags-are-inconsistent-with-thread-analysis' into 'main'

Resolve "The dynamic load flags are inconsistent with thread analysis"

Closes #2120

See merge request isc-projects/bind9!4084

5 years agoDon't run dyndb and dlzexternal if running TSAN as
Mark Andrews [Fri, 28 Aug 2020 06:31:35 +0000 (16:31 +1000)] 
Don't run dyndb and dlzexternal if running TSAN as

the dlopen flags being used are incompatible with TSAN.

5 years agoalphabetize tests/usage
Mark Andrews [Thu, 3 Sep 2020 04:09:38 +0000 (14:09 +1000)] 
alphabetize tests/usage

5 years agoMerge branch 'each-faster-tcp-test' into 'main'
Evan Hunt [Fri, 4 Sep 2020 21:22:20 +0000 (21:22 +0000)] 
Merge branch 'each-faster-tcp-test' into 'main'

shorten the tcp system test

See merge request isc-projects/bind9!4091

5 years agoshorten the tcp system test
Evan Hunt [Fri, 4 Sep 2020 17:58:47 +0000 (10:58 -0700)] 
shorten the tcp system test

the tcp system test uses the 'packet.pl' test tool to send a packet
thousands of times. this took a long time because the tool was waiting
for replies and parsing them; however, for that particular test the
replies aren't relevant.

this commit uses non-blocking sockets and moves the reply parsing
outside the send loop, which speeds the system test up substantially.

5 years agoMerge branch '1919-include-bind-documentation-in-windows-zips' into 'main'
Michał Kępień [Thu, 3 Sep 2020 10:01:55 +0000 (10:01 +0000)] 
Merge branch '1919-include-bind-documentation-in-windows-zips' into 'main'

Include BIND documentation in Windows zips

Closes #1919

See merge request isc-projects/bind9!4085

5 years agoInclude BIND documentation in Windows zips
Michał Kępień [Thu, 3 Sep 2020 08:35:37 +0000 (10:35 +0200)] 
Include BIND documentation in Windows zips

As generated documentation files are no longer stored in the BIND Git
repository, put a copy of the PDF version of the BIND ARM generated by
the "docs" GitLab CI job into the Windows zips to make it easily
available to the end users on that platform.

Make sure Windows zips also contain certain documentation files included
in source tarballs to make the contents of each release more consistent
across different platforms.

5 years agoMerge branch 'marka-check-deny-name-with-grant-subdomain' into 'main'
Mark Andrews [Thu, 3 Sep 2020 06:16:01 +0000 (06:16 +0000)] 
Merge branch 'marka-check-deny-name-with-grant-subdomain' into 'main'

Check 'deny name' + 'grant subdomain' for the same name

See merge request isc-projects/bind9!4079

5 years agoCheck 'deny name' + 'grant subdomain' for the same name
Mark Andrews [Wed, 6 Mar 2019 06:45:03 +0000 (17:45 +1100)] 
Check 'deny name' + 'grant subdomain' for the same name

5 years agoMerge branch '2115-the-load-of-huge-zone-can-take-over-100-secs-when-running-under...
Mark Andrews [Wed, 2 Sep 2020 21:12:02 +0000 (21:12 +0000)] 
Merge branch '2115-the-load-of-huge-zone-can-take-over-100-secs-when-running-under-a-sanitiser' into 'main'

Resolve "The load of huge.zone can take over 100 secs when running under a sanitiser."

Closes #2115

See merge request isc-projects/bind9!4068

5 years agoIncrease zone load timeout in the "rndc" test
Mark Andrews [Mon, 31 Aug 2020 12:09:38 +0000 (22:09 +1000)] 
Increase zone load timeout in the "rndc" test

The "huge.zone" zone can take longer than 100 seconds to load when
running under a sanitizer.  Increase the relevant zone load timeout to
prevent intermittent failures of the "rndc" system test.

5 years agoMerge branch '2091-print-out-more-diagnostics-on-dns_name_issubdomain' into 'main'
Ondřej Surý [Wed, 2 Sep 2020 16:33:19 +0000 (16:33 +0000)] 
Merge branch '2091-print-out-more-diagnostics-on-dns_name_issubdomain' into 'main'

Print diagnostics on dns_name_issubdomain() failure in fctx_create()

Closes #2091

See merge request isc-projects/bind9!4071

5 years agoPrint diagnostics on dns_name_issubdomain() failure in fctx_create()
Ondřej Surý [Mon, 24 Aug 2020 08:15:07 +0000 (10:15 +0200)] 
Print diagnostics on dns_name_issubdomain() failure in fctx_create()

Log diagnostic message when dns_name_issubdomain() in the fctx_create()
when the resolver is qname minimizing and forwarding at the same time.

5 years agoMerge branch '2054-dig-bufsize-0-sets-bufsize-to-4096-2' into 'main'
Ondřej Surý [Wed, 2 Sep 2020 15:01:00 +0000 (15:01 +0000)] 
Merge branch '2054-dig-bufsize-0-sets-bufsize-to-4096-2' into 'main'

Resolve "dig +bufsize=0 sets bufsize to 4096"

Closes #2054

See merge request isc-projects/bind9!4055

5 years agoAdd CHANGES and release note for GL #2054
Mark Andrews [Wed, 29 Jul 2020 02:34:54 +0000 (12:34 +1000)] 
Add CHANGES and release note for GL #2054

5 years ago'dig +bufsize=0' no longer disables EDNS as a side effect.
Mark Andrews [Wed, 29 Jul 2020 02:34:54 +0000 (12:34 +1000)] 
'dig +bufsize=0' no longer disables EDNS as a side effect.

Additionally 'dig +bufsize' restores the default EDNS buffer size.

5 years agoMerge branch '2084-9-11-data-race-in-dispatch_test-2' into 'main'
Mark Andrews [Wed, 2 Sep 2020 13:57:59 +0000 (13:57 +0000)] 
Merge branch '2084-9-11-data-race-in-dispatch_test-2' into 'main'

watch_fd also requires lockfd to be held. (9.16/9.17)

See merge request isc-projects/bind9!4058

5 years agowatch_fd also requires thread->fdlock[lockid] to be held
Mark Andrews [Wed, 2 Sep 2020 04:42:47 +0000 (14:42 +1000)] 
watch_fd also requires thread->fdlock[lockid] to be held

5 years agoremove dead code
Mark Andrews [Wed, 2 Sep 2020 03:26:21 +0000 (13:26 +1000)] 
remove dead code

5 years agoMerge branch '2037-deferred-system-test-tcp-buffers-filling-fix' into 'main'
Ondřej Surý [Wed, 2 Sep 2020 12:16:05 +0000 (12:16 +0000)] 
Merge branch '2037-deferred-system-test-tcp-buffers-filling-fix' into 'main'

Reorder the response reading in packet.pl to not fill TCP buffers

Closes #2037

See merge request isc-projects/bind9!4065

5 years agoSkip the large TCP assertion failure test in the CI environment
Ondřej Surý [Wed, 2 Sep 2020 11:10:17 +0000 (13:10 +0200)] 
Skip the large TCP assertion failure test in the CI environment

5 years agoReorder the response reading in packet.pl to not fill TCP buffers
Ondřej Surý [Wed, 2 Sep 2020 10:44:36 +0000 (12:44 +0200)] 
Reorder the response reading in packet.pl to not fill TCP buffers

5 years agoMerge branch '1748-log-cds-cdnskey-publication' into 'main'
Matthijs Mekking [Wed, 2 Sep 2020 10:03:15 +0000 (10:03 +0000)] 
Merge branch '1748-log-cds-cdnskey-publication' into 'main'

Resolve "Logging of CDS/CDNSKEY generation for workflow"

Closes #2103 and #1748

See merge request isc-projects/bind9!4028

5 years agoAdd change entry and release note for #1748
Matthijs Mekking [Thu, 27 Aug 2020 12:36:12 +0000 (14:36 +0200)] 
Add change entry and release note for #1748

5 years agoLog when CDS/CDNSKEY is published in zone.
Matthijs Mekking [Thu, 27 Aug 2020 12:32:52 +0000 (14:32 +0200)] 
Log when CDS/CDNSKEY is published in zone.

Log when named decides to add a CDS/CDNSKEY record to the zone. Now
you understand how the bug was found that was fixed in the previous
commits.

5 years agoFix CDS (non-)publication
Matthijs Mekking [Thu, 27 Aug 2020 12:24:50 +0000 (14:24 +0200)] 
Fix CDS (non-)publication

The CDS/CDNSKEY record will be published when the DS is in the
rumoured state. However, with the introduction of the rndc '-checkds'
command, the logic in the keymgr was changed to prevent the DS
state to go in RUMOURED unless the specific command was given. Hence,
the CDS was never published before it was seen in the parent.

Initially I thought this was a policy approval rule, however it is
actually a DNSSEC timing rule. Remove the restriction from
'keymgr_policy_approval' and update the 'keymgr_transition_time'
function. When looking to move the DS state to OMNIPRESENT it will
no longer calculate the state from its last change, but from when
the DS was seen in the parent, "DS Publish". If the time was not set,
default to next key event of an hour.

Similarly for moving the DS state to HIDDEN, the time to wait will
be derived from the "DS Delete" time, not from when the DS state
last changed.

5 years agoSilence two grep calls
Matthijs Mekking [Thu, 27 Aug 2020 12:14:57 +0000 (14:14 +0200)] 
Silence two grep calls

5 years agoUpdate rndc_checkds test util
Matthijs Mekking [Thu, 27 Aug 2020 12:11:23 +0000 (14:11 +0200)] 
Update rndc_checkds test util

The 'rndc_checkds' utility now allows "now" as the time when the DS
has been seen in/seen removed from the parent.

Also it uses "KEYX" as the key argument, rather than key id.
The 'rndc_checkds' will retrieve the key from the "KEYX" string. This
makes the call a bit more readable.

5 years agoImprove kasp test readability
Matthijs Mekking [Thu, 27 Aug 2020 11:18:10 +0000 (13:18 +0200)] 
Improve kasp test readability

This commit has a lot of updates on comments, mainly to make the
system test more readable.

Also remove some redundant signing policy checks (check_keys,
check_dnssecstatus, check_keytimes).

Finally, move key time checks and expected key time settings above
'rndc_checkds' calls (with the new way of testing next key event
times there is no need to do them after 'rndc_checkds', and moving
them above 'rndc_checkds' makes the flow of testing easier to follow.

5 years agoAdd dnssec-settime [-P ds|-D ds] to kasp test
Matthijs Mekking [Thu, 27 Aug 2020 10:38:51 +0000 (12:38 +0200)] 
Add dnssec-settime [-P ds|-D ds] to kasp test

Add the new '-P ds' and '-D ds' calls to the kasp test setup so that
next key event times can reliably be tested.

5 years agoAdd '-P ds' and '-D ds' to dnssec-settime
Matthijs Mekking [Thu, 27 Aug 2020 10:32:41 +0000 (12:32 +0200)] 
Add '-P ds' and '-D ds' to dnssec-settime

Add two more arguments to the dnssec-settime tool. '-P ds' sets the
time that the DS was published in the parent, '-D ds' sets the time
that the DS was removed from the parent (these times are not accurate,
but rely on the user to use them appropriately, and as long as the
time is not before actual publication/withdrawal, it is fine).

These new arguments are needed for the kasp system test. We want to
test when the next key event is once a DS is published, and now
that 'parent-registration-delay' is obsoleted, we need a different
approach to reliable test the timings.

5 years agoMerge branch 'mnowak/drop-gperftools-profiler-configure-switch' into 'main'
Michal Nowak [Wed, 2 Sep 2020 09:34:29 +0000 (09:34 +0000)] 
Merge branch 'mnowak/drop-gperftools-profiler-configure-switch' into 'main'

Drop gperftools-profiler configure switch

See merge request isc-projects/bind9!4045

5 years agoAdd CHANGES and release note for GL !4045
Michal Nowak [Wed, 2 Sep 2020 09:08:14 +0000 (11:08 +0200)] 
Add CHANGES and release note for GL !4045

5 years agoDrop gperftools-profiler configure switch
Michal Nowak [Mon, 31 Aug 2020 15:46:45 +0000 (17:46 +0200)] 
Drop gperftools-profiler configure switch

This switch is believed to be unnecessary. The possibility to use
gperftools CPU profiler was kept, one needs to set 'CFLAGS' and
'LDFLAGS' accordingly.

5 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Wed, 2 Sep 2020 09:05:12 +0000 (09:05 +0000)] 
Merge branch 'marka-placeholder' into 'main'

placeholder

See merge request isc-projects/bind9!4061

5 years agoplaceholder
Mark Andrews [Wed, 2 Sep 2020 08:46:56 +0000 (18:46 +1000)] 
placeholder

5 years agoMerge branch '2081-data-race-in-zonemgr_test' into 'main'
Mark Andrews [Wed, 2 Sep 2020 01:36:51 +0000 (01:36 +0000)] 
Merge branch '2081-data-race-in-zonemgr_test' into 'main'

Resolve "data race in zonemgr_test"

Closes #2081

See merge request isc-projects/bind9!3989

5 years agoAdd CHANGES note
Mark Andrews [Wed, 19 Aug 2020 08:53:20 +0000 (18:53 +1000)] 
Add CHANGES note

5 years agoisc_ratelimiter needs to hold a reference to its task
Mark Andrews [Wed, 19 Aug 2020 08:45:38 +0000 (18:45 +1000)] 
isc_ratelimiter needs to hold a reference to its task

to prevent the task subsystem shutting down before the
ratelimiter is freed.

5 years agoMerge branch '2111-restore-d-option-to-packet-pl' into 'main'
Mark Andrews [Wed, 2 Sep 2020 00:24:03 +0000 (00:24 +0000)] 
Merge branch '2111-restore-d-option-to-packet-pl' into 'main'

Resolve "Restore '-d' option to packet.pl"

Closes #2111

See merge request isc-projects/bind9!4054

5 years agoDump the returned packet
Mark Andrews [Tue, 1 Sep 2020 23:40:45 +0000 (09:40 +1000)] 
Dump the returned packet

5 years agoMerge branch '2049-cleanup-sock' into 'main'
Mark Andrews [Tue, 1 Sep 2020 22:38:43 +0000 (22:38 +0000)] 
Merge branch '2049-cleanup-sock' into 'main'

Resolve "Compiler warnings identified by Intel C++ Compiler"

See merge request isc-projects/bind9!3924

5 years agoremove unused variable sock
Mark Andrews [Thu, 6 Aug 2020 02:21:50 +0000 (12:21 +1000)] 
remove unused variable sock

5 years agoMerge branch '1847-recursor-has-issues-recursing-ip6-arpa' into 'main'
Diego dos Santos Fronza [Tue, 1 Sep 2020 18:49:23 +0000 (18:49 +0000)] 
Merge branch '1847-recursor-has-issues-recursing-ip6-arpa' into 'main'

Resolve "9.16.* recursor has issues recursing"

Closes #1847

See merge request isc-projects/bind9!4027

5 years agoAdd CHANGES and release note for GL #1847
Diego Fronza [Mon, 31 Aug 2020 16:26:56 +0000 (13:26 -0300)] 
Add CHANGES and release note for GL #1847

5 years agoAdded test for the proposed fix
Diego Fronza [Fri, 28 Aug 2020 21:49:26 +0000 (18:49 -0300)] 
Added test for the proposed fix

The test works as follows:

1. Client wants to resolve unusual ip6.arpa. name:

   test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

2. Query is sent to ns7, a qmin enabled resolver.

3. ns7 do the first stage in query minimization for the name and send a new
   query to root (ns1):

  _.1.0.0.2.ip6.arpa.        IN  A

4. ns1 delegates ip6.arpa. to ns2.good.:

    ;; AUTHORITY SECTION:
    ;ip6.arpa.      20  IN  NS  ns2.good.

    ;; ADDITIONAL SECTION:
    ;ns2.good.      20  IN  A   10.53.0.2

5. ns7 do a second round in minimizing the name and send a new query
   to ns2.good. (10.53.0.2):

   _.8.2.6.0.1.0.0.2.ip6.arpa.    IN  A

6. ans2 delegates 8.2.6.0.1.0.0.2.ip6.arpa. to ns3.good.:

    ;; AUTHORITY SECTION:
    ;8.2.6.0.1.0.0.2.ip6.arpa. 60   IN  NS  ns3.good.

    ;; ADDITIONAL SECTION:
    ;ns3.good.      60  IN  A   10.53.0.3

7. ns7 do a third round in minimizing the name and send a new query to
   ns3.good.:

    _.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN A

8. ans3 delegates 1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. to ns4.good.:

    ;; AUTHORITY SECTION:
    ;1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    NS  ns4.good.

    ;; ADDITIONAL SECTION:
    ;ns4.good.      60  IN  A   10.53.0.4

9. ns7 do fourth round in minimizing the name and send a new query to
   ns4.good.:

_.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa.    IN A

10. ns4.good. doesn't know such name, but answers stating it is authoritative for
    the domai:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  53815
...
;; AUTHORITY SECTION:
1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    SOA ns4.good.  ...

11. ns7 do another minimization on name:
   _.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
   sends to ns4.good. and gets the same SOA response stated in item #10

12. ns7 do another minimization on name:
_.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
sends to ns4.good. and gets the same SOA response stated in item #10.

13. ns7 do the last query minimization name for the ip6.arpa. QNAME.
After all IPv6 labels are exausted the algorithm falls back to the
original QNAME:
test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa

    ns7 sends a new query with the original QNAME to ans4.

14. Finally ans4 answers with the expected response:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  40969
;; flags: qr aa; QUESTION: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 8192
;; QUESTION SECTION:
;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

;; ANSWER SECTION:
;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 1    IN TXT "long_ip6_name"

5 years agoFix resolution of unusual ip6.arpa names
Diego Fronza [Wed, 26 Aug 2020 17:36:14 +0000 (14:36 -0300)] 
Fix resolution of unusual ip6.arpa names

Before this commit, BIND was unable to resolve ip6.arpa names like
the one reported in issue #1847 when using query minimization.

As reported in the issue, an attempt to resolve a name like
'rec-test-dom-158937817846788.test123.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.3.4.3.5.4.0.8.2.6.0.1.0.0.2.ip6.arpa'
using default settings would fail.

The reason was that query minimization algorithm in 'fctx_minimize_qname'
would divide any ip6.arpa names in increasing number of labels,
7,11, ... up to 35, thus limiting the destination name (minimized) to a number
of 35 labels.

In case the last query minimization attempt (with 35 labels) would fail with
NXDOMAIN, BIND would attempt the query mininimization again with the exact
same QNAME, limited on the 35 labels, and that in turn would fail again.

This fix avoids this fail loop by considering the extra labels that may appear
in the leftmost part of an ip6.arpa name, those after the IPv6 part.

5 years agoMerge branch '2037-deferred-system-test-fix' into 'main'
Ondřej Surý [Tue, 1 Sep 2020 14:17:21 +0000 (14:17 +0000)] 
Merge branch '2037-deferred-system-test-fix' into 'main'

Unhexlify 2037-pk11_numbits-crash-test.pkt file

Closes #2037

See merge request isc-projects/bind9!4047

5 years agoMultiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP
Ondřej Surý [Tue, 1 Sep 2020 07:37:05 +0000 (09:37 +0200)] 
Multiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP

The test for assertion failure via large TCP packet needs to be repeated
multiple times (we use 300000).  This commit fixes the input file to be
properly hexlified and uses the new packet.pl -r feature to send it
300000 times via TCP.

5 years agoAdd `-r <repeats>` option to packet.pl
Ondřej Surý [Tue, 1 Sep 2020 07:37:05 +0000 (09:37 +0200)] 
Add `-r <repeats>` option to packet.pl

For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.

5 years agoProperly format 2037-pk11_numbits-crash-test.pkt file
Ondřej Surý [Tue, 1 Sep 2020 07:26:04 +0000 (09:26 +0200)] 
Properly format 2037-pk11_numbits-crash-test.pkt file

5 years agoMerge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering'...
Mark Andrews [Tue, 1 Sep 2020 12:21:25 +0000 (12:21 +0000)] 
Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering' into 'main'

Resolve "isc_refcount_decrement  needs acquire release memory ordering."

Closes #2096

See merge request isc-projects/bind9!4010

5 years agoUse memory_order_acq_rel in isc_refcount_decrement.
Mark Andrews [Tue, 25 Aug 2020 12:42:27 +0000 (22:42 +1000)] 
Use memory_order_acq_rel in isc_refcount_decrement.

While

if (isc_refcount_decrement() == 1) { // memory_order_release
isc_refcount_destroy(); // memory_order_acquire
...
}

is theoretically the most efficent in practice, using
memory_order_acq_rel produces the same code on x86_64 and doesn't
trigger tsan data races (which use a idealistic model) if
isc_refcount_destroy() is not called immediately.  In fact
isc_refcount_destroy() could be removed if we didn't want
to check for the count being 0 when isc_refcount_destroy() is
called.

https://stackoverflow.com/questions/49112732/memory-order-in-shared-pointer-destructor

5 years agoMerge branch '2075-add-T-maxcachesize-command-line-option' into 'main'
Michał Kępień [Mon, 31 Aug 2020 21:40:28 +0000 (21:40 +0000)] 
Merge branch '2075-add-T-maxcachesize-command-line-option' into 'main'

Add "-T maxcachesize=..." command line option

Closes #2075

See merge request isc-projects/bind9!4043

5 years agoUse "-T maxcachesize=2097152" in all system tests
Michał Kępień [Mon, 31 Aug 2020 11:15:33 +0000 (13:15 +0200)] 
Use "-T maxcachesize=2097152" in all system tests

In order to lower the amount of memory allocated at startup by named
instances used in the BIND system test suite, set the default value of
"max-cache-size" for these to 2 megabytes.  The purpose of this change
is to prevent named instances (or even entire virtual machines) from
getting killed by the operating system on the test host due to excessive
memory use.

Remove all "max-cache-size" statements from named configuration files
used in system tests ("checkconf" notwithstanding) to prevent confusion
as the "-T maxcachesize=..." command line option takes precedence over
configuration files.

5 years agoAdd "-T maxcachesize=..." command line option
Michał Kępień [Mon, 31 Aug 2020 11:15:33 +0000 (13:15 +0200)] 
Add "-T maxcachesize=..." command line option

An implicit default of "max-cache-size 90%;" may cause memory use issues
on hosts which run numerous named instances in parallel (e.g. GitLab CI
runners) due to the cache RBT hash table now being pre-allocated [1] at
startup.  Add a new command line option, "-T maxcachesize=...", to allow
the default value of "max-cache-size" to be overridden at runtime.  When
this new option is in effect, it overrides any other "max-cache-size"
setting in the configuration, either implicit or explicit.  This
approach was chosen because it is arguably the simplest one to
implement.

The following alternative approaches to solving this problem were
considered and ultimately rejected (after it was decided they were not
worth the extra code complexity):

  - adding the same command line option, but making explicit
    configuration statements have priority over it,

  - adding a build-time option that allows the implicit default of
    "max-cache-size 90%;" to be overridden.

[1] see commit e24bc324b455d9cad7b51acd3d5c7b4e40c66187

5 years agoMerge branch '1996-deferred-system-test' into 'main'
Ondřej Surý [Mon, 31 Aug 2020 10:04:42 +0000 (10:04 +0000)] 
Merge branch '1996-deferred-system-test' into 'main'

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

See merge request isc-projects/bind9!4038

5 years agoAdd PoC for assertion failure on large TCP DNS messages
Ondřej Surý [Fri, 31 Jul 2020 08:08:41 +0000 (10:08 +0200)] 
Add PoC for assertion failure on large TCP DNS messages

5 years agoMerge branch '1997-deferred-system-test' into 'main'
Ondřej Surý [Mon, 31 Aug 2020 09:59:01 +0000 (09:59 +0000)] 
Merge branch '1997-deferred-system-test' into 'main'

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

See merge request isc-projects/bind9!4039

5 years agotest whether DS chasing works correctly when forwarding
Evan Hunt [Sat, 11 Jul 2020 00:57:23 +0000 (17:57 -0700)] 
test whether DS chasing works correctly when forwarding

5 years agoMerge branch '2037-deferred-system-test' into 'main'
Ondřej Surý [Mon, 31 Aug 2020 08:58:03 +0000 (08:58 +0000)] 
Merge branch '2037-deferred-system-test' into 'main'

Resolve "[CVE-2020-8623] A flaw in native PKCS#11 code can lead to a remotely triggerable assertion failure in pk11.c"

See merge request isc-projects/bind9!4037

5 years agoAdd PoC system test for pk11_numbits() assertion
Ondřej Surý [Tue, 21 Jul 2020 13:56:13 +0000 (15:56 +0200)] 
Add PoC system test for pk11_numbits() assertion

5 years agoFix relative path to conf.sh in cleanpkcs11.sh
Michał Kępień [Fri, 31 Jul 2020 09:26:31 +0000 (11:26 +0200)] 
Fix relative path to conf.sh in cleanpkcs11.sh

5 years agoMerge branch '2028-deferred-system-test' into 'main'
Ondřej Surý [Mon, 31 Aug 2020 06:24:41 +0000 (06:24 +0000)] 
Merge branch '2028-deferred-system-test' into 'main'

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

See merge request isc-projects/bind9!4034

5 years agocheck that a malformed truncated response to a TSIG query is handled
Mark Andrews [Wed, 15 Jul 2020 06:06:07 +0000 (16:06 +1000)] 
check that a malformed truncated response to a TSIG query is handled

5 years agoMerge branch '1928-handle-EPROTO' into 'main'
Ondřej Surý [Fri, 28 Aug 2020 18:47:43 +0000 (18:47 +0000)] 
Merge branch '1928-handle-EPROTO' into 'main'

Resolve "error: socket.c:1540: unexpected error:"

Closes #1928

See merge request isc-projects/bind9!4023

5 years agoAdd CHANGES and release note for GL #1928
Ondřej Surý [Wed, 26 Aug 2020 14:39:46 +0000 (16:39 +0200)] 
Add CHANGES and release note for GL #1928

5 years agoHandle EPROTO errno from recvmsg
Ondřej Surý [Wed, 26 Aug 2020 14:31:13 +0000 (16:31 +0200)] 
Handle EPROTO errno from recvmsg

It was discovered, that some systems might set EPROTO instead of EACCESS
on recvmsg() call causing spurious syslog messages from the socket
code.  This commit returns soft handling of EPROTO errno code to the
socket code. [GL #1928]

5 years agoMerge branch '2104-fix-off-by-one-error-in-rehash_bits' into 'main'
Ondřej Surý [Fri, 28 Aug 2020 15:42:13 +0000 (15:42 +0000)] 
Merge branch '2104-fix-off-by-one-error-in-rehash_bits' into 'main'

Resolve "Bind 9.16.6 due to assertion failure"

Closes #2104

See merge request isc-projects/bind9!4030

5 years agoAdd CHANGES and release notes for GL #2104
Ondřej Surý [Fri, 28 Aug 2020 07:44:28 +0000 (09:44 +0200)] 
Add CHANGES and release notes for GL #2104

5 years agoFix off-by-one error when calculating new hashtable size
Ondřej Surý [Fri, 28 Aug 2020 07:30:29 +0000 (09:30 +0200)] 
Fix off-by-one error when calculating new hashtable size

When calculating the new hashtable bitsize, there was an off-by-one
error that would allow the new bitsize to be larger than maximum allowed
causing assertion failure in the rehash() function.

5 years agoMerge branch 'mnowak/fix-tarball-test-suite.log-print' into 'main'
Michal Nowak [Fri, 28 Aug 2020 12:38:32 +0000 (12:38 +0000)] 
Merge branch 'mnowak/fix-tarball-test-suite.log-print' into 'main'

Print test-suite.log correctly in tarball system test job

See merge request isc-projects/bind9!3990

5 years agoPrint test-suite.log correctly in tarball system test job
Michal Nowak [Wed, 19 Aug 2020 09:16:11 +0000 (11:16 +0200)] 
Print test-suite.log correctly in tarball system test job

Printing test-suite.log on system test failure does not work for system
test run from tarball because the "after_script" step does not honour
directory change from the "before_script" step and fails with:

    Running after script...
    $ cat bin/tests/system/test-suite.log
    cat: bin/tests/system/test-suite.log: No such file or directory

5 years agoMerge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields' into...
Ondřej Surý [Wed, 26 Aug 2020 14:28:17 +0000 (14:28 +0000)] 
Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields' into 'main'

Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

Closes #2074

See merge request isc-projects/bind9!3988

5 years agoAdd CHANGES note
Mark Andrews [Wed, 19 Aug 2020 07:54:06 +0000 (17:54 +1000)] 
Add CHANGES note

5 years agoRefactor totext_loc
Mark Andrews [Tue, 25 Aug 2020 01:03:30 +0000 (11:03 +1000)] 
Refactor  totext_loc

5 years agoCorrectly encode LOC records with non integer negative altitudes.
Mark Andrews [Sat, 22 Aug 2020 15:38:17 +0000 (01:38 +1000)] 
Correctly encode LOC records with non integer negative altitudes.

5 years agoCheck LOC's altitude field is properly parsed and encoded.
Mark Andrews [Sat, 22 Aug 2020 15:35:19 +0000 (01:35 +1000)] 
Check LOC's altitude field is properly parsed and encoded.

5 years agoTighten LOC parsing to reject period and/or m as a value.
Mark Andrews [Wed, 19 Aug 2020 08:47:35 +0000 (18:47 +1000)] 
Tighten LOC parsing to reject period and/or m as a value.

5 years agoMerge branch '2080-data-race-in-rdataset_addglue' into 'main'
Mark Andrews [Wed, 26 Aug 2020 11:32:57 +0000 (11:32 +0000)] 
Merge branch '2080-data-race-in-rdataset_addglue' into 'main'

Resolve "data race in rdataset_addglue"

Closes #2080

See merge request isc-projects/bind9!3987

5 years agoAdd CHANGES note
Mark Andrews [Wed, 19 Aug 2020 05:11:06 +0000 (15:11 +1000)] 
Add CHANGES note

5 years agoUse the Fibonacci Hashing for the RBTDB glue table
Ondřej Surý [Mon, 24 Aug 2020 10:30:42 +0000 (12:30 +0200)] 
Use the Fibonacci Hashing for the RBTDB glue table

The rbtdb version glue_table has been refactored similarly to rbt.c hash
table, so it does use 32-bit hash function return values and apply
Fibonacci Hashing to lookup the index to the hash table instead of
modulo.  For more details, see the lib/dns/rbt.c commit log.

5 years agorbtversion->glue_table_size must be read when holding a lock
Mark Andrews [Wed, 19 Aug 2020 04:59:02 +0000 (14:59 +1000)] 
rbtversion->glue_table_size must be read when holding a lock

5 years agoMerge branch 'mnowak/tumbleweed-fix-krb5-config-location' into 'main'
Michal Nowak [Wed, 26 Aug 2020 08:57:20 +0000 (08:57 +0000)] 
Merge branch 'mnowak/tumbleweed-fix-krb5-config-location' into 'main'

Tumbleweed changed location of krb5-config

See merge request isc-projects/bind9!4016

5 years agoTumbleweed changed location of krb5-config
Michal Nowak [Wed, 26 Aug 2020 07:15:43 +0000 (09:15 +0200)] 
Tumbleweed changed location of krb5-config

krb5-config is now in /usr/bin/ and we should detect it automatically.

5 years agoMerge branch '2097-manual-page-tools-need-updating' into 'main'
Ondřej Surý [Wed, 26 Aug 2020 08:51:49 +0000 (08:51 +0000)] 
Merge branch '2097-manual-page-tools-need-updating' into 'main'

Fix generated documentation

Closes #2097

See merge request isc-projects/bind9!4017

5 years agoFix generated documentation
Michal Nowak [Wed, 26 Aug 2020 08:32:15 +0000 (10:32 +0200)] 
Fix generated documentation

With Sphinx 3.2.1 line-leading period should be escaped.

5 years agoMerge branch 'ondrej/copy-wire-test-to-fuzz' into 'main'
Ondřej Surý [Tue, 25 Aug 2020 18:19:02 +0000 (18:19 +0000)] 
Merge branch 'ondrej/copy-wire-test-to-fuzz' into 'main'

Add dns_message_parse() fuzzer

See merge request isc-projects/bind9!4009

5 years agoAdd minimized (cmin-tmin-cmin) corpus for dns_message_parse fuzzer
Ondřej Surý [Tue, 25 Aug 2020 08:04:11 +0000 (10:04 +0200)] 
Add minimized (cmin-tmin-cmin) corpus for dns_message_parse fuzzer

The non-minimized corpus from https://github.com/CZ-NIC/dns-fuzzing was
used as input to afl-cmin, then every case were processed by afl-tmin
and then afl-cmin was used to further minimize the corpus again.

5 years agoAdd dns_message_parse() fuzzer
Ondřej Surý [Tue, 25 Aug 2020 07:51:40 +0000 (09:51 +0200)] 
Add dns_message_parse() fuzzer

Previously, the bin/system/wire_test.c was optionally used as a fuzzer,
this commit extracts the parts relevant to the fuzzing into a
specialized fuzzer that can be used in oss-fuzz project.

The fuzzer parses the input as UDP DNS message, then prints parsed DNS
message, then renders the DNS message and then prints the rendered DNS
message.  No part of the code should cause a assertion failure.

5 years agoMerge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behavio...
Ondřej Surý [Tue, 25 Aug 2020 14:11:04 +0000 (14:11 +0000)] 
Merge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour' into 'main'

Resolve "Shifting large rcode in dns/message.c results in undefined behaviour"

Closes #2095

See merge request isc-projects/bind9!4011

5 years agoCast the original rcode to (dns_ttl_t) when setting extended rcode
Mark Andrews [Tue, 25 Aug 2020 12:59:35 +0000 (22:59 +1000)] 
Cast the original rcode to (dns_ttl_t) when setting extended rcode

Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in

5 years agoMerge branch '2053-test-disable-buffer-useinline-in-gitlab-ci' into 'main'
Michal Nowak [Tue, 25 Aug 2020 14:04:47 +0000 (14:04 +0000)] 
Merge branch '2053-test-disable-buffer-useinline-in-gitlab-ci' into 'main'

Resolve "Test --disable-buffer-useinline in GitLab CI"

Closes #2053

See merge request isc-projects/bind9!3983

5 years agoBuild CentOS 8 with --enable-buffer-useinline
Michal Nowak [Tue, 18 Aug 2020 16:30:09 +0000 (18:30 +0200)] 
Build CentOS 8 with --enable-buffer-useinline

5 years agoFix warnings in when build with --enable-buffer-useinline
Michal Nowak [Tue, 18 Aug 2020 16:27:29 +0000 (18:27 +0200)] 
Fix warnings in when build with --enable-buffer-useinline

    sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness

5 years agoMerge branch 'marka-add-missing-isc_mutex_init' into 'main'
Mark Andrews [Mon, 24 Aug 2020 23:54:46 +0000 (23:54 +0000)] 
Merge branch 'marka-add-missing-isc_mutex_init' into 'main'

Add missing isc_mutex_init to manytasks subtest.

See merge request isc-projects/bind9!3996

5 years agoAdd missing isc_mutex_init to manytasks subtest.
Mark Andrews [Fri, 21 Aug 2020 03:29:15 +0000 (13:29 +1000)] 
Add missing isc_mutex_init to manytasks subtest.

5 years agoMerge branch 'ondrej/update-pregenerated-files' into 'main'
Ondřej Surý [Mon, 24 Aug 2020 17:48:14 +0000 (17:48 +0000)] 
Merge branch 'ondrej/update-pregenerated-files' into 'main'

Update pregenerated documentation files

See merge request isc-projects/bind9!4005

5 years agoSync the pregenerated files with their source counterparts
Ondřej Surý [Mon, 24 Aug 2020 12:32:02 +0000 (14:32 +0200)] 
Sync the pregenerated files with their source counterparts