]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
18 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.

18 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

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

18 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

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

18 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

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

18 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

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

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

18 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

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

18 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

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

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

18 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

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

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

18 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

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

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

18 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

18 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'.

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

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

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

18 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

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

18 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

18 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

18 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

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

18 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

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

18 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

18 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".

18 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

18 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

18 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

18 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/

18 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

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

18 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

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

18 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

18 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

18 months agoUpdate BIND version for release 209678 v9.21.3
Petr Špaček [Mon, 2 Dec 2024 16:57:42 +0000 (17:57 +0100)] 
Update BIND version for release

18 months agoAdd missing copyright header to Release Notes
Petr Špaček [Tue, 3 Dec 2024 09:43:02 +0000 (10:43 +0100)] 
Add missing copyright header to Release Notes

18 months agoAdd release note for GL #5022
Petr Špaček [Tue, 3 Dec 2024 09:36:58 +0000 (10:36 +0100)] 
Add release note for GL #5022

18 months agoAdd release note for GL #4986
Petr Špaček [Tue, 3 Dec 2024 09:19:17 +0000 (10:19 +0100)] 
Add release note for GL #4986

18 months agonew: doc: Prepare documentation for BIND 9.21.3
Petr Špaček [Mon, 2 Dec 2024 16:55:38 +0000 (16:55 +0000)] 
new: doc: Prepare documentation for BIND 9.21.3

Merge branch 'pspacek/prepare-documentation-for-bind-9.21.3' into 'v9.21.3-release'

See merge request isc-private/bind9!755

18 months agoTweak and reword release notes
Petr Špaček [Mon, 2 Dec 2024 15:24:43 +0000 (16:24 +0100)] 
Tweak and reword release notes

18 months agoAutomatically add hyperlinks to release notes for BIND 9.21.3
Petr Špaček [Mon, 2 Dec 2024 14:34:07 +0000 (15:34 +0100)] 
Automatically add hyperlinks to release notes for BIND 9.21.3

18 months agoPrepare release notes for BIND 9.21.3
Petr Špaček [Mon, 2 Dec 2024 14:29:59 +0000 (15:29 +0100)] 
Prepare release notes for BIND 9.21.3

18 months agoFix Sphinx build failures on generated changelog for BIND 9.21.3
Petr Špaček [Mon, 2 Dec 2024 14:13:30 +0000 (15:13 +0100)] 
Fix Sphinx build failures on generated changelog for BIND 9.21.3

18 months agoGenerate changelog for BIND 9.21.3
Petr Špaček [Mon, 2 Dec 2024 14:07:55 +0000 (15:07 +0100)] 
Generate changelog for BIND 9.21.3

18 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

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

18 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

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

18 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

18 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

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

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

18 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

18 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

18 months agoRemove unused definition of ISC_CMSG_IP_TOS
Ondřej Surý [Tue, 20 Aug 2024 10:15:05 +0000 (12:15 +0200)] 
Remove unused definition of ISC_CMSG_IP_TOS

The #define was used before, but we forgot to clean it up when we
removed support for dscp.

18 months agoRemove the incomplete code for IPv6 pktinfo
Ondřej Surý [Tue, 20 Aug 2024 10:12:47 +0000 (12:12 +0200)] 
Remove the incomplete code for IPv6 pktinfo

The code that listens on individual interfaces is now stable and doesn't
require any changes.  The code that would bind to IPv6 wildcard address
and then use IPv6 pktinfo structure to get the source address is not
going to be completed, so it's better to just remove the dead cruft.

18 months agoAssume universal availability of socklen_t
Ondřej Surý [Tue, 20 Aug 2024 09:57:35 +0000 (11:57 +0200)] 
Assume universal availability of socklen_t

The SUSv2 defines accept(..., socklen_t), so we can safely require
socklen_t to be universally available.

18 months agoAssume that IPv4 and IPv6 is always available
Ondřej Surý [Tue, 20 Aug 2024 09:53:07 +0000 (11:53 +0200)] 
Assume that IPv4 and IPv6 is always available

In 2024, it is reasonable to assume that IPv4 and IPv6 is always
available on a socket() level.  We still keep the option to enable or
disable each IP version individually, as the routing might be broken or
undesirable for one of the versions.

18 months agoAssume IPV6_V6ONLY is universally available
Ondřej Surý [Tue, 20 Aug 2024 09:48:04 +0000 (11:48 +0200)] 
Assume IPV6_V6ONLY is universally available

In 2024, IPV6_V6ONLY socket option is either available or the operating
system is just not going to be supported.

18 months agofix: test: Fix the nslookup system test
Arаm Sаrgsyаn [Wed, 27 Nov 2024 13:34:29 +0000 (13:34 +0000)] 
fix: test: Fix the nslookup system test

The nslookup system test checks the count of resolved addresses in
the CNAME tests using a 'grep' match on the hostname, and ignoring
lines containing the 'canonical name' string. In order to protect
the check from intermittent failures like the 'address in use' warning
message, which then automatically resolves after a retry, edit the
'grep' matching string to also ignore the comments (as the mentioned
warning message is a comment which contains the hostname).

Closes #4948

Merge branch '4948-nslookup-test-fix' into 'main'

See merge request isc-projects/bind9!9523

18 months agoFix the nslookup system test
Aram Sargsyan [Thu, 19 Sep 2024 14:47:49 +0000 (14:47 +0000)] 
Fix the nslookup system test

The nslookup system test checks the count of resolved addresses in
the CNAME tests using a 'grep' match on the hostname, and ignoring
lines containing the 'canonical name' string. In order to protect
the check from intermittent failures like the 'address in use' warning
message, which then automatically resolves after a retry, edit the
'grep' matching string to also ignore the comments (as the mentioned
warning message is a comment which contains the hostname).

18 months agofix: dev: Make dns_validator_cancel() respect the data ownership
Ondřej Surý [Wed, 27 Nov 2024 13:00:33 +0000 (13:00 +0000)] 
fix: dev: Make dns_validator_cancel() respect the data ownership

There was a data race dns_validator_cancel() was called when the
offloaded operations were in progress.  Make dns_validator_cancel()
respect the data ownership and only set new .canceling variable when
the offloaded operations are in progress.  The cancel operation would
then finish when the offloaded work passes the ownership back to the
respective thread.

Closes #4926

Merge branch '4926-fix-data-race-in-dns_validator' into 'main'

See merge request isc-projects/bind9!9470

18 months agoMake dns_validator_cancel() respect the data ownership
Ondřej Surý [Tue, 10 Sep 2024 12:18:48 +0000 (14:18 +0200)] 
Make dns_validator_cancel() respect the data ownership

There was a data race dns_validator_cancel() was called when the
offloaded operations were in progress.  Make dns_validator_cancel()
respect the data ownership and only set new .shuttingdown variable when
the offloaded operations are in progress.  The cancel operation would
then finish when the offloaded work passes the ownership back to the
respective thread.

18 months agofix: usr: Fix trying the next primary server when the preivous one was marked as...
Arаm Sаrgsyаn [Wed, 27 Nov 2024 11:46:09 +0000 (11:46 +0000)] 
fix: usr: Fix trying the next primary server when the preivous one was marked as unreachable

In some cases (there is evidence only when XoT was used) `named` failed
to try the next primary server in the list when the previous one was
marked as unreachable. This has been fixed.

Closes #5038

Merge branch '5038-xfr-primary-next-fix' into 'main'

See merge request isc-projects/bind9!9781

18 months agoTest trying of the next primary server
Aram Sargsyan [Tue, 26 Nov 2024 12:09:57 +0000 (12:09 +0000)] 
Test trying of the next primary server

Add test cases which check that when a XoT primary server is
unreachable or is already marked as unreachble then the next
primary server in the list is used.

18 months agoxfrin: refactor and fix the ISC_R_CANCELED case handling
Aram Sargsyan [Tue, 26 Nov 2024 12:06:03 +0000 (12:06 +0000)] 
xfrin: refactor and fix the ISC_R_CANCELED case handling

Previously a ISC_R_CANCELED result code switch-case has been added to
the zone.c:zone_xfrdone() function, which did two things:

1. Schedule a new zone transfer if there's a scheduled force reload of
   the zone.

2. Reset the primaries list.

This proved to be not a well-thought change and causes problems,
because the ISC_R_CANCELED code is used not only when the whole transfer
is canceled, but also when, for example, a particular primary server is
unreachable, and named still needs to continue the transfer process by
trying the next server, which it now no longer does in some cases. To
solve this issue, three changes are made:

1. Make sure dns_zone_refresh() runs on the zone's loop, so that the
   sequential calls of dns_zone_stopxfr() and dns_zone_forcexfr()
   functions (like done in 'rndc retransfer -force') run in intended
   order and don't race with each other.

2. Since starting the new transfer is now guaranteed to run after the
   previous transfer is shut down (see the previous change), remove the
   special handling of the ISC_R_CANCELED case, and let the default
   handler to handle it like before. This will bring back the ability to
   try the next primary if the current one was interrupted with a
   ISC_R_CANCELED result code.

3. Change the xfrin.c:xfrin_shutdown() function to pass the
   ISC_R_SHUTTINGDOWN result code instead of ISC_R_CANCELED, as it makes
   more sense.

18 months agoClean up dns_zonemgr_unreachabledel()
Aram Sargsyan [Tue, 26 Nov 2024 11:36:33 +0000 (11:36 +0000)] 
Clean up dns_zonemgr_unreachabledel()

The results of isc_sockaddr_format() calls are not used, remove them
and the local variables.

18 months agochg: dev: Use default listening rules from config.c string
Evan Hunt [Wed, 27 Nov 2024 00:08:28 +0000 (00:08 +0000)] 
chg: dev: Use default listening rules from config.c string

Remove special code which creates default listeners, and use the normal named.conf configuration parser instead. This removes unneeded code and makes the built-in configuration text provide a true primary source of defaults. This change should be transparent to end-users and should not cause any visible change.

Closes #1424

Merge branch '1424-listen-builtin-config' into 'main'

See merge request isc-projects/bind9!2663

18 months agoRemove ns_listenlist_default()
Petr Menšík [Mon, 6 Dec 2021 12:44:51 +0000 (13:44 +0100)] 
Remove ns_listenlist_default()

It is not used anywhere in named and is no longer necessary
there.  It was called in some unit tests, but was not actually
needed by them.

18 months agoLoad default listen-on[-v6] values from config.c
Petr Menšík [Mon, 6 Dec 2021 12:42:53 +0000 (13:42 +0100)] 
Load default listen-on[-v6] values from config.c

Stop using ns_listenlist_default() to set the default listen-on
and listen-on-v6 configuration.  Instead, configure these options
using the default values in config.c.

18 months agochg: test: Rewrite emptyzones system test to pytest
Michal Nowak [Tue, 26 Nov 2024 15:15:51 +0000 (15:15 +0000)] 
chg: test: Rewrite emptyzones system test to pytest

Merge branch 'mnowak/pytest_rewrite_emptyzones' into 'main'

See merge request isc-projects/bind9!9154

18 months agoRewrite emptyzones system test to pytest
Michal Nowak [Wed, 17 Jul 2024 11:01:28 +0000 (13:01 +0200)] 
Rewrite emptyzones system test to pytest

18 months agoAdd isctest.check.refused()
Michal Nowak [Wed, 17 Jul 2024 13:35:05 +0000 (15:35 +0200)] 
Add isctest.check.refused()

18 months agochg: test: Rewrite database system test to pytest
Michal Nowak [Tue, 26 Nov 2024 12:11:30 +0000 (12:11 +0000)] 
chg: test: Rewrite database system test to pytest

Merge branch 'mnowak/pytest_rewrite_database' into 'main'

See merge request isc-projects/bind9!9156

18 months agoRewrite database system test to pytest
Michal Nowak [Thu, 18 Jul 2024 08:16:16 +0000 (10:16 +0200)] 
Rewrite database system test to pytest

18 months agorem: usr: Move contributed DLZ modules into a separate repository
Ondřej Surý [Tue, 26 Nov 2024 11:30:12 +0000 (11:30 +0000)] 
rem: usr: Move contributed DLZ modules into a separate repository

The DLZ modules are poorly maintained as we only ensure they can still
be compiled, the DLZ interface is blocking, so anything that blocks the
query to the database blocks the whole server and they should not be
used except in testing.  The DLZ interface itself is going to be scheduled
for removal.

The DLZ modules now live in https://gitlab.isc.org/isc-projects/dlz-modules
repository.

Closes #4865

Merge branch '4865-remove-contributed-DLZ-modules' into 'main'

See merge request isc-projects/bind9!9349

18 months agoMove contributed DLZ modules into a separate repository
Ondřej Surý [Mon, 19 Aug 2024 12:39:11 +0000 (14:39 +0200)] 
Move contributed DLZ modules into a separate repository

The DLZ modules are poorly maintained as we only ensure they can still
be compiled, the DLZ interface is blocking, so anything that blocks the
query to the database blocks the whole server and they should not be
used except in testing.  The DLZ interface itself should be scheduled
for removal.

18 months agorem: test: Revert "xfail upforwd system test if DNSTAP is enabled"
Michal Nowak [Tue, 26 Nov 2024 10:48:26 +0000 (10:48 +0000)] 
rem: test: Revert "xfail upforwd system test if DNSTAP is enabled"

This reverts commit 0579e0a4299d7d238997486c52c3e3c97ebd977d.

See isc-projects/bind9#4996

Merge branch 'mnowak/revert-xfail-upforwd-system-test' into 'main'

See merge request isc-projects/bind9!9681

18 months agoRevert "xfail upforwd system test if DNSTAP is enabled"
Michal Nowak [Wed, 23 Oct 2024 14:04:13 +0000 (16:04 +0200)] 
Revert "xfail upforwd system test if DNSTAP is enabled"

This reverts commit 0579e0a4299d7d238997486c52c3e3c97ebd977d.

18 months agochg: usr: Add new logging module for logging crypto errors in libisc
Ondřej Surý [Tue, 26 Nov 2024 10:23:11 +0000 (10:23 +0000)] 
chg: usr: Add new logging module for logging crypto errors in libisc

Add a new 'crypto' log module that will be used for a low-level
cryptographic operations.  The DNS related cryptography logs
are still logged in the 'dns/crypto' module.

Merge branch 'ondrej/add-ISC_LOGMODULE_CRYPTO' into 'main'

See merge request isc-projects/bind9!9287

18 months agoAdd new logging category for logging crypto errors in libisc
Ondřej Surý [Thu, 8 Aug 2024 09:26:27 +0000 (11:26 +0200)] 
Add new logging category for logging crypto errors in libisc

The libisc now includes sizeable chunks of cryptography, but the crypto
log module was missing.  Add the new ISC_LOGMODULE_CRYPTO to libisc and
use it in the isc_tls error logging.

18 months agofix: test: Ignore test artifacts in .libs
Nicki Křížek [Tue, 26 Nov 2024 09:05:28 +0000 (09:05 +0000)] 
fix: test: Ignore test artifacts in .libs

Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.

Closes #5055

Merge branch '5055-ignore-libs-artifacts' into 'main'

See merge request isc-projects/bind9!9766

18 months agoIgnore test artifacts in .libs
Nicki Křížek [Mon, 25 Nov 2024 17:16:12 +0000 (18:16 +0100)] 
Ignore test artifacts in .libs

Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.

18 months agochg: usr: Add none parameter to query-source and query-source-v6 to disable IPv4...
Colin Vidal [Tue, 26 Nov 2024 08:46:58 +0000 (08:46 +0000)] 
chg: usr: Add none parameter to query-source and query-source-v6 to disable IPv4 or IPv6 upstream queries

Add a none parameter to named configuration option `query-source` (respectively `query-source-v6`) which forbid usage of IPv4 (respectively IPv6) addresses when named is doing an upstream query.

Closes #4981 Turning-off upstream IPv6 queries while still listening to downstream queries on IPv6.

Merge branch 'colin/querysource-none' into 'main'

See merge request isc-projects/bind9!9727

18 months agoAdd a none parameter to query-source[-v6]
Colin Vidal [Tue, 5 Nov 2024 12:40:55 +0000 (13:40 +0100)] 
Add a none parameter to query-source[-v6]

This change adds a "none" parameter to the query-source[-v6]
options in named.conf, which forbid the usage of IPv4 or IPv6
addresses when doing upstream queries.

18 months agochg: usr: emit more helpful log for exceeding max-records-per-type
Mark Andrews [Tue, 26 Nov 2024 07:15:25 +0000 (07:15 +0000)] 
chg: usr: emit more helpful log for exceeding max-records-per-type

The new log message is emitted when adding or updating an RRset
fails due to exceeding the max-records-per-type limit. The log includes
the owner name and type, corresponding zone name, and the limit value.
It will be emitted on loading a zone file, inbound zone transfer
(both AXFR and IXFR), handling a DDNS update, or updating a cache DB.
It's especially helpful in the case of zone transfer, since the
secondary side doesn't have direct access to the offending zone data.

It could also be used for max-types-per-name, but this change
doesn't implement it yet as it's much less likely to happen
in practice.

Merge branch 'helpful-log-on-toomanyrecords' into 'main'

See merge request isc-projects/bind9!9509

18 months agoupdate system tests to confirm new log messages
JINMEI Tatuya [Thu, 26 Sep 2024 08:04:57 +0000 (17:04 +0900)] 
update system tests to confirm new log messages

18 months agouse more generic log module name for 'logtoomanyrecords'
JINMEI Tatuya [Wed, 18 Sep 2024 06:32:21 +0000 (15:32 +0900)] 
use more generic log module name for 'logtoomanyrecords'

DNS_LOGMODULE_RBTDB was simply inappropriate, and this
log message is actually dependent on db implementation
details, so DNS_LOGMODULE_DB would be the best choice.