]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
21 months agoDocument 'responselog' in the ARM
Mark Andrews [Thu, 6 Jun 2024 01:53:55 +0000 (11:53 +1000)] 
Document 'responselog' in the ARM

21 months agoCheck responselog behaviour
Mark Andrews [Wed, 19 Jun 2019 07:40:21 +0000 (17:40 +1000)] 
Check responselog behaviour

Extends the resolver system test to to check whether responses are
logged to the query log in addition to the queries.

21 months agoMove common flags logging to shared functions
Petr Menšík [Wed, 6 Oct 2021 11:53:33 +0000 (13:53 +0200)] 
Move common flags logging to shared functions

Query and response log shares the same flags. Move flags logging out of
log_query to share it with log_response. Use buffer instead of snprintf
to fill flags a bit faster.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
21 months agoMake responselog flags similar to querylog
Petr Menšík [Tue, 13 Jul 2021 18:12:11 +0000 (20:12 +0200)] 
Make responselog flags similar to querylog

Remove answer flag from log, log instead count of records for each
message section. Include EDNS version and few flags of response. Add
also status of result.

Still does not include body of responses rrset.

21 months agoReduce code duplication
Evan Hunt [Thu, 15 Jul 2021 01:54:01 +0000 (18:54 -0700)] 
Reduce code duplication

combined named_server_togglequerylog() and
named_server_toggleresponselog() into named_server_setortoggle().

21 months agoLog the rcode returned to for a query
Mark Andrews [Wed, 19 Jun 2019 06:20:24 +0000 (16:20 +1000)] 
Log the rcode returned to for a query

Log to the querylog the rcode of a previous query using
the identifier 'response:' to diffenciate queries from
responses.

21 months agochg: minor cleanup in qpcache
Evan Hunt [Thu, 19 Sep 2024 21:42:33 +0000 (21:42 +0000)] 
chg: minor cleanup in qpcache

when the QP cache was adapted from the RBTDB, some variable names weren't changed, and still incorrectly reference the RBT.

Merge branch 'each-qpcache-nits' into 'main'

See merge request isc-projects/bind9!9515

21 months agorename 'rbtiterator' and similar names in qpcache
Evan Hunt [Sat, 14 Sep 2024 02:26:54 +0000 (19:26 -0700)] 
rename 'rbtiterator' and similar names in qpcache

when the QP cache was adapted from the RBT database, some names
weren't changed. this could be confusing, so let's change them now.
also, we no longer need to include rbt.h.

21 months agoMerge tag 'v9.21.1'
Nicki Křížek [Wed, 18 Sep 2024 16:02:41 +0000 (18:02 +0200)] 
Merge tag 'v9.21.1'

21 months agorem: usr: Remove DNSRPS implementation from the open-source version
Ondřej Surý [Wed, 18 Sep 2024 15:39:40 +0000 (15:39 +0000)] 
rem: usr: Remove DNSRPS implementation from the open-source version

DNSRPS was the API for a commercial implementation of Response-Policy
Zones that was supposedly better.  However, it was never open-sourced
and has only ever been available from a single vendor.  This goes against
the principle that the open-source edition of BIND 9 should contain only
features that are generally available and universal.

This commit removes the DNSRPS implementation from BIND 9.  It may be
reinstated in the subscription edition if there's enough interest from
customers, but it would have to be rewritten as a plugin (hook) instead
of hard-wiring it again in so many places.

Merge branch 'ondrej/remove-DNSRPS-from-open-source-edition' into 'main'

See merge request isc-projects/bind9!9358

21 months agoRemove DNSRPS implementation
Ondřej Surý [Mon, 19 Aug 2024 15:19:21 +0000 (17:19 +0200)] 
Remove DNSRPS implementation

DNSRPS was the API for a commercial implementation of Response-Policy
Zones that was supposedly better.  However, it was never open-sourced
and has only ever been available from a single vendor.  This goes against
the principle that the open-source edition of BIND 9 should contain only
features that are generally available and universal.

This commit removes the DNSRPS implementation from BIND 9.  It may be
reinstated in the subscription edition if there's enough interest from
customers, but it would have to be rewritten as a plugin (hook) instead
of hard-wiring it again in so many places.

21 months agofix: dev: Clean up DNSRPS
Ondřej Surý [Wed, 18 Sep 2024 15:38:11 +0000 (15:38 +0000)] 
fix: dev: Clean up DNSRPS

Addressed several build and test errors when DNSRPS is enabled.

Merge branch 'each-dnsrps-cleanup' into 'main'

See merge request isc-projects/bind9!9374

21 months agofix DNSRPS errors
Evan Hunt [Tue, 20 Aug 2024 20:09:20 +0000 (13:09 -0700)] 
fix DNSRPS errors

silence some reported snprintf() overrun warnings that prevented
DNSRPS from building on some platforms.

21 months agouse uv_dlopen() instead of dlopen() when linking DNSRPZ
Evan Hunt [Thu, 22 Aug 2024 23:01:50 +0000 (16:01 -0700)] 
use uv_dlopen() instead of dlopen() when linking DNSRPZ

take advantage of libuv's shared library handling capability
when linking to a DNSRPS library.  (see b396f555861 and 37b9511ce1d
for prior related work.)

21 months agoRemove old cruft from dnsrps code
Ondřej Surý [Mon, 19 Aug 2024 13:41:43 +0000 (15:41 +0200)] 
Remove old cruft from dnsrps code

There was some old cruft for ancient compilers checking for attributes
that we regularly use, etc.  Just remove the cruft.

21 months agochg: usr: Set logging category for notify/xfer-in related messages
Arаm Sаrgsyаn [Tue, 17 Sep 2024 15:52:20 +0000 (15:52 +0000)] 
chg: usr: Set logging category for notify/xfer-in related messages

Some 'notify' and 'xfer-in' related log messages were logged at the
'general' category instead of their own category. This has been fixed.

Closes #2730

Merge branch '2730-logging-category-for-notify-and-xfer-related-messages' into 'main'

See merge request isc-projects/bind9!9451

21 months agoSet logging category for notify/xfer related messages
Aram Sargsyan [Thu, 22 Aug 2024 07:52:20 +0000 (07:52 +0000)] 
Set logging category for notify/xfer related messages

Some notify/xfer related log messages are logged at the general
category. Set a more suitable caterogry for those messages.

21 months agofix: usr: Limit the outgoing UDP send queue size
Ondřej Surý [Tue, 17 Sep 2024 14:02:16 +0000 (14:02 +0000)] 
fix: usr: Limit the outgoing UDP send queue size

If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  Try a bit harder to deliver the
outgoing UDP messages synchronously and if that fails, drop the outgoing
DNS message that would get queued up and then timeout on the client side.

Closes #4930

Merge branch '4930-limit-the-UDP-send-queue' into 'main'

See merge request isc-projects/bind9!9506

21 months agoLimit the outgoing UDP send queue size
Ondřej Surý [Mon, 16 Sep 2024 07:10:36 +0000 (09:10 +0200)] 
Limit the outgoing UDP send queue size

If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  As those are not going to be
delivered anyway (as we argued when we stopped enlarging the operating
system send and receive buffers), try to send the UDP messages directly
using `uv_udp_try_send()` and if that fails, drop the outgoing UDP
message.

21 months agodev: Ignore commit that reformatted sh script in git blame
Ondřej Surý [Tue, 17 Sep 2024 11:44:49 +0000 (11:44 +0000)] 
dev: Ignore commit that reformatted sh script in git blame

Merge branch 'ondrej/ignore-shfmt-git-blame' into 'main'

See merge request isc-projects/bind9!9510

21 months agoIgnore commit that reformatted sh script in git blame
Ondřej Surý [Tue, 17 Sep 2024 11:42:53 +0000 (13:42 +0200)] 
Ignore commit that reformatted sh script in git blame

21 months agofix: usr: Do not set SO_INCOMING_CPU
Alessio Podda [Mon, 16 Sep 2024 12:56:25 +0000 (12:56 +0000)] 
fix: usr: Do not set SO_INCOMING_CPU

We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue by setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

Closes #4936

Merge branch '4936-remove-so-incoming-cpu' into 'main'

See merge request isc-projects/bind9!9497

21 months agoDo not set SO_INCOMING_CPU
alessio [Thu, 12 Sep 2024 14:48:00 +0000 (16:48 +0200)] 
Do not set SO_INCOMING_CPU

We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue and setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

21 months agonew: usr: Implement the ForwardOnlyFail statistics channel counter
Arаm Sаrgsyаn [Mon, 16 Sep 2024 12:17:42 +0000 (12:17 +0000)] 
new: usr: 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.

Related to #1793

Merge branch 'aram/add-new-stats-channel-counter-forwardonlyfail' into 'main'

See merge request isc-projects/bind9!9498

21 months agoUpdate the statistics channel check in the forward system test
Aram Sargsyan [Thu, 12 Sep 2024 12:39:14 +0000 (12:39 +0000)] 
Update the statistics channel check in the forward system test

Check that the ForwardOnlyFail increases as expected.

21 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.

21 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.

21 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

21 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.

21 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.

21 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

21 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.

21 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

21 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.

21 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.

21 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

21 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

21 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.

21 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

21 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

21 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

21 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

21 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

21 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.

21 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

21 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

21 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

21 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.

21 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

21 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.

21 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

21 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

21 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.

21 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

21 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

21 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

21 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)

21 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

21 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

21 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

21 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)

21 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

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

21 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.

21 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

21 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.

21 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

21 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.

21 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

21 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.

21 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

21 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.

21 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

21 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

21 months agoUpdate BIND version for release v9.21.1
Nicki Křížek [Mon, 9 Sep 2024 13:04:19 +0000 (15:04 +0200)] 
Update BIND version for release

21 months agonew: doc: Prepare documentation for BIND 9.21.1
Nicki Křížek [Mon, 9 Sep 2024 12:58:59 +0000 (12:58 +0000)] 
new: doc: Prepare documentation for BIND 9.21.1

Merge branch 'nicki/prepare-documentation-for-bind-9.21.1' into 'v9.21.1-release'

See merge request isc-private/bind9!737

21 months agoTweak and reword release notes
Nicki Křížek [Thu, 5 Sep 2024 11:13:30 +0000 (13:13 +0200)] 
Tweak and reword release notes

21 months agoFix dnssec-policy options formatting and links in ARM
Nicki Křížek [Thu, 5 Sep 2024 13:03:15 +0000 (15:03 +0200)] 
Fix dnssec-policy options formatting and links in ARM

The statements that already exist in the grammar can't be created with
the namedconf:statement. Use a plain definition list for these
statements and add a manual anchor for each one so links to them can be
created.

Avoid using the :any: syntax in the definition lists, as that just
creates a link to the duplicate and completely unrelated statement,
which just makes the documentation more confusing.

21 months agoAdd Known Issue [#GL 4898]
Nicki Křížek [Fri, 6 Sep 2024 12:03:28 +0000 (14:03 +0200)] 
Add Known Issue [#GL 4898]

21 months agoRemove a fixed known issue [GL #4793]
Nicki Křížek [Thu, 5 Sep 2024 11:13:43 +0000 (13:13 +0200)] 
Remove a fixed known issue [GL #4793]

21 months agoPrepare release notes for BIND 9.21.1
Nicki Křížek [Thu, 5 Sep 2024 13:20:25 +0000 (15:20 +0200)] 
Prepare release notes for BIND 9.21.1

21 months agoGenerate release notes
Nicki Křížek [Thu, 5 Sep 2024 08:39:08 +0000 (10:39 +0200)] 
Generate release notes

21 months agoGenerate changelog
Nicki Křížek [Thu, 5 Sep 2024 08:36:01 +0000 (10:36 +0200)] 
Generate changelog

21 months agochg: dev: Double the number of threadpool threads
Nicki Křížek [Fri, 6 Sep 2024 13:03:20 +0000 (13:03 +0000)] 
chg: dev: Double the number of threadpool threads

Introduce this temporary workaround to reduce the impact of long-running
tasks in offload threads which can block the resolution of queries.

Related isc-projects/bind9#4898

Merge branch '4898-workaround-double-threadpool-threads' into 'v9.21.1-release'

See merge request isc-private/bind9!740

21 months agoDouble the number of threadpool threads
Nicki Křížek [Fri, 6 Sep 2024 12:15:21 +0000 (14:15 +0200)] 
Double the number of threadpool threads

Introduce this temporary workaround to reduce the impact of long-running
tasks in offload threads which can block the resolution of queries.

21 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

21 months agofix: usr: Fix an assertion failure in validate_dnskey_dsset_done()
Nicki Křížek [Wed, 4 Sep 2024 14:18:25 +0000 (14:18 +0000)] 
fix: usr: Fix an assertion failure in validate_dnskey_dsset_done()

Under rare circumstances, named could terminate unexpectedly
when validating a DNSKEY resource record if the validation
was canceled in the meantime. This has been fixed.

Closes isc-projects/bind9#4911

Merge branch '4911-assertion-failure-in-validate_dnskey_dsset_done' into 'v9.21.1-release'

See merge request isc-private/bind9!731

21 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.

21 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.

21 months agoProcess canceled/shut down results in validate_dnskey_dsset_done()
Aram Sargsyan [Mon, 2 Sep 2024 14:44:05 +0000 (14:44 +0000)] 
Process canceled/shut down results in validate_dnskey_dsset_done()

When a validator is already shut down, val->name becomes NULL. We
need to process and keep the ISC_R_CANCELED or ISC_R_SHUTTINGDOWN
result code before calling validate_async_done(), otherwise, when it
is called with the hardcoded DNS_R_NOVALIDSIG result code, it can
cause an assetion failure when val->name (being NULL) is used in
proveunsecure().

21 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

21 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).

21 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

21 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>
21 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

21 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.

21 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

21 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.

21 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

21 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