Commit graph

33349 commits

Author SHA1 Message Date
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
Matthijs Mekking
22e5666925 Add test for NSEC3PARAM not changed after restart
Add a test case where 'named' is restarted and ensure that an already
signed zone does not change its NSEC3 parameters.

The test case first tests the current zone and saves the used salt
value. Then after restart it checks if the salt (and other parameters)
are the same as before the restart.

This test case changes 'set_nsec3param'. This will now reset the salt
value, and when checking for NSEC3PARAM we will store the salt and
use it when testing the NXDOMAIN response. This does mean that for
every test case we now have to call 'set_nsec3param' explicitly (and
can not omit it because it is the same as the previous zone).

Finally, slightly changed some echo output to make debugging friendlier.

(cherry picked from commit 08a9e7add1)
2021-06-09 09:18:37 +02:00
Ondřej Surý
4cf637cd9a Merge branch '2732-pause-the-dbiterator-in-dumptostream-v9_16' into 'v9_16'
Pause the dbiterator when dumping the zone to the disk

See merge request isc-projects/bind9!5151
2021-06-04 10:05:36 +00:00
Ondřej Surý
6a43b1e711 Pause the dbiterator when dumping the zone to the disk
When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.

(cherry picked from commit 7e59b8a4a1)
2021-06-04 11:32:31 +02:00
Mark Andrews
884346628d Merge branch '2751-serve-stale-tests-false-negative-v9_16' into 'v9_16'
Address test race condition in serve-stale

See merge request isc-projects/bind9!5145
2021-06-03 09:03:18 +00:00
Mark Andrews
6d84bff565 Address test race condition in serve-stale
the dig.out.test# files could still be being written when the
content greps where being made.

(cherry picked from commit af95cb8ccc)
2021-06-03 18:43:24 +10:00
Mark Andrews
554578e8cb Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing-v9_16' into 'v9_16'
Report which assertion failed when calling set_global_error

See merge request isc-projects/bind9!5144
2021-06-03 08:10:08 +00:00
Mark Andrews
a74b2a4448 Report which assertion failed when calling set_global_error
(cherry picked from commit 66d1df57cb)
2021-06-03 17:36:51 +10:00
Mark Andrews
e2e5e1601a Merge branch '2724-statschannel-system-test-sometimes-hangs-v9_16' into 'v9_16'
Add timeout to url get requests

See merge request isc-projects/bind9!5140
2021-06-02 23:35:16 +00:00
Mark Andrews
3f20e71430 Add timeout to url get requests
to prevent the system test taking forever on failures.

(cherry picked from commit 02726cb66e)
2021-06-03 08:39:12 +10:00
Ondřej Surý
906cd59d88 Merge branch '2746-fix-the-typo-in-setsockopt_off-v9_16' into 'v9_16'
Fix copy&paste error in setsockopt_off

See merge request isc-projects/bind9!5139
2021-06-02 17:23:02 +00:00
Ondřej Surý
bff37dc79b Add CHANGES and release note for [GL #2746]
(cherry picked from commit 22aa929aac)
2021-06-02 18:10:44 +02:00
Ondřej Surý
e528b3241d Fix copy&paste error in setsockopt_off
Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.

(cherry picked from commit f14d870d15)
2021-06-02 18:10:44 +02:00
Michał Kępień
e3de88945c Merge branch '2540-check-dname-resolution-via-itself-v9_16' into 'v9_16'
[v9_16] Check DNAME resolution via itself

See merge request isc-projects/bind9!5136
2021-06-02 13:10:43 +00:00