]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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.

2 years agoAlter autosign system test
Matthijs Mekking [Fri, 16 Jun 2023 11:52:14 +0000 (13:52 +0200)] 
Alter autosign system test

The autosign system test mainly tests the auto-dnssec configuration
option. Since this option is going to be removed, update the system
test so that it uses dnssec-policy.

We could remove the complete system test, but keeping an altered
version of the system test may still be useful to detect unexpected
behavior after code changes.

Change the ns1 (test root server) to use manual signing. This zone
has some weird corner cases that do not fit the dnssec-policy model
very well.

The ns2 bar zone also needs to use manual signing, because it revokes
its key, and RFC 5011 key revocation is not supported with
dnssec-policy.

There are also a couple of weird corner test cases that can be removed:
- Inactive KSK or ZSK. With dnssec-policy there is no such thing as
  ZSK taking over the role of a KSK when the KSK is deleted, or vice
  versa.
- The CDS and CDNSKEY DELETE records are now automated with
  dnssec-policy and so the tests for persistence are no longer required.

In tests.sh, bump the expected number of root DNSKEY records to 11,
because with manual signing the activation before publication is
actually honored.

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

Remove any check interval tests, these "next key event" times are
now calculated and tested in the kasp system test.

2 years agoRemove auto-dnssec checkconf tests
Matthijs Mekking [Wed, 14 Jun 2023 13:52:09 +0000 (15:52 +0200)] 
Remove auto-dnssec checkconf tests

Any checkconf tests related to auto-dnssec can be removed, as this
option will be removed too.

2 years agoMerge branch '4096-uv-now' into 'main'
Ondřej Surý [Wed, 19 Jul 2023 13:32:47 +0000 (13:32 +0000)] 
Merge branch '4096-uv-now' into 'main'

add isc_loop_now() to get consistent time

Closes #4096

See merge request isc-projects/bind9!7989

2 years agouse isc_loop_now() for dispentry timeouts
Evan Hunt [Sun, 28 May 2023 02:20:47 +0000 (19:20 -0700)] 
use isc_loop_now() for dispentry timeouts

store a pointer to the running loop when creating a dispatch entry
with dns_dispatch_add(), and use isc_loop_now() to get the timestamp for
the current event loop tick when we initialize the dispentry start time
and check for timeouts.

2 years agoadd isc_loop_now() to get consistent time
Evan Hunt [Sat, 27 May 2023 08:42:46 +0000 (01:42 -0700)] 
add isc_loop_now() to get consistent time

isc_loop_now() is a front-end to uv_now(), returning the start
time of the current event loop tick.

2 years agoMerge branch 'aram/tests-statschannel-fetch.pl-typo' into 'main'
Arаm Sаrgsyаn [Wed, 19 Jul 2023 13:24:31 +0000 (13:24 +0000)] 
Merge branch 'aram/tests-statschannel-fetch.pl-typo' into 'main'

Fix a bug in an utility script for the statschannel system test

See merge request isc-projects/bind9!8108

2 years agoFix a bug in an utility script for the statschannel system test
Aram Sargsyan [Tue, 30 May 2023 15:13:22 +0000 (15:13 +0000)] 
Fix a bug in an utility script for the statschannel system test

Because of a typo, the fetch.pl script tries to extract the server
address from the input parameter 'a' instead of 's'. Fix the typo.

2 years agoMerge tag 'v9.19.15'
Tom Krizek [Wed, 19 Jul 2023 12:16:32 +0000 (14:16 +0200)] 
Merge tag 'v9.19.15'

2 years agoMerge branch 'ondrej/add-missing-headers-to-dns_rdataslab-header' into 'main'
Ondřej Surý [Wed, 19 Jul 2023 07:40:59 +0000 (07:40 +0000)] 
Merge branch 'ondrej/add-missing-headers-to-dns_rdataslab-header' into 'main'

Add missing headers to <dns/rdataslab.h>

See merge request isc-projects/bind9!8115

2 years agoAdd missing headers to <dns/rdataslab.h>
Ondřej Surý [Wed, 19 Jul 2023 06:50:17 +0000 (08:50 +0200)] 
Add missing headers to <dns/rdataslab.h>

The new header was not self-contained and required extra headers to be
included before including <dns/rdataslah.h>; rectify that.

2 years agoMerge branch 'mnowak/remove-windows-support-remnants' into 'main'
Michal Nowak [Tue, 18 Jul 2023 14:40:24 +0000 (14:40 +0000)] 
Merge branch 'mnowak/remove-windows-support-remnants' into 'main'

Remove remnants of Windows support in system test

See merge request isc-projects/bind9!8105

2 years agoRemove remnants of Windows support in system test
Michal Nowak [Mon, 17 Jul 2023 16:33:50 +0000 (18:33 +0200)] 
Remove remnants of Windows support in system test

The "uname -o" command is harmful on OpenBSD because this platform does
not know about the "-o" option. It is a permanent failure since system
tests are started with "set -e".

2 years agoMerge branch 'matthijs-dont-add-signing-records-on-dnskey-update' into 'main'
Matthijs Mekking [Tue, 18 Jul 2023 14:37:07 +0000 (14:37 +0000)] 
Merge branch 'matthijs-dont-add-signing-records-on-dnskey-update' into 'main'

Don't add signing records for DNSKEY added with dynamic update

See merge request isc-projects/bind9!8070

2 years agoAdd CHANGES entry
Matthijs Mekking [Mon, 17 Jul 2023 08:08:11 +0000 (10:08 +0200)] 
Add CHANGES entry

2 years agoDon't add signing records for dyn update DNSKEY
Matthijs Mekking [Thu, 29 Jun 2023 08:43:40 +0000 (10:43 +0200)] 
Don't add signing records for dyn update DNSKEY

We removed DNSSEC management via dynamic update (see issue #3686),
this means we also should no longer add signing records (of private
type) for DNSKEY records added via dynamic update.

2 years agoMerge branch 'tkrizek/readthedocs-config' into 'main'
Tom Krizek [Tue, 18 Jul 2023 13:32:14 +0000 (13:32 +0000)] 
Merge branch 'tkrizek/readthedocs-config' into 'main'

Add configuration for readthedocs.org

See merge request isc-projects/bind9!8101

2 years agoAdd configuration for readthedocs.org
Tom Krizek [Fri, 14 Jul 2023 11:14:49 +0000 (13:14 +0200)] 
Add configuration for readthedocs.org

readthedocs.org is switching to in-repo configuration file in favor of
the deprecated web interface as it allows more flexibility.

This also fixes our recent doc build issues, as we're switching to a
newer Python which is required by Sphinx.

See https://blog.readthedocs.com/migrate-configuration-v2/

2 years agoMerge branch '4185-reduce-the-recursion-in-query_lookup' into 'main'
Ondřej Surý [Tue, 18 Jul 2023 11:41:25 +0000 (11:41 +0000)] 
Merge branch '4185-reduce-the-recursion-in-query_lookup' into 'main'

Make the recursive query_lookup() call from query_gotanswer() async

Closes #4185

See merge request isc-projects/bind9!8073

2 years agoAdd CHANGES and release note for [GL #4185]
Ondřej Surý [Thu, 29 Jun 2023 12:51:51 +0000 (14:51 +0200)] 
Add CHANGES and release note for [GL #4185]

2 years agoMake query chain processing asynchronous
Evan Hunt [Thu, 29 Jun 2023 21:58:56 +0000 (14:58 -0700)] 
Make query chain processing asynchronous

Under some circumstances when processing a query response - for example,
when it contains a CNAME or DNAME - a query will have to be restarted
from the beginning to look up a new target.

This was previously handled by recursively calling the ns__query_start()
function directly from ns_query_done(). However, performance test data
indicated that chains of CNAMEs could consume quite a bit of time inside
the worker thread, increasing latency for other waiting queries.  This
has now been changed so that restarted queries are run asynchronously.

2 years agoMerge branch '4203-run-gdb-not-found' into 'main'
Mark Andrews [Tue, 18 Jul 2023 00:34:05 +0000 (00:34 +0000)] 
Merge branch '4203-run-gdb-not-found' into 'main'

Resolve "run.gdb not found"

Closes #4203

See merge request isc-projects/bind9!8091

2 years agoUse absolute path to locate run.gdb
Mark Andrews [Mon, 10 Jul 2023 03:02:22 +0000 (13:02 +1000)] 
Use absolute path to locate run.gdb

2 years agoMerge branch 'tkrizek/doth-test-curl-set-e' into 'main'
Tom Krizek [Mon, 17 Jul 2023 15:52:58 +0000 (15:52 +0000)] 
Merge branch 'tkrizek/doth-test-curl-set-e' into 'main'

Handle curl without HTTP/2 support in doth test

See merge request isc-projects/bind9!8104

2 years agoHandle curl without HTTP/2 support in doth test
Tom Krizek [Mon, 17 Jul 2023 14:28:49 +0000 (16:28 +0200)] 
Handle curl without HTTP/2 support in doth test

2 years agoMerge branch 'each-split-rbtdb' into 'main'
Ondřej Surý [Mon, 17 Jul 2023 12:50:50 +0000 (12:50 +0000)] 
Merge branch 'each-split-rbtdb' into 'main'

Split up rbtdb.c

See merge request isc-projects/bind9!7873

2 years agosplit out cache-specific functions
Evan Hunt [Sat, 13 May 2023 06:01:01 +0000 (23:01 -0700)] 
split out cache-specific functions

move cache-specific functions from rbtdb.c to rbt-cachedb.c.

2 years agosplit out zone-specific functions
Evan Hunt [Wed, 10 May 2023 06:07:50 +0000 (23:07 -0700)] 
split out zone-specific functions

move zone-specific functions from rbtdb.c to rbt-zonedb.c.

2 years agomove slab rdataset implementation to rdataslab.c
Evan Hunt [Wed, 10 May 2023 06:07:50 +0000 (23:07 -0700)] 
move slab rdataset implementation to rdataslab.c

ultimately we want the slab implementation of dns_rdataset to
be usable by more database implementaions than just rbtdb. this
commit moves rdataset_methods to rdataslab.c, renamed
dns_rdataslab_rdatasetmethods.

new database methods have been added: locknode, unlocknode,
addglue, expiredata, and deletedata, allowing external functions to
perform functions that previously required internal access to the
database implementation.

database and heap pointers are now stored in the dns_slabheader object
so that header is the only thing that needs to be passed to some
functions; this will simplify moving functions that process slabheaders
out of rbtdb.c so they can be used by other database implementations.

2 years agomove prototypes for common functions to rbtdb_p.h
Evan Hunt [Tue, 9 May 2023 00:44:12 +0000 (17:44 -0700)] 
move prototypes for common functions to rbtdb_p.h

rename the existing rbtdb.h to rbtdb_p.h, and start putting
macros and declarations of dns__rbtdb functions into it.

2 years agoclean up unused dns_db methods
Evan Hunt [Mon, 8 May 2023 18:47:18 +0000 (11:47 -0700)] 
clean up unused dns_db methods

to reduce the amount of common code that will need to be shared
between the separated cache and zone database implementations,
clean up unused portions of dns_db.

the methods dns_db_dump(), dns_db_isdnssec(), dns_db_printnode(),
dns_db_resigned(), dns_db_expirenode() and dns_db_overmem() were
either never called or were only implemented as nonoperational stub
functions: they have now been removed.

dns_db_nodefullname() was only used in one place, which turned out
to be unnecessary, so it has also been removed.

dns_db_ispersistent() and dns_db_transfernode() are used, but only
the default implementation in db.c was ever actually called. since
they were never overridden by database methods, there's no need to
retain methods for them.

in rbtdb.c, beginload() and endload() methods are no longer defined for
the cache database, because that was never used (except in a few unit
tests which can easily be modified to use the zone implementation
instead).  issecure() is also no longer defined for the cache database,
as the cache is always insecure and the default implementation of
dns_db_issecure() returns false.

for similar reasons, hashsize() is no longer defined for zone databases.

implementation functions that are shared between zone and cache are now
prepended with 'dns__rbtdb_' so they can become nonstatic.

serve_stale_ttl is now a common member of dns_db.

2 years agoclean up rbtdb.c
Evan Hunt [Thu, 11 May 2023 16:38:26 +0000 (09:38 -0700)] 
clean up rbtdb.c

in preparation for splitting up rbtdb.c, rename some types so they
can be defined in dns/types.h instead of only locally. these include:

- struct noqname, which is used to hold no-qname and closest-encloser
  proofs, and is now named dns_proof_t;
- rbtdb_rdatatype_t, which is used to hold a pair of rdatatypes and
  is now called dns_typepair_t and defined in rdatatype.h;
- rbtdb_serial_t, which is now just a uint32_t;
- rdatasetheader_t and rdatasetheaderlist_t, now called
  dns_slabheader_t and dns_slabheaderlist_t;
- rbtdb_version_t, now called dns_rbtdb_version_t.

the helper functions header_from_raw() and raw_from_header() are
renamed dns_slabheader_fromrdataset() and dns_slabheader_raw().

also made further style changes:
- fixing uninitialized pointer variables throughout rbtdb.c;
- switching some initializations to struct literals;
- renaming some functions and struct members more descriptively;
- replacing dns_db_secure_t with a simple bool since it no longer needs
  to be tri-valued.

2 years agoremove unused DNS_DBFIND options
Evan Hunt [Wed, 3 May 2023 03:56:25 +0000 (20:56 -0700)] 
remove unused DNS_DBFIND options

the DNS_DBFIND_VALIDATEGLUE and DNS_DBFIND_FORCENSEC options
were never set, so the code implementing them (which in the case
of _VALIDATEGLUE appears to have been quite outdated anyway) was
never reached. they have now been removed.

2 years agoGive the rdataset->privateN fields more helpful names
Tony Finch [Fri, 28 Apr 2023 00:12:39 +0000 (01:12 +0100)] 
Give the rdataset->privateN fields more helpful names

BIND's rdataset structure is a view of some DNS records. It is
polymorphic, so the details of how the records are stored can vary.
For instance, the records can be held in an rdatalist, or in an
rdataslab in the rbtdb.

The dns_rdataset structure previously had a number of fields called
`private1` up to `private7`, which were used by the various rdataset
implementations. It was not at all clear what these fields were for,
without reading the code and working it out from context.

This change makes the rdataset inheritance hierarchy more clear. The
polymorphic part of a `struct dns_rdataset` is now a union of structs,
each of which is named for the class of implementation using it. The
fields of these structs replace the old `privateN` fields. (Note: the
term "inheritance hierarchy" refers to the fact that the builtin and
SDLZ implementations are based on and inherit from the rdatalist
implementation, which in turn inherits from the generic rdataset.

Most of this change is mechanical, but there are a few extras.

In keynode.c there were a number of REQUIRE()ments that were not
necessary: they had already been checked by the rdataset method
dispatch code. On the other hand, In ncache.c there was a public
function which needed to REQUIRE() that an rdataset was valid.

I have removed lots of "reset iterator state" comments, because it
should now be clear from `target->iter = NULL` where before
`target->private5 = NULL` could have been doing anything.

Initialization is a bit neater in a few places, using C structure
literals where appropriate.

The pointer arithmetic for translating between an rdataslab header and
its raw contents is now fractionally safer.

2 years agorefactor the slab rdataset implementation
Evan Hunt [Tue, 25 Apr 2023 16:26:47 +0000 (17:26 +0100)] 
refactor the slab rdataset implementation

- use externally accessible functions for attachnode/detachnode
  so these functions can be moved outside rbtdb.c
- simplify and tidy up some other functions
- use struct initializers when appropriate
- remove the flag RDATASET_ATTR_RETAIN; it was never being set
- renamed the rdataset attributes to
- remove the 'slab_methods' rdataset implementation. this was
  a reduced set of slab rdataset methods, omitting 'setownercase()'
  and 'getownercase()'. we can get the identical result by using
  an DNS_RDATASETATTR_KEEPCASE attribute in rdatasets that
  shouldn't have their case modified, and then we only need one
  set of rdataset methods.

2 years agoMerge branch 'tkrizek/tkey-cleanup' into 'main'
Tom Krizek [Mon, 17 Jul 2023 09:07:28 +0000 (09:07 +0000)] 
Merge branch 'tkrizek/tkey-cleanup' into 'main'

Remove tkey test remnants

See merge request isc-projects/bind9!8102

2 years agoRemove tkey test remnants
Tom Krizek [Mon, 17 Jul 2023 08:36:09 +0000 (10:36 +0200)] 
Remove tkey test remnants

The tkey test was removed in bd4576b3cef88bcb78ae0dd7619019be4fdfb2ea
and the prereq.sh bit was accidentally added in
175d0c6d85f501c959d1371ab1017b95e27c528c

2 years agoMerge branch 'tkrizek/run-tests-with-set-e' into 'main'
Tom Krizek [Mon, 17 Jul 2023 08:19:01 +0000 (08:19 +0000)] 
Merge branch 'tkrizek/run-tests-with-set-e' into 'main'

Run system tests with set -e

See merge request isc-projects/bind9!8052

2 years agoCheck return codes from commands in inline test
Tom Krizek [Fri, 14 Jul 2023 15:10:58 +0000 (17:10 +0200)] 
Check return codes from commands in inline test

To improve the compatibility of the inline test with the `set -e`
option, ensure all commands which are expected to pass are explicitly
checked for return code and non-zero return codes are handled.

2 years agoIgnore test cleanup commits in git blame
Tom Krizek [Mon, 26 Jun 2023 16:42:29 +0000 (18:42 +0200)] 
Ignore test cleanup commits in git blame

2 years agoUse $(...) notation for subshells in system tests
Tom Krizek [Mon, 26 Jun 2023 16:35:04 +0000 (18:35 +0200)] 
Use $(...) notation for subshells in system tests

The changes were mostly done with sed:

find . -name '*.sh' | xargs sed -i 's/`\([^`]*\)`/$(\1)/g'

There have been a few manual changes where the regex wasn't sufficient
(e.g. backslashes inside the `...`) or wrong (`...` referring to docs or
in comments).

2 years agoHandle non-zero return codes in rootkeysentinel tests
Tom Krizek [Wed, 28 Jun 2023 09:12:13 +0000 (11:12 +0200)] 
Handle non-zero return codes in rootkeysentinel tests

2 years agoHandle non-zero return codes in resolver test
Tom Krizek [Tue, 27 Jun 2023 15:03:23 +0000 (17:03 +0200)] 
Handle non-zero return codes in resolver test

2 years agoHandle non-zero return codes in statschannel test
Tom Krizek [Thu, 22 Jun 2023 16:49:55 +0000 (18:49 +0200)] 
Handle non-zero return codes in statschannel test

2 years agoHandle non-zero return codes in checkconf test
Tom Krizek [Thu, 22 Jun 2023 15:34:44 +0000 (17:34 +0200)] 
Handle non-zero return codes in checkconf test

2 years agoHandle non-zero return codes in dnstap test
Tom Krizek [Thu, 22 Jun 2023 16:08:03 +0000 (18:08 +0200)] 
Handle non-zero return codes in dnstap test

2 years agoHandle non-zero return codes in kasp test
Tom Krizek [Thu, 22 Jun 2023 15:57:10 +0000 (17:57 +0200)] 
Handle non-zero return codes in kasp test