Commit Graph
41818 Commits
Author SHA1 Message Date
Evan Hunt 5011360deb experiment: make header->trust atomic 2024-09-16 17:08:34 -07:00
Evan Hunt 3577c748f4 experiment: increase QP chunk size 2024-09-16 17:08:34 -07:00
Evan Hunt 5a07bea738 in findnode, use a read transaction when possible
when findnode() is called with the 'create' flag set, instead of
automatically opening a write transaction, we will now try to look up
the name with a read transaction, and only open a write transaction if
that failed.
2024-09-16 17:08:34 -07:00
Evan Hunt c7cb8e2143 reduce node locking
some calls to bindrdataset were node-locked; this is no longer necessary.
2024-09-16 17:08:34 -07:00
Evan Hunt 63920bcaa8 access node attributes atomically
in the qpcnode struct, the .delegating, .nsec, and .dirty
members are now atomic, enabling us to avoid acquiring the
node lock when those are the only things we need to check.

also, renamed the check_zonecut() function to the more
correctly descriptive has_dname().
2024-09-16 17:08:34 -07:00
Ondřej SurýandEvan Hunt be0f1bcdf7 compact the cache database less often
to speed up the cache, compact the database only when nodes
have been added or removed.
2024-09-16 17:08:34 -07:00
Ondřej SurýandEvan Hunt 93aa99802e add an isc_loop_rcu_barrier() for memory cleanup to finish
when adding data to the cache while over memory limits, add an
RCU barrier to ensure that memory is cleaned right away.
2024-09-16 17:08:34 -07:00
Ondřej SurýandEvan Hunt 9b79e9761b Add a function to call rcu_barrier once per loop
isc_loop_rcu_barrier() sets a flag so that rcu_barrier() will be
called at the end of the current loop tick. This allows us to minimize
time spent synchronizing between threads.
2024-09-16 17:08:34 -07:00
Evan Hunt 18ad5314cb use dns_qpmulti instead of dns_qp in the cache
replace the single-threaded dns_qp objects in the qpcache
database with dns_qpmulti and eliminate the tree lock.
2024-09-16 17:08:28 -07:00
Ondřej Surý 23b2ce56e5 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
2024-09-12 14:35:08 +00:00
Ondřej Surý 8a96a3af6a 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.
2024-09-12 12:09:45 +00:00
Ondřej Surý 6370e9b311 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.
2024-09-12 12:09:45 +00:00
Michal Nowak 91bc0b439a 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
2024-09-12 09:57:22 +00:00
Michal Nowak 8b55d0709d Extract dns.rcode compatibility code to isctest.compat 2024-09-12 11:42:22 +02:00
Michal Nowak d2e0043ec3 Turn off deadline for wildcard tests
Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.
2024-09-12 11:42:22 +02:00
Michal Nowak 2cec1de43b Extract "custom" named instances support to isctest.run module 2024-09-12 11:42:22 +02:00
Michal Nowak 5929ba0f54 Rework query functions to retry by default 2024-09-12 11:42:22 +02:00
Michal Nowak cb3ffac9a7 Deprecate dns.resolver module in BIND 9 system tests 2024-09-12 11:42:22 +02:00
Michal Nowak bfe338b965 Replace dns.resolver module in system tests 2024-09-12 11:42:22 +02:00
Arаm Sаrgsyаn 3808567de1 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
2024-09-12 09:08:59 +00:00
Aram Sargsyan 35ef25e5ea 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.
2024-09-12 09:08:35 +00:00
Nicki Křížek 149b3d552e 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
2024-09-12 08:51:36 +00:00
Vicky RiskandNicki Křížek f47bc5923f Add CWE category to Internal_use_only-CVE.md template 2024-09-12 10:51:18 +02:00
Alessio Podda dc3578ee84 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
2024-09-12 07:45:18 +00:00
alessio da0e48b611 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.
2024-09-12 08:15:58 +02:00
Mark Andrews 0d4accd07f 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
2024-09-12 03:27:10 +00:00
Mark Andrews b9246418e8 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.
2024-09-12 09:21:44 +10:00
Mark Andrews d0c8c6d7ef Only configure statistics-channels if supported 2024-09-12 09:21:44 +10:00
Mark Andrews 31650d9440 Don't create the HTTP server if libxml and libjson-c are unavailable 2024-09-12 09:21:44 +10:00
Mark Andrews ed81b3ae93 Don't return the style sheet unless libxml2 is supported
If not statistics are available we don't want the style sheet
returned.
2024-09-12 09:21:44 +10:00
Mark Andrews 29263b115b 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
2024-09-11 23:05:34 +00:00
Mark Andrews 7de939609b Properly detect when libxml2 or json-c is not available 2024-09-11 20:51:24 +00:00
Nicki Křížek c6cb9d83dd [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
2024-09-11 15:13:02 +00:00
Suzanne GoldlustandNicki Křížek b409cba48b Review and update ARM documentation
Minor edits and fixes for the documentation added from 2022 through
9.18.

(cherry picked from commit b6e4b512dd)
2024-09-11 16:23:30 +02:00
Aydın Mercan 19b23b3ed8 new: doc: Document TCP4Clients/TCP6Clients
Future port the missing TCP4Clients/TCP6Clients documentation entry.

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

(cherry picked from commit cb79240091)

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

See merge request isc-projects/bind9!9078
2024-09-11 10:06:37 +00:00
Aydın Mercan c62b6c82c0 make the tcp client counter documentation consistent with others 2024-09-11 12:51:34 +03:00
Aydın Mercan 3be2d25e54 alphabetically sort socket i/o counters 2024-09-11 12:51:34 +03:00
Michał KępieńandAydın Mercan 9bc152dd25 Document TCP4Clients/TCP6Clients
Commit abc47f5ce4 added two new statistics
counters without documenting them.  Add the missing counter descriptions
to the ARM.

(cherry picked from commit cb79240091)
2024-09-11 12:51:34 +03:00
Michal Nowak 0962fbd200 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
2024-09-11 09:28:55 +00:00
Mark Andrews 8ff039e3eb Update to ignore ff69d07fed 2024-09-11 15:08:37 +10:00
Michal Nowak ff69d07fed Update code formatting
clang 19 was updated in the base image.
2024-09-10 17:31:32 +02:00
Nicki Křížek b343484ddb 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
2024-09-10 12:38:45 +00:00
JINMEI TatuyaandNicki Křížek 7289090683 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.
2024-09-10 14:02:38 +02:00
Arаm Sаrgsyаn 6bb4070685 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
2024-09-10 10:33:56 +00:00
Aram Sargsyan 0367c60759 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.
2024-09-10 09:54:20 +00:00
Mark Andrews 0d2482c62e 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
2024-09-10 00:08:51 +00:00
Mark Andrews 61faffd06f 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.
2024-09-09 23:32:16 +00:00
Nicki Křížek 004a5329e2 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
2024-09-09 17:41:34 +00:00
Matthijs MekkingandNicki Křížek 903534c9a9 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.
2024-09-09 19:41:03 +02:00
Nicki Křížek 3f61f69c52 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
2024-09-09 17:23:50 +00:00