]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
20 months agoDocument the ForwardOnlyFail statistics channel counter
Aram Sargsyan [Thu, 12 Sep 2024 12:38:38 +0000 (12:38 +0000)] 
Document the ForwardOnlyFail statistics channel counter

Update ARM with the information about the new ForwardOnlyFail
counter.

20 months agoImplement the ForwardOnlyFail statistics channel counter
Aram Sargsyan [Thu, 12 Sep 2024 12:34:40 +0000 (12:34 +0000)] 
Implement the ForwardOnlyFail statistics channel counter

The new ForwardOnlyFail statistics channel counter indicates the
number of queries failed due to bad forwarders for 'forward only'
zones.

20 months agofix: usr: Fix a statistics channel counter bug when 'forward only' zones are used
Arаm Sаrgsyаn [Mon, 16 Sep 2024 09:30:56 +0000 (09:30 +0000)] 
fix: usr: Fix a statistics channel counter bug when 'forward only' zones are used

When resolving a zone with a 'forward only' policy, and
finding out that all the forwarders are marked as "bad",
the 'ServerQuota' counter of the statistics channel was
incorrectly increased. This has been fixed.

Closes #1793

Merge branch '1793-serverquota-counter-bug-with-forward-only' into 'main'

See merge request isc-projects/bind9!9493

20 months agoAdd a statistics channel check in the forward system test
Aram Sargsyan [Thu, 12 Sep 2024 12:17:28 +0000 (12:17 +0000)] 
Add a statistics channel check in the forward system test

Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.

20 months agoFix a 'serverquota' counter calculation bug
Aram Sargsyan [Thu, 12 Sep 2024 11:50:28 +0000 (11:50 +0000)] 
Fix a 'serverquota' counter calculation bug

The 'all_spilled' local variable in resolver.c:fctx_getaddresses()
is 'true' by default, and only becomes false when there is at least
one successfully found NS address. However, when a 'forward only;'
configuration is used, the code jumps over the part where it looks
for NS addresses and doesn't reset the 'all_spilled' to false, which
results in incorretly increased 'serverquota' statistics variable,
and also in invalid return error code from the function. The result
code error didn't make any differences, because all codes other than
'ISC_R_SUCCESS' or 'DNS_R_WAIT' were treated in the same way, and
the result code was never logged anywhere.

Set the default value of 'all_spilled' to 'false', and only make it
'true' before actually starting to look up NS addresses.

20 months agochg: dev: Remove statslock from dnssec-signzone
Mark Andrews [Mon, 16 Sep 2024 02:49:11 +0000 (02:49 +0000)] 
chg: dev: Remove statslock from dnssec-signzone

Silence Coverity CID 468757 and 468767 (DATA RACE read not locked) by converting dnssec-signzone to use atomics for statistics counters rather than using a lock.

Closes #4939

Merge branch '4939-remove-stats-lock-from-dnssec-signzone' into 'main'

See merge request isc-projects/bind9!9496

20 months agoRemove 'statslock' from dnssec-signzone
Mark Andrews [Fri, 13 Sep 2024 03:30:34 +0000 (13:30 +1000)] 
Remove 'statslock' from dnssec-signzone

Silence Coverity CID 468757 and 468767 (DATA RACE read not locked)
by converting dnssec-signzone to use atomics for statistics counters
rather than using a lock.  This should be marginally faster than
using the lock as well when statistics are requested.

20 months agofix: usr: Separate DNSSEC validation from the long-running tasks
Ondřej Surý [Thu, 12 Sep 2024 14:35:08 +0000 (14:35 +0000)] 
fix: usr: Separate DNSSEC validation from the long-running tasks

As part of the KeyTrap \[CVE-2023-50387\] mitigation, the DNSSEC CPU-intensive operations were offloaded to a separate threadpool that we use to run other tasks that could affect the networking latency.

If that threadpool is running some long-running tasks like RPZ, catalog zone processing, or zone file operations, it would delay DNSSEC validations to a point where the resolving signed DNS records would fail.

Split the CPU-intensive and long-running tasks into separate threadpools in a way that the long-running tasks don't block the CPU-intensive operations.

Closes #4898

Merge branch '4898-move-offloaded-DNSSEC-to-own-threads' into 'main'

See merge request isc-projects/bind9!9473

20 months agoMove offloaded DNSSEC operations to different helper threads
Ondřej Surý [Mon, 9 Sep 2024 12:39:14 +0000 (14:39 +0200)] 
Move offloaded DNSSEC operations to different helper threads

Currently, the isc_work API is overloaded.  It runs both the
CPU-intensive operations like DNSSEC validations and long-term tasks
like RPZ processing, CATZ processing, zone file loading/dumping and few
others.

Under specific circumstances, when many large zones are being loaded, or
RPZ zones processed, this stops the CPU-intensive tasks and the DNSSEC
validation is practically stopped until the long-running tasks are
finished.

As this is undesireable, this commit moves the CPU-intensive operations
from the isc_work API to the isc_helper API that only runs fast memory
cleanups now.

20 months agoAdd isc_helper API that adds 1:1 thread for each loop
Ondřej Surý [Tue, 10 Sep 2024 13:02:53 +0000 (15:02 +0200)] 
Add isc_helper API that adds 1:1 thread for each loop

Add an extra thread that can be used to offload operations that would
affect latency, but are not long-running tasks; those are handled by
isc_work API.

Each isc_loop now has matching isc_helper thread that also built on top
of uv_loop.  In fact, it matches most of the isc_loop functionality, but
only the `isc_helper_run()` asynchronous call is exposed.

20 months agochg: test: Replace dns.resolver module in system tests
Michal Nowak [Thu, 12 Sep 2024 09:57:22 +0000 (09:57 +0000)] 
chg: test: Replace dns.resolver module in system tests

Closes #4634

Merge branch '4634-drop-dns.resolver-module-from-system-tests' into 'main'

See merge request isc-projects/bind9!9150

20 months agoExtract dns.rcode compatibility code to isctest.compat
Michal Nowak [Tue, 27 Aug 2024 18:14:00 +0000 (20:14 +0200)] 
Extract dns.rcode compatibility code to isctest.compat

20 months agoTurn off deadline for wildcard tests
Michal Nowak [Wed, 7 Aug 2024 18:53:00 +0000 (20:53 +0200)] 
Turn off deadline for wildcard tests

Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.

20 months agoExtract "custom" named instances support to isctest.run module
Michal Nowak [Mon, 22 Jul 2024 14:20:02 +0000 (16:20 +0200)] 
Extract "custom" named instances support to isctest.run module

20 months agoRework query functions to retry by default
Michal Nowak [Tue, 16 Jul 2024 18:06:06 +0000 (20:06 +0200)] 
Rework query functions to retry by default

20 months agoDeprecate dns.resolver module in BIND 9 system tests
Michal Nowak [Thu, 4 Jul 2024 18:06:36 +0000 (20:06 +0200)] 
Deprecate dns.resolver module in BIND 9 system tests

20 months agoReplace dns.resolver module in system tests
Michal Nowak [Thu, 11 Jul 2024 11:01:29 +0000 (13:01 +0200)] 
Replace dns.resolver module in system tests

20 months agofix: dev: Fix data race in offloaded dns_message_checksig()
Arаm Sаrgsyаn [Thu, 12 Sep 2024 09:08:59 +0000 (09:08 +0000)] 
fix: dev: Fix data race in offloaded dns_message_checksig()

When verifying a message in an offloaded thread there is a race with
the worker thread which writes to the same buffer. Clone the message
buffer before offloading.

Closes #4929

Merge branch '4929-data-race-in-dns_dnssec_verifymessage-memmove' into 'main'

See merge request isc-projects/bind9!9481

20 months agoFix data race in offloaded dns_message_checksig()
Aram Sargsyan [Wed, 11 Sep 2024 15:58:11 +0000 (15:58 +0000)] 
Fix data race in offloaded dns_message_checksig()

When verifying a message in an offloaded thread there is a race with
the worker thread which writes to the same buffer. Clone the message
buffer before offloading.

20 months agochg: doc: Add CWE category to the security issue template
Nicki Křížek [Thu, 12 Sep 2024 08:51:36 +0000 (08:51 +0000)] 
chg: doc: Add CWE category to the security issue template

Merge branch 'vicky-main-patch-72181' into 'main'

See merge request isc-projects/bind9!9482

20 months agoAdd CWE category to Internal_use_only-CVE.md template
Vicky Risk [Wed, 11 Sep 2024 16:32:54 +0000 (16:32 +0000)] 
Add CWE category to Internal_use_only-CVE.md template

20 months agorem: usr: Remove "port" from source address options
Alessio Podda [Thu, 12 Sep 2024 07:45:18 +0000 (07:45 +0000)] 
rem: usr: Remove "port" from source address options

Remove the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Remove the use of source ports for parental-agents.

Also remove the deprecated options use-{v4,v6}-udp-ports and
avoid-{v4,v6}udp-ports.

Closes #3843

Merge branch '3843-remove-deprecated-source-port-options' into 'main'

See merge request isc-projects/bind9!9469

20 months agoRemove "port" from source address options
alessio [Wed, 4 Sep 2024 15:48:04 +0000 (17:48 +0200)] 
Remove "port" from source address options

Remove the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Remove the use of source ports for parental-agents.

Also remove the deprecated options use-{v4,v6}-udp-ports and
avoid-{v4,v6}udp-ports.

20 months agofix: usr: Don't allow statistics-channel if libxml2 and libjson-c are unsupported
Mark Andrews [Thu, 12 Sep 2024 03:27:10 +0000 (03:27 +0000)] 
fix: usr: Don't allow statistics-channel if libxml2 and libjson-c are unsupported

When the libxml2 and libjson-c libraries are not supported, the statistics channel can't return anything useful, so it is now disabled. Use of `statistics-channel` in `named.conf` is a fatal error.

Closes #4895

Merge branch '4895-link-style-sheet-to-libxml2-support' into 'main'

See merge request isc-projects/bind9!9423

20 months agoFix named-checkconf and statistics-channels
Mark Andrews [Mon, 2 Sep 2024 05:53:11 +0000 (15:53 +1000)] 
Fix named-checkconf and statistics-channels

If neither libxml2 nor libjson_c are available have named-checkconf
fail if a statistics-channels block is specified.

20 months agoOnly configure statistics-channels if supported
Mark Andrews [Tue, 3 Sep 2024 04:59:19 +0000 (14:59 +1000)] 
Only configure statistics-channels if supported

20 months agoDon't create the HTTP server if libxml and libjson-c are unavailable
Mark Andrews [Tue, 27 Aug 2024 01:22:41 +0000 (11:22 +1000)] 
Don't create the HTTP server if libxml and libjson-c are unavailable

20 months agoDon't return the style sheet unless libxml2 is supported
Mark Andrews [Mon, 26 Aug 2024 22:54:54 +0000 (08:54 +1000)] 
Don't return the style sheet unless libxml2 is supported

If not statistics are available we don't want the style sheet
returned.

20 months agofix: test: The statschannel tests fails if one of libxml2 or json-c is configured
Mark Andrews [Wed, 11 Sep 2024 23:05:34 +0000 (23:05 +0000)] 
fix: test: The statschannel tests fails if one of libxml2 or json-c is configured

The `statschannel` system test failed if only one of `libxml2` or `json-c` is
available / configured as checks were being run against the non available
statistics page.

Closes #4919

Merge branch '4919-fix-statschannel-system-test' into 'main'

See merge request isc-projects/bind9!9454

20 months agoProperly detect when libxml2 or json-c is not available
Mark Andrews [Wed, 4 Sep 2024 02:52:22 +0000 (12:52 +1000)] 
Properly detect when libxml2 or json-c is not available

20 months ago[9.21] chg: doc: Review BIND ARM (9.18 updates)
Nicki Křížek [Wed, 11 Sep 2024 15:13:02 +0000 (15:13 +0000)] 
[9.21] chg: doc: Review BIND ARM (9.18 updates)

Forward-port of !9375

Closes #4832

Merge branch '4832-bind-arm-review-from-2022-through-9-18-main' into 'main'

See merge request isc-projects/bind9!9479

20 months agoReview and update ARM documentation
Suzanne Goldlust [Wed, 28 Aug 2024 19:53:46 +0000 (19:53 +0000)] 
Review and update ARM documentation

Minor edits and fixes for the documentation added from 2022 through
9.18.

(cherry picked from commit b6e4b512dd02d0cbd8dc7f90784ad3ddba21d270)

20 months agonew: doc: Document TCP4Clients/TCP6Clients
Aydın Mercan [Wed, 11 Sep 2024 10:06:37 +0000 (10:06 +0000)] 
new: doc: Document TCP4Clients/TCP6Clients

Future port the missing TCP4Clients/TCP6Clients documentation entry.

Commit abc47f5ce4a50ab2d3b23505914e9c65f856262b added two new statistics
counters without documenting them.  Add the missing counter descriptions
to the ARM.

(cherry picked from commit cb7924009152a4b8b1ec82a50bdb112541e9ec74)

Merge branch 'aydin/tcpclient-doc' into 'main'

See merge request isc-projects/bind9!9078

20 months agomake the tcp client counter documentation consistent with others
Aydın Mercan [Fri, 31 May 2024 15:14:31 +0000 (18:14 +0300)] 
make the tcp client counter documentation consistent with others

20 months agoalphabetically sort socket i/o counters
Aydın Mercan [Fri, 31 May 2024 15:12:08 +0000 (18:12 +0300)] 
alphabetically sort socket i/o counters

20 months agoDocument TCP4Clients/TCP6Clients
Michał Kępień [Mon, 27 May 2024 13:03:18 +0000 (15:03 +0200)] 
Document TCP4Clients/TCP6Clients

Commit abc47f5ce4a50ab2d3b23505914e9c65f856262b added two new statistics
counters without documenting them.  Add the missing counter descriptions
to the ARM.

(cherry picked from commit cb7924009152a4b8b1ec82a50bdb112541e9ec74)

20 months agochg: ci: Update code formatting
Michal Nowak [Wed, 11 Sep 2024 09:28:55 +0000 (09:28 +0000)] 
chg: ci: Update code formatting

clang 19 was updated in the base image.

Merge branch 'mnowak/fix-clang-format' into 'main'

See merge request isc-projects/bind9!9475

20 months agoUpdate to ignore ff69d07fed2619a9bedf5ccc18cf106b7dd49bef
Mark Andrews [Wed, 11 Sep 2024 05:08:37 +0000 (15:08 +1000)] 
Update to ignore ff69d07fed2619a9bedf5ccc18cf106b7dd49bef

20 months agoUpdate code formatting
Michal Nowak [Tue, 10 Sep 2024 15:31:32 +0000 (17:31 +0200)] 
Update code formatting

clang 19 was updated in the base image.

20 months agochg: usr: allow IXFR-to-AXFR fallback on DNS_R_TOOMANYRECORDS
Nicki Křížek [Tue, 10 Sep 2024 12:38:45 +0000 (12:38 +0000)] 
chg: usr: allow IXFR-to-AXFR fallback on DNS_R_TOOMANYRECORDS

This change allows fallback from an IXFR failure to AXFR when the reason is `DNS_R_TOOMANYRECORDS`. This is because this error condition could be temporary only in an intermediate version of IXFR transactions and it's possible that the latest version of the zone doesn't have that condition. In such a case, the secondary would never be able to update the zone (even if it could) without this fallback.

This fallback behavior is particularly useful with the recently introduced `max-records-per-type` and `max-types-per-name` options: the primary may not have these limitations and may temporarily introduce "too many" records, breaking IXFR. If the primary side subsequently deletes these records, this fallback will help recover the zone transfer failure automatically; without it, the secondary side would first need to increase the limit, which requires more operational overhead and has its own adverse effect.

Closes #4928

Merge branch 'fallback-ixfr-to-axfr-on-toomanyrecords' into 'main'

See merge request isc-projects/bind9!9333

20 months agoallow IXFR-to-AXFR fallback on DNS_R_TOOMANYRECORDS
JINMEI Tatuya [Fri, 16 Aug 2024 07:53:38 +0000 (16:53 +0900)] 
allow IXFR-to-AXFR fallback on DNS_R_TOOMANYRECORDS

This change allows fallback from an IXFR failure to AXFR when the
reason is DNS_R_TOOMANYRECORDS. This is because this error condition
could be temporary only in an intermediate version of IXFR
transactions and it's possible that the latest version of the zone
doesn't have that condition. In such a case, the secondary would never
be able to update the zone (even if it could) without this fallback.

This fallback behavior is particularly useful with the recently
introduced max-records-per-type and max-types-per-name options:
the primary may not have these limitations and may temporarily
introduce "too many" records, breaking IXFR. If the primary side
subsequently deletes these records, this fallback will help recover
the zone transfer failure automatically; without it, the secondary
side would first need to increase the limit, which requires more
operational overhead and has its own adverse effect.

This change also fixes a minor glitch that DNS_R_TOOMANYRECORDS wasn't
logged in xfrin_fail.

20 months agofix: usr: Fix assertion failure when processing access control lists
Arаm Sаrgsyаn [Tue, 10 Sep 2024 10:33:56 +0000 (10:33 +0000)] 
fix: usr: Fix assertion failure when processing access control lists

The named process could terminate unexpectedly when processing ACL. This has been fixed.

Closes #4908

Merge branch '4908-acl-assertion-failure' into 'main'

See merge request isc-projects/bind9!9458

20 months agoFix RCU API usage in acl.c
Aram Sargsyan [Wed, 4 Sep 2024 16:19:44 +0000 (16:19 +0000)] 
Fix RCU API usage in acl.c

The rcu_xchg_pointer() function can be used outside of a critical
section, and usually must be followed by a synchronize_rcu() or
call_rcu() call to detach from the resource, unless if there are
some guarantees in place because of our own reference counting.

20 months agonew: usr: Add flag to named-checkconf to ignore "not configured" errors
Mark Andrews [Tue, 10 Sep 2024 00:08:51 +0000 (00:08 +0000)] 
new: usr: Add flag to named-checkconf to ignore "not configured" errors

`named-checkconf` now takes "-n" to ignore "not configured" errors. This allows named-checkconf to check the syntax of configurations from other builds which have support for more options.

Merge branch '4913-add-option-to-named-checkconf-to-override-notconfigured-flag' into 'main'

See merge request isc-projects/bind9!9446

20 months agoAdd flag to named-checkconf to ignore "not configured" errors
Mark Andrews [Mon, 2 Sep 2024 06:03:17 +0000 (16:03 +1000)] 
Add flag to named-checkconf to ignore "not configured" errors

named-checkconf now takes "-n" to ignore "not configured" errors.
This allows named-checkconf to check the syntax of configurations
from other builds which have support for more options.

20 months agochg: test: Remove test.skr unit test file
Nicki Křížek [Mon, 9 Sep 2024 17:41:34 +0000 (17:41 +0000)] 
chg: test: Remove test.skr unit test file

This file was initially created for unit testing, but later code was added to generate the file. The static file should have been removed from the git repo.

Closes #4916

Merge branch '4916-skr-unit-test-rm-test-file' into 'main'

See merge request isc-projects/bind9!9450

20 months agoRemove test.skr unit test file
Matthijs Mekking [Wed, 4 Sep 2024 08:38:43 +0000 (10:38 +0200)] 
Remove test.skr unit test file

This file was initially created for unit testing, but later code was
added to generate the file. The static file should have been removed
from the git repo.

20 months agochg: doc: Set up version for BIND 9.21.2
Nicki Křížek [Mon, 9 Sep 2024 17:23:50 +0000 (17:23 +0000)] 
chg: doc: Set up version for BIND 9.21.2

Merge branch 'nicki/set-up-version-for-bind-9.21.2' into 'main'

See merge request isc-projects/bind9!9462

20 months agoUpdate BIND version to 9.21.2-dev
Nicki Křížek [Mon, 9 Sep 2024 17:15:54 +0000 (19:15 +0200)] 
Update BIND version to 9.21.2-dev

20 months agofix: usr: Fix bug in Offline KSK that is using ZSK with unlimited lifetime
Matthijs Mekking [Wed, 4 Sep 2024 14:40:02 +0000 (14:40 +0000)] 
fix: usr: Fix bug in Offline KSK that is using ZSK with unlimited lifetime

If the ZSK has unlimited lifetime, the timing metadata "Inactive" and "Delete" cannot be found and is treated as an error, preventing the zone to be signed. This has been fixed.

Closes #4914

Merge branch '4914-offline-ksk-zsk-lifetime-unlimited-bug' into 'main'

See merge request isc-projects/bind9!9447

20 months agoNit logging change
Matthijs Mekking [Tue, 3 Sep 2024 09:50:32 +0000 (11:50 +0200)] 
Nit logging change

Fix wrong function name (dns_dnssec_keymgr -> dns_keymgr_run).

Add error log if dns_keymgr_offline() fails.

20 months agoFix bug in dns_keymgr_offline
Matthijs Mekking [Tue, 3 Sep 2024 09:52:19 +0000 (11:52 +0200)] 
Fix bug in dns_keymgr_offline

If the ZSK has lifetime unlimited, the timing metadata "Inactive" and
"Delete" cannot be found and is treated as an error. Fix by allowing
these metadata to not exist.

20 months agofix: usr: Delay release of root privileges until after configuring controls
Evan Hunt [Thu, 29 Aug 2024 18:11:15 +0000 (18:11 +0000)] 
fix: usr: Delay release of root privileges until after configuring controls

Delay relinquishing root privileges until the control channel has been configured, for the benefit of systems that require root to use privileged port numbers.  This mostly affects systems without fine-grained privilege systems (i.e., other than Linux).

Closes #4793

Merge branch '4793-bind-9-19-24-not-listening-to-rndc-port-953-on-localhost' into 'main'

Closes #4793

See merge request isc-projects/bind9!9123

20 months agoDelay release of root privileges until after configuring controls
Evan Hunt [Wed, 3 Jul 2024 06:40:54 +0000 (23:40 -0700)] 
Delay release of root privileges until after configuring controls

On systems where root access is needed to configure privileged
ports, we don't want to fully relinquish root privileges until
after the control channel (which typically runs on port 953) has
been established.

named_os_changeuser() now takes a boolean argument 'permanent'.
This allows us to switch the effective userid temporarily with
named_os_changeuser(false) and restore it with named_os_restoreuser(),
before permanently dropping privileges with named_os_changeuser(true).

20 months agochg: usr: Follow the number of CPU set by taskset/cpuset
Ondřej Surý [Thu, 29 Aug 2024 14:43:34 +0000 (14:43 +0000)] 
chg: usr: Follow the number of CPU set by taskset/cpuset

Administrators may wish to constrain the set of cores that BIND 9 runs on via the 'taskset', 'cpuset' or 'numactl' programs (or equivalent on other O/S).

If the admin has used taskset, the `named` will now follow to automatically use the given number of CPUs rather than the system wide count.

Closes #4884

Merge branch '4884-use-cpuset-to-get-number-of-cpus' into 'main'

Closes #4884

See merge request isc-projects/bind9!9398

20 months agoFollow the number of CPU set by taskset/cpuset
Ondřej Surý [Thu, 22 Aug 2024 15:23:09 +0000 (17:23 +0200)] 
Follow the number of CPU set by taskset/cpuset

Administrators may wish to constrain the set of cores that BIND 9 runs
on via the 'taskset', 'cpuset' or 'numactl' programs (or equivalent on
other O/S), for example to achieve higher (or more stable) performance
by more closely associating threads with individual NIC rx queues. If
the admin has used taskset, it follows that BIND ought to
automatically use the given number of CPUs rather than the system wide
count.

Co-Authored-By: Ray Bellis <ray@isc.org>
20 months agochg: test: Bump max-recursion-queries to 100 in resolver system test
Michal Nowak [Thu, 29 Aug 2024 14:38:06 +0000 (14:38 +0000)] 
chg: test: Bump max-recursion-queries to 100 in resolver system test

With max-recursion-queries set to 50 the resolver system test was
unstable in the "checking query resolution for a domain with a valid
glueless delegation chain" check as ns1 replied with SERVFAIL.

Closes #4897

Merge branch '4897-resolver-ns1-max-recursion-queries-100' into 'main'

Closes #4897

See merge request isc-projects/bind9!9435

20 months agoBump max-recursion-queries to 100 in resolver system test
Michal Nowak [Mon, 26 Aug 2024 15:56:56 +0000 (17:56 +0200)] 
Bump max-recursion-queries to 100 in resolver system test

With max-recursion-queries set to 50 the resolver system test was
unstable in the "checking query resolution for a domain with a valid
glueless delegation chain" check as ns1 replied with SERVFAIL.

20 months agofix: chg: Improve performance when looking for the closest encloser when returning...
Mark Andrews [Thu, 29 Aug 2024 13:24:09 +0000 (13:24 +0000)] 
fix: chg: Improve performance when looking for the closest encloser when returning NSEC3 proofs

Use the fact that the database returns the longest matching part of the requested name to find the required NSEC3 record. If there are multiple versions present in the database we may have to search further.

Closes #4460

Merge branch '4460-auth-nsec3-many-labels' into 'main'

Closes #4460

See merge request isc-projects/bind9!9436

20 months agoReturn partial match when requested
Mark Andrews [Mon, 4 Dec 2023 06:15:41 +0000 (17:15 +1100)] 
Return partial match when requested

Return partial match from dns_db_find/dns_db_find when requested
to short circuit the closest encloser discover process.  Most of the
time this will be the actual closest encloser but may not be when
there yet to be committed / cleaned up versions of the zone with
names below the actual closest encloser.

20 months agofix: Accessing fctx->state without holding lock
Mark Andrews [Thu, 29 Aug 2024 12:46:12 +0000 (12:46 +0000)] 
fix: Accessing fctx->state without holding lock

Move lock earlier in the call sequence to address access without lock report.

```
1559        /*
1560         * Caller must be holding the fctx lock.
1561         */

CID 468796: (#1 of 1): Data race condition (MISSING_LOCK)
1. missing_lock: Accessing fctx->state without holding lock fetchctx.lock. Elsewhere, fetchctx.state is written to with fetchctx.lock held 2 out of 2 times.
1562        REQUIRE(fctx->state == fetchstate_done);
1563
1564        FCTXTRACE("sendevents");
1565
1566        LOCK(&fctx->lock);
1567
```

Closes #4902

Merge branch '4902-accessing-fctx-state-without-holding-lock' into 'main'

Closes #4902

See merge request isc-projects/bind9!9427

20 months agoMove lock earlier in the call sequence
Mark Andrews [Wed, 28 Aug 2024 03:07:54 +0000 (13:07 +1000)] 
Move lock earlier in the call sequence

fctx->state should be read with the lock held.

    1559        /*
    1560         * Caller must be holding the fctx lock.
    1561         */

    CID 468796: (#1 of 1): Data race condition (MISSING_LOCK)
    1. missing_lock: Accessing fctx->state without holding lock fetchctx.lock.
       Elsewhere, fetchctx.state is written to with fetchctx.lock held 2 out of 2 times.
    1562        REQUIRE(fctx->state == fetchstate_done);
    1563
    1564        FCTXTRACE("sendevents");
    1565
    1566        LOCK(&fctx->lock);
    1567

20 months agofix: Address potential TSAN issue with find->status
Mark Andrews [Thu, 29 Aug 2024 03:58:50 +0000 (03:58 +0000)] 
fix: Address potential TSAN issue with find->status

find->status is a private field of dns_adbfind_t so it now has an accessor function and has been made atomic.

Closes #4802

Merge branch '4802-address-potential-tsan-issue-with-find-status' into 'main'

Closes #4802

See merge request isc-projects/bind9!9137

20 months agoUse atomics to access find->status
Mark Andrews [Tue, 16 Jul 2024 03:36:54 +0000 (13:36 +1000)] 
Use atomics to access find->status

20 months agoUse an accessor fuction to access find->status
Mark Andrews [Wed, 28 Aug 2024 01:37:05 +0000 (11:37 +1000)] 
Use an accessor fuction to access find->status

find->status is marked as private and access is controlled
by find->lock.

20 months agochg: ci: Generate TSAN stress test
Michal Nowak [Wed, 28 Aug 2024 09:39:32 +0000 (09:39 +0000)] 
chg: ci: Generate TSAN stress test

Merge branch 'mnowak/generate-tsan-stress-jobs' into 'main'

See merge request isc-projects/bind9!9334

20 months agoGenerate TSAN stress test
Michal Nowak [Fri, 16 Aug 2024 16:13:46 +0000 (18:13 +0200)] 
Generate TSAN stress test

20 months agochg: ci: Cleanup stress test artifacts
Michal Nowak [Wed, 28 Aug 2024 07:58:03 +0000 (07:58 +0000)] 
chg: ci: Cleanup stress test artifacts

Merge branch 'mnowak/avoid-some-artifacts-in-stress-tests' into 'main'

See merge request isc-projects/bind9!9424

20 months agoSome stress test artifacts should not be saved in CI artifact
Michal Nowak [Tue, 27 Aug 2024 10:12:50 +0000 (12:12 +0200)] 
Some stress test artifacts should not be saved in CI artifact

20 months agochg: usr: Exempt prefetches from the fetches-per-zone and fetches-per-server quotas
Arаm Sаrgsyаn [Mon, 26 Aug 2024 15:50:50 +0000 (15:50 +0000)] 
chg: usr: Exempt prefetches from the fetches-per-zone and fetches-per-server quotas

Fetches generated automatically as a result of 'prefetch' are now
exempt from the 'fetches-per-zone' and 'fetches-per-server' quotas.
This should help in maintaining the cache from which query responses
can be given.

Closes #4219

Merge branch '4219-exempt-good-queries-from-fetch-limits' into 'main'

Closes #4219

See merge request isc-projects/bind9!9095

20 months agoDocument that prefeteches are exempt from select quotas
Aram Sargsyan [Fri, 7 Jun 2024 16:31:07 +0000 (16:31 +0000)] 
Document that prefeteches are exempt from select quotas

Add notes to the 'fetches-per-zone' and 'fetches-per-server' clauses
documentation to document that prefetches are exempted.

20 months agoExempt prefetches from the fetches-per-server quota
Aram Sargsyan [Fri, 7 Jun 2024 16:24:00 +0000 (16:24 +0000)] 
Exempt prefetches from the fetches-per-server quota

Give prefetches a free pass through the quota so that the cache
entries for popular zones could be updated successfully even if the
quota for is already reached.

20 months agoExempt prefetches from the fetches-per-zone quota
Aram Sargsyan [Fri, 7 Jun 2024 16:19:40 +0000 (16:19 +0000)] 
Exempt prefetches from the fetches-per-zone quota

Give prefetches a free pass through the quota so that the cache entry
for a popular zone could be updated successfully even if the quota for
it is already reached.

20 months agofix: dev: Stop using malloc_usable_size and malloc_size
Ondřej Surý [Mon, 26 Aug 2024 15:01:03 +0000 (15:01 +0000)] 
fix: dev: Stop using malloc_usable_size and malloc_size

The `malloc_usable_size()` can return size larger than originally allocated and when these sizes disagree the fortifier enabled by `_FORTIFY_SOURCE=3` detects overflow and stops the `named` execution abruptly.  Stop using these convenience functions as they are primary used for introspection-only.

Closes #4880

Merge branch '4880-dont-use-malloc_usable_size' into 'main'

Closes #4880

See merge request isc-projects/bind9!9400

20 months agoStop using malloc_usable_size and malloc_size
Ondřej Surý [Fri, 23 Aug 2024 04:02:00 +0000 (06:02 +0200)] 
Stop using malloc_usable_size and malloc_size

Although the nanual page of malloc_usable_size says:

    Although the excess bytes can be over‐written by the application
    without ill effects, this is not good programming practice: the
    number of excess bytes in an allocation depends on the underlying
    implementation.

it looks like the premise is broken with _FORTIFY_SOURCE=3 on newer
systems and it might return a value that causes program to stop with
"buffer overflow" detected from the _FORTIFY_SOURCE.  As we do have own
implementation that tracks the allocation size that we can use to track
the allocation size, we can stop relying on this introspection function.

Also the newer manual page for malloc_usable_size changed the NOTES to:

    The value returned by malloc_usable_size() may be greater than the
    requested size of the allocation because of various internal
    implementation details, none of which the programmer should rely on.
    This function is intended to only be used for diagnostics and
    statistics; writing to the excess memory without first calling
    realloc(3) to resize the allocation is not supported.  The returned
    value is only valid at the time of the call.

Remove usage of both malloc_usable_size() and malloc_size() to be on the
safe size and only use the internal size tracking mechanism when
jemalloc is not available.

20 months agochg: ci: Drop removed system tests from cross-version-config-tests
Michal Nowak [Mon, 26 Aug 2024 14:28:47 +0000 (14:28 +0000)] 
chg: ci: Drop removed system tests from cross-version-config-tests

The cross-version-config-tests job fails when a system test is removed
from the upcoming release. To avoid this, remove the system test also
from the $BIND_BASELINE_VERSION.

See the failure mode at https://gitlab.isc.org/isc-projects/bind9/-/jobs/4668947.

Merge branch 'mnowak/remove-dialup-from-cross-version-config-tests-job' into 'main'

See merge request isc-projects/bind9!9413

20 months agoDrop removed system tests from $BIND_BASELINE_VERSION
Michal Nowak [Mon, 26 Aug 2024 11:41:47 +0000 (13:41 +0200)] 
Drop removed system tests from $BIND_BASELINE_VERSION

The cross-version-config-tests job fails when a system test is removed
from the upcoming release. To avoid this, remove the system test also
from the $BIND_BASELINE_VERSION.

20 months agofix: dev: Preserve statement tag order in documentation
Petr Špaček [Fri, 23 Aug 2024 13:57:31 +0000 (13:57 +0000)] 
fix: dev: Preserve statement tag order in documentation

This supports bit-for-bit reproducibility of built documentation.

Closes #4886

Merge branch 'issue-4886/order-preserving-documentation-tags' into 'main'

Closes #4886

See merge request isc-projects/bind9!9399

20 months agoDisallow duplicate statement tags in docs
Petr Špaček [Fri, 23 Aug 2024 13:23:10 +0000 (15:23 +0200)] 
Disallow duplicate statement tags in docs

I can't think of a use-case for them, so let's simplify code and treat
them as an invalid input.

20 months agoPreserve de-duplicated tag order in documentation
James Addison [Sun, 25 Feb 2024 21:10:36 +0000 (21:10 +0000)] 
Preserve de-duplicated tag order in documentation

The 'set' datatype in Python does not provide iteration-order
guarantees related to insertion-order.  That means that its
usage in the 'split_csv' helper function during documentation
build can produce nondeterministic results.

That is non-desirable for two reasons: it means that the
documentation output may appear to vary unnecessarily between
builds, and secondly there could be loss-of-information in cases
where tag order in the source documentation is significant.

This patch implements order-preserving de-duplication of tags,
allowing authors to specify tags using intentional priority
ordering, while also removing tags that appear more than once.

20 months agonew: ci: Automate parts of MR workflow
Petr Špaček [Fri, 23 Aug 2024 07:50:22 +0000 (07:50 +0000)] 
new: ci: Automate parts of MR workflow

Merge branch 'pspacek/post-merge-ci' into 'main'

See merge request isc-projects/bind9!9244

20 months agoRemove milestone check from dangerfile
Petr Špaček [Fri, 23 Aug 2024 07:34:20 +0000 (09:34 +0200)] 
Remove milestone check from dangerfile

Milestone is automatically set by 'merged-metadata' CI job to 'Not
released yet' so it does not matter what the original value was.

20 months agoRemove 'Release notes' label check from dangerfile
Petr Špaček [Thu, 22 Aug 2024 15:21:43 +0000 (17:21 +0200)] 
Remove 'Release notes' label check from dangerfile

This label is now handled automatically by 'merged-metadata' CI job.

20 months agoRemove 'No CHANGES' check from dangerfile
Petr Špaček [Thu, 22 Aug 2024 15:17:15 +0000 (17:17 +0200)] 
Remove 'No CHANGES' check from dangerfile

This label is now handled automatically by 'merged-metadata' CI job.

20 months agoAutomatically adjust MR metadata after merge
Petr Špaček [Mon, 5 Aug 2024 08:48:34 +0000 (10:48 +0200)] 
Automatically adjust MR metadata after merge

1. Set milestone to 'Not released yet' after merge
   We will set milestone to actual version number when we actually tag a
   particular version. This will get rid of mass MR reassignment when we
   do last minute changes to a release plan etc.

2. Adjust No CHANGES and Release Notes MR labels to match gitchangelog
   workflow.

20 months agoMark backports CI job as non-interruptible
Petr Špaček [Mon, 5 Aug 2024 08:21:46 +0000 (10:21 +0200)] 
Mark backports CI job as non-interruptible

Previously CI job for the autobackport bot inherited "interruptible:
true" global configuration. This caused premature termination of the job
when another merge was finished before the autobackport job ran to
completion.

20 months agorem: usr: Remove the 'dialup' and 'heartbeat-interval' options
Evan Hunt [Thu, 22 Aug 2024 19:43:49 +0000 (19:43 +0000)] 
rem: usr: Remove the 'dialup' and 'heartbeat-interval' options

The `dialup` and `heartbeat-interval` options have been removed, along with all code implementing them. Using these options is now a fatal error.

Closes #4237

Merge branch '4237-remove-dialup' into 'main'

Closes #4237

See merge request isc-projects/bind9!8160

20 months agoremove the "dialup" and "heartbeat-interval" options
Evan Hunt [Mon, 3 Jul 2023 23:22:04 +0000 (16:22 -0700)] 
remove the "dialup" and "heartbeat-interval" options

mark "dialup" and "heartbeat-interval" options as ancient and
remove the documentation and the code implementing them.

20 months agonew: usr: implement the 'request-ixfr-max-diffs' configuration option
Arаm Sаrgsyаn [Thu, 22 Aug 2024 15:33:17 +0000 (15:33 +0000)] 
new: usr: implement the 'request-ixfr-max-diffs' configuration option

The new 'request-ixfr-max-diffs' configuration option sets the
maximum number of incoming incremental zone transfer (IXFR) differences,
exceeding which triggers a full zone transfer (AXFR).

Closes #4389

Merge branch '4389-request-ixfr-max-diffs' into 'main'

Closes #4389

See merge request isc-projects/bind9!9094

20 months agoDocument the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:51:51 +0000 (14:51 +0000)] 
Document the 'request-ixfr-max-diffs' configuration option

Document the new configuration option and its default value.

20 months agoTest the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:49:59 +0000 (14:49 +0000)] 
Test the 'request-ixfr-max-diffs' configuration option

Configure a maximum of 3 allowed differences and add 5 new records.
Check that named detected that the differences exceed the allowed
limit and successfully retries with AXFR.

20 months agoImplement the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:47:55 +0000 (14:47 +0000)] 
Implement the 'request-ixfr-max-diffs' configuration option

This limits the maximum number of received incremental zone
transfer differences for a secondary server. Upon reaching the
confgiured limit, the secondary aborts IXFR and initiates a full
zone transfer (AXFR).

20 months agonew: usr: Support restricted key tag range when generating new keys
Mark Andrews [Thu, 22 Aug 2024 12:55:46 +0000 (12:55 +0000)] 
new: usr: Support restricted key tag range when generating new keys

It is useful when multiple signers are being used
to sign a zone to able to specify a restricted
range of range of key tags that will be used by an
operator to sign the zone.  This adds controls to
named (dnssec-policy), dnssec-signzone, dnssec-keyfromlabel and
dnssec-ksr (dnssec-policy) to specify such ranges.

Closes #4830

Merge branch '4830-support-restricted-key-tag-range-when-generating-new-keys' into 'main'

Closes #4830

See merge request isc-projects/bind9!9258

20 months agoAdd bad dnssec-policy range variants test examples
Mark Andrews [Tue, 13 Aug 2024 00:32:19 +0000 (10:32 +1000)] 
Add bad dnssec-policy range variants test examples

20 months agoAdd a multi-signer where the key tag range changes
Mark Andrews [Mon, 12 Aug 2024 09:29:10 +0000 (19:29 +1000)] 
Add a multi-signer where the key tag range changes

20 months agoUse key tag ranges when generating multisigner keys
Mark Andrews [Mon, 12 Aug 2024 03:23:03 +0000 (13:23 +1000)] 
Use key tag ranges when generating multisigner keys

20 months agoCheck that dnssec-keygen honours key tag ranges
Mark Andrews [Thu, 8 Aug 2024 06:01:36 +0000 (16:01 +1000)] 
Check that dnssec-keygen honours key tag ranges

20 months agoDocument dnssec-policy keys range directive
Mark Andrews [Thu, 8 Aug 2024 03:11:40 +0000 (13:11 +1000)] 
Document dnssec-policy keys range directive

Co-authored-by: Suzanne Goldlust <sgoldlust@isc.org>
20 months agoAdd good dnssec-policy tag-range variants test examples
Mark Andrews [Thu, 8 Aug 2024 02:31:23 +0000 (12:31 +1000)] 
Add good dnssec-policy tag-range variants test examples

20 months agoCheck key tag range when matching dnssec keys to kasp keys
Mark Andrews [Wed, 7 Aug 2024 06:57:45 +0000 (16:57 +1000)] 
Check key tag range when matching dnssec keys to kasp keys