Commit Graph

33614 Commits

Author SHA1 Message Date
Mark Andrews
a8413d5f0f wait for post 'rndc freeze' writes to complete
(cherry picked from commit 45b6b8199e)
2021-08-26 13:18:33 +10:00
Mark Andrews
a8914f9e11 Merge branch '2461-named-checkconf-fails-to-detect-illegal-key-names-in-primaries-lists-v9_16' into 'v9_16'
[v9_16] Named-checkconf fails to detect illegal key names in primaries lists

See merge request isc-projects/bind9!5359
2021-08-26 00:27:51 +00:00
Mark Andrews
2ffb2e5ffd Add CHANGED for [GL #2461]
(cherry picked from commit 5d2183c450)
2021-08-26 00:00:16 +00:00
Mark Andrews
706f5811c3 Check that primary key names are syntactically valid
(cherry picked from commit 4fa9d8389a)
2021-08-26 00:00:16 +00:00
Evan Hunt
3638f2d284 Merge branch '331-further-refactoring-of-functions-in-lib-dns-zoneverify-c-v9_16' into 'v9_16'
Resolve "Further refactoring of functions in lib/dns/zoneverify.c"

See merge request isc-projects/bind9!5362
2021-08-25 23:32:58 +00:00
Diego Fronza
f262860d5d Replace literal 255 with a more descriptive macro name
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12186

(cherry picked from commit bd0cc048d1)
2021-08-25 15:57:35 -07:00
Diego Fronza
caa4af08d4 Avoid an empty block under if condition
This commit doesn't change the logic flow from previous code, it only
makes the code more readable and consistent.

More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12185

(cherry picked from commit 90e724af45)
2021-08-25 15:57:35 -07:00
Diego Fronza
7af2573219 Remove redundant function 'newchain'
The removed function 'newchain(a, b)' was almost the same as calling
!chain_equal(a, b), varying only in the amount of data compared
in the non-fixed-length data portion of given chain nodes.

A third argument 'data_size' has been introduced into 'chain_equal'
function in order to allow it to know how many bytes to compare in the
variable-length data portion of the chain nodes.

A helper function 'chain_length(e)' has been introduced to allow
easy calculation of the total length of the non-fixed-length data part
of chain nodes.

Check the thread below for more details:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12184

(cherry picked from commit 37f42d19a1)
2021-08-25 15:57:35 -07:00
Diego Fronza
063bc21543 Use sizeof instead of arbitrary number to iterate fixed size array
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12180

(cherry picked from commit 6a12e37382)
2021-08-25 15:57:34 -07:00
Diego Fronza
9954c2da91 Initialize buffers with { 0 } instead of memset
More details on threads:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12178
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12181

(cherry picked from commit 87e970474f)
2021-08-25 15:57:34 -07:00
Diego Fronza
9f5c643769 Minor refactoring on function match_nsec3
The logic for matching a set of nsec3 objects against an nsec3param
object was moved to a specific function.

For more details check thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12176

(cherry picked from commit 98d1e40143)
2021-08-25 15:57:34 -07:00
Diego Fronza
ebb827c1d5 Minor refactoring/cleanup
This commit moves the warning message to the logical block where it
belongs better.

For more details check thread comment:
https://gitlab.isc.org/isc-projects/bind9/merge_requests/291#note_12167

(cherry picked from commit 966c06a9e6)
2021-08-25 15:57:34 -07:00
Mark Andrews
cac4c29f64 Merge branch '2842-clean-up-catalog-journal-v9_16' into 'v9_16'
[v9_16] Clean up catalog journal

See merge request isc-projects/bind9!5358
2021-08-25 05:44:48 +00:00
Mark Andrews
d4d7e060ab Add CHANGES for [GL #2842]
(cherry picked from commit 53f9416176)
2021-08-25 15:17:51 +10:00
Mark Andrews
c3db4acf61 Also delete journal file
(cherry picked from commit 0b83636648)
2021-08-25 15:17:51 +10:00
Mark Andrews
3e2a39dc7a check that journal files are also removed
(cherry picked from commit 1972300919)
2021-08-25 15:17:51 +10:00
Matthijs Mekking
2bc855fff8 Merge branch '1721-grow-shrink-dnssec-sign-stats-v9_16' into 'v9_16'
Grow and shrink dnssec-sign statistics on key rollover events (9.16)

See merge request isc-projects/bind9!5354
2021-08-24 08:58:21 +00:00
Matthijs Mekking
7505703a43 Add CHANGES for [GL #1721]
(cherry picked from commit 8224dc8e35)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
229bc4ee95 Add statschannel test case for key removal
Add a statschannel test case to confirm that when keys are removed
(in this case because of a dnssec-policy change), the corresponding
dnssec-sign stats are cleared and are no longer shown in the
statistics.

(cherry picked from commit 1a3c82f765)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
c499478321 Clear dnssec-sign stats for removed keys
Clear the key slots for dnssec-sign statistics for keys that are
removed. This way, the number of slots will stabilize to the maximum
key usage in a zone and will not grow every time a key rollover is
triggered.

(cherry picked from commit de15e07800)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
7e90ef8f8c Add back the statschannel manykeys test case
Add a test case that has more than four keys (the initial number of
key slots that are created for dnssec-sign statistics). We shouldn't
be expecting weird values.

This fixes some errors in the manykeys zone configuration (keys
were created for algorithm RSASHA256, but the policy expected RSASHA1,
and the zone was not allowing dynamic updates).

This also fixes an error in the calls to 'zones-json.pl': The perl
script excepts an index number where the zone can be found, rather
than the zone name.

(cherry picked from commit 019a52a184)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
df6fb95621 Grow dnssec-sign statistics instead of rotating
We have introduced dnssec-sign statistics to the zone statistics. This
introduced an operational issue because when using zone-statistics
full, the memory usage was going through the roof. We fixed this by
by allocating just four key slots per zone. If a zone exceeds the
number of keys for example through a key rollover, the keys will be
rotated out on a FIFO basis.

This works for most cases, and fixes the immediate problem of high
memory usage, but if you sign your zone with many, many keys, or are
sign with a ZSK/KSK double algorithm strategy you may experience weird
statistics. A better strategy is to grow the number of key slots per
zone on key rollover events.

That is what this commit is doing: instead of rotating the four slots
to track sign statistics, named now grows the number of key slots
during a key rollover (or via some other method that introduces new
keys).

(cherry picked from commit d9cca81d50)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
4a1987a380 Add a function isc_stats_resize
Add a new function to resize the number of counters in a statistics
counter structure. This will be needed when we keep track of DNSSEC
sign statistics and new keys are introduced due to a rollover.

(cherry picked from commit 9acce8a82a)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
4f08beb1de Add stats unit test
Add a simple stats unit test that tests the existing library functions
isc_stats_ncounters, isc_stats_increment, isc_stats_decrement,
isc_stats_set, and isc_stats_update_if_greater.

(manually picked from commit 0bac9c7c5c)
2021-08-24 09:27:38 +02:00
Matthijs Mekking
713ded2cc3 Merge branch '2857-migrate-csk-to-dnssec-policy-v9_16' into 'v9_16'
Test migrating CSK to dnssec-policy (9.16)

See merge request isc-projects/bind9!5351
2021-08-23 08:58:44 +00:00
Matthijs Mekking
4822c2a618 Add a test case for non-SEP CSK migration
A zone with a single key without the SEP bit set must also be assumed
to be a CSK.

(cherry picked from commit a8d0d2feed)
2021-08-23 10:37:17 +02:00
Matthijs Mekking
073f11fcac Changes to kasp script to deal with non-SEP CSK
In order to test cases with non-SEP CSK keys, the Flags Field needs to
be determined differently to deal with such exceptional scenarios.

(cherry picked from commit 36ad0331e2)
2021-08-23 10:37:11 +02:00
Matthijs Mekking
89349b4661 Add change and release note for [#2857]
(cherry picked from commit c43faf44cd)
2021-08-23 10:37:02 +02:00
Matthijs Mekking
db18004d69 Migrate a single key to CSK with dnssec-policy
When migrating keys to dnssec-policy, if a zone has only one key,
assume it is going to be a CSK.

(cherry picked from commit 3ea953512a)
2021-08-23 10:36:42 +02:00
Matthijs Mekking
9df0bf8f17 Test migrating CSK to dnssec-policy
Add a test case for migrating CSK to dnssec-policy. The keymgr has no
way of telling that the key is used as a CSK, but if there is only one
key to migrate it is going to assume it must be a CSK.

(cherry picked from commit 96ee323622)
2021-08-23 10:36:37 +02:00
Michał Kępień
0ccd0468a3 Merge branch '2845-rndc-freeze-edit-include-file-thaw-v9_16' into 'v9_16'
[v9_16] Add test for in-view zone edits

See merge request isc-projects/bind9!5344
2021-08-19 10:36:49 +00:00
Mark Andrews
9eb98e024d wait for each staged to complete
(cherry picked from commit 8e189840b1)
2021-08-19 11:44:38 +02:00
Matthijs Mekking
d9b19dade5 Add test for in-view zone edits
Add a test case for GL #2845 where a zone is in two views, one base
view and one "in-view" and that zone is using an $INCLUDE. Make sure
that there is a jnl file (have ixfr-from-differences enabled and do a
dynamic update). Then freeze and make updates in the included file
(this requires the test.db file also to be updated because 'rndc freeze'
causes the zone file to be overwritten). Finally reload and ensure that
the edit in the included file has been loaded.

(cherry picked from commit 598bf1c29b)
2021-08-19 11:44:38 +02:00
Mark Andrews
b6a744479c Merge branch '2868-svbc-fromwire-should-reject-zero-length-alpn-elements-v9_16' into 'v9_16'
Reject zero length ALPN elements in fromwire

See merge request isc-projects/bind9!5343
2021-08-19 09:18:04 +00:00
Mark Andrews
7d3d7cacf9 Reject zero length ALPN elements in fromwire
(cherry picked from commit 8833d90292)
2021-08-19 18:59:29 +10:00
Mark Andrews
b1583122ca Merge branch '2867-svbc-from-wire-needs-to-check-that-alpn-in-present-when-no-default-alpn-is-present-v9_16' into 'v9_16'
Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire

See merge request isc-projects/bind9!5342
2021-08-19 08:07:15 +00:00
Mark Andrews
c9858fa078 Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire
(cherry picked from commit 2f51bb2d93)
2021-08-19 17:32:32 +10:00
Michał Kępień
6e9eb068bd Merge branch 'v9_16_20-release' into 'v9_16'
Merge 9.16.20 release branch

See merge request isc-projects/bind9!5339
2021-08-19 05:29:23 +00:00
Michał Kępień
2bbec2bf74 Set up release notes for BIND 9.16.21 2021-08-19 07:20:15 +02:00
Tinderbox User
e05387ac12 Merge branch 'prep-release' into security-v9_16 2021-08-19 07:20:15 +02:00
Michał Kępień
d17acf0df3 Merge branch 'michal/prepare-documentation-for-bind-9.16.20' into 'security-v9_16'
Prepare documentation for BIND 9.16.20

See merge request isc-private/bind9!317
2021-08-19 07:20:15 +02:00
Tinderbox User
69dcc8bb58 prep 9.16.20 2021-08-19 07:20:15 +02:00
Michal Nowak
8ae32b0972 Merge branch '2839-confidential-rrl-msgsize-v9_16' into 'security-v9_16'
[CVE-2021-25218]: assertion failure in RRL after EMSGSIZE error (v9.16)

See merge request isc-private/bind9!314
2021-08-19 07:20:15 +02:00
Michał Kępień
e5534b2991 Prepare release notes for BIND 9.16.20 2021-08-19 07:20:15 +02:00
Evan Hunt
21dbf3798c Add CHANGES and release notes for [GL #2839] 2021-08-19 07:20:15 +02:00
Michał Kępień
152a946c6e Add release note for GL #2756 2021-08-19 07:20:15 +02:00
Ondřej Surý
607f8d114e Disable the Path MTU Discover on UDP Sockets
Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.
2021-08-19 07:20:15 +02:00
Michał Kępień
9407ee95c1 Reorder release notes 2021-08-19 07:20:15 +02:00
Evan Hunt
15996f0cb1 ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.

More recently, it was used in a3ba95116e
commit (part of GL #2790) to force the sending of a TC=1 NOERROR
response, triggering a retry via TCP, when a UDP packet could not be
sent due to ISC_R_MAXSIZE.

This ran afoul of a pre-existing INSIST in ns_client_error() when
RRL was in use. the INSIST was based on the assumption that
ns_client_error() could never result in a non-error rcode. as
that assumption is no longer valid, the INSIST has been removed.
2021-08-19 07:20:15 +02:00
Michał Kępień
1a3ac45a04 Tweak and reword release notes 2021-08-19 07:20:15 +02:00