]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoAlways use OpenSSL 3.0 API when available
Timo Teräs [Fri, 28 Jul 2023 10:21:09 +0000 (13:21 +0300)] 
Always use OpenSSL 3.0 API when available

The new APIs work always as OpenSSL provides glue to access also
old style engines using the new APIs.

2 years agoFix support for engine/provider ECDSA keys
Timo Teräs [Fri, 28 Jul 2023 10:18:40 +0000 (13:18 +0300)] 
Fix support for engine/provider ECDSA keys

Exporting private key of on-token keys is not possible. Fix code
to not fail in this case.

2 years agoFix OpenSSL 3.0 API EC curve names
Timo Teräs [Fri, 28 Jul 2023 10:15:48 +0000 (13:15 +0300)] 
Fix OpenSSL 3.0 API EC curve names

The OpenSSL man page examples used the NIST curve names which
are supported. But when querying the name, the native OpenSSL
name is returned. Use these names to pass curve type checks for
engine/provider objects.

2 years agoMerge branch 'mnowak/pytest_rewrite_stress' into 'main'
Michal Nowak [Tue, 8 Aug 2023 12:29:24 +0000 (12:29 +0000)] 
Merge branch 'mnowak/pytest_rewrite_stress' into 'main'

Rewrite stress test to pytest

See merge request isc-projects/bind9!7905

2 years agoConvert setup.pl into static configurations
Michał Kępień [Tue, 11 Jul 2023 13:56:31 +0000 (15:56 +0200)] 
Convert setup.pl into static configurations

The setup.pl script has been replaced with static BIND configurations,
and in the course of this change, the unused ns1 server was removed.
This enhancement has greatly improved the overall test's readability.

2 years agoRewrite stress test to pytest
Michal Nowak [Tue, 9 May 2023 17:11:00 +0000 (19:11 +0200)] 
Rewrite stress test to pytest

The shell version of the test was completed only after all DNS zone
updates were sent, even if the BIND server crashed while processing
them, leading to prolonged execution and potential hang in the CI
environment. The Python rewrite of the test ensures that DNS update
tasks finish within five minutes of starting, irrespective of a BIND
crash possibility or DNS zone updates not finishing in time.

2 years agoMerge branch '4240-dnstap-system-test-fixes' into 'main'
Michał Kępień [Mon, 7 Aug 2023 11:58:54 +0000 (11:58 +0000)] 
Merge branch '4240-dnstap-system-test-fixes' into 'main'

"dnstap" system test fixes

Closes #4240

See merge request isc-projects/bind9!8177

2 years agoLower the minimum expected dnstap output file size
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Lower the minimum expected dnstap output file size

Lower the size requirement for the dnstap output file produced during
the "dnstap" system test from 454 to 450 bytes; while files of that size
are not generated in any GitLab CI job, they are in other environments
where the test passes.

2 years agoWait until fstrm_capture is ready
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Wait until fstrm_capture is ready

The fstrm_capture utility is started in the background during the
"dnstap" system test.  Consequently, "rndc dnstap-reopen" and similar
commands may be executed before fstrm_capture starts listening on the
Unix domain socket it is configured to receive dnstap data on.  This
results in the dnstap data sent to that socket in the meantime to be
lost; while the fstrm writer thread is able to recover from such a
scenario within a couple of seconds (by reopening the configured dnstap
destination itself), only one write attempt is made for data
successfully queued to the writer thread, so dnstap frames can still be
lost in the process.  This may happen during the "dnstap" system test,
leading to the dnstap output file being empty, which in turn causes the
test to fail.

Fix by waiting until fstrm_capture starts listening on the Unix domain
socket it is configured to use before asking named to reopen the
configured dnstap destination.  Since various fstrm_capture versions log
different messages when the listening socket is set up, wait for a
common string that works for all fstrm_capture versions released to
date.  Add a few extra debug messages indicating test progress and make
the test fail if the expected fstrm_capture log message is not generated
within 10 seconds.

2 years agoCapture all fstrm_capture output
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Capture all fstrm_capture output

The fstrm_capture.out file is overwritten when the fstrm_capture utility
is restarted during the "dnstap" system test.  Use a separate output
file for each fstrm_capture instance to ensure all output produced by
that tool during the "dnstap" system test is preserved for forensic
purposes.

2 years agoMerge branch '4243-_wait_for_stats-errors-not-detected-in-ixfr-system-test' into...
Mark Andrews [Mon, 7 Aug 2023 09:16:55 +0000 (09:16 +0000)] 
Merge branch '4243-_wait_for_stats-errors-not-detected-in-ixfr-system-test' into 'main'

Resolve "_wait_for_stats errors not detected in ixfr system test"

Closes #4243

See merge request isc-projects/bind9!8171

2 years agoSet ret=1 if _wait_for_stats does not succeed
Mark Andrews [Sun, 6 Aug 2023 23:38:56 +0000 (09:38 +1000)] 
Set ret=1 if _wait_for_stats does not succeed

Errors getting transfer statistics from named.run where not detected
as ret was not set to one if there hadn't been a success after looping
for a while.

2 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.17' into 'main'
Michał Kępień [Mon, 7 Aug 2023 08:26:04 +0000 (08:26 +0000)] 
Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.17' into 'main'

Set up version and release notes for BIND 9.19.17

See merge request isc-projects/bind9!8173

2 years agoSet up release notes for BIND 9.19.17
Michał Kępień [Mon, 7 Aug 2023 08:23:55 +0000 (10:23 +0200)] 
Set up release notes for BIND 9.19.17

2 years agoUpdate BIND version to 9.19.17-dev
Michał Kępień [Mon, 7 Aug 2023 08:23:55 +0000 (10:23 +0200)] 
Update BIND version to 9.19.17-dev

2 years agoMerge branch '4232-rbtdb-performance-fix' into 'main'
Evan Hunt [Fri, 4 Aug 2023 09:12:45 +0000 (09:12 +0000)] 
Merge branch '4232-rbtdb-performance-fix' into 'main'

use read lock in rdataset_getownercase()

Closes #4232

See merge request isc-projects/bind9!8169

2 years agouse read lock in rdataset_getownercase()
Evan Hunt [Thu, 3 Aug 2023 19:51:41 +0000 (12:51 -0700)] 
use read lock in rdataset_getownercase()

we were incorrectly write-locking the node when retrieving
the owner case of an rdataset.

2 years agoMerge branch 'matthijs-followup-4032' into 'main'
Matthijs Mekking [Wed, 2 Aug 2023 10:21:32 +0000 (10:21 +0000)] 
Merge branch 'matthijs-followup-4032' into 'main'

Change default TTLsig to one week

See merge request isc-projects/bind9!8164

2 years agoChange default TTLsig to one week
Matthijs Mekking [Wed, 2 Aug 2023 09:16:50 +0000 (11:16 +0200)] 
Change default TTLsig to one week

Commit dc6dafdad1bce4c59bec0dbc355650c384cfc4d9 allows larger TTL values
in zones that go insecure, and ignores the maximum zone TTL.

This means that if you use TTL values larger than 1 day in your zone,
your zone runs the risk of going bogus before it moves safely to
insecure.

Most resolvers by default cap the maximum TTL that they cache RRsets,
at one day (Unbound, Knot, PowerDNS) so that is fine. However, BIND 9's
default is one week.

Change the default TTLsig to one week, so that also for BIND 9
resolvers in the default cases responses for zones that are going
insecure will not be evaluated as bogus.

This change does mean that when unsigning your zone, it will take six
days longer to safely go insecure, regardless of what TTL values you
use in the zone.

2 years agoMerge branch 'michal/add-changes-entry-for-rbtdb-split-up' into 'main'
Michał Kępień [Wed, 2 Aug 2023 08:44:11 +0000 (08:44 +0000)] 
Merge branch 'michal/add-changes-entry-for-rbtdb-split-up' into 'main'

Add CHANGES entry for GL !7873

See merge request isc-projects/bind9!8162

2 years agoAdd CHANGES entry for GL !7873
Michał Kępień [Wed, 2 Aug 2023 08:40:09 +0000 (10:40 +0200)] 
Add CHANGES entry for GL !7873

2 years agoMerge branch '3700-deprecate-dialup' into 'main'
Evan Hunt [Wed, 2 Aug 2023 01:38:27 +0000 (01:38 +0000)] 
Merge branch '3700-deprecate-dialup' into 'main'

deprecate "dialup" and "heartbeat-interval"

Closes #3700

See merge request isc-projects/bind9!8080

2 years agoCHANGES and release note for [GL #3700]
Evan Hunt [Mon, 3 Jul 2023 23:40:56 +0000 (16:40 -0700)] 
CHANGES and release note for [GL #3700]

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.