Commit Graph
39439 Commits
Author SHA1 Message Date
Mark Andrews 75ae186fa1 [9.18] 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

Backport of MR !9865

Merge branch 'backport-5084-plain-unknown-keyword-in-resolv-conf-not-handled-propely-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9878
2024-12-10 03:36:40 +00:00
Mark Andrews ea43609f45 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.

(cherry picked from commit c44c4fcbfb)
2024-12-10 14:01:23 +11:00
Mark Andrews 841269601c 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.

(cherry picked from commit eb78ad2080)
2024-12-10 00:49:11 +00:00
Michal Nowak 4e768eba17 [9.18] new: test: Add Fedora 41
Prereq: isc-projects/images!345

Backport of MR !9612

Merge branch 'backport-mnowak/fedora-41-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9876
2024-12-09 18:00:12 +00:00
Michal Nowak a3064a9f92 Add Fedora 41
(cherry picked from commit 66fddf812f)
2024-12-09 17:20:36 +00:00
Michal Nowak e8ba695fbb [9.18] new: test: Add Alpine Linux 3.21
Prereq: isc-projects/images!359

Backport of MR !9872

Merge branch 'backport-mnowak/alpine-3.21-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9874
2024-12-09 17:17:39 +00:00
Michal Nowak d23489d7d3 Add Alpine Linux 3.21
(cherry picked from commit 6340454ea7)
2024-12-09 16:26:35 +00:00
Michal Nowak 4528a41417 [9.18] new: ci: Add FreeBSD 14.2
Backport of MR !9838

Merge branch 'backport-mnowak/freebsd-14.2-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9870
2024-12-09 13:42:25 +00:00
Michal Nowak 36ba252bf6 Add FreeBSD 14.2
(cherry picked from commit a5628101ee)
2024-12-09 13:38:00 +00:00
Matthijs Mekking b1207ea9ed [9.18] chg: dev: Use query counters in validator code
Commit af7db89513 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

Backport of MR !9856

Merge branch 'backport-4980-pass-counters-in-validator-createfetch-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9867
2024-12-09 11:26:20 +00:00
Matthijs Mekking b2516e1e0c Use query counters in validator code
Commit af7db89513 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.

(cherry picked from commit 5b1ae4a948)
2024-12-09 11:44:24 +01:00
Ondřej Surý 326b445e46 [9.18] chg: dev: Update picohttpparser.{c,h} with upstream repository
Closes #4485

Backport of MR !9857

Merge branch 'backport-4485-update-httppicoparser-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9864
2024-12-08 13:16:07 +00:00
Ondřej Surý 43f7642e5d 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.

(cherry picked from commit d14a76e115)
2024-12-08 12:30:11 +00:00
Matthijs Mekking c30067bb2f [9.18] chg: dev: Remove unused maxquerycount
Related to #4980

Backport of MR !9850

Merge branch 'backport-4980-remove-unused-maxqueryqount-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9854
2024-12-06 16:26:18 +00:00
Matthijs Mekking 413ba531f5 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.

(cherry picked from commit 397ca34e34)
2024-12-06 15:19:01 +00:00
Matthijs Mekking 64b2b6edff [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9847
2024-12-06 15:17:58 +00:00
Matthijs Mekking 84519c106c 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 15:17:53 +00:00
Matthijs Mekking 69b2f99c00 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 15:17:53 +00:00
Matthijs Mekking a0ce89bc15 Implement global limit for outgoing queries
This global limit is not reset on query restarts and is a hard limit
for any client request.

Note: This commit has been significantly modified because of many
merge conflicts due to the dns_resolver_createfetch api changes.

(cherry picked from commit 16b3bd1cc7)
2024-12-06 15:17:53 +00:00
Matthijs Mekking 3d0559621b Implement getter function for counter limit
(cherry picked from commit ca7d487357)
2024-12-06 15:17:53 +00:00
Matthijs Mekking 5a806910a8 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 15:17:53 +00:00
Michal Nowak 185503def1 [9.18] new: test: Add OpenBSD 7.6
Backport of MR !9609

Merge branch 'backport-mnowak/openbsd-7.6-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9849
2024-12-06 13:34:32 +00:00
Michal Nowak 4dd4d67a54 Add OpenBSD 7.6
(cherry picked from commit 11670b581d)
2024-12-06 10:17:17 +00:00
Michal Nowak b98e081ae2 [9.18] chg: test: Add FreeBSD 13.4
Backport of MR !9640

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

See merge request isc-projects/bind9!9846
2024-12-06 10:13:34 +00:00
Michal Nowak 6e78832360 Add FreeBSD 13.4
(cherry picked from commit 88b4367daa)
2024-12-06 09:32:13 +00:00
Matthijs Mekking 9a0588f7cf [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9835
2024-12-06 09:27:10 +00:00
Matthijs Mekking 90fbe91997 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
4b7c6138 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.

(manually picked from commit aa24b77d8b)
2024-12-06 09:26:40 +00:00
Matthijs Mekking 7068d0698f 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 09:26:40 +00:00
Mark Andrews bf2f4d4aad [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9841
2024-12-06 02:20:57 +00:00
Mark Andrews 59255ca3a1 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 12:25:54 +11:00
Mark Andrews 5de305195b 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:13 +00:00
Michal Nowak 55475d9357 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9825
2024-12-05 10:47:59 +00:00
Michal Nowak 2f093e7c95 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 11:17:55 +01:00
Mark Andrews 1d4e60c9ba [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9821
2024-12-05 05:20:04 +00:00
Mark Andrews 01f5ad3b1d 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 15:45:34 +11:00
Petr Špaček 8b8b39396d chg: doc: Set up version for BIND 9.18.33
Merge branch 'pspacek/set-up-version-for-bind-9.18.33' into 'bind-9.18'

See merge request isc-projects/bind9!9812
2024-12-04 15:10:39 +00:00
Petr Špaček fbab0bc03d Update BIND version to 9.18.33-dev 2024-12-04 16:07:22 +01:00
Petr Špaček ad28cd1f33 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9803
2024-12-02 14:01:48 +00:00
Nicki KřížekandPetr Špaček 949110287d 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:05 +00:00
Evan Hunt 9712d00cb0 [9.18] fix: dev: Use attach()/detach() functions instead of touching .references
In rbtdb.c, there were two 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9796
2024-11-27 22:51:34 +00:00
Ondřej Surý a4e3d25652 Use attach()/detach() functions instead of touching .references
In rbtdb.c, there were two places where the code touched .references
directly instead of using the helper functions.  Use the helper
functions instead.
2024-11-27 21:17:22 +01:00
Arаm Sаrgsyаn 60be885c9b [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!9792
2024-11-27 15:54:08 +00:00
Aram Sargsyan 8607730d82 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:30 +00:00
Mark Andrews 99328b7369 [9.18] 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.

Backport of MR !9509

Merge branch 'backport-helpful-log-on-toomanyrecords-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9772
2024-11-27 03:22:49 +00:00
JINMEI TatuyaandMark Andrews 318fcc4c35 update system tests to confirm new log messages
(cherry picked from commit 000720fe14)
2024-11-27 12:34:11 +11:00
JINMEI TatuyaandMark Andrews 7d1de99656 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.

(cherry picked from commit b0309ee631)
2024-11-27 12:34:11 +11:00
JINMEI TatuyaandMark Andrews a129206f37 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.

(cherry picked from commit 4156995431)
2024-11-27 12:34:11 +11:00
Michal Nowak da90ea77ef [9.18] chg: test: Rewrite emptyzones system test to pytest
Backport of MR !9154

Merge branch 'backport-mnowak/pytest_rewrite_emptyzones-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9783
2024-11-26 18:27:08 +00:00
Michal Nowak 4aba98b186 Rewrite emptyzones system test to pytest
(cherry picked from commit 3ace62472c)
2024-11-26 16:11:44 +00:00
Michal Nowak 2006193711 Add isctest.check.refused()
(cherry picked from commit 7bedd1c296)
2024-11-26 16:11:44 +00:00