]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoAddress qp/rbtdb backup file style differences
Mark Andrews [Thu, 2 May 2024 05:31:18 +0000 (15:31 +1000)] 
Address qp/rbtdb backup file style differences

qp and rbtdb produce stylistically different backup files.  This
was causing the xferquota system test to fail.  This has been
addressed by making the test independent of the stylistic differences.

2 years agoAdd jobs for RBT zone- & cache-enabled GCC builds
Michal Nowak [Mon, 29 Apr 2024 17:25:18 +0000 (19:25 +0200)] 
Add jobs for RBT zone- & cache-enabled GCC builds

2 years agoMerge branch '4502-missing-reference' into 'main'
Mark Andrews [Thu, 9 May 2024 00:08:09 +0000 (00:08 +0000)] 
Merge branch '4502-missing-reference' into 'main'

Resolve "Missing reference?"

Closes #4502

See merge request isc-projects/bind9!8996

2 years agoAdd CHANGES for [GL #4502]
Mark Andrews [Tue, 30 Apr 2024 01:10:06 +0000 (11:10 +1000)] 
Add CHANGES for [GL #4502]

2 years agoStop processing catalog zone changes when shutting down
Mark Andrews [Tue, 7 May 2024 06:48:17 +0000 (16:48 +1000)] 
Stop processing catalog zone changes when shutting down

Abandon catz_addmodzone_cb  and catz_delzone_cb processing if the
loop is shutting down.

2 years agocatz should use weak attachment to the view
Mark Andrews [Tue, 30 Apr 2024 01:24:53 +0000 (11:24 +1000)] 
catz should use weak attachment to the view

2 years agocatzs->view should maintain a view reference
Mark Andrews [Tue, 30 Apr 2024 01:04:31 +0000 (11:04 +1000)] 
catzs->view should maintain a view reference

Use dns_view_weakattach and dns_view_weakdetach to maintain a
reference to the view referenced through catzs->view.

2 years agoMerge branch 'pspacek/doc-rfc-ref-update' into 'main'
Petr Špaček [Wed, 8 May 2024 07:07:48 +0000 (07:07 +0000)] 
Merge branch 'pspacek/doc-rfc-ref-update' into 'main'

Update RFC references in documentation

See merge request isc-projects/bind9!9020

2 years agoUpdate reference for Catalog Zones spec to RFC9432
Petr Špaček [Tue, 7 May 2024 11:34:51 +0000 (13:34 +0200)] 
Update reference for Catalog Zones spec to RFC9432

2 years agoUpdate KSK root sentinel references
Petr Špaček [Tue, 7 May 2024 11:24:43 +0000 (13:24 +0200)] 
Update KSK root sentinel references

The mechanism was published as RFC 8509. I've briefly looked at diff
between versions -08 and the RFC and did not find significant protocol
change. Quick manual check confirms what we seem to comply with the
published protocol.

2 years agoMention RFC 9276 Guidance for NSEC3 Parameter Settings
Petr Špaček [Tue, 7 May 2024 11:11:03 +0000 (13:11 +0200)] 
Mention RFC 9276 Guidance for NSEC3 Parameter Settings

Draft was eventually published as RFC 9276 but we did not update our
docs. Also add couple mentions in relevant places in the ARM and
dnssec-signzone man page, mainly around "do not touch" places.

2 years agoUpdate DNSSEC Operational Practices references to Version 2
Petr Špaček [Tue, 7 May 2024 11:10:07 +0000 (13:10 +0200)] 
Update DNSSEC Operational Practices references to Version 2

RFC 4641 was obsoleted by 6781.

2 years agoMerge branch '4704-svcb-https-bind9-and-dig-fail-to-parse-packet-if-zero-svcpriority...
Mark Andrews [Tue, 7 May 2024 02:07:21 +0000 (02:07 +0000)] 
Merge branch '4704-svcb-https-bind9-and-dig-fail-to-parse-packet-if-zero-svcpriority-and-existing-svcparams' into 'main'

Resolve "SVCB/HTTPS: Bind9 and Dig fail to parse packet if zero SvcPriority and existing SvcParams"

Closes #4704

See merge request isc-projects/bind9!9000

2 years agoAdd CHANGES note for [GL #4704]
Mark Andrews [Wed, 1 May 2024 04:59:15 +0000 (14:59 +1000)] 
Add CHANGES note for [GL #4704]

2 years agoOnly check SVBC alias forms at higher levels
Mark Andrews [Wed, 1 May 2024 04:29:20 +0000 (14:29 +1000)] 
Only check SVBC alias forms at higher levels

Allow SVBC (HTTPS) alias form with parameters to be accepted from
the wire and when transfered.  This is for possible future extensions.

2 years agoMerge branch '4357-treat-notfile-as-eof' into 'main'
Mark Andrews [Tue, 7 May 2024 01:03:00 +0000 (01:03 +0000)] 
Merge branch '4357-treat-notfile-as-eof' into 'main'

Remove infinite loop on ISC_R_NOFILE

Closes #4357

See merge request isc-projects/bind9!9004

2 years agoAdd CHANGES note for [GL #4357]
Mark Andrews [Thu, 18 Jan 2024 08:04:54 +0000 (19:04 +1100)] 
Add CHANGES note for [GL #4357]

2 years agoTest including a directory in a zone file
Mark Andrews [Thu, 18 Jan 2024 08:08:14 +0000 (19:08 +1100)] 
Test including a directory in a zone file

2 years agoRemove infinite loop on ISC_R_NOFILE
Mark Andrews [Thu, 18 Jan 2024 07:54:09 +0000 (18:54 +1100)] 
Remove infinite loop on ISC_R_NOFILE

When parsing a zonefile named-checkzone (and others) could loop
infinitely if a directory was $INCLUDED.  Record the error and treat
as EOF when looking for multiple errors.

This was found by Eric Sesterhenn from X41.

2 years agoMerge branch '4353-fix-nibbles' into 'main'
Mark Andrews [Mon, 6 May 2024 23:58:36 +0000 (23:58 +0000)] 
Merge branch '4353-fix-nibbles' into 'main'

Address infinite loop when processing $GENERATE

Closes #4353

See merge request isc-projects/bind9!9003

2 years agoAdd CHANGES note for [GL #4353]
Mark Andrews [Fri, 19 Jan 2024 01:45:55 +0000 (12:45 +1100)] 
Add CHANGES note for [GL #4353]

2 years agoTest $GENERATE in nibble mode with a negative value
Mark Andrews [Fri, 19 Jan 2024 01:42:13 +0000 (12:42 +1100)] 
Test $GENERATE in nibble mode with a negative value

Negative values used to cause $GENERATE to loop forever.

2 years agoAddress infinite loop when processing $GENERATE
Mark Andrews [Fri, 19 Jan 2024 01:37:10 +0000 (12:37 +1100)] 
Address infinite loop when processing $GENERATE

In nibble mode if the value to be converted was negative the parser
would loop forever.  Process the value as an unsigned int instead
of as an int to prevent sign extension when shifting.

This was found by Eric Sesterhenn from X41.

2 years agoMerge branch 'mnowak/fedora-40' into 'main'
Michal Nowak [Mon, 6 May 2024 17:40:55 +0000 (17:40 +0000)] 
Merge branch 'mnowak/fedora-40' into 'main'

Add Fedora 40

See merge request isc-projects/bind9!8979

2 years agoSupress the leak detection in xmlNewGlobalState
Michal Nowak [Wed, 24 Apr 2024 15:33:52 +0000 (17:33 +0200)] 
Supress the leak detection in xmlNewGlobalState

2 years agoAdd Fedora 40
Michal Nowak [Wed, 27 Mar 2024 18:11:11 +0000 (19:11 +0100)] 
Add Fedora 40

2 years agoMerge branch 'mnowak/ubuntu-24.04-noble-numbat' into 'main'
Michal Nowak [Mon, 6 May 2024 16:35:59 +0000 (16:35 +0000)] 
Merge branch 'mnowak/ubuntu-24.04-noble-numbat' into 'main'

Add Ubuntu 24.04 LTS (Noble Numbat)

See merge request isc-projects/bind9!8980

2 years agoAdd Ubuntu 24.04 LTS (Noble Numbat)
Michal Nowak [Wed, 24 Apr 2024 16:56:21 +0000 (18:56 +0200)] 
Add Ubuntu 24.04 LTS (Noble Numbat)

2 years agoMerge branch 'mnowak/openbsd-7.5' into 'main'
Michal Nowak [Mon, 6 May 2024 15:20:24 +0000 (15:20 +0000)] 
Merge branch 'mnowak/openbsd-7.5' into 'main'

Add OpenBSD 7.5

See merge request isc-projects/bind9!8965

2 years agoAdd OpenBSD 7.5
Michal Nowak [Mon, 22 Apr 2024 14:48:19 +0000 (16:48 +0200)] 
Add OpenBSD 7.5

2 years agoMerge branch '4711-stress-test-finer-runtime-granularity' into 'main'
Michal Nowak [Mon, 6 May 2024 14:05:22 +0000 (14:05 +0000)] 
Merge branch '4711-stress-test-finer-runtime-granularity' into 'main'

Add short version of "stress" tests to MR-triggered pipelines

Closes #4711

See merge request isc-projects/bind9!9002

2 years agoAdd short "stress" test jobs
Michal Nowak [Thu, 2 May 2024 15:49:42 +0000 (17:49 +0200)] 
Add short "stress" test jobs

2 years agoRename "stress" tests to long "stress" tests
Michal Nowak [Thu, 2 May 2024 15:37:01 +0000 (17:37 +0200)] 
Rename "stress" tests to long "stress" tests

2 years agoRevert "Drop parallel build from stress tests"
Michal Nowak [Thu, 2 May 2024 15:24:31 +0000 (17:24 +0200)] 
Revert "Drop parallel build from stress tests"

This reverts commit 3fd7e7c81f81e21adebde2930fe511fe335f825e.

In AWS this is no longer a concern.

2 years agoMerge branch '4543-reenable-unreachable-dnssec-checks' into 'main'
Nicki Křížek [Mon, 6 May 2024 13:15:49 +0000 (13:15 +0000)] 
Merge branch '4543-reenable-unreachable-dnssec-checks' into 'main'

Re-enable accidentally disabled dnssec checks

Closes #4543

See merge request isc-projects/bind9!8667

2 years agoUpdate hours-vs-days test
Matthijs Mekking [Wed, 31 Jan 2024 12:55:29 +0000 (13:55 +0100)] 
Update hours-vs-days test

This test is outdated because it tested the 'sig-validity-interval'
option that has been replaced by dnssec-policy's 'signatures-validity',
'signatures-refresh', and 'signatures-jitter' options.

Nevertheless, it tests if the jitter is spread correctly.

Update the test to make use of 'signatures-jitter', set the value
to 1 day (meaning resign in 499 days since 'signatures-validity' is
set to 500 days).

Note that this previously changed erroneously the refresh value to
449 days (should have been 499 days, but that is not allowed by
checkconf, since it is above 90% of 'signatures-validity').

2 years agoFix dnssec system test iterations too high
Matthijs Mekking [Tue, 30 Jan 2024 16:21:34 +0000 (17:21 +0100)] 
Fix dnssec system test iterations too high

After we have changed the maximum allowed iterations to 51 for signing,
the NSEC3 chain has changed and requires one more NSEC to be returned
in the answer (plus corresponding RRSIG). So the expected number or
records in the authority section is now 8.

2 years agoOffline KSK and dnssec-policy not yet supported
Matthijs Mekking [Tue, 30 Jan 2024 16:10:28 +0000 (17:10 +0100)] 
Offline KSK and dnssec-policy not yet supported

If the key is offline and the keymgr runs, it will treat it as a missing key,
and generate a new key (according to the policy). Fix the test by putting
back the KSK temporarily when we run 'rndc loadkeys'.

2 years agoFix ZSK rollovers in dnssec system test
Matthijs Mekking [Tue, 30 Jan 2024 15:16:47 +0000 (16:16 +0100)] 
Fix ZSK rollovers in dnssec system test

1. When generating keys, don't set timing metadata. Otherwise keys
   are considered to be in use and won't be selected when dnssec-policy
   starts a new key rollover.

2. Add an extra check to make sure the new ZSK (zsk2) is prepublished.
   Also add a check to make sure it has become active.

3. When using dnssec-settime, add -s to also write to key state files.

2 years agoEnsure dnssec test doesn't leak queries to root servers
Tom Krizek [Fri, 19 Jan 2024 15:01:47 +0000 (16:01 +0100)] 
Ensure dnssec test doesn't leak queries to root servers

The config was recently modified to ensure ns4 won't leak any queries to
root servers. However, the test wasn't executed and it turns out the way
this was handled actually broke the test case. Add our custom root hint
to both of the views to ensure the test can still pass without leaking
any queries.

2 years agoRe-enable accidentally disabled dnssec checks
Tom Krizek [Fri, 19 Jan 2024 15:00:46 +0000 (16:00 +0100)] 
Re-enable accidentally disabled dnssec checks

Remove the premature exit statement which made the rest of the checks
unreachable.

2 years agoMerge branch '3323-different-rpz-soa-ttl' into 'main'
Matthijs Mekking [Mon, 6 May 2024 10:10:42 +0000 (10:10 +0000)] 
Merge branch '3323-different-rpz-soa-ttl' into 'main'

RPZ response's SOA record is incorrectly set to 1

Closes #3323

See merge request isc-projects/bind9!8998

2 years agoAdd release note and CHANGES for #3323
Matthijs Mekking [Tue, 30 Apr 2024 09:21:59 +0000 (11:21 +0200)] 
Add release note and CHANGES for #3323

2 years agoRPZ response's SOA record is incorrectly set to 1
Matthijs Mekking [Tue, 30 Apr 2024 09:14:42 +0000 (11:14 +0200)] 
RPZ response's SOA record is incorrectly set to 1

An RPZ response's SOA record TTL is set to 1 instead of the SOA TTL,
a boolean value is passed on to query_addsoa, which is supposed to be
a TTL value. I don't see what value is appropriate to be used for
overriding, so we will pass UINT32_MAX.

2 years agoMerge branch 'matthijs-offline-ksk-add-ksk-on-sign' into 'main'
Matthijs Mekking [Mon, 6 May 2024 09:30:10 +0000 (09:30 +0000)] 
Merge branch 'matthijs-offline-ksk-add-ksk-on-sign' into 'main'

Add DNSKEY record for KSK when creating the SKR

See merge request isc-projects/bind9!8986

2 years agoRetrieve DNSKEY TTL from policy
Matthijs Mekking [Fri, 3 May 2024 12:04:58 +0000 (14:04 +0200)] 
Retrieve DNSKEY TTL from policy

The desired DNSKEY TTL is configured in the policy so set it to that
value on new RRsets. Note that the same TTL is used for CDS and CDNSKEY.

2 years agoRename create_cds to create_ksk
Matthijs Mekking [Thu, 25 Apr 2024 15:28:06 +0000 (17:28 +0200)] 
Rename create_cds to create_ksk

Now that this function also creates the DNSKEY record for the KSKs,
as well as other associated records such as CDS and CDNSKEY, rename
the function to something slightly better.

2 years agoAdd DNSKEY rr corresponding to the KSK to the SKR
Matthijs Mekking [Thu, 25 Apr 2024 15:25:04 +0000 (17:25 +0200)] 
Add DNSKEY rr corresponding to the KSK to the SKR

When signing a KSR, add the DNSKEY records from the signing KSK(s) to
the DNSKEY RRset prior to signing.

2 years agoDon't add KSKs to the KSR
Matthijs Mekking [Thu, 25 Apr 2024 14:00:09 +0000 (16:00 +0200)] 
Don't add KSKs to the KSR

Creating the KSR happens on the "ZSK side". The KSK is offline and while
the public key and state file may be present, draft-icann-dnssec-keymgmt-01.txt
suggest that the KSR only contains ZSKs.

This is also what knot dns does, so it would also be in the spirit of
interoperability.

2 years agoMerge branch 'matthijs-fix-dnssec-ksr-version-missing' into 'main'
Matthijs Mekking [Mon, 6 May 2024 08:40:46 +0000 (08:40 +0000)] 
Merge branch 'matthijs-fix-dnssec-ksr-version-missing' into 'main'

Fix missing version in KSR

See merge request isc-projects/bind9!8983

2 years agoFix missing version in KSR
Matthijs Mekking [Thu, 25 Apr 2024 13:48:49 +0000 (15:48 +0200)] 
Fix missing version in KSR

The final line in a KSR ";; KeySigningRequest generated at ..." was
missing the version number, that has now been fixed.

Thanks Libor Peltan for reporting.

2 years agoMerge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.25' into 'main'
Michal Nowak [Fri, 3 May 2024 14:01:59 +0000 (14:01 +0000)] 
Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.25' into 'main'

Set up version and release notes for BIND 9.19.25

See merge request isc-projects/bind9!9005

2 years agoSet up release notes for BIND 9.19.25
Michal Nowak [Fri, 3 May 2024 13:51:53 +0000 (15:51 +0200)] 
Set up release notes for BIND 9.19.25

2 years agoUpdate BIND version to 9.19.25-dev
Michal Nowak [Fri, 3 May 2024 13:51:53 +0000 (15:51 +0200)] 
Update BIND version to 9.19.25-dev

2 years agoUpdate BIND version for release v9.19.24
Michal Nowak [Fri, 3 May 2024 07:11:45 +0000 (09:11 +0200)] 
Update BIND version for release

2 years agoAdd a CHANGES marker
Michal Nowak [Fri, 3 May 2024 07:10:49 +0000 (09:10 +0200)] 
Add a CHANGES marker

2 years agoMerge branch 'mnowak/prepare-documentation-for-bind-9.19.24' into 'v9.19.24-release'
Michal Nowak [Fri, 3 May 2024 07:08:26 +0000 (07:08 +0000)] 
Merge branch 'mnowak/prepare-documentation-for-bind-9.19.24' into 'v9.19.24-release'

Prepare documentation for BIND 9.19.24

See merge request isc-private/bind9!684

2 years agoTweak and reword release notes
Michal Nowak [Thu, 2 May 2024 10:30:39 +0000 (12:30 +0200)] 
Tweak and reword release notes

2 years agoPrepare release notes for BIND 9.19.24
Michal Nowak [Thu, 2 May 2024 09:25:21 +0000 (11:25 +0200)] 
Prepare release notes for BIND 9.19.24

2 years agoMerge branch '4710-qpcache-crash-on-assert-in-decref' into 'main'
Arаm Sаrgsyаn [Thu, 2 May 2024 10:25:55 +0000 (10:25 +0000)] 
Merge branch '4710-qpcache-crash-on-assert-in-decref' into 'main'

Fix a bug in expireheader() call arguments order

Closes #4710

See merge request isc-projects/bind9!9001

2 years agoFix a bug in expireheader() call arguments order
Aram Sargsyan [Thu, 2 May 2024 08:33:51 +0000 (08:33 +0000)] 
Fix a bug in expireheader() call arguments order

The expireheader() call in the expire_ttl_headers() function
is erroneous as it passes the 'nlocktypep' and 'tlocktypep'
arguments in a wrong order, which then causes an assertion
failure.

Fix the order of the arguments so it corresponds to the function's
prototype.

2 years agoMerge branch '4702-qpiter-fix' into 'main'
Evan Hunt [Wed, 1 May 2024 08:13:58 +0000 (08:13 +0000)] 
Merge branch '4702-qpiter-fix' into 'main'

dns_qp_lookup() doesn't handle searches for escaped characters well

Closes #4702

See merge request isc-projects/bind9!8999

2 years agoCHANGES for [GL #4702]
Evan Hunt [Tue, 30 Apr 2024 22:22:03 +0000 (15:22 -0700)] 
CHANGES for [GL #4702]

2 years agohandle QP lookups involving escaped characters better
Evan Hunt [Tue, 30 Apr 2024 21:23:43 +0000 (14:23 -0700)] 
handle QP lookups involving escaped characters better

in QP keys, characters that are not common in DNS names are
encoded as two-octet sequences. this caused a glitch in iterator
positioning when some lookups failed.

consider the case where we're searching for "\009" (represented
in a QP key as {0x03, 0x0c}) and a branch exists for "\000"
(represented as {0x03, 0x03}). we match on the 0x03, and continue
to search down. at the point where we find we have no match,
we need to pop back up to the branch before the 0x03 - which may
be multiple levels up the stack - before we position the iterator.

2 years agoadd another test case for an incorrect QP iterator position
Evan Hunt [Tue, 30 Apr 2024 07:16:45 +0000 (00:16 -0700)] 
add another test case for an incorrect QP iterator position

build a database tree with names containing control characters,
search for another control character, and verify the iterator is
positioned correctly.

2 years agoAdd a unit test case for converting \000\009
Matthijs Mekking [Tue, 30 Apr 2024 15:36:47 +0000 (17:36 +0200)] 
Add a unit test case for converting \000\009

Sanity checking that this domain converts to the key I am expecting.

Also fix some of the other names that had trailing 0x02 bits.

2 years agoadd a test method to print QP keys
Evan Hunt [Tue, 30 Apr 2024 08:22:39 +0000 (01:22 -0700)] 
add a test method to print QP keys

add a method qp_test_printkey() to print the name encoded in a QP key.

2 years agoMerge branch 'each-qpcache-cleanup' into 'main'
Evan Hunt [Tue, 30 Apr 2024 20:28:52 +0000 (20:28 +0000)] 
Merge branch 'each-qpcache-cleanup' into 'main'

clean up and speed up qpcache

See merge request isc-projects/bind9!8987

2 years agofix more ambiguous struct names
Evan Hunt [Mon, 29 Apr 2024 22:45:26 +0000 (15:45 -0700)] 
fix more ambiguous struct names

there were some structure names used in qpcache.c and qpzone.c that
were too similar to each other and could be confusing when debugging.
they have been changed as follows:

in qcache.c:
- changed_t was unused, and has been removed
- search_t -> qpc_search_t
- qpdb_rdatasetiter_t -> qpc_rditer_t
- qpdb_dbiterator_t -> qpc_dbiter_t

in qpzone.c:
- qpdb_changed_t -> qpz_changed_t
- qpdb_changedlist_t -> qpz_changedlist_t
- qpdb_version_t -> qpz_version_t
- qpdb_versionlist_t -> qpz_versionlist_t
- qpdb_search_t -> qpz_search_t
- qpdb_load_t -> qpz_search_t

2 years agouse dns_qp_getname() where possible
Evan Hunt [Thu, 11 Apr 2024 17:00:22 +0000 (10:00 -0700)] 
use dns_qp_getname() where possible

some calls to dns_qp_lookup() do not need partial matches, QP chains
or QP iterators. in these cases it's more efficient to use
dns_qp_getname().

2 years agoget foundname from the node
Evan Hunt [Thu, 11 Apr 2024 03:48:24 +0000 (23:48 -0400)] 
get foundname from the node

when calling dns_qp_lookup() from qpcache, instead of passing
'foundname' so that a name would be constructed from the QP key,
we now just use the name field in the node data. this makes
dns_qp_lookup() run faster.

the same optimization has also been added to qpzone.

the documentation for dns_qp_lookup() has been updated to
discuss this performance consideration.

2 years agoinclude the nodenames when calculating memory to purge
Evan Hunt [Thu, 14 Mar 2024 23:46:52 +0000 (16:46 -0700)] 
include the nodenames when calculating memory to purge

when the cache is over memory, we purge from the LRU list until
we've freed the approximate amount of memory to be added. this
approximation could fail because the memory allocated for nodenames
wasn't being counted.

add a dns_name_size() function so we can look up the size of nodenames,
then add that to the purgesize calculation.

2 years agosimplify qpcache iterators
Evan Hunt [Wed, 13 Mar 2024 05:19:47 +0000 (22:19 -0700)] 
simplify qpcache iterators

in a cache database, unlike zones, NSEC3 records are stored in
the main tree. it is not necessary to maintain a separate 'nsec3'
tree, nor to have code in the dbiterator implementation to traverse
from one tree to another.

(if we ever implement synth-from-dnssec using NSEC3 records, we'll
need to revert this change. in the meantime, simpler code is better.)

2 years agoclean up unnecessary dbiterator code related to origin
Evan Hunt [Mon, 29 Apr 2024 21:57:42 +0000 (14:57 -0700)] 
clean up unnecessary dbiterator code related to origin

the QP database doesn't support relative names as the RBTDB did, so
there's no need for a 'new_origin' flag or to handle `DNS_R_NEWORIGIN`
result codes.

2 years agomore cleanups in qpcache.c
Evan Hunt [Tue, 12 Mar 2024 08:05:07 +0000 (01:05 -0700)] 
more cleanups in qpcache.c

- remove unneeded struct members and misleading comments.
- remove unused parameters for static functions.
- rename 'find_callback' to 'delegating' for consistency with qpzone;
  the find callback mechanism is not used in QP databases.

2 years agorename QPDB_HEADERNODE to HEADERNODE
Evan Hunt [Mon, 29 Apr 2024 22:54:37 +0000 (15:54 -0700)] 
rename QPDB_HEADERNODE to HEADERNODE

this makes the macro consistent between qpcache.c and qpzone.c.

also removed a redundant definition of HEADERNODE in qpzone.c.

2 years agofix structure names in qpcache.c and qpzone.c
Evan Hunt [Mon, 29 Apr 2024 22:29:33 +0000 (15:29 -0700)] 
fix structure names in qpcache.c and qpzone.c

- change dns_qpdata_t to qpcnode_t (QP cache node), and dns_qpdb_t to
  qpcache_t, as these types are only accessed locally.
- also change qpdata_t in qpzone.c to qpznode_t (QP zone node), for
  consistency.
- make the refcount declarations for qpcnode_t and qpznode_t static,
  using the new ISC_REFCOUNT_STATIC macros.

2 years agoclean up unnecessary requirements in qpcache.c
Evan Hunt [Mon, 29 Apr 2024 22:09:43 +0000 (15:09 -0700)] 
clean up unnecessary requirements in qpcache.c

qpcache can only support cache semantics now, so there's
no longer any need to check for that internally.

2 years agoadd static macros for ISC_REFCOUNT_DECL/IMPL
Evan Hunt [Tue, 12 Mar 2024 08:02:48 +0000 (01:02 -0700)] 
add static macros for ISC_REFCOUNT_DECL/IMPL

this commit adds a mechanism to statically declare attach/detach
and ref/unref methods, for objects that are only accessed within
a single C file.

2 years agoMerge branch 'ondrej/improve-newref-checks' into 'main'
Ondřej Surý [Tue, 30 Apr 2024 18:43:39 +0000 (18:43 +0000)] 
Merge branch 'ondrej/improve-newref-checks' into 'main'

Improve the reference counting in newref()

See merge request isc-projects/bind9!8914

2 years agoImprove the reference counting checks in newref()
Ondřej Surý [Tue, 26 Mar 2024 13:13:24 +0000 (14:13 +0100)] 
Improve the reference counting checks in newref()

In qpcache (and rbtdb), there are some functions that acquire
neither the tree lock nor the node lock when calling newref().
In theory, this could lead to a race in which a new reference
is added to a node that was about to be deleted.

We now detect this condition by passing the current tree and node
lock status to newref(). If the node was previously unreferenced
and we don't hold at least one read lock, we will assert.

2 years agoMerge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'
Michal Nowak [Mon, 29 Apr 2024 18:10:52 +0000 (18:10 +0000)] 
Merge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'

Use FreeBSD autoscaler for "stress" tests

See merge request isc-projects/bind9!8968

2 years agoUse FreeBSD autoscaler for "stress" tests
Michal Nowak [Thu, 4 Apr 2024 10:59:50 +0000 (12:59 +0200)] 
Use FreeBSD autoscaler for "stress" tests

The FreeBSD autoscaler has been configured to utilize the new "instance"
GitLab Runner executor to spawn "stress" test CI jobs on AWS EC2
dynamically. A shared GitLab Runner named "freebsd-instance-autoscaler"
has been set up in GitLab CI/CD to communicate with EC2, provisioning VM
instances on demand based on a FreeBSD 13 AMI image. This image is the
same as the one previously used for FreeBSD "stress" tests before the
implementation of autoscaling (specifically, the
"freebsd13-amd64-bind9stress.aws.lab.isc.org" GitLab Runner in CI/CD).

2 years agoMerge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'
Michał Kępień [Mon, 29 Apr 2024 09:48:06 +0000 (09:48 +0000)] 
Merge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'

Update URLs and paths for the BIND 9 QA repository

See merge request isc-projects/bind9!8990

2 years agoUpdate URLs and paths for the BIND 9 QA repository
Michał Kępień [Fri, 26 Apr 2024 16:43:07 +0000 (18:43 +0200)] 
Update URLs and paths for the BIND 9 QA repository

Since the BIND 9 QA repository has been made public, adjust the relevant
URLs and paths used in .gitlab-ci.yml so that they work with the public
version of that repository.

2 years agoMerge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'
Aydın Mercan [Fri, 26 Apr 2024 15:47:46 +0000 (15:47 +0000)] 
Merge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'

Emit and read correct DoT and DoH dnstap entries

Closes #4523

See merge request isc-projects/bind9!8697

2 years agoAdd CHANGES and release note for [GL #4523]
Aydın Mercan [Tue, 6 Feb 2024 12:28:12 +0000 (15:28 +0300)] 
Add CHANGES and release note for [GL #4523]

2 years agoProvide an early escape hatch for ns_client_transport_type
Aydın Mercan [Thu, 15 Feb 2024 10:30:42 +0000 (13:30 +0300)] 
Provide an early escape hatch for ns_client_transport_type

Because some tests don't have a legtimate handle, provide a temporary
return early that should be fixed and removed before squashing. This
short circuiting is still correct until DoQ/DoH3 support is introduced.

2 years agoAdd fallback to ns_client_get_type despite unreachable
Aydın Mercan [Wed, 7 Feb 2024 08:35:59 +0000 (11:35 +0300)] 
Add fallback to ns_client_get_type despite unreachable

GCC might fail to compile because it expects a return after UNREACHABLE.
It should ideally just work anyway since UNREACHABLE is either a
noreturn or UB (__builtin_unreachable / C23 unreachable).

Either way, it should be optimized almost always so the fallback is
free or basically free anyway when it isn't optimized out.

2 years agoEmit and read correct DoT and DoH dnstap entries
Aydın Mercan [Thu, 1 Feb 2024 07:20:12 +0000 (10:20 +0300)] 
Emit and read correct DoT and DoH dnstap entries

Other protocols still pretend to be TCP/UDP.
This only causes a difference when using dnstap-read on a file with DoQ
or DNSCrypt entries

2 years agoUpdate the dnstap protobuf definition
Aydın Mercan [Fri, 19 Jan 2024 12:33:31 +0000 (15:33 +0300)] 
Update the dnstap protobuf definition

The new definition includes the missing protocol definitions and
specifies the protobuf version.

2 years agoMerge branch 'each-qpzone-oneheap' into 'main'
Evan Hunt [Fri, 26 Apr 2024 01:19:42 +0000 (01:19 +0000)] 
Merge branch 'each-qpzone-oneheap' into 'main'

simplify qpzone database by using only one heap for resigning

See merge request isc-projects/bind9!8889

2 years agoavoid a race in the qpzone getsigningtime() implementation
Ondřej Surý [Tue, 26 Mar 2024 00:23:19 +0000 (17:23 -0700)] 
avoid a race in the qpzone getsigningtime() implementation

the previous commit introduced a possible race in getsigningtime()
where the rdataset header could change between being found on the
heap and being bound.

getsigningtime() now looks at the first element of the heap, gathers the
locknum, locks the respective lock, and retrieves the header from the
heap again.  If the locknum has changed, it will rinse and repeat.
Theoretically, this could spin forever, but practically, it almost never
will as the heap changes on the zone are very rare.

we simplify matters further by changing the dns_db_getsigningtime()
API call. instead of passing back a bound rdataset, we pass back the
information the caller actually needed: the resigning time, owner name
and type of the rdataset that was first on the heap.

2 years agosimplify qpzone database by using only one heap for resigning
Evan Hunt [Wed, 13 Mar 2024 22:59:53 +0000 (15:59 -0700)] 
simplify qpzone database by using only one heap for resigning

in RBTDB, the heap was used by zone databases for resigning, and
by the cache for TTL-based cache cleaning. the cache use case required
very frequent updates, so there was a separate heap for each of the
node lock buckets.

qpzone is for zones only, so it doesn't need to support the cache
use case; the heap will only be touched when the zone is updated or
incrementally signed. we can simplify the code by using only a single
heap.

2 years agoMerge branch '4659-rootkeysentinel-test-fails-for-certain-values-of-oldid' into ...
Evan Hunt [Thu, 25 Apr 2024 18:10:29 +0000 (18:10 +0000)] 
Merge branch '4659-rootkeysentinel-test-fails-for-certain-values-of-oldid' into 'main'

fix_iterator() bug causes DNSSEC NXDOMAIN responses to be broken

Closes #4659

See merge request isc-projects/bind9!8942

2 years agoCHANGES for [GL #4659]
Evan Hunt [Thu, 25 Apr 2024 17:30:47 +0000 (10:30 -0700)] 
CHANGES for [GL #4659]

2 years agosimplify code by removing return values where possible
Evan Hunt [Fri, 19 Apr 2024 22:57:32 +0000 (15:57 -0700)] 
simplify code by removing return values where possible

fix_iterator() and related functions are quite difficult to read.
perhaps it would be a little clearer if we didn't assign values
to variables that won't subsequently be used, or unnecessarily
pop the stack and then push the same value back onto it.

also, in dns_qp_lookup() we previously called fix_iterator(),
removed the leaf from the top of the iterator stack, and then
added it back on. this would be clearer if we just push the leaf
onto the stack when we need to, but leave the stack alone when
it's already complete.

2 years agoadd another broken testcase
Evan Hunt [Thu, 18 Apr 2024 19:01:25 +0000 (12:01 -0700)] 
add another broken testcase

2 years agoclean up fix_iterator() arguments
Evan Hunt [Thu, 18 Apr 2024 23:25:48 +0000 (16:25 -0700)] 
clean up fix_iterator() arguments

the value passed as 'start' was redundant; it's always the same
as the current top of the iterator stack.

2 years agoyet another fix_iterator() bug
Evan Hunt [Wed, 10 Apr 2024 20:13:48 +0000 (16:13 -0400)] 
yet another fix_iterator() bug

under some circumstances it was possible for the iterator to
be set to the first leaf in a set of twigs, when it should have
been set to the last.

a unit test has been added to test this scenario. if there is a
a tree containing the following values: {".", "abb.", "abc."}, and
we query for "acb.", previously the iterator would be positioned at
"abb." instead of "abc.".

the tree structure is:
    branch (offset 1, ".")
      branch (offset 3, ".ab")
        leaf (".abb")
        leaf (".abc")

we find the branch with offset 3 (indicating that its twigs differ
from each other in the third position of the label, "abB" vs "abC").
but the search key differs from the found keys at position 2
("aC" vs "aB").  we look up the bit value in position 3 of the
search key ("B"), and incorrectly follow it onto the wrong twig
("abB").

to correct for this, we need to check for the case where the search
key is greater than the found key in a position earlier than the
branch offset. if it is, then we need to pop from the current leaf
to its parent, and get the greatest leaf from there.

a further change is needed to ensure that we don't do this twice;
when we've moved to a new leaf and the point of difference between
it and the search key even earlier than before, then we're definitely
at a predecessor node and there's no need to continue the loop.