Commit Graph

32067 Commits

Author SHA1 Message Date
Michał Kępień
b0e1d19599 Merge branch '1919-include-bind-documentation-in-windows-zips-v9_16' into 'v9_16'
[v9_16] Include BIND documentation in Windows zips

See merge request isc-projects/bind9!4087
2020-09-03 10:11:07 +00:00
Michał Kępień
6e2a35df2d 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.

(cherry picked from commit 549ddca256)
2020-09-03 12:02:19 +02:00
Mark Andrews
a86dd63dc0 Merge branch 'marka-check-deny-name-with-grant-subdomain-v9_16' into 'v9_16'
Check 'deny name' + 'grant subdomain' for the same name

See merge request isc-projects/bind9!4082
2020-09-03 06:41:46 +00:00
Mark Andrews
1ef4fa9a0b Check 'deny name' + 'grant subdomain' for the same name
(cherry picked from commit a402ffbced)
2020-09-03 16:22:01 +10:00
Mark Andrews
4e6635f13f Merge branch '2115-the-load-of-huge-zone-can-take-over-100-secs-when-running-under-a-sanitiser-v9_16' into 'v9_16'
Increase zone load timeout in the "rndc" test

See merge request isc-projects/bind9!4076
2020-09-02 22:00:12 +00:00
Mark Andrews
91daae5c62 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.

(cherry picked from commit fd08918df5)
2020-09-02 21:41:30 +00:00
Mark Andrews
0b4b2e990b Merge branch '2084-9-11-data-race-in-dispatch_test-2-v9_16' into 'v9_16'
Resolve "9.11 data race in dispatch_test"

See merge request isc-projects/bind9!4075
2020-09-02 21:33:58 +00:00
Mark Andrews
e6332e4a67 watch_fd also requires thread->fdlock[lockid] to be held
(cherry picked from commit 22f499cdc4)
2020-09-03 07:14:45 +10:00
Mark Andrews
eadfe4b673 remove dead code
(cherry picked from commit e923e62f6c)
2020-09-03 07:14:45 +10:00
Ondřej Surý
cfeb3bf803 Merge branch '2091-print-out-more-diagnostics-on-dns_name_issubdomain-v9_16' into 'v9_16'
Print diagnostics on dns_name_issubdomain() failure in fctx_create()

See merge request isc-projects/bind9!4073
2020-09-02 20:21:19 +00:00
Ondřej Surý
56d2cf6f1e 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.

(cherry picked from commit 0a22024c27)
2020-09-02 18:29:01 +02:00
Ondřej Surý
184b608745 Merge branch '1847-recursor-has-issues-recursing-ip6-arpa-v9_16' into 'v9_16'
Resolve "9.16.* recursor has issues recursing" [v9.16]

See merge request isc-projects/bind9!4070
2020-09-02 14:54:00 +00:00
Diego Fronza
d791f04960 Add CHANGES and release note for GL #1847
(cherry picked from commit 044a72cca9)
2020-09-02 16:52:39 +02:00
Diego Fronza
55c0fa2bf6 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"

(cherry picked from commit 11add69198)
2020-09-02 16:52:39 +02:00
Diego Fronza
eb9d8e9e10 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.

(cherry picked from commit 230d79c191)
2020-09-02 16:52:39 +02:00
Matthijs Mekking
bd2932e110 Merge branch '1748-log-cds-cdnskey-publication-v9_16' into 'v9_16'
Resolve "Logging of CDS/CDNSKEY generation for workflow"

See merge request isc-projects/bind9!4067
2020-09-02 13:01:03 +00:00
Matthijs Mekking
729668841e Add change entry and release note for #1748
(cherry picked from commit ff006a1730)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
4a7f87aa89 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.

(cherry picked from commit f9ef5120c1)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
6405b04477 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.

(cherry picked from commit c8205bfa0e)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
7065299a9d Silence two grep calls
(cherry picked from commit 2d2b8e7c02)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
94fe9f1fdf 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.

(cherry picked from commit dd754a974c)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
2a9e4fea5a 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.

(cherry picked from commit 8cb394e047)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
a33c49a838 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.

(cherry picked from commit 4a67cdabfe)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
75adf06f19 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.

(cherry picked from commit d4c4f6a669)
2020-09-02 14:59:20 +02:00
Ondřej Surý
3b5eb62009 Merge branch '2037-deferred-system-test-fix-v9_16' into 'v9_16'
Fix the new pkcs11 and tcp test [v9.16]

See merge request isc-projects/bind9!4050
2020-09-02 12:16:10 +00:00
Ondřej Surý
c978d3efdf Skip the large TCP assertion failure test in the CI environment 2020-09-02 13:11:10 +02:00
Ondřej Surý
d1643772eb Reorder the response reading in packet.pl to not fill TCP buffers 2020-09-02 12:46:43 +02:00
Mark Andrews
02be5fc953 Dump the returned packet 2020-09-02 12:46:43 +02:00
Ondřej Surý
92df4ba652 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.

(cherry picked from commit 5f6eb014aa)
2020-09-02 12:46:43 +02:00
Ondřej Surý
4dc666d474 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.

(cherry picked from commit dd46559a19)
2020-09-02 12:46:43 +02:00
Ondřej Surý
677e569dda Properly format 2037-pk11_numbits-crash-test.pkt file
(cherry picked from commit 22e0272063)
2020-09-02 12:46:43 +02:00
Mark Andrews
9b735298c2 Merge branch '2054-dig-bufsize-0-sets-bufsize-to-4096' into 'v9_16'
Resolve "dig +bufsize=0 sets bufsize to 4096" (9.11/9.16)

See merge request isc-projects/bind9!3891
2020-09-02 09:37:38 +00:00
Mark Andrews
0dc04cb901 dig +bufsize=0 failed to disable EDNS as a side effect. 2020-09-02 09:07:55 +00:00
Michał Kępień
e991f6ca9e Merge branch 'michal/fix-the-forward-system-test-on-windows' into 'v9_16'
Fix the "forward" system test on Windows

See merge request isc-projects/bind9!4060
2020-09-02 08:44:48 +00:00
Michał Kępień
665dcfae5f Fix the "forward" system test on Windows
Make the "forward" system test work on Windows again by fixing a
backporting glitch in commit 544ea41224.
2020-09-02 10:01:29 +02:00
Mark Andrews
bcfa5f1593 Merge branch '2081-data-race-in-zonemgr_test-v9_16' into 'v9_16'
Resolve "data race in zonemgr_test"

See merge request isc-projects/bind9!4056
2020-09-02 02:02:29 +00:00
Mark Andrews
debb5f3994 Add CHANGES note
(cherry picked from commit ca1b0f1539)
2020-09-02 11:40:09 +10:00
Mark Andrews
e460d83dbb isc_ratelimiter needs to hold a reference to its task
to prevent the task subsystem shutting down before the
ratelimiter is freed.

(cherry picked from commit b8e4b6d303)
2020-09-02 11:39:36 +10:00
Mark Andrews
e7e5a2fa6b Merge branch '2049-cleanup-sock-v9_16' into 'v9_16'
remove unused variable sock

See merge request isc-projects/bind9!4052
2020-09-01 22:59:32 +00:00
Mark Andrews
489b99b65c remove unused variable sock
(cherry picked from commit b1c424ddf3)
2020-09-02 08:41:11 +10:00
Mark Andrews
8df297f34a Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering-v9_16' into 'v9_16'
Use memory_order_acq_rel in isc_refcount_decrement.

See merge request isc-projects/bind9!4048
2020-09-01 13:09:35 +00:00
Mark Andrews
1af9cf78bd 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
(cherry picked from commit 6278899a38)
2020-09-01 22:24:52 +10:00
Michał Kępień
4f949e5c5b Merge branch '2075-add-T-maxcachesize-command-line-option-v9_16' into 'v9_16'
[v9_16] Add "-T maxcachesize=..." command line option

See merge request isc-projects/bind9!4046
2020-08-31 22:10:26 +00:00
Michał Kępień
894b7a8345 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.

(cherry picked from commit dad6572093)
2020-08-31 23:42:38 +02:00
Michał Kępień
3f25b8e608 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 aa72c31422

(cherry picked from commit 9ac1f6a9bc)
2020-08-31 23:41:24 +02:00
Ondřej Surý
3abbbead55 Merge branch '1996-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8620] Fix TCP DNS buffer sizes [TEST] [v9.16]

See merge request isc-projects/bind9!4044
2020-08-31 12:03:28 +00:00
Ondřej Surý
9d3c6785b5 Add PoC for assertion failure on large TCP DNS messages
(cherry picked from commit 2c796bb9c8)
2020-08-31 13:38:17 +02:00
Ondřej Surý
651a9fe4db Merge branch '1997-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding [TEST] [v9.16]

See merge request isc-projects/bind9!4042
2020-08-31 10:33:26 +00:00
Evan Hunt
544ea41224 test whether DS chasing works correctly when forwarding
(cherry picked from commit dd8db89525)
2020-08-31 12:00:13 +02:00
Ondřej Surý
22b0af0cf2 Merge branch '2037-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used [TEST] [v9.16]

See merge request isc-projects/bind9!4040
2020-08-31 09:50:37 +00:00