]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
17 months agoset "multi-master" automatically with multiple primaries each-automatic-multimaster 9898/head
Evan Hunt [Wed, 11 Dec 2024 19:07:53 +0000 (11:07 -0800)] 
set "multi-master" automatically with multiple primaries

By default, named logs a message at level info if a secondary
zone receives an update indicating that the serial number has
gone backwards. The "multi-master" option was provided to
allow this message to be suppressed if a zone was configured
with multiple primary servers.

That option has now been marked obsolete. The message is now
logged at debug level 1 when there are multiple primary server
addresses configured for the zone. It is still logged at level
info if there is only address.

17 months agofix: dev: clean up incorrect logging module names
Evan Hunt [Wed, 11 Dec 2024 17:12:18 +0000 (17:12 +0000)] 
fix: dev: clean up incorrect logging module names

Some files used logmodule names that had been copied in from elsewhere; these have now been given module names of their own. Also, the RBT and RBTDB logmodules have been removed, since they are now unused.

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

See merge request isc-projects/bind9!9895

17 months agoclean up log module names
Evan Hunt [Wed, 11 Dec 2024 03:11:26 +0000 (19:11 -0800)] 
clean up log module names

- remove obsolete DNS_LOGMODULE_RBT and DNS_LOGMODULE_RBTDB
- correct the misuse of the wrong log modules in dns/rpz.c and
  dns/catz.c, and add DNS_LOGMODULE_RPZ and DNS_LOGMODULE_CATZ
  to support them.

17 months agorem: usr: Remove trusted-keys and managed-keys options
Matthijs Mekking [Wed, 11 Dec 2024 13:39:02 +0000 (13:39 +0000)] 
rem: usr: Remove trusted-keys and managed-keys options

These options have been deprecated in 9.19 in favor of the 'trust-anchors' option and are now being removed.

Closes #5080

Merge branch '5080-remove-trusted-and-managed-keys' into 'main'

See merge request isc-projects/bind9!9855

17 months agoRemove trusted-keys and managed-keys options
Matthijs Mekking [Fri, 6 Dec 2024 15:30:04 +0000 (16:30 +0100)] 
Remove trusted-keys and managed-keys options

These options have been deprecated in 9.19 in favor of the trust-anchors
option. They are now removed to clean up the configuration and the code.

17 months agofix: nil: update style guideline to reflect current practice
Evan Hunt [Wed, 11 Dec 2024 03:39:21 +0000 (03:39 +0000)] 
fix: nil: update style guideline to reflect current practice

The style guide now mentions clang-format, doesn't parenthesize return values, and no longer calls for backward compatibility in public function names.

Merge branch 'each-style-update' into 'main'

See merge request isc-projects/bind9!9892

17 months agoupdate style guideline to reflect current practice
Evan Hunt [Tue, 10 Dec 2024 22:11:45 +0000 (14:11 -0800)] 
update style guideline to reflect current practice

It now mentions clang-format, doesn't parenthesize return values,
and no longer calls for backward compatibility in public function names.

17 months agofix: dev: mark loop as shuttingdown earlier in shutdown_cb
Ondřej Surý [Tue, 10 Dec 2024 19:51:20 +0000 (19:51 +0000)] 
fix: dev: mark loop as shuttingdown earlier in shutdown_cb

Merge branch 'loop-shuttingdown' into 'main'

See merge request isc-projects/bind9!9827

17 months agomark loop as shuttingdown earlier in shutdown_cb
Pavel Březina [Thu, 5 Dec 2024 11:37:37 +0000 (12:37 +0100)] 
mark loop as shuttingdown earlier in shutdown_cb

`shutdown_trigger_close_cb` is not called in the main loop since
queued events in the `loop->async_trigger`, including loop teardown
(shutdown_server) are processed first, before the `uv_close` callback
is executed..

In order to pass the information to the queued events, it is necessary
to set the flag earlier in the process and not wait for the `uv_close`
callback to trigger.

17 months agofix: test: Add rr-related common test artifacts
Michal Nowak [Tue, 10 Dec 2024 17:40:35 +0000 (17:40 +0000)] 
fix: test: Add rr-related common test artifacts

Merge branch 'mnowak/add-rr-related-common-artifacts' into 'main'

See merge request isc-projects/bind9!9830

17 months agoAdd rr-related common test artifacts
Michal Nowak [Thu, 5 Dec 2024 11:54:38 +0000 (12:54 +0100)] 
Add rr-related common test artifacts

17 months agofix: ci: Set cross-version-config-tests to allow_failure in CI
Michal Nowak [Tue, 10 Dec 2024 09:54:02 +0000 (09:54 +0000)] 
fix: ci: Set cross-version-config-tests to allow_failure in CI

Address failing cross-version-config-tests job.

Closes #5087

Merge branch 'mnowak/cross-version-config-tests-allow-fail' into 'main'

See merge request isc-projects/bind9!9833

17 months agoSet cross-version-config-tests to allow_failure in CI
Michal Nowak [Thu, 5 Dec 2024 14:50:40 +0000 (15:50 +0100)] 
Set cross-version-config-tests to allow_failure in CI

The December releases suffer from the ns2/managed1.conf file not being
in the mkeys extra_artifacts. This manifests only when pytest is run
with the --setup-only option, which is the case in the
cross-version-config-tests CI job. The original issue is fixed in !9815,
but the fix will be effective only when subsequent releases are out.

The #4666 issue removed the "fixed" value for the "rrset-order" option
which is still present in the December release system test and which the
current named can't handle. This will be addressed when when the January
9.21 release is published.

The #4482 issue removed the "dnssec-must-be-secure" feature.

17 months agorem: dev: Drop single-use RETERR macro
Matthijs Mekking [Tue, 10 Dec 2024 08:46:29 +0000 (08:46 +0000)] 
rem: dev: Drop single-use RETERR macro

If the RETERR define is only used once in a file, just drop the macro.

Merge branch 'matthijs-remove-single-use-define-reterr' into 'main'

See merge request isc-projects/bind9!9871

17 months agoDrop single-use RETERR macro
Matthijs Mekking [Mon, 9 Dec 2024 14:10:53 +0000 (15:10 +0100)] 
Drop single-use RETERR macro

If the RETERR define is only used once in a file, just drop the macro.

17 months agochg: test: Use a different burst name to identify test queries
Mark Andrews [Tue, 10 Dec 2024 05:52:45 +0000 (05:52 +0000)] 
chg: test: Use a different burst name to identify test queries

This allows easier identification of which burst is which in
named.run.

Merge branch 'marka-use-different-burst-name-for-forensics' into 'main'

See merge request isc-projects/bind9!9881

17 months agoUse a different burst name to identify test queries
Mark Andrews [Fri, 6 Sep 2024 04:51:24 +0000 (14:51 +1000)] 
Use a different burst name to identify test queries

This allows easier identification of which burst is which in
named.run.

17 months agofix: test: Fix static stub subtest description
Mark Andrews [Tue, 10 Dec 2024 03:15:53 +0000 (03:15 +0000)] 
fix: test: Fix static stub subtest description

This subtest exercises static stub behaviour when server-addresses has an address.  This was misidentified in the description.

Closes !9799

Merge branch 'marka-fix-stub-subtest-description' into 'main'

See merge request isc-projects/bind9!9799

17 months agoFix static stub subtest description
Mark Andrews [Tue, 1 Oct 2024 03:12:11 +0000 (13:12 +1000)] 
Fix static stub subtest description

17 months agofix: dev: Accept resolv.conf with more than 8 search domains
Mark Andrews [Tue, 10 Dec 2024 01:39:04 +0000 (01:39 +0000)] 
fix: dev: Accept resolv.conf with more than 8 search domains

Closes #1259

Merge branch '1259-irs-search-unlimited' into 'main'

See merge request isc-projects/bind9!2446

17 months agoRemove artificial search limit from libirs
Petr Menšík [Fri, 4 Oct 2019 22:20:54 +0000 (00:20 +0200)] 
Remove artificial search limit from libirs

Search directive from resolv.conf had a maximum of 8 domains. Any
more were ignored. Do not ignore them anymore; iterate over any
number of domains.

Test resolv.conf support by checking the first and last domain in
the search list. Ignore the domains between; just ensure that the
last domain in the configuration is the last domain parsed.

17 months agofix: usr: Unknown directive in resolv.conf not handled properly
Mark Andrews [Tue, 10 Dec 2024 00:45:44 +0000 (00:45 +0000)] 
fix: usr: Unknown directive in resolv.conf not handled properly

The line after an unknown directive in resolv.conf could accidentally be skipped, potentially affecting dig, host, nslookup, nsupdate, or delv. This has been fixed.

Closes #5084

Merge branch '5084-plain-unknown-keyword-in-resolv-conf-not-handled-propely' into 'main'

See merge request isc-projects/bind9!9865

17 months agoExtend resconf_test
Mark Andrews [Mon, 9 Dec 2024 02:04:05 +0000 (13:04 +1100)] 
Extend resconf_test

Update to the new unit test framework.

Add a test for an unknown directive without any arguments.

Add test for an unknown directive without arguments, followed
by a search directive.

17 months agoFix parsing of unknown directives in resolv.conf
Mark Andrews [Mon, 9 Dec 2024 03:45:38 +0000 (14:45 +1100)] 
Fix parsing of unknown directives in resolv.conf

Only call eatline() to skip to the next line if we're not
already at the end of a line when parsing an unknown directive.
We were accidentally skipping the next line when there was only
a single unknown directive on the current line.

17 months agonew: test: Add Fedora 41
Michal Nowak [Mon, 9 Dec 2024 17:19:26 +0000 (17:19 +0000)] 
new: test: Add Fedora 41

Prereq: isc-projects/images!345

Merge branch 'mnowak/fedora-41' into 'main'

See merge request isc-projects/bind9!9612

17 months agoAdd Fedora 41
Michal Nowak [Thu, 10 Oct 2024 09:11:48 +0000 (11:11 +0200)] 
Add Fedora 41

17 months agoAdd Alpine Linux 3.21
Michal Nowak [Mon, 9 Dec 2024 16:25:12 +0000 (16:25 +0000)] 
Add Alpine Linux 3.21

Prereq: isc-projects/images!359

Merge branch 'mnowak/alpine-3.21' into 'main'

See merge request isc-projects/bind9!9872

17 months agoAdd Alpine Linux 3.21
Michal Nowak [Mon, 9 Dec 2024 15:35:59 +0000 (16:35 +0100)] 
Add Alpine Linux 3.21

17 months agonew: ci: Add FreeBSD 14.2
Michal Nowak [Mon, 9 Dec 2024 13:35:30 +0000 (13:35 +0000)] 
new: ci: Add FreeBSD 14.2

Merge branch 'mnowak/freebsd-14.2' into 'main'

See merge request isc-projects/bind9!9838

17 months agoAdd FreeBSD 14.2
Michal Nowak [Thu, 5 Dec 2024 18:27:36 +0000 (19:27 +0100)] 
Add FreeBSD 14.2

17 months agorem: usr: Remove dnssec-must-be-secure feature
Ondřej Surý [Mon, 9 Dec 2024 12:10:48 +0000 (12:10 +0000)] 
rem: usr: Remove dnssec-must-be-secure feature

Closes #4482

Merge branch '4482-remove-dnssec-must-be-secure-feature' into 'main'

See merge request isc-projects/bind9!9851

17 months agoReplace remaining usage of DNS_R_MUSTBESECURE with DNS_R_NOVALIDSIG
Ondřej Surý [Fri, 6 Dec 2024 17:12:15 +0000 (18:12 +0100)] 
Replace remaining usage of DNS_R_MUSTBESECURE with DNS_R_NOVALIDSIG

The DNS_R_MUSTBESECURE lost its meaning with removal of
dnssec-must-be-secure option, so replace the few remaining (and a bit
confusing) use of this result code with DNS_R_NOVALIDSIG.

17 months agoRemove dnssec-must-be-secure feature
Ondřej Surý [Fri, 6 Dec 2024 12:11:59 +0000 (13:11 +0100)] 
Remove dnssec-must-be-secure feature

The dnssec-must-be-secure feature was added in the early days of BIND 9
and DNSSEC and it makes sense only as a debugging feature.  There are no
reasons to keep this feature in the production code anymore.

Remove the feature to simplify the code.

17 months agorem: usr: Remove fixed value for the rrset-order option
Ondřej Surý [Mon, 9 Dec 2024 12:09:36 +0000 (12:09 +0000)] 
rem: usr: Remove fixed value for the rrset-order option

Remove the "fixed" value from the "rrset-order" option and from the
autoconf script.

Closes #4666

Merge branch '4666-remote-rrset-order-fixed' into 'main'

See merge request isc-projects/bind9!9852

17 months agoRemove fixed value for the rrset-order option
Ondřej Surý [Fri, 6 Dec 2024 13:13:56 +0000 (14:13 +0100)] 
Remove fixed value for the rrset-order option

Remove the "fixed" value from the "rrset-order" option and from the
autoconf script.

17 months agofix: usr: disable deterministic ecdsa for fips builds
Michal Nowak [Mon, 9 Dec 2024 11:55:53 +0000 (11:55 +0000)] 
fix: usr: disable deterministic ecdsa for fips builds

FIPS 186-5 [1] allows the usage deterministic ECDSA (Section 6.3) which
is compabile with RFC 6979 [2] but OpenSSL seems to follow FIPS 186-4
(Section 6.3) [3] which only allows for random k values, failing
k value generation for OpenSSL >=3.2. [4]

Fix signing by not using deterministic ECDSA when FIPS mode is active.

[1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
[2]: https://datatracker.ietf.org/doc/html/rfc6979
[3]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
[4]: https://github.com/openssl/openssl/blob/85f17585b0d8b55b335f561e2862db14a20b1e64/crypto/ec/ecdsa_ossl.c#L201-L207

Closes #5072

Merge branch '5072-the-ecdsa_determinism_test-check-fails-on-ol-9-5-fips' into 'main'

See merge request isc-projects/bind9!9808

17 months agodisable deterministic ecdsa for fips builds
Aydın Mercan [Wed, 4 Dec 2024 10:11:45 +0000 (13:11 +0300)] 
disable deterministic ecdsa for fips builds

FIPS 186-5 [1] allows the usage deterministic ECDSA (Section 6.3) which
is compabile with RFC 6979 [2] but OpenSSL seems to follow FIPS 186-4
(Section 6.3) [3] which only allows for random k values, failing
k value generation for OpenSSL >=3.2. [4]

Fix signing by not using deterministic ECDSA when FIPS mode is active.

[1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
[2]: https://datatracker.ietf.org/doc/html/rfc6979
[3]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
[4]: https://github.com/openssl/openssl/blob/85f17585b0d8b55b335f561e2862db14a20b1e64/crypto/ec/ecdsa_ossl.c#L201-L207

17 months agochg: dev: Use query counters in validator code
Matthijs Mekking [Mon, 9 Dec 2024 10:31:24 +0000 (10:31 +0000)] 
chg: dev: Use query counters in validator code

Commit af7db8951364a89c468eda1535efb3f53adc2c1f as part of #4141 was supposed to apply the 'max-recursion-queries' quota to validator queries, but the counter was never actually passed on to 'dns_resolver_createfetch()'. This has been fixed, and the global query counter ('max-query-count', per client request) is now also added.

Related to #4980

Merge branch '4980-pass-counters-in-validator-createfetch' into 'main'

See merge request isc-projects/bind9!9856

17 months agoUse query counters in validator code
Matthijs Mekking [Fri, 6 Dec 2024 15:41:15 +0000 (16:41 +0100)] 
Use query counters in validator code

Commit af7db8951364a89c468eda1535efb3f53adc2c1f as part of #4141 was
supposed to apply the 'max-recursion-queries' quota to validator
queries, but the counter was never actually passed on to
dns_resolver_createfetch(). This has been fixed, and the global query
counter ('max-query-count', per client request) is now also added.

17 months agochg: dev: Update picohttpparser.{c,h} with upstream repository
Ondřej Surý [Sun, 8 Dec 2024 12:28:23 +0000 (12:28 +0000)] 
chg: dev: Update picohttpparser.{c,h} with upstream repository

Closes #4485

Merge branch '4485-update-httppicoparser' into 'main'

See merge request isc-projects/bind9!9857

17 months agoUpdate picohttpparser.{c,h} with upstream repository
Ondřej Surý [Fri, 6 Dec 2024 17:29:39 +0000 (18:29 +0100)] 
Update picohttpparser.{c,h} with upstream repository

Upstream code doesn't do regular releases, so we need to regularly
sync the code from the upstream repository.  This is synchronization up
to the commit f8d0513 from Jan 29, 2024.

17 months agofix: usr: Preserve cache across reconfig when using attach-cache
Evan Hunt [Fri, 6 Dec 2024 21:34:15 +0000 (21:34 +0000)] 
fix: usr: Preserve cache across reconfig when using attach-cache

When the `attach-cache` option is used in the `options` block with an arbitrary name, it causes all views to use the same cache. Previously, this configuration caused the cache to be deleted and a new cache created every time the server was reconfigured. This has been fixed.

Closes #5061

Merge branch '5061-attach-cache-fix' into 'main'

See merge request isc-projects/bind9!9787

17 months agopreserve cache across reload when using attach-cache
Evan Hunt [Wed, 27 Nov 2024 08:35:16 +0000 (00:35 -0800)] 
preserve cache across reload when using attach-cache

when the attach-cache option is used in the options block
with an arbitrary name, it causes all views to use the same
cache. however, previously, this could cause the cache to be
deleted and a new cache created every time the server was
reconfigured. this did *not* occur when attach-cache was
used at the view level to refer back to another view's cache.

in this commit we correct the problem by checking for
pre-existing caches during reconfiguration, and moving
them from the old server cache list to the new cache list
before cleaning up and freeing the old cache list.

17 months agofix: dev: Revert "Lock and attach when returning zone stats"
Ondřej Surý [Fri, 6 Dec 2024 19:45:57 +0000 (19:45 +0000)] 
fix: dev: Revert "Lock and attach when returning zone stats"

Closes #5082

Merge branch '5082-lock-and-attach-when-return-zone-stats-revert' into 'main'

See merge request isc-projects/bind9!9859

17 months agoRevert "Attach dnssecsignstats, rcvquerystats, and requeststats" 9858/head
Ondřej Surý [Fri, 6 Dec 2024 18:46:39 +0000 (19:46 +0100)] 
Revert "Attach dnssecsignstats, rcvquerystats, and requeststats"

This reverts commit fb50a7115927e481b0a471de48dc668eb75af941.

17 months agochg: dev: Remove unused maxquerycount
Matthijs Mekking [Fri, 6 Dec 2024 15:18:28 +0000 (15:18 +0000)] 
chg: dev: Remove unused maxquerycount

Related to #4980

Merge branch '4980-remove-unused-maxqueryqount' into 'main'

See merge request isc-projects/bind9!9850

17 months agoRemove unused maxquerycount
Matthijs Mekking [Fri, 6 Dec 2024 10:19:18 +0000 (11:19 +0100)] 
Remove unused maxquerycount

While implementing the global limit 'max-query-count', initially I
thought adding the variable to the resolver structure. But the limit
is per client request so it was moved to the view structure (and
counter in ns_query structure). However, I forgot to remove the
variable from the resolver structure again. This commit fixes that.

17 months agonew: test: Add OpenBSD 7.6
Michal Nowak [Fri, 6 Dec 2024 10:16:29 +0000 (10:16 +0000)] 
new: test: Add OpenBSD 7.6

Merge branch 'mnowak/openbsd-7.6' into 'main'

See merge request isc-projects/bind9!9609

17 months agoAdd OpenBSD 7.6
Michal Nowak [Wed, 9 Oct 2024 20:18:23 +0000 (22:18 +0200)] 
Add OpenBSD 7.6

17 months agochg: test: Add FreeBSD 13.4
Michal Nowak [Fri, 6 Dec 2024 09:30:17 +0000 (09:30 +0000)] 
chg: test: Add FreeBSD 13.4

Merge branch 'mnowak/freebsd-13.4' into 'main'

See merge request isc-projects/bind9!9640

17 months agoAdd FreeBSD 13.4
Michal Nowak [Tue, 15 Oct 2024 13:16:22 +0000 (15:16 +0200)] 
Add FreeBSD 13.4

17 months agofix: dev: Lock and attach when returning zone stats
Mark Andrews [Fri, 6 Dec 2024 05:32:05 +0000 (05:32 +0000)] 
fix: dev: Lock and attach when returning zone stats

When returning zone statistics counters, the statistics sets are now attached while the zone is locked.  This addresses Coverity warnings CID 468720, 468728 and 468729.

Closes #4934

Merge branch '4934-lock-and-attach-when-return-zone-stats' into 'main'

See merge request isc-projects/bind9!9488

17 months agoAttach dnssecsignstats, rcvquerystats, and requeststats
Mark Andrews [Thu, 19 Sep 2024 05:22:24 +0000 (15:22 +1000)] 
Attach dnssecsignstats, rcvquerystats, and requeststats

In dns_zone_getdnssecsignstats, dns_zone_getrcvquerystats and
dns_zone_getrequeststats attach to the statistics structure.

17 months agoINSIST that the zone in locked before unlocking
Mark Andrews [Mon, 28 Oct 2024 23:12:20 +0000 (10:12 +1100)] 
INSIST that the zone in locked before unlocking

This is the counterpart to the INSIST(!zone->locked) when the zone
is locked.

17 months agofix: dev: Finalize removal of memory debug flags size and mctx
Mark Andrews [Fri, 6 Dec 2024 03:12:29 +0000 (03:12 +0000)] 
fix: dev: Finalize removal of memory debug flags size and mctx

Commit 4b3d0c66009d30f5c0bc12ee128fc59f1d853f44 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.

Merge branch 'main-memory-flags-size-mctx' into 'main'

See merge request isc-projects/bind9!9606

17 months agoFinalize removal of memory debug flags size and mctx
Petr Menšík [Wed, 9 Oct 2024 13:32:07 +0000 (15:32 +0200)] 
Finalize removal of memory debug flags size and mctx

Commit 4b3d0c66009d30f5c0bc12ee128fc59f1d853f44 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.

17 months agofix: usr: Fix dnssec-signzone signing non-DNSKEY RRsets with revoked keys
Mark Andrews [Fri, 6 Dec 2024 00:59:26 +0000 (00:59 +0000)] 
fix: usr: Fix dnssec-signzone signing non-DNSKEY RRsets with revoked keys

`dnssec-signzone` was using revoked keys for signing RRsets other than DNSKEY.  This has been corrected.

Closes #5070

Merge branch '5070-dnssec-signzone-fix-revoke' into 'main'

See merge request isc-projects/bind9!9800

17 months agoCheck dnssec-signzone behaviour with revoked keys
Mark Andrews [Mon, 2 Dec 2024 07:30:41 +0000 (18:30 +1100)] 
Check dnssec-signzone behaviour with revoked keys

Only DNSKEY records should be signed with a revoked key.

17 months agoDo not sign non DNSKEY RRset with revoked keys
Mark Andrews [Fri, 29 Nov 2024 06:20:39 +0000 (17:20 +1100)] 
Do not sign non DNSKEY RRset with revoked keys

It does not make sense to sign RRsets other than DNSKEY with revoked
keys.

17 months agofix: test: ecdsa pytest rewrite fixes
Michal Nowak [Thu, 5 Dec 2024 18:22:24 +0000 (18:22 +0000)] 
fix: test: ecdsa pytest rewrite fixes

Merge branch 'mnowak/ecdsa-pytest-rewrite-fixes' into 'main'

See merge request isc-projects/bind9!9823

17 months agoUse os.getenv() instead of os.environ
Michal Nowak [Thu, 5 Dec 2024 09:37:19 +0000 (10:37 +0100)] 
Use os.getenv() instead of os.environ

If ECDSAP256SHA256_SUPPORTED or ECDSAP384SHA384_SUPPORTED variables were
not present in the environment, os.environ would raise KeyError that is
not being handled in the decorator. Use os.getenv() instead.

17 months agoFix skipif decorators' conditions
Michal Nowak [Thu, 5 Dec 2024 09:23:53 +0000 (10:23 +0100)] 
Fix skipif decorators' conditions

The ECDSA256 and ECDSA384 check conditions were switched.

17 months agofix: usr: Fix nsupdate hang when processing a large update
Matthijs Mekking [Thu, 5 Dec 2024 15:13:45 +0000 (15:13 +0000)] 
fix: usr: Fix nsupdate hang when processing a large update

To mitigate DNS flood attacks over a single TCP connection, we throttle the connection when the other side does not read the data. Throttling should only occur on server-side sockets, but erroneously also happened for nsupdate, which acts as a client. When nsupdate started throttling the connection, it never attempts to read again. This has been fixed.

Closes #4910

Merge branch '4910-nsupdate-hangs-when-processing-large-update' into 'main'

See merge request isc-projects/bind9!9709

17 months agoFix nsupdate hang when processing a large update
Matthijs Mekking [Fri, 1 Nov 2024 12:25:26 +0000 (13:25 +0100)] 
Fix nsupdate hang when processing a large update

The root cause is the fix for CVE-2024-0760 (part 3), which resets
the TCP connection on a failed send. Specifically commit
4b7c61381f186e20a476c35032a871295ebbd385 stops reading on the socket
because the TCP connection is throttling.

When the tcpdns_send_cb callback thinks about restarting reading
on the socket, this fails because the socket is a client socket.
And nsupdate is a client and is using the same netmgr code.

This commit removes the requirement that the socket must be a server
socket, allowing reading on the socket again after being throttled.

17 months agoAdd test case for nsupdate hangs on large update
Matthijs Mekking [Fri, 1 Nov 2024 12:23:20 +0000 (13:23 +0100)] 
Add test case for nsupdate hangs on large update

This test case hangs, despite the update being performed on the
name server.

17 months agonew: usr: Add a new option to configure the maximum number of outgoing queries per...
Matthijs Mekking [Thu, 5 Dec 2024 13:50:48 +0000 (13:50 +0000)] 
new: usr: Add a new option to configure the maximum number of outgoing queries per client request

The configuration option 'max-query-count' sets how many outgoing queries per client request is allowed. The existing 'max-recursion-queries' is the number of permissible queries for a single name and is reset on every CNAME redirection. This new option is a global limit on the client request. The default is 200.

This allows us to send a bit more queries while looking up a single name. The default for 'max-recursion-queries' is changed from 32 to 50.

Closes #4980
Closes #4921

Merge branch '4980-global-limit-outgoing-queries' into 'main'

See merge request isc-projects/bind9!9737

17 months agoChange default max-recursion-queries to 50
Matthijs Mekking [Thu, 5 Dec 2024 08:52:38 +0000 (09:52 +0100)] 
Change default max-recursion-queries to 50

Changing the default for max-recursion-queries from 100 to 32 was too
strict in some cases, especially lookups in reverse IPv6 trees started
to fail more frequently. From issue #4921 it looks like 50 is a better
default.

Now that we have 'max-query-count' as a global limit of outgoing queries
per client request, we can increase the default for
'max-recursion-queries' again, as the number of recursive queries is
no longer bound by the multiple of 'max-recursion-queries' and
'max-query-restarts'.

17 months agoAdd a CAMP test case
Matthijs Mekking [Mon, 25 Nov 2024 15:27:21 +0000 (16:27 +0100)] 
Add a CAMP test case

This adds a new test directory specifically for CAMP attacks. This first
test in this test directory follows multiple CNAME chains, restarting
the max-recursion-queries counter, but should bail when the global
maximum quota max-query-count is reached.

17 months agoAdd +maxtotalqueries option to delv
Matthijs Mekking [Mon, 11 Nov 2024 13:06:28 +0000 (14:06 +0100)] 
Add +maxtotalqueries option to delv

The max-query-count value can now be set on the command line in delv
with +maxtotalqueries.

17 months agoImplement global limit for outgoing queries
Matthijs Mekking [Mon, 11 Nov 2024 10:01:50 +0000 (11:01 +0100)] 
Implement global limit for outgoing queries

This global limit is not reset on query restarts and is a hard limit
for any client request.

17 months agoImplement getter function for counter limit
Matthijs Mekking [Fri, 29 Nov 2024 13:29:08 +0000 (14:29 +0100)] 
Implement getter function for counter limit

17 months agoImplement 'max-query-count'
Matthijs Mekking [Thu, 7 Nov 2024 09:52:19 +0000 (10:52 +0100)] 
Implement 'max-query-count'

Add another option to configure how many outgoing queries per
client request is allowed. The existing 'max-recursion-queries' is
per restart, this one is a global limit.

17 months agochg: doc: only one loopmgr is expected
Ondřej Surý [Thu, 5 Dec 2024 10:32:25 +0000 (10:32 +0000)] 
chg: doc: only one loopmgr is expected

Resolves: https://gitlab.isc.org/isc-projects/bind9/-/issues/5057

Merge branch 'docs' into 'main'

See merge request isc-projects/bind9!9789

17 months agoupdate docs: only one loopmgr is expected
Pavel Březina [Wed, 27 Nov 2024 12:19:23 +0000 (13:19 +0100)] 
update docs: only one loopmgr is expected

Resolves: https://gitlab.isc.org/isc-projects/bind9/-/issues/5057

17 months agofix: ci: Add ns2/managed1.conf to mkeys extra_artifacts
Michal Nowak [Thu, 5 Dec 2024 10:07:46 +0000 (10:07 +0000)] 
fix: ci: Add ns2/managed1.conf to mkeys extra_artifacts

The ns2/managed1.conf file is created by the setup.sh script. Then, in
the tests.sh script it is moved to ns2/managed.conf. The latter file
name is in mkeys extra_artifacts, but the former one is not. This is a
problem when pytest is started with the --setup-only option as it only
runs the setup.sh script (e.g., in the cross-version-config-tests CI
job) and thus failing the "Unexpected files found" assertion.

Merge branch 'mnowak/mkeys-add-ns2-managed1-conf-to-extra-artifacts' into 'main'

See merge request isc-projects/bind9!9815

17 months agoAdd ns2/managed1.conf to mkeys extra_artifacts
Michal Nowak [Wed, 4 Dec 2024 17:17:40 +0000 (18:17 +0100)] 
Add ns2/managed1.conf to mkeys extra_artifacts

The ns2/managed1.conf file is created by the setup.sh script. Then, in
the tests.sh script it is moved to ns2/managed.conf. The latter file
name is in mkeys extra_artifacts, but the former one is not. This is a
problem when pytest is started with the --setup-only option as it only
runs the setup.sh script (e.g., in the cross-version-config-tests CI
job) and thus failing the "Unexpected files found" assertion.

17 months agofix: usr: Fix possible assertion failure when reloading server while processing updates
Mark Andrews [Thu, 5 Dec 2024 04:13:49 +0000 (04:13 +0000)] 
fix: usr: Fix possible assertion failure when reloading server while processing updates

Closes #5006

Merge branch '5006-get-max-by-type-earlier' into 'main'

See merge request isc-projects/bind9!9745

17 months agoKeep a local copy of the update rules to prevent UAF
Mark Andrews [Tue, 19 Nov 2024 14:20:42 +0000 (01:20 +1100)] 
Keep a local copy of the update rules to prevent UAF

Previously, the update policy rules check was moved earlier in the
sequence, and the keep rule match pointers were kept to maintain the
ability to verify maximum records by type.

However, these pointers can become invalid if server reloading
or reconfiguration occurs before update completion. To prevent
this issue, extract the maximum records by type value immediately
during processing and only keep the copy of the values instead of the
full ssurule.

17 months agofix: doc: document optional statements the same, enabled or not
Evan Hunt [Thu, 5 Dec 2024 02:36:47 +0000 (02:36 +0000)] 
fix: doc: document optional statements the same, enabled or not

The automatically-generated grammar for named.conf clauses that may or may not be enabled at compile time will now include the same comment, regardless of whether or not they are. Previously, the grammar didn't include a comment if an option was enabled, but said "not configured" if it was disabled. Now, in both cases, it will say "optional (only available if configured)".

Closes #4960

Merge branch '4960-optional-grammar' into 'main'

See merge request isc-projects/bind9!9579

17 months agodocument optional statements the same, enabled or not
Evan Hunt [Wed, 2 Oct 2024 02:16:55 +0000 (19:16 -0700)] 
document optional statements the same, enabled or not

the generated grammar for named.conf clauses that may or may not be
enabled at compile time will now print the same comment regardless of
whether or not they are.

previously, the grammar didn't print a comment if an option was enabled,
but printed "not configured" if it was disabled. now, in both cases,
it will say "optional (only available if configured)".

as an incidental fix, clarified the documentation for "named-checkconf -n".

17 months agochg: test: Rewrite ecdsa system test to pytest
Michal Nowak [Wed, 4 Dec 2024 18:32:55 +0000 (18:32 +0000)] 
chg: test: Rewrite ecdsa system test to pytest

Merge branch 'mnowak/pytest_rewrite_ecdsa' into 'main'

See merge request isc-projects/bind9!9159

17 months agoRewrite ecdsa system test to pytest
Michal Nowak [Thu, 18 Jul 2024 19:43:42 +0000 (21:43 +0200)] 
Rewrite ecdsa system test to pytest

17 months agofix: ci: tests: Use FIPS compatible DH-param files
Artem Boldariev [Wed, 4 Dec 2024 16:50:36 +0000 (16:50 +0000)] 
fix: ci: tests: Use FIPS compatible DH-param files

When the tests were added, the files were generated without FIPS
compatibility in mind. That made the tests fail on recent OpenSSL
versions in FIPS mode.

So, the files were regenerated on a FIPS compliant system using the
following stanza:

```
$ openssl dhparam -out <file> 3072
```

Apparently, the old files are not valid for FIPS starting with OpneSSL
3.1.X release series as "FIPS 140-3 compliance changes" are mentioned
in the [changelog](https://openssl-library.org/news/openssl-3.1-notes/).

Closes #5074.

Merge branch '5074-fips-compatible-dhparams' into 'main'

See merge request isc-projects/bind9!9807

17 months agoUse FIPS compatible DH-param files
Artem Boldariev [Tue, 3 Dec 2024 10:38:34 +0000 (12:38 +0200)] 
Use FIPS compatible DH-param files

When the tests were added, the files were generated without FIPS
compatibility in mind. That made the tests fail on recent OpenSSL
versions in FIPS mode.

So, the files were regenerated on a FIPS compliant system using the
following stanza:

$ openssl dhparam -out <file> 3072

Apparently, the old files are not valid for FIPS starting with OpneSSL
3.1.X release series as "FIPS 140-3 compliance changes" are mentioned
in the changelog:

https://openssl-library.org/news/openssl-3.1-notes/

17 months agonew: usr: Add Extended DNS Error Code 22 - No Reachable Authority
Colin Vidal [Wed, 4 Dec 2024 15:52:16 +0000 (15:52 +0000)] 
new: usr: Add Extended DNS Error Code 22 - No Reachable Authority

When the resolver is trying to query an authority server and eventually timed out, a SERVFAIL answer is given to the client. Add the Extended DNS Error Code 22 - No Reachable Authority to the response.

Closes #2268

Merge branch '2268/ede-no-reachable-authority' into 'main'

See merge request isc-projects/bind9!9743

17 months agoAdd EDE 22 No reachable authority code
Colin Vidal [Fri, 8 Nov 2024 17:18:30 +0000 (18:18 +0100)] 
Add EDE 22 No reachable authority code

Add support for Extended DNS Errors (EDE) error 22: No reachable
authority. This occurs when after a timeout delay when the resolver is
trying to query an authority server.

17 months agorem: dev: Remove the log message about incomplete IPv6 API
Ondřej Surý [Wed, 4 Dec 2024 15:19:21 +0000 (15:19 +0000)] 
rem: dev: Remove the log message about incomplete IPv6 API

The log message would not be ever reached, because the IPv6 API is
always considered to be complete.  Just remove the dead code.

Closes #5068

Merge branch '5068-remove-dead-code-from-ns_interface' into 'main'

See merge request isc-projects/bind9!9798

17 months agoRemove the log message about incomplete IPv6 API
Ondřej Surý [Thu, 28 Nov 2024 16:28:35 +0000 (17:28 +0100)] 
Remove the log message about incomplete IPv6 API

The log message would not be ever reached, because the IPv6 API is
always considered to be complete.  Just remove the dead code.

17 months agochg: doc: Set up version for BIND 9.21.4
Petr Špaček [Wed, 4 Dec 2024 15:10:58 +0000 (15:10 +0000)] 
chg: doc: Set up version for BIND 9.21.4

Merge branch 'pspacek/set-up-version-for-bind-9.21.4' into 'main'

See merge request isc-projects/bind9!9810

17 months agoUpdate BIND version to 9.21.4-dev
Petr Špaček [Wed, 4 Dec 2024 14:52:49 +0000 (15:52 +0100)] 
Update BIND version to 9.21.4-dev

17 months agochg: doc: gitchangelog: don't break lines on hyphens in relnotes
Petr Špaček [Mon, 2 Dec 2024 13:53:38 +0000 (13:53 +0000)] 
chg: doc: gitchangelog: don't break lines on hyphens in relnotes

When release notes are generated, the text is wrapped and line breaks
are inserted into each paragraph (sourced from the commit message's
body). Prevent line breaks after hyphens, as these are often used for
option names. This makes it possible to easily find the options
afterwards.

Merge branch 'nicki/gitchangelog-dont-break-on-hyphens' into 'main'

See merge request isc-projects/bind9!9801

17 months agogitchangelog: don't break lines on hyphens in relnotes
Nicki Křížek [Mon, 2 Dec 2024 10:10:01 +0000 (11:10 +0100)] 
gitchangelog: don't break lines on hyphens in relnotes

When release notes are generated, the text is wrapped and line breaks
are inserted into each paragraph (sourced from the commit message's
body). Prevent line breaks after hyphens, as these are often used for
option names. This makes it possible to easily find the options
afterwards.

17 months agonew: dev: Extended TCP accept() logging
Artem Boldariev [Wed, 27 Nov 2024 19:48:58 +0000 (19:48 +0000)] 
new: dev: Extended TCP accept() logging

Add extra log messages about TCP connection management.

Merge branch 'tcp-accept-extended-logging' into 'main'

See merge request isc-projects/bind9!9089

17 months agoExtended TCP accept()/close() logging
Artem Boldariev [Wed, 5 Jun 2024 10:15:04 +0000 (13:15 +0300)] 
Extended TCP accept()/close() logging

This commit adds extra log messages issued when accepting or closing a
TCP connection (provided that debugging logging level >=99 is
enabled).

17 months agofix: usr: Improve the memory cleaning in the SERVFAIL cache
Ondřej Surý [Wed, 27 Nov 2024 17:04:29 +0000 (17:04 +0000)] 
fix: usr: Improve the memory cleaning in the SERVFAIL cache

The SERVFAIL cache doesn't have a memory bound and the
cleaning of the old SERVFAIL cache entries was implemented
only in opportunistic manner.  Improve the memory cleaning
of the SERVFAIL cache to be more aggressive, so it doesn't
consume a lot of memory in the case the server encounters
many SERVFAILs at once.

Closes #5025

Merge branch '5025-improve-badcache-cleaning' into 'main'

See merge request isc-projects/bind9!9760

17 months agochg: dev: Optimize memory layout of core structs
Alessio Podda [Wed, 27 Nov 2024 17:02:08 +0000 (17:02 +0000)] 
chg: dev: Optimize memory layout of core structs

Reduce memory footprint by:
- Reordering struct fields to minimize padding.
- Using exact-sized atomic types instead of `*_least`/`*_fast` variants
- Downsizing integer fields where possible

Affected structs:
- dns_name_t
- dns_slabheader_t
- dns_rdata_t
- qpcnode_t
- qpznode_t

Closes #5022

Merge branch '5022-reduce-metadata-overhead-by-struct-packing' into 'main'

See merge request isc-projects/bind9!9721

17 months agoRemove dns_badcache usage in the resolver (lame-ttl)
Ondřej Surý [Fri, 22 Nov 2024 14:10:26 +0000 (15:10 +0100)] 
Remove dns_badcache usage in the resolver (lame-ttl)

The lame-ttl processing was overriden to be disabled in the config,
but the code related to the lame-ttl was still kept in the resolver
code.  More importantly, the DNS_RESOLVER_BADCACHETTL() macro would
cause the entries in the resolver badcache to be always cached for at
least 30 seconds even if the lame-ttl would be set to 0.

Remove the dns_badcache code from the dns_resolver unit, so we save some
processing time and memory in the resolver code.

17 months agoImprove the badcache cleaning by adding LRU and using RCU
Ondřej Surý [Thu, 14 Nov 2024 18:51:29 +0000 (19:51 +0100)] 
Improve the badcache cleaning by adding LRU and using RCU

Instead of cleaning the dns_badcache opportunistically, add per-loop
LRU, so each thread-loop can clean the expired entries.  This also
allows removal of the atomic operations as the badcache entries are now
immutable, instead of updating the badcache entry in place, the old
entry is now deleted from the hashtable and the LRU list, and the new
entry is inserted in the LRU.

17 months agoOptimize memory layout of core structs
alessio [Tue, 5 Nov 2024 08:36:24 +0000 (09:36 +0100)] 
Optimize memory layout of core structs

Reduce memory footprint by:

 - Reordering struct fields to minimize padding.
 - Using exact-sized atomic types instead of *_least/*_fast variants
 - Downsizing integer fields where possible

Affected structs:

 - dns_name_t
 - dns_slabheader_t
 - dns_rdata_t
 - qpcnode_t
 - qpznode_t

17 months agochg: dev: Assume IPv6 is universally available (on the kernel level)
Ondřej Surý [Wed, 27 Nov 2024 14:23:11 +0000 (14:23 +0000)] 
chg: dev: Assume IPv6 is universally available (on the kernel level)

Instead of various probing, just assume that IPv6 is universally available
and cleanup the various checks and defines that we have accumulated over
the years.

Merge branch 'ondrej/cleanup-IPv6-networking-support' into 'main'

See merge request isc-projects/bind9!9360