Commit Graph

33362 Commits

Author SHA1 Message Date
Matthijs Mekking
b2851b3c5f Add changes and notes for [#2783]
(cherry picked from commit dae42dc9d4)
2021-06-22 09:25:54 +02:00
Matthijs Mekking
bb1f0404ab Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.

(cherry picked from commit 42c601ae14)
2021-06-22 09:25:46 +02:00
Matthijs Mekking
e7401506e4 Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.

(cherry picked from commit acd83881ff)
2021-06-22 09:25:40 +02:00
Michał Kępień
7dc60c5953 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16-v9_16' into 'v9_16'
Checking of key-directory and dnssec-policy was broken

See merge request isc-projects/bind9!5197
2021-06-18 09:50:08 +00:00
Mark Andrews
0df4c40d64 Add release note for [GL #2778]
(cherry picked from commit 85033788d3)
2021-06-18 17:29:41 +10:00
Mark Andrews
01f547b34b Add CHANGES for [GL #2778]
(cherry picked from commit bd1419a9e8)
2021-06-18 17:29:41 +10:00
Mark Andrews
efbf4ed5e1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.

(cherry picked from commit d1e283ede1)
2021-06-18 17:29:41 +10:00
Mark Andrews
d3268ea9ad Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query-v9_16' into 'v9_16'
Add w and W to maptoupper and maptolower tables

See merge request isc-projects/bind9!5196
2021-06-18 07:14:37 +00:00
Mark Andrews
467c795bfe Add release note for [GL #2779]
(cherry picked from commit 7372e9a60d)
2021-06-18 16:36:38 +10:00
Mark Andrews
c3fdbcb1c1 Add CHANGES note for [GL #2779]
(cherry picked from commit 8c60debc18)
2021-06-18 16:36:38 +10:00
Mark Andrews
ab597b8b91 Check wild card expansions by code point
(cherry picked from commit c65dc2f7dc)
2021-06-18 16:36:37 +10:00
Mark Andrews
52cc9ff372 Add w and W to maptoupper and maptolower tables
(cherry picked from commit 08eeebb6a7)
2021-06-18 16:35:19 +10:00
Michal Nowak
ebc6fece77 Merge branch 'mnowak/alpine-3.14-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.14

See merge request isc-projects/bind9!5192
2021-06-17 16:24:54 +00:00
Michal Nowak
387fbbd4df Add Alpine Linux 3.14
(cherry picked from commit 80f828bc37)
2021-06-17 18:19:18 +02:00
Michał Kępień
76cd42fb56 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown-v9_16' into 'v9_16'
[v9_16] Allow hash tables for cache RBTs to be grown

See merge request isc-projects/bind9!5191
2021-06-17 15:44:38 +00:00
Michał Kępień
cc6d89f913 Add CHANGES entry
(cherry picked from commit 0c59f1362c)
2021-06-17 17:17:37 +02:00
Michał Kępień
c745b14203 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.

(cherry picked from commit 6b77583f54)
2021-06-17 17:17:37 +02:00
Michał Kępień
c2d9c14354 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.

(cherry picked from commit c096f91451)
2021-06-17 17:17:37 +02:00
Michał Kępień
b5e164d87a Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test-v9_16' into 'v9_16'
[v9_16] Increase timeout in the rndc deadlock test

See merge request isc-projects/bind9!5190
2021-06-17 10:45:12 +00:00
Michał Kępień
b9c9ed6197 Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.

(cherry picked from commit ac4c58e8ce)
2021-06-17 12:41:01 +02:00
Michał Kępień
65b74626e4 Merge branch 'v9_16_17-release' into 'v9_16'
Merge 9.16.17 release branch

See merge request isc-projects/bind9!5187
2021-06-16 20:38:37 +00:00
Michał Kępień
a6b5004a72 Set up release notes for BIND 9.16.18 2021-06-16 22:29:27 +02:00
Tinderbox User
84cc19b692 Merge branch 'prep-release' into v9_16_17-release 2021-06-16 22:29:27 +02:00
Michał Kępień
043f7b5ec1 Merge branch 'michal/prepare-documentation-for-bind-9.16.17' into 'v9_16_17-release'
Prepare documentation for BIND 9.16.17

See merge request isc-private/bind9!300
2021-06-16 22:29:27 +02:00
Tinderbox User
13b9f23cce prep 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
b926b343ed Prepare release notes for BIND 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
f481179977 Reorder release notes 2021-06-16 22:29:27 +02:00
Michał Kępień
a3bbfaf1ff Tweak and reword release notes 2021-06-16 22:29:27 +02:00
Michał Kępień
e0ba988ac8 Tweak and reword recent CHANGES entries 2021-06-16 22:29:27 +02:00
Mark Andrews
08c27ce967 Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment-v9_16' into 'v9_16'
make it clear algorithm field is a domain name

See merge request isc-projects/bind9!5181
2021-06-16 06:48:46 +00:00
Mark Andrews
1281b4f281 make it clear algorithm field is a domain name
(cherry picked from commit 47ca495108)
2021-06-16 16:12:44 +10:00
Mark Andrews
19df77ca48 Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid-v9_16' into 'v9_16'
Lock access to task->threadid

See merge request isc-projects/bind9!5178
2021-06-15 05:04:28 +00:00
Mark Andrews
2c38ba4670 Lock access to task->threadid
(cherry picked from commit 234ad2d075)
2021-06-15 12:53:13 +10:00
Ondřej Surý
a7b3865eac Merge branch 'ondrej/bump-clang-dependency-to-llvm-12-v9_16' into 'v9_16'
Change the LLVM tools version to 12 (v9.16)

See merge request isc-projects/bind9!5175
2021-06-13 09:01:15 +00:00
Ondřej Surý
b0e7511001 Update the source code formatting using clang-format-12
clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.
2021-06-13 08:19:44 +02:00
Ondřej Surý
8c20738feb Change the LLVM tools version to 12
LLVM 12 stable was released on 15. April 2021, change the default
version to the current stable.

(cherry picked from commit 9f7855322c)
2021-06-12 08:58:22 +02:00
Michał Kępień
cc8624c0f6 Merge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations-v9_16' into 'v9_16'
[v9_16] Fix "no DS" proofs for wildcard+CNAME delegations

See merge request isc-projects/bind9!5169
2021-06-10 09:11:16 +00:00
Michał Kępień
5ca495ad4f Add release note
(cherry picked from commit 16708682ad)
2021-06-10 10:26:51 +02:00
Michał Kępień
46001e4de3 Add CHANGES entry
(cherry picked from commit c223d81691)
2021-06-10 10:26:51 +02:00
Michał Kępień
f88c90f47f Fix "no DS" proofs for wildcard+CNAME delegations
When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).

(cherry picked from commit 7a87bf468b)
2021-06-10 10:26:51 +02:00
Michał Kępień
82b7e6ccef Add AUTHORITY tests for CNAME-sourced delegations
Add a set of system tests which check the contents of the AUTHORITY
section for signed, insecure delegation responses constructed from CNAME
records and wildcards, both for zones using NSEC and NSEC3.

(cherry picked from commit 26ec4b9a89)
2021-06-10 10:26:51 +02:00
Michał Kępień
5b9c25bef8 Merge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion-v9_16' into 'v9_16'
[v9_16] Fix the variable checked by a post-load assertion

See merge request isc-projects/bind9!5168
2021-06-10 08:06:31 +00:00
Mark Andrews
3593651559 Fix the variable checked by a post-load assertion
Instead of checking the value of the variable modified two lines earlier
(the number of SOA records present at the apex of the old version of the
zone), one of the RUNTIME_CHECK() assertions in zone_postload() checks
the number of SOA records present at the apex of the new version of the
zone, which is already checked before.  Fix the assertion by making it
check the correct variable.

(cherry picked from commit 098639dc59)
2021-06-10 10:04:21 +02:00
Mark Andrews
63e1a742ee Merge branch '2760-db-unit-test-failure-v9_16' into 'v9_16'
Adjust acceptable count values

See merge request isc-projects/bind9!5159
2021-06-09 23:20:54 +00:00
Mark Andrews
c7216ae382 Adjust acceptable count values
usleep(100000) can be slightly less than 10ms so allow the count
to reach 11.

(cherry picked from commit 2bc454dc2d)
2021-06-10 08:33:46 +10:00
Mark Andrews
dab8e3fa0e Merge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isepoch-v9_16' into 'v9_16'
Address race between zone_settimer and set_key_expiry_warning by

See merge request isc-projects/bind9!5157
2021-06-09 22:05:28 +00:00
Mark Andrews
edd0fe1dca Address race between zone_settimer and set_key_expiry_warning by
adding missing lock.

    WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: read M1, write M2):
    #0 isc_time_isepoch lib/isc/unix/time.c:110
    #1 zone_settimer lib/dns/zone.c:14649
    #2 dns_zone_maintenance lib/dns/zone.c:6281
    #3 dns_zonemgr_forcemaint lib/dns/zone.c:18190
    #4 view_loaded server.c:9654
    #5 call_loaddone lib/dns/zt.c:301
    #6 doneloading lib/dns/zt.c:575
    #7 zone_asyncload lib/dns/zone.c:2259
    #8 task_run lib/isc/task.c:845
    #9 isc_task_run lib/isc/task.c:938
    #10 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #11 process_netievent lib/isc/netmgr/netmgr.c:934
    #12 process_queue lib/isc/netmgr/netmgr.c:1003
    #13 process_all_queues lib/isc/netmgr/netmgr.c:775
    #14 async_cb lib/isc/netmgr/netmgr.c:804
    #15 <null> <null>
    #16 isc__trampoline_run lib/isc/trampoline.c:191
    #17 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 isc_time_set lib/isc/unix/time.c:93
    #1 set_key_expiry_warning lib/dns/zone.c:6430
    #2 del_sigs lib/dns/zone.c:6711
    #3 zone_resigninc lib/dns/zone.c:7113
    #4 zone_maintenance lib/dns/zone.c:11111
    #5 zone_timer lib/dns/zone.c:14588
    #6 task_run lib/isc/task.c:845
    #7 isc_task_run lib/isc/task.c:938
    #8 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #9 process_netievent lib/isc/netmgr/netmgr.c:934
    #10 process_queue lib/isc/netmgr/netmgr.c:1003
    #11 process_all_queues lib/isc/netmgr/netmgr.c:775
    #12 async_cb lib/isc/netmgr/netmgr.c:804
    #13 <null> <null>
    #14 isc__trampoline_run lib/isc/trampoline.c:191
    #15 <null> <null>

    SUMMARY: ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch

(cherry picked from commit 3d66e97a28)
2021-06-09 23:56:47 +10:00
Matthijs Mekking
35a1a6e5c1 Merge branch '2725-nsec3param-changes-on-restart-v9_16' into 'v9_16'
Fix NSEC3 resalt on restart (9.16)

See merge request isc-projects/bind9!5154
2021-06-09 08:01:25 +00:00
Matthijs Mekking
203652baef Add release note and change entry for [#2725]
(cherry picked from commit d51aed7112)
2021-06-09 09:18:51 +02:00
Matthijs Mekking
7893064f2e Fix NSEC3 resalting upon restart
When named restarts, it will examine signed zones and checks if the
current denial of existence strategy matches the dnssec-policy. If not,
it will schedule to create a new NSEC(3) chain.

However, on startup the zone database may not be read yet, fooling
BIND that the denial of existence chain needs to be created. This
results in a replacement of the previous NSEC(3) chain.

Change the code such that if the NSEC3PARAM lookup failed (the result
did not return in ISC_R_SUCCESS or ISC_R_NOTFOUND), we will try
again later. The nsec3param structure has additional variables to
signal if the lookup is postponed. We also need to save the signal
if an explicit resalt was requested.

In addition to the two added boolean variables, we add a variable to
store the NSEC3PARAM rdata. This may have a yet to be determined salt
value. We can't create the private data yet because there may be a
mismatch in salt length and the NULL salt value.

(cherry picked from commit 0ae3ffdc1c)
2021-06-09 09:18:44 +02:00