Commit Graph

42057 Commits

Author SHA1 Message Date
Michal Nowak
83178557b4 Add OpenBSD 7.6
(cherry picked from commit 11670b581d)
2024-12-06 10:17:12 +00:00
Michal Nowak
b2c60b8401 [9.20] chg: test: Add FreeBSD 13.4
Backport of MR !9640

Merge branch 'backport-mnowak/freebsd-13.4-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9845
2024-12-06 10:08:28 +00:00
Michal Nowak
2b7ed7fde8 Add FreeBSD 13.4
(cherry picked from commit 88b4367daa)
2024-12-06 09:32:08 +00:00
Matthijs Mekking
4ca7a5d601 [9.20] 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

Backport of MR !9709

Merge branch 'backport-4910-nsupdate-hangs-when-processing-large-update-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9834
2024-12-06 08:31:28 +00:00
Matthijs Mekking
a7b291adc7 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
4b7c61381f 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.

(cherry picked from commit aa24b77d8b)
2024-12-06 08:31:19 +00:00
Matthijs Mekking
cc004b2b8f Add test case for nsupdate hangs on large update
This test case hangs, despite the update being performed on the
name server.

(cherry picked from commit 3adabb4f89)
2024-12-06 08:31:19 +00:00
Michal Nowak
336e9c746e [9.20] fix: test: ecdsa pytest rewrite fixes
Backport of MR !9823

Merge branch 'backport-mnowak/ecdsa-pytest-rewrite-fixes-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9837
2024-12-06 07:08:34 +00:00
Michal Nowak
dffcf1226c 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.

(cherry picked from commit 1a5683b638)
2024-12-06 07:06:31 +00:00
Michal Nowak
85176a62ca Fix skipif decorators' conditions
The ECDSA256 and ECDSA384 check conditions were switched.

(cherry picked from commit 2a7b8d9795)
2024-12-06 07:06:31 +00:00
Mark Andrews
844a531053 [9.20] 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

Backport of MR !9737

Merge branch 'backport-4980-global-limit-outgoing-queries-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9832
2024-12-06 06:59:18 +00:00
Matthijs Mekking
dd098a4b3b 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'.

(cherry picked from commit 84df920d9e)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
1d7ddb5ec4 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.

(cherry picked from commit 73eafaba14)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
63e5f295fb Add +maxtotalqueries option to delv
The max-query-count value can now be set on the command line in delv
with +maxtotalqueries.

(cherry picked from commit 74f845d62f)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
492f79560d Implement global limit for outgoing queries
This global limit is not reset on query restarts and is a hard limit
for any client request.

(cherry picked from commit 16b3bd1cc7)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
511c86facb Implement getter function for counter limit
(cherry picked from commit ca7d487357)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
c233bb9de0 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.

(cherry picked from commit bbc16cc8e6)
2024-12-06 06:20:33 +00:00
Mark Andrews
79e6519168 [9.20] 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

Backport of MR !9488

Merge branch 'backport-4934-lock-and-attach-when-return-zone-stats-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9843
2024-12-06 06:19:41 +00:00
Mark Andrews
bcf3f8b44d Attach dnssecsignstats, rcvquerystats, and requeststats
In dns_zone_getdnssecsignstats, dns_zone_getrcvquerystats and
dns_zone_getrequeststats attach to the statistics structure.

(cherry picked from commit fb50a71159)
2024-12-06 16:45:52 +11:00
Mark Andrews
12a0f80b99 INSIST that the zone in locked before unlocking
This is the counterpart to the INSIST(!zone->locked) when the zone
is locked.

(cherry picked from commit aa686512df)
2024-12-06 05:32:56 +00:00
Mark Andrews
31918336e8 [9.20] fix: dev: Finalize removal of memory debug flags size and mctx
Commit 4b3d0c6600 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.

Backport of MR !9606

Merge branch 'backport-main-memory-flags-size-mctx-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9842
2024-12-06 03:56:14 +00:00
Petr Menšík
5a1c39b1b7 Finalize removal of memory debug flags size and mctx
Commit 4b3d0c6600 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.

(cherry picked from commit 65b9eeb39a)
2024-12-06 03:13:14 +00:00
Mark Andrews
c577c3b544 [9.20] 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

Backport of MR !9800

Merge branch 'backport-5070-dnssec-signzone-fix-revoke-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9840
2024-12-06 02:03:35 +00:00
Mark Andrews
3eea26ba37 Check dnssec-signzone behaviour with revoked keys
Only DNSKEY records should be signed with a revoked key.

(cherry picked from commit 30ef6dde05)
2024-12-06 01:00:08 +00:00
Mark Andrews
db19675ee9 Do not sign non DNSKEY RRset with revoked keys
It does not make sense to sign RRsets other than DNSKEY with revoked
keys.

(cherry picked from commit 23775c6006)
2024-12-06 01:00:08 +00:00
Ondřej Surý
4345aac6dc [9.20] chg: doc: only one loopmgr is expected
Resolves: https://gitlab.isc.org/isc-projects/bind9/-/issues/5057

Backport of MR !9789

Merge branch 'backport-docs-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9826
2024-12-05 19:50:21 +00:00
Pavel Březina
0884e223c4 update docs: only one loopmgr is expected
Resolves: https://gitlab.isc.org/isc-projects/bind9/-/issues/5057
(cherry picked from commit 6f21cf201b)
2024-12-05 19:50:16 +00:00
Michal Nowak
d1f1d13efd [9.20] 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.

Backport of MR !9815

Merge branch 'backport-mnowak/mkeys-add-ns2-managed1-conf-to-extra-artifacts-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9824
2024-12-05 10:43:25 +00:00
Michal Nowak
e8d6be9c38 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.

(cherry picked from commit e7d973bd00)
2024-12-05 10:08:34 +00:00
Colin Vidal
ee77a19209 [9.20] 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

Backport of MR !9743

Merge branch 'backport-2268/ede-no-reachable-authority-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9814
2024-12-05 10:03:28 +00:00
Colin Vidal
c586d9a658 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.

(cherry picked from commit d13e94b930)

Commit amended in order to fix usage of isc_log_write (adding dns_lctx
parameter)
2024-12-05 10:30:28 +01:00
Michal Nowak
fc14b62e92 [9.20] chg: test: Rewrite ecdsa system test to pytest
Backport of MR !9159

Merge branch 'backport-mnowak/pytest_rewrite_ecdsa-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9816
2024-12-05 07:46:46 +00:00
Michal Nowak
211a0eafa9 Rewrite ecdsa system test to pytest
(cherry picked from commit 292e919156)
2024-12-05 07:46:17 +00:00
Mark Andrews
41af766cd0 [9.20] fix: usr: Fix possible assertion failure when reloading server while processing updates
Closes #5006

Backport of MR !9745

Merge branch 'backport-5006-get-max-by-type-earlier-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9820
2024-12-05 04:48:33 +00:00
Mark Andrews
f5bcc2a1b8 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.

(cherry picked from commit 44a54a29d8)
2024-12-05 04:14:28 +00:00
Petr Špaček
ae739c80cc fix: dev: Fix m4 macro in configure.ac
Merge branch 'pspacek/fix-bind-9.20-build' into 'bind-9.20'

See merge request isc-projects/bind9!9813
2024-12-04 15:45:39 +00:00
Petr Špaček
cd033ac41f Fix m4 macro in configure.ac
Release automation went wrong, it seems. And I just glanced over the
line, saw 4 -> 5 change at the end and did not notice the change at the
beginning of the line...
2024-12-04 16:38:14 +01:00
Petr Špaček
37c3e5a1c0 chg: doc: Set up version for BIND 9.20.5
Merge branch 'pspacek/set-up-version-for-bind-9.20.5' into 'bind-9.20'

See merge request isc-projects/bind9!9811
2024-12-04 15:10:48 +00:00
Petr Špaček
0b44cfd53a Update BIND version to 9.20.5-dev 2024-12-04 16:06:17 +01:00
Petr Špaček
408bd910ec [9.20] 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.

Backport of MR !9801

Merge branch 'backport-nicki/gitchangelog-dont-break-on-hyphens-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9802
2024-12-02 14:01:29 +00:00
Nicki Křížek
2a86b13e28 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.

(cherry picked from commit 9b0d0c0173)
2024-12-02 13:56:00 +00:00
Evan Hunt
1e9c3af75a [9.20] fix: dev: Use attach()/detach() functions instead of touching .references
In rbtdb.c, there were places where the code touched .references
directly instead of using the helper functions.  Use the helper
functions instead.

Forward port from https://gitlab.isc.org/isc-private/bind9/-/merge_requests/753

Merge branch 'ondrej/use-attach-detach-in-rbtdb-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9795
2024-11-27 22:51:41 +00:00
Ondřej Surý
db5803a0ec Use attach()/detach() functions instead of touching .references
In rbtdb.c, there were places where the code touched .references
directly instead of using the helper functions.  Use the helper
functions instead.
2024-11-27 21:16:22 +01:00
Ondřej Surý
8002fda38c [9.20] 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

Backport of MR !9470

Merge branch 'backport-4926-fix-data-race-in-dns_validator-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9790
2024-11-27 19:04:26 +00:00
Ondřej Surý
f04514e98a 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.

(cherry picked from commit ee122ba025)
2024-11-27 19:43:26 +01:00
Ondřej Surý
fa5d270f95 [9.20] 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

Backport of MR !9760

Merge branch 'backport-5025-improve-badcache-cleaning-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9794
2024-11-27 18:04:38 +00:00
Ondřej Surý
de7312ae5f 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.

(cherry picked from commit b61739836d)
2024-11-27 17:07:03 +00:00
Ondřej Surý
6c3f1f09b2 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.

(cherry picked from commit 2cb5a6210f)
2024-11-27 17:07:03 +00:00
Arаm Sаrgsyаn
894295a926 [9.20] 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

Backport of MR !9523

Merge branch 'backport-4948-nslookup-test-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9791
2024-11-27 15:54:01 +00:00
Aram Sargsyan
bebdabc06c 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).

(cherry picked from commit 345b0f9e5c)
2024-11-27 13:35:25 +00:00
Arаm Sаrgsyаn
ab138bb717 [9.20] 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

Backport of MR !9781

Merge branch 'backport-5038-xfr-primary-next-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9788
2024-11-27 13:30:13 +00:00