]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agodeprecate "dialup" and "heartbeat-interval"
Evan Hunt [Mon, 3 Jul 2023 23:34:22 +0000 (16:34 -0700)] 
deprecate "dialup" and "heartbeat-interval"

these options concentrate zone maintenance actions into
bursts for the benefit of servers with intermittent connections.
that's no longer something we really need to optimize.

2 years agoMerge branch '4229-nextpart-failed-set-e-fallout' into 'main'
Mark Andrews [Wed, 2 Aug 2023 00:21:26 +0000 (00:21 +0000)] 
Merge branch '4229-nextpart-failed-set-e-fallout' into 'main'

Resolve "nextpart failed, set -e fallout?"

Closes #4229

See merge request isc-projects/bind9!8149

2 years agoAdd sleep 1 so that the signing happens in a different second
Mark Andrews [Thu, 27 Jul 2023 22:38:20 +0000 (08:38 +1000)] 
Add sleep 1 so that the signing happens in a different second

2 years agoUse $() instead of backticks
Mark Andrews [Thu, 27 Jul 2023 19:24:01 +0000 (05:24 +1000)] 
Use $() instead of backticks

2 years agoCorrectly grep nextpart output
Mark Andrews [Thu, 27 Jul 2023 19:22:43 +0000 (05:22 +1000)] 
Correctly grep nextpart output

2 years agoMerge branch '4059-oracle-linux-8-shell-doesn-t-always-restore-environment-variable...
Mark Andrews [Tue, 1 Aug 2023 23:47:38 +0000 (23:47 +0000)] 
Merge branch '4059-oracle-linux-8-shell-doesn-t-always-restore-environment-variable-correctly' into 'main'

Resolve "Oracle Linux 8 shell doesn't always restore environment variable correctly"

Closes #4059

See merge request isc-projects/bind9!7908

2 years agoUse sub shell to isolate enviroment changes
Mark Andrews [Thu, 11 May 2023 02:09:26 +0000 (12:09 +1000)] 
Use sub shell to isolate enviroment changes

'HOME=value command' should only change HOME for command but on
some platforms this occasionally sets HOME for the rest of the
test. Explicitly isolate the enviroment change using a sub shell.

2 years agoMerge branch '4226-dig-help-message-https-plain-get-vs-http-plain-get' into 'main'
Arаm Sаrgsyаn [Tue, 1 Aug 2023 10:39:26 +0000 (10:39 +0000)] 
Merge branch '4226-dig-help-message-https-plain-get-vs-http-plain-get' into 'main'

Fix dig help message typo in the http-plain-get option

Closes #4226

See merge request isc-projects/bind9!8148

2 years agoFix dig help message typo in the http-plain-get option
Aram Sargsyan [Thu, 27 Jul 2023 11:17:42 +0000 (11:17 +0000)] 
Fix dig help message typo in the http-plain-get option

The option name is misspelled as 'https-plain-get'. Fix the error.

2 years agoMerge branch '4032-ignore-max-zone-ttl-dnssec-policy-insecure' into 'main'
Matthijs Mekking [Tue, 1 Aug 2023 07:46:22 +0000 (07:46 +0000)] 
Merge branch '4032-ignore-max-zone-ttl-dnssec-policy-insecure' into 'main'

Ignore max-zone-ttl on dnssec-policy insecure

Closes #4032

See merge request isc-projects/bind9!8142

2 years agoAdd CHANGES and release note for #4032
Matthijs Mekking [Wed, 26 Jul 2023 09:55:20 +0000 (11:55 +0200)] 
Add CHANGES and release note for #4032

2 years agoIgnore max-zone-ttl on dnssec-policy insecure
Matthijs Mekking [Wed, 26 Jul 2023 09:50:57 +0000 (11:50 +0200)] 
Ignore max-zone-ttl on dnssec-policy insecure

Allow larger TTL values in zones that go insecure. This is necessary
because otherwise the zone will not be loaded due to the max-zone-ttl
of P1D that is part of the current insecure policy.

In the keymgr.c code, default back to P1D if the max-zone-ttl is set
to zero.

2 years agoMerge branch '3677-dnssec-policy-inline-signing' into 'main'
Matthijs Mekking [Tue, 1 Aug 2023 06:55:56 +0000 (06:55 +0000)] 
Merge branch '3677-dnssec-policy-inline-signing' into 'main'

Add inline-signing to dnssec-policy

Closes #3677

See merge request isc-projects/bind9!7204

2 years agoAdd release note and CHANGES for GL #3677
Matthijs Mekking [Fri, 9 Dec 2022 11:42:05 +0000 (12:42 +0100)] 
Add release note and CHANGES for GL #3677

News worthy.

2 years agoRemove redundant inline-signing lines from docs
Matthijs Mekking [Fri, 9 Dec 2022 11:36:38 +0000 (12:36 +0100)] 
Remove redundant inline-signing lines from docs

Now that inline-signing is explicitly set in dnssec-policy, remove
the redundant "inline-signing yes;" lines from the documentation.

2 years agoRemove redundant inline-signing lines from tests
Matthijs Mekking [Mon, 3 Apr 2023 15:13:34 +0000 (17:13 +0200)] 
Remove redundant inline-signing lines from tests

Now that inline-signing is explicitly set in dnssec-policy, remove
the redundant "inline-signing yes;" lines from the system tests.

2 years agoUpdate inline-signing checkconf code
Matthijs Mekking [Fri, 9 Dec 2022 11:22:49 +0000 (12:22 +0100)] 
Update inline-signing checkconf code

When using automated DNSSEC management, it is required that the zone
is dynamic, or that inline-signing is enabled (or both). Update the
checkconf code to also allow inline-signing to be enabled within
dnssec-policy.

2 years agoAdd inline-signing to dnssec-policy
Matthijs Mekking [Mon, 3 Apr 2023 15:00:36 +0000 (17:00 +0200)] 
Add inline-signing to dnssec-policy

Add an option to enable/disable inline-signing inside the
dnssec-policy clause. The existing inline-signing option that is
set in the zone clause takes priority, but if it is omitted, then the
value that is set in dnssec-policy is taken.

The built-in policies use inline-signing.

This means that if you want to use the default policy without
inline-signing you either have to set it explicitly in the zone
clause:

    zone "example" {
        ...
        dnssec-policy default;
        inline-signing no;
    };

Or create a new policy, only overriding the inline-signing option:

    dnssec-policy "default-dynamic" {
        inline-signing no;
    };

    zone "example" {
        ...
        dnssec-policy default-dynamic;
    };

This also means that if you are going insecure with a dynamic zone,
the built-in "insecure" policy needs to be accompanied with
"inline-signing no;".

2 years agoMerge branch '4196-use-rculist-for-dns_db_updatenotify' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 16:12:54 +0000 (16:12 +0000)] 
Merge branch '4196-use-rculist-for-dns_db_updatenotify' into 'main'

Use cds_lfht for updatenotify mechanism in dns_db unit

Closes #4196

See merge request isc-projects/bind9!8097

2 years agofixup! Use cds_lfht for updatenotify mechanism in dns_db unit
Ondřej Surý [Mon, 31 Jul 2023 16:03:45 +0000 (18:03 +0200)] 
fixup! Use cds_lfht for updatenotify mechanism in dns_db unit

2 years agoUse cds_lfht for updatenotify mechanism in dns_db unit
Ondřej Surý [Mon, 10 Jul 2023 09:36:19 +0000 (11:36 +0200)] 
Use cds_lfht for updatenotify mechanism in dns_db unit

The updatenotify mechanism in dns_db relied on unlocked ISC_LIST for
adding and removing the "listeners".  The mechanism relied on the
exclusive mode - it should have been updated only during reconfiguration
of the server.  This turned not to be true anymore in the dns_catz - the
updatenotify list could have been updated during offloaded work as the
offloaded threads are not subject to the exclusive mode.

Change the update_listeners to be cds_lfht (lock-free hash-table), and
slightly refactor how register and unregister the callbacks - the calls
are now idempotent (the register call already was and the return value
of the unregister function was mostly ignored by the callers).

2 years agoMerge branch 'ondrej/add-isc_rwlock-unit-test' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 16:08:46 +0000 (16:08 +0000)] 
Merge branch 'ondrej/add-isc_rwlock-unit-test' into 'main'

Add rwlock unit test

See merge request isc-projects/bind9!7859

2 years agoAdd rwlock unit test
Ondřej Surý [Thu, 30 Mar 2023 08:08:52 +0000 (10:08 +0200)] 
Add rwlock unit test

Add simple rwlock unit test and rwlock benchmark.  The benchmark
compares the pthread rwlock with isc rwlock implementation, so it's
mainly useful when developing a new isc rwlock implementation.

2 years agoMerge branch '4223-replace-dns_badcache-hashtable-implementation' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 13:54:11 +0000 (13:54 +0000)] 
Merge branch '4223-replace-dns_badcache-hashtable-implementation' into 'main'

Refactor dns_badcache to use cds_lfht lock-free hashtable

Closes #4223

See merge request isc-projects/bind9!8139

2 years agoAdd CHANGES note for [GL #4223]
Ondřej Surý [Tue, 27 Jun 2023 07:05:46 +0000 (09:05 +0200)] 
Add CHANGES note for [GL #4223]

2 years agoCall rcu_barrier() five times in the isc__mem_destroy()
Ondřej Surý [Tue, 27 Jun 2023 06:26:12 +0000 (08:26 +0200)] 
Call rcu_barrier() five times in the isc__mem_destroy()

Because rcu_barrier() needs to be called as many times as the number of
nested call_rcu() calls (call_rcu() calls made from call_rcu thread),
and currently there's no mechanism to detect whether there are more
call_rcu callbacks scheduled, we simply call the rcu_barrier() multiple
times.  The overhead is negligible and it prevents rare assertion
failures caused by the check for memory leaks in isc__mem_destroy().

2 years agoDon't cleanup the dns_message_checksig fuzzer in atexit handler
Ondřej Surý [Thu, 22 Jun 2023 13:43:04 +0000 (15:43 +0200)] 
Don't cleanup the dns_message_checksig fuzzer in atexit handler

After the dns_badcache refactoring, the dns_badcache_destroy() would
call call_rcu().  The dns_message_checksig cleanup which calls
dns_view_detach() happens in the atexit handler, so there might be
call_rcu threads started very late in the process.  The liburcu
registers library destructor that destroys the data structured internal
to liburcu and this clashes with the call_rcu thread that just got
started in the atexit() handler causing either (depending on timing):

 - a normal run
 - a straight segfault
 - an assertion failure from liburcu

Instead of trying to cleanup the dns_message_checksig unit, ignore the
leaked memory as we do with all the other fuzzing tests.

2 years agoMake the load-names benchmark multithreaded
Ondřej Surý [Wed, 21 Jun 2023 12:10:28 +0000 (14:10 +0200)] 
Make the load-names benchmark multithreaded

The load-names benchmark was originally only measuring single thread
performance of the data structures.  As this is not how those are used
in the real life, it was refactored to be multi-threaded with proper
protections in place (rwlock for ht, hashmap and rbt; transactions for
qp).

The qp test has been extended to see effect of the dns_qp_compact() and
rcu_barrier() on the overall speed and memory consumption.

2 years agoRefactor dns_badcache to use cds_lfht lock-free hashtable
Ondřej Surý [Mon, 19 Jun 2023 13:43:02 +0000 (15:43 +0200)] 
Refactor dns_badcache to use cds_lfht lock-free hashtable

The dns_badcache unit had (yet another) own locked hashtable
implementation.  Replace the hashtable used by dns_badcache with
lock-free cds_lfht implementation from liburcu.

2 years agoMerge branch 'stepan/fix-check-in-ecdsa-system-test' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 07:14:27 +0000 (07:14 +0000)] 
Merge branch 'stepan/fix-check-in-ecdsa-system-test' into 'main'

Fix ecdsa256 check in ecdsa system test setup

See merge request isc-projects/bind9!8053

2 years agoFix ecdsa256 check in ecdsa system test setup
Štěpán Balážik [Sat, 24 Jun 2023 09:45:50 +0000 (11:45 +0200)] 
Fix ecdsa256 check in ecdsa system test setup

Probably by copy-paste mistake, ecdsa384 was checked twice.

2 years agoMerge branch '4086-run-dispentry_destroy-on-associated-loop' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 07:07:50 +0000 (07:07 +0000)] 
Merge branch '4086-run-dispentry_destroy-on-associated-loop' into 'main'

Pin dns_request to the associated loop

Closes #4086

See merge request isc-projects/bind9!8137

2 years agoAdd CHANGES note for [GL #4086]
Ondřej Surý [Wed, 26 Jul 2023 12:18:31 +0000 (14:18 +0200)] 
Add CHANGES note for [GL #4086]

2 years agoPin dns_request to the associated loop
Ondřej Surý [Tue, 25 Jul 2023 08:30:09 +0000 (10:30 +0200)] 
Pin dns_request to the associated loop

When dns_request was canceled via dns_requestmgr_shutdown() the cancel
event would be propagated on different loop (loop 0) than the loop where
request was created on.  In turn this would propagate down to isc_netmgr
where we require all the events to be called from the matching isc_loop.

Pin the dns_requests to the loops and ensure that all the events are
called on the associated loop.  This in turn allows us to remove the
hashed locks on the requests and change the single .requests list to be
a per-loop list for the request accounting.

Additionally, do some extra cleanup because some race condititions are
now not possible as all events on the dns_request are serialized.

2 years agoMerge branch 'ondrej/remove__tsan_acquire_release-hints' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 06:59:44 +0000 (06:59 +0000)] 
Merge branch 'ondrej/remove__tsan_acquire_release-hints' into 'main'

Cleanup the __tsan_acquire/__tsan_release

See merge request isc-projects/bind9!8114

2 years agoCleanup the __tsan_acquire/__tsan_release
Ondřej Surý [Wed, 19 Jul 2023 06:58:31 +0000 (08:58 +0200)] 
Cleanup the __tsan_acquire/__tsan_release

With ThreadSanitizer support added to the Userspace RCU, we no longer
need to wrap the call_rcu and caa_container_of with
__tsan_{acquire,release} hints.  Remove the direct calls to
__tsan_{acquire,release} and the isc_urcu_{container,cleanup} macros.

2 years agoMerge branch '4225-return-refused-if-gssapi-not-configured' into 'main'
Mark Andrews [Fri, 28 Jul 2023 06:43:58 +0000 (06:43 +0000)] 
Merge branch '4225-return-refused-if-gssapi-not-configured' into 'main'

Resolve "SERVFAIL response to TKEY query"

Closes #4225

See merge request isc-projects/bind9!8146

2 years agoAdd CHANGES for [GL #4225]
Mark Andrews [Wed, 26 Jul 2023 22:51:11 +0000 (08:51 +1000)] 
Add CHANGES for [GL #4225]

2 years agoCheck GSS-API TKEY against non configured server
Mark Andrews [Thu, 27 Jul 2023 07:08:34 +0000 (17:08 +1000)] 
Check GSS-API TKEY against non configured server

Check for the expected error message which includes rcode REFUSED
then reload the server to specify the keytab for the rest of the
GSSAPI tests.

2 years agoReport TKEY query errors in nsupdate
Mark Andrews [Thu, 27 Jul 2023 06:47:09 +0000 (16:47 +1000)] 
Report TKEY query errors in nsupdate

2 years agoReturn REFUSED if GSSAPI is not configured
Mark Andrews [Wed, 26 Jul 2023 22:34:45 +0000 (08:34 +1000)] 
Return REFUSED if GSSAPI is not configured

Return REFUSED if neither a keytab nor a gssapi credential is
configured to GSSAPI/TKEY requests.

2 years agoMerge branch 'ondrej/workaround-the-ASAN-report-for-cds_lfht_for_each_entry' into...
Ondřej Surý [Thu, 27 Jul 2023 13:22:08 +0000 (13:22 +0000)] 
Merge branch 'ondrej/workaround-the-ASAN-report-for-cds_lfht_for_each_entry' into 'main'

Workaround AddressSanitizer overzealous check

See merge request isc-projects/bind9!8116

2 years agoWorkaround AddressSanitizer overzealous check
Ondřej Surý [Thu, 22 Jun 2023 10:25:45 +0000 (12:25 +0200)] 
Workaround AddressSanitizer overzealous check

The cds_lfht_for_each_entry and cds_lfht_for_each_entry_duplicate macros
had a code that operated on the NULL pointer, at the end of the list it
was calling caa_container_of() on the NULL pointer in the init-clause
and iteration-expression, but the result wasn't actually used anywhere
because the cond-expression in the for loop has prevented executing
loop-statement.  This made AddressSanitizer notice the invalid operation
and rightfully complain.

This was reported to the upstream and fixed there.  Pull the upstream
fix into our <isc/urcu.h> header, so our CI checks pass.

2 years agoMerge branch '4227-free-stub_glue_request-in-stub_glue_response' into 'main'
Ondřej Surý [Thu, 27 Jul 2023 10:34:20 +0000 (10:34 +0000)] 
Merge branch '4227-free-stub_glue_request-in-stub_glue_response' into 'main'

Free struct stub_glue_request in stub_glue_response() callback

Closes #4227

See merge request isc-projects/bind9!8147

2 years agoAdd CHANGES note for [GL #4227]
Ondřej Surý [Thu, 27 Jul 2023 09:33:22 +0000 (11:33 +0200)] 
Add CHANGES note for [GL #4227]

2 years agoFree struct stub_glue_request in stub_glue_response() callback
Ondřej Surý [Thu, 27 Jul 2023 09:31:06 +0000 (11:31 +0200)] 
Free struct stub_glue_request in stub_glue_response() callback

When stub_glue_response() is called, the associated data is stored in
newly allocated struct stub_glue_request.  The allocated structure is
never freed in the callback, thus we leak a little bit of memory.

2 years agoUnify the naming for struct stub_glue_request
Ondřej Surý [Thu, 27 Jul 2023 09:31:06 +0000 (11:31 +0200)] 
Unify the naming for struct stub_glue_request

The stub_request_nameserver_address() used 'request' as name for
struct stub_glue_request leading to confusion between 'request'
(stub_glue_request) and 'request->request' (dns_request_t).

Unify the name to 'sgr' already used in struct stub_glue_response().

2 years agoMerge branch 'ondrej/cleanup-isc_stats_create-return' into 'main'
Ondřej Surý [Thu, 27 Jul 2023 10:10:26 +0000 (10:10 +0000)] 
Merge branch 'ondrej/cleanup-isc_stats_create-return' into 'main'

Refactor isc_stats_create() and its downstream users to return void

See merge request isc-projects/bind9!8055

2 years agoRefactor ns_server_create() to return void
Ondřej Surý [Mon, 26 Jun 2023 09:09:26 +0000 (11:09 +0200)] 
Refactor ns_server_create() to return void

After isc_stats_create() change, the ns_server_create() cannot fail, so
refactor the function to return void and fix all its uses.

2 years agoRefactor dns_zone_create() to return void
Ondřej Surý [Mon, 26 Jun 2023 09:09:26 +0000 (11:09 +0200)] 
Refactor dns_zone_create() to return void

After isc_stats_create() change, the dns_zone_create() cannot fail, so
refactor the function to return void and fix all its uses.

2 years agoRefactor dns_adb_create() to return void
Ondřej Surý [Mon, 26 Jun 2023 09:04:33 +0000 (11:04 +0200)] 
Refactor dns_adb_create() to return void

After isc_stats_create() change, the dns_adb_create() cannot fail, so
refactor the function to return void and fix all its uses.

2 years agoRefactor isc_stats_create() and its downstream users to return void
Ondřej Surý [Mon, 26 Jun 2023 08:58:30 +0000 (10:58 +0200)] 
Refactor isc_stats_create() and its downstream users to return void

The isc_stats_create() can no longer return anything else than
ISC_R_SUCCESS.  Refactor isc_stats_create() and its variants in libdns,
libns and named to just return void.

2 years agoMerge branch '4055-improve-the-overmem-cache-cleaning-test' into 'main'
Tom Krizek [Wed, 26 Jul 2023 11:24:36 +0000 (11:24 +0000)] 
Merge branch '4055-improve-the-overmem-cache-cleaning-test' into 'main'

[CVE-2023-2828] Add test for dns_rbtdb overmem purging

Closes #4055

See merge request isc-projects/bind9!8141

2 years agoAdd test for dns_rbtdb overmem purging
Ondřej Surý [Tue, 6 Jun 2023 12:55:22 +0000 (14:55 +0200)] 
Add test for dns_rbtdb overmem purging

Add a unit test to check if the overmem purging in the RBTDB is
effective when mixed size RR data is inserted into the database.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Jinmei Tatuya <jtatuya@infoblox.com>
2 years agoMerge branch '4089-stale-query-loop-test' into 'main'
Tom Krizek [Tue, 25 Jul 2023 08:34:00 +0000 (08:34 +0000)] 
Merge branch '4089-stale-query-loop-test' into 'main'

Reproducer for CVE-2023-2911

Closes #4089

See merge request isc-projects/bind9!8132

2 years agoReproducer for CVE-2023-2911
Tom Krizek [Mon, 24 Jul 2023 14:29:31 +0000 (16:29 +0200)] 
Reproducer for CVE-2023-2911

The conditions that trigger the crash:
- a stale record is in cache
- stale-answer-client-timeout is 0
- multiple clients query for the stale record, enough of them to exceed
  the recursive-clients quota
- the response from the authoritative is sufficiently delayed so that
  recursive-clients quota is exceeded first

The reproducer attempts to simulate this situation. However, it hasn't
proven to be 100 % reproducible, especially in CI. When reproducing
locally, the priming query also seems to sometimes interfere and prevent
the crash. When the reproducer is ran twice, it appears to be more
reliable in reproducing the issue.

2 years agoMerge branch 'tkrizek/checkconf-keys-dir-set-e' into 'main'
Tom Krizek [Tue, 25 Jul 2023 07:20:31 +0000 (07:20 +0000)] 
Merge branch 'tkrizek/checkconf-keys-dir-set-e' into 'main'

Clean up keys directory in checkconf test

See merge request isc-projects/bind9!8133

2 years agoClean up keys directory in checkconf test
Tom Krizek [Mon, 24 Jul 2023 16:35:13 +0000 (18:35 +0200)] 
Clean up keys directory in checkconf test

The keys directory should be cleaned up in clean.sh. Doing that in the
test itself isn't reliable which may lead to failing mkdir which causes
the test to fail with set -e.

2 years agoMerge branch '4222-inline-system-test-ns7-fails-to-start' into 'main'
Matthijs Mekking [Tue, 25 Jul 2023 06:42:17 +0000 (06:42 +0000)] 
Merge branch '4222-inline-system-test-ns7-fails-to-start' into 'main'

Change RSASHA256 key length to be FIPS compliant

Closes #4222

See merge request isc-projects/bind9!8131

2 years agoChange RSASHA256 key length to be FIPS compliant
Matthijs Mekking [Mon, 24 Jul 2023 12:04:15 +0000 (14:04 +0200)] 
Change RSASHA256 key length to be FIPS compliant

After commit f4eb3ba4, that is part of removing 'auto-dnssec', the
inline system test started to fail in FIPS CI jobs. This is because
the 'nsec3-loop' zone started to use a RSASHA256 key size of 1024 and
this is not FIPS compliant.

This commit changes the key size from 1024 to 4096, in order to
become FIPS compliant again.

2 years agoMerge branch 'ondrej/cleanup-cruft-in-dns_catz' into 'main'
Ondřej Surý [Mon, 24 Jul 2023 17:54:26 +0000 (17:54 +0000)] 
Merge branch 'ondrej/cleanup-cruft-in-dns_catz' into 'main'

Cleanup the dns_catz unit API

See merge request isc-projects/bind9!8099

2 years agoFix TSAN data race accessing zone->parentcatz
Ondřej Surý [Mon, 24 Jul 2023 14:10:47 +0000 (16:10 +0200)] 
Fix TSAN data race accessing zone->parentcatz

The zone->parentcatz was accessed unlocked in dns_zone_get_parentcatz(),
add a locking around it.

2 years agoTest catz member zone fail-safe recreation
Aram Sargsyan [Mon, 24 Jul 2023 11:26:05 +0000 (11:26 +0000)] 
Test catz member zone fail-safe recreation

The catz module has a fail-safe code to recreate a member zone
that was expected to exist but was not found.

Improve a test case where the fail-safe code is expected to execute
to check that the log message exists.

Add a test case where the fail-safe code is not expected to execute
to check that the log message does not exist.

2 years agoCleanup the dns_catz unit API
Ondřej Surý [Wed, 12 Jul 2023 07:22:11 +0000 (09:22 +0200)] 
Cleanup the dns_catz unit API

1. Change the _new, _add and _copy functions to return the new object
   instead of returning 'void' (or always ISC_R_SUCCESS)

2. Cleanup the isc_ht_find() + isc_ht_add() usage - the code is always
   locked with catzs->lock (mutex), so when isc_ht_find() returns
   ISC_R_NOTFOUND, the isc_ht_add() must always succeed.

3. Instead of returning direct iterator for the catalog zone entries,
   add dns_catz_zone_for_each_entry2() function that calls callback
   for each catalog zone entry and passes two extra arguments to the
   callback.  This will allow changing the internal storage for the
   catalog zone entries.

4. Cleanup the naming - dns_catz_<fn>_<obj> -> dns_catz_<obj>_<fn>, as an
   example dns_catz_new_zone() gets renamed to dns_catz_zone_new().

2 years agoMerge branch '4221-multisigner-add-nsupdate-return-value-checks' into 'main'
Matthijs Mekking [Mon, 24 Jul 2023 15:18:44 +0000 (15:18 +0000)] 
Merge branch '4221-multisigner-add-nsupdate-return-value-checks' into 'main'

Add nsupdate retvalue checks in multisigner test

See merge request isc-projects/bind9!8130

2 years agoAdd nsupdate retvalue checks in multisigner test
Matthijs Mekking [Mon, 24 Jul 2023 09:48:07 +0000 (11:48 +0200)] 
Add nsupdate retvalue checks in multisigner test

Ensure the nsupdate command executes with success.

Add a couple of 'n=$((n+1))' and explicit 'ret=0' to clearly mark the
start of a new check.

2 years agoMerge branch '4215-add-isc_r_timedout-to-the-reasons-to-call-dns_zonemgr_unreachablea...
Mark Andrews [Fri, 21 Jul 2023 22:57:38 +0000 (22:57 +0000)] 
Merge branch '4215-add-isc_r_timedout-to-the-reasons-to-call-dns_zonemgr_unreachableadd-in-xfrin' into 'main'

Resolve "Add ISC_R_TIMEDOUT to the reasons to call dns_zonemgr_unreachableadd in xfrin"

Closes #4215

See merge request isc-projects/bind9!8122

2 years agoAdd CHANGES note for [GL #4215]
Mark Andrews [Wed, 19 Jul 2023 23:18:54 +0000 (09:18 +1000)] 
Add CHANGES note for [GL #4215]

2 years agoMark a primary as unreachable on timed out in xfin
Mark Andrews [Wed, 19 Jul 2023 23:16:03 +0000 (09:16 +1000)] 
Mark a primary as unreachable on timed out in xfin

When a primary server is not responding, mark it as temporarialy
unreachable.  This will prevent too many zones queuing up on a
unreachable server and allow the refresh process to move onto
the next primary sooner once it has been so marked.

2 years agoMerge branch '4200-placeholder' into 'main'
Ondřej Surý [Thu, 20 Jul 2023 16:40:42 +0000 (16:40 +0000)] 
Merge branch '4200-placeholder' into 'main'

Add CHANGES placeholder for [GL #4200]

Closes #4200

See merge request isc-projects/bind9!8127

2 years agoAdd CHANGES placeholder for [GL #4200]
Ondřej Surý [Thu, 20 Jul 2023 16:40:08 +0000 (18:40 +0200)] 
Add CHANGES placeholder for [GL #4200]

2 years agoMerge branch '4212-dead-code-in-dns_rbt-zonedb' into 'main'
Ondřej Surý [Thu, 20 Jul 2023 16:00:13 +0000 (16:00 +0000)] 
Merge branch '4212-dead-code-in-dns_rbt-zonedb' into 'main'

Restore the IS_STUB() condition in zone_zonecut_callback

Closes #4212

See merge request isc-projects/bind9!8117

2 years agoRestore the IS_STUB() condition in zone_zonecut_callback
Ondřej Surý [Wed, 19 Jul 2023 10:07:25 +0000 (12:07 +0200)] 
Restore the IS_STUB() condition in zone_zonecut_callback

After the refactoring the condition whether to use DNAME or NS for the
zonecut was incorrectly simplified and the !IS_STUB() condition was
removed.  This was flagged by Coverity as:

/lib/dns/rbt-zonedb.c: 192 in zone_zonecut_callback()
186      found = ns_header;
187      search->zonecut_sigheader = NULL;
188      } else if (dname_header != NULL) {
189      found = dname_header;
190      search->zonecut_sigheader = sigdname_header;
191      } else if (ns_header != NULL) {
>>>     CID 462773:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "found = ns_header;".
192      found = ns_header;
193      search->zonecut_sigheader = NULL;
194      }
195
196      if (found != NULL) {
197      /*

Instead of removing the extra block, restore the !IS_STUB() condition
for the first if block.

2 years agoMerge branch 'tkrizek/multisigner-test-pytest-glue' into 'main'
Tom Krizek [Thu, 20 Jul 2023 15:55:09 +0000 (15:55 +0000)] 
Merge branch 'tkrizek/multisigner-test-pytest-glue' into 'main'

Add missing pytest glue to run multisigner test

See merge request isc-projects/bind9!8126

2 years agoAdd missing pytest glue to run multisigner test
Tom Krizek [Thu, 20 Jul 2023 13:31:56 +0000 (15:31 +0200)] 
Add missing pytest glue to run multisigner test

Without the pytest glue file, the multisigner/tests.sh isn't picked
up by the pytest runner and the test isn't executed.

Related !6901

2 years agoMerge branch '3672-remove-auto-dnssec' into 'main'
Matthijs Mekking [Thu, 20 Jul 2023 14:37:30 +0000 (14:37 +0000)] 
Merge branch '3672-remove-auto-dnssec' into 'main'

Remove auto-dnssec

Closes #3672

See merge request isc-projects/bind9!8085

2 years agoUpdate autosign system test
Matthijs Mekking [Thu, 20 Jul 2023 13:34:53 +0000 (15:34 +0200)] 
Update autosign system test

When checking for the number of logs related to DNSKEY key maintenance
events, don't include CDNSKEY is published lines.

Also consider RSASHA1: If not supported, the key maintenance for
the nsec-only zone are not logged.

2 years agoAdd release note and CHANGES for #3672
Matthijs Mekking [Tue, 11 Jul 2023 14:57:42 +0000 (16:57 +0200)] 
Add release note and CHANGES for #3672

"The king is dead. Long live the king."

2 years agoObsolete dnssec-update-mode
Matthijs Mekking [Tue, 11 Jul 2023 14:49:45 +0000 (16:49 +0200)] 
Obsolete dnssec-update-mode

We no longer support 'no-resign' and thus the configuration option
becomes obsolete. Remove the corresponding dnssec system test cases.

2 years agoTiny refactor revoked key check
Matthijs Mekking [Tue, 11 Jul 2023 12:51:24 +0000 (14:51 +0200)] 
Tiny refactor revoked key check

This makes the code flow a bit more readable.

2 years agoObsolete dnssec-dnskey-kskonly update-check-ksk
Matthijs Mekking [Tue, 11 Jul 2023 11:57:49 +0000 (13:57 +0200)] 
Obsolete dnssec-dnskey-kskonly update-check-ksk

These two configuration options worked in conjunction with 'auto-dnssec'
to determine KSK usage, and thus are now obsoleted.

However, in the code we keep KSK processing so that when a zone is
reconfigured from using 'dnssec-policy' immediately to 'none' (without
going through 'insecure'), the zone is not immediately made bogus.

Add one more test case for going straight to none, now with a dynamic
zone (no inline-signing).

2 years agoRefactor KSK processing
Matthijs Mekking [Tue, 11 Jul 2023 12:01:36 +0000 (14:01 +0200)] 
Refactor KSK processing

There are multiple almost identical code blocks, time to make a
function.

2 years agoObsolete sig-validity-interval dnskey-sig-validity
Matthijs Mekking [Wed, 5 Jul 2023 08:59:24 +0000 (10:59 +0200)] 
Obsolete sig-validity-interval dnskey-sig-validity

These two configuration options worked in conjunction with 'auto-dnssec'
to set the signature validity, and thus are now obsoleted.

2 years agoRemove remaining auto-dnssec bits
Matthijs Mekking [Wed, 5 Jul 2023 07:46:10 +0000 (09:46 +0200)] 
Remove remaining auto-dnssec bits

Remove the remaining bits related to 'auto-dnssec'.

2 years agoRemove auto-dnssec check
Matthijs Mekking [Wed, 5 Jul 2023 07:42:24 +0000 (09:42 +0200)] 
Remove auto-dnssec check

Remove the check configuration parts related to 'auto-dnssec'.

2 years agoRemove auto-dnssec from documentation
Matthijs Mekking [Tue, 4 Jul 2023 15:08:21 +0000 (17:08 +0200)] 
Remove auto-dnssec from documentation

Update the ARM and DNSSEC guide, removing references to 'auto-dnssec',
replacing them with 'dnssec-policy' if needed.

The section "Alternative Ways" of signing has to be refactored, since
we now only focus on one alternative way, that is manual signing.

2 years agoRemove the auto-dnssec option
Matthijs Mekking [Tue, 4 Jul 2023 15:06:36 +0000 (17:06 +0200)] 
Remove the auto-dnssec option

Mark the "auto-dnssec" option ancient (effectively disallowing it from
the configuration).

2 years agoUpdate zonechecks system test
Matthijs Mekking [Thu, 29 Jun 2023 09:28:01 +0000 (11:28 +0200)] 
Update zonechecks system test

Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

2 years agoUpdate views system test
Matthijs Mekking [Thu, 29 Jun 2023 09:23:34 +0000 (11:23 +0200)] 
Update views system test

Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

Because we now use 'dnssec-policy', there is no need to create an
explicit key in the final test that adds multiple inline zones
followed by a reconfig.

2 years agoUpdate unknown system test
Matthijs Mekking [Thu, 29 Jun 2023 09:02:06 +0000 (11:02 +0200)] 
Update unknown system test

Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

There is no need to sign the zone in advance.

2 years agoUpdate statschannel system test
Matthijs Mekking [Thu, 29 Jun 2023 08:57:01 +0000 (10:57 +0200)] 
Update statschannel system test

Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

Because we now add a DNSKEY with dynamic update, the sign statistics
change. When adding signatures triggered by dynamic update, the
dnssec-refresh stats are not incremented (this is only incremented
when signing is triggered by resign in lib/dns/zone.c).

2 years agoUpdate nsupdate system test
Matthijs Mekking [Wed, 28 Jun 2023 13:53:57 +0000 (15:53 +0200)] 
Update nsupdate system test

Remove from the nsupdate system test two test cases that are no longer
supported: We no longer support adding signing keys via dynamic update.

2 years agoAlter mkeys system test
Matthijs Mekking [Wed, 28 Jun 2023 13:38:42 +0000 (15:38 +0200)] 
Alter mkeys system test

The mkeys system test configured 'auto-dnssec' on the root zone to do
smart signing and simulate root key changes that should be picked up
by the automated trust anchor management of BIND.

This does not require 'auto-dnssec' or 'dnssec-policy', so change the
tests to use manual smart signing with 'dnssec-signzone'.

2 years agoUpdate masterformat system test
Matthijs Mekking [Wed, 28 Jun 2023 10:49:24 +0000 (12:49 +0200)] 
Update masterformat system test

Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

2 years agoRemove keymgr2kasp system test
Matthijs Mekking [Wed, 28 Jun 2023 09:34:20 +0000 (11:34 +0200)] 
Remove keymgr2kasp system test

The keymgr2kasp system test tests migration from auto-dnssec to
dnssec-policy. With auto-dnssec removed, we can also remove the
migration system test.

2 years agoRemove dupsigs system test
Matthijs Mekking [Tue, 27 Jun 2023 14:25:30 +0000 (16:25 +0200)] 
Remove dupsigs system test

This test uses key timing metadata to do rollovers, this is no longer
applicable with 'dnssec-policy'. Note that with 'dnssec-policy' key
timing metadata is still written, but it is not used for determining
what and when to do key rollovers.

2 years agoCopy DNSKEY record from unsigned zone db
Matthijs Mekking [Tue, 20 Jun 2023 08:08:29 +0000 (10:08 +0200)] 
Copy DNSKEY record from unsigned zone db

Since external DNSKEY records may exist in the unsigned version of the
zone (for example DNSKEY records from other providers), handle these
RRsets also when copying non DNSSEC records from the unsigned zone
database to the signed version.

2 years agoAllow rndc signing commands with dnssec-policy
Matthijs Mekking [Tue, 20 Jun 2023 08:06:01 +0000 (10:06 +0200)] 
Allow rndc signing commands with dnssec-policy

Some 'rndc signing' commands can still be used in conjunction with
'dnssec-policy' because it shows the progress of signing and
private type records can be cleaned up. Allow these commands to be
executed.

However, setting NSEC3 parameters is incompatible with dnssec-policy.

2 years agoChange inline system test
Matthijs Mekking [Mon, 19 Jun 2023 14:21:11 +0000 (16:21 +0200)] 
Change inline system test

The inline system test tests 'auto-dnssec' in conjunction with
'inline-signing'. Change the tests to make use of 'dnssec-policy'.

Remove some tests that no longer make sense:
- The 'retransfer3.' zone tests changing the parameters with
  'rndc signing -nsec3param'. This command is going away and NSEC3
  parameters now need to be configured with nsec3param within
  'dnssec-policy'.
- The 'inactivezsk.' and 'inactiveksk.' zones test whether the ZSK take
  over signing if the KSK is inactive, or vice versa. This fallback
  mode longer makes sense when using a DNSSEC policy.

Some tests need to be adapted more than just changing 'auto-dnssec'
to 'dnssec-policy':
- The 'delayedkeys.' zone first needs to be configured as insecure,
  then we can change it to start signing. Previously, no existing
  keys means that you cannot sign the zone, with 'dnssec-policy'
  new keys will be created.
- The 'updated.' zone needs to have key states in a specific state
  so that the minimal journal check still works (otherwise CDS/
  CDNSKEY and related records will be in the journal too).
- External keys are now added to the unsigned zone and no longer
  are maintained with key files. Adjust the 'externalkey.' zone
  accordingly.
- The 'nsec3-loop.' zone requires three signing keys. Since
  'dnssec-policy' will ignore duplicates in the 'keys' section,
  create RSASHA256 keys with different role and/or key length.

Finally, the 'externalkey.' zone checks for an expected number of
DNSKEY and RRSIG records in the response. This used to be 3 DNSKEY
and 2 RRSIG records. Due to logic behavior changes (key timing
metadata is no longer authoritative, these expected values are
changed to 4 DNSKEY records (two signing keys and two external keys
per algorithm) and 1 RRSIG record (one active KSK per signing
algorithm).

2 years agoUpdate dnssec system test
Matthijs Mekking [Fri, 16 Jun 2023 15:06:28 +0000 (17:06 +0200)] 
Update dnssec system test

The dnssec system test has some tests that use auto-dnssec. Update
these tests to make use of dnssec-policy.

Remove any 'rndc signing -nsec3param' commands because with
dnssec-policy you set the NSEC3 parameters in the configuration.

Remove now duplicate tests that checked if CDS and CDNSKEY RRsets
are signed with KSK only (the dnssec-dnskey-kskonly option worked
in combination with auto-dnssec).

Also remove the publish-inactive.example test case because such
use cases are no longer supported (only with manual signing).

The auto-nsec and auto-nsec3 zones need to use an alternative
algorithm because duplicate lines in dnssec-policy/keys are ignored.