Commit Graph

32051 Commits

Author SHA1 Message Date
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
Ondřej Surý
f195c192a6 Add PoC system test for pk11_numbits() assertion
(cherry picked from commit a69433ba40)
2020-08-31 10:58:56 +02:00
Ondřej Surý
e7dca64cf7 Merge branch '2028-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries [TEST] [v9.16]

See merge request isc-projects/bind9!4035
2020-08-31 07:24:41 +00:00
Mark Andrews
6acd6ae943 check that a malformed truncated response to a TSIG query is handled
(cherry picked from commit 8bbf3eb5f3)
2020-08-31 08:35:30 +02:00
Ondřej Surý
d723209185 Merge branch '1928-handle-EPROTO-v9_16' into 'v9_16'
Resolve "error: socket.c:1540: unexpected error:"

See merge request isc-projects/bind9!4032
2020-08-28 18:50:38 +00:00
Ondřej Surý
cc07b3f78a Add CHANGES and release note for GL #1928
(cherry picked from commit 4722196b13)
2020-08-28 20:49:02 +02:00
Ondřej Surý
9b9fee13fa 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]

(cherry picked from commit e0380d437d)
2020-08-28 20:49:01 +02:00
Ondřej Surý
3751e24e9e Merge branch '2104-fix-off-by-one-error-in-rehash_bits-v9_16' into 'v9_16'
Resolve "Bind 9.16.6 due to assertion failure"

See merge request isc-projects/bind9!4031
2020-08-28 18:48:41 +00:00
Ondřej Surý
be46c49300 Add CHANGES and release notes for GL #2104
(cherry picked from commit d47d2b3fe0)
2020-08-28 20:43:39 +02:00
Ondřej Surý
2b08ff879a 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.

(cherry picked from commit 78543ad5a7)
2020-08-28 20:43:38 +02:00
Michal Nowak
0d964dfc4b Merge branch '2097-manual-page-tools-need-updating-v9_16' into 'v9_16'
[v9_16] Resolve "manual page tools need updating."

See merge request isc-projects/bind9!4022
2020-08-26 16:31:25 +00:00
Michal Nowak
5082d60105 Fix generated documentation 2020-08-26 16:30:04 +00:00
Michal Nowak
934c470b54 Add pandoc and w3m
pandoc and w3m are needed to generate some files.
2020-08-26 16:30:04 +00:00
Ondřej Surý
cd38e92c48 Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields-v9_16' into 'v9_16'
Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

See merge request isc-projects/bind9!4024
2020-08-26 15:31:38 +00:00
Mark Andrews
d8cb5ac0db Add CHANGES note
(cherry picked from commit d9594cffab)
2020-08-26 16:44:01 +02:00
Mark Andrews
c2ee9eea3a Refactor totext_loc
(cherry picked from commit 2ca4d35037)
2020-08-26 16:44:01 +02:00
Mark Andrews
baf93342d0 Correctly encode LOC records with non integer negative altitudes.
(cherry picked from commit 337cc878fa)
2020-08-26 16:44:01 +02:00