Commit Graph

39416 Commits

Author SHA1 Message Date
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říž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 Tatuya
318fcc4c35 update system tests to confirm new log messages
(cherry picked from commit 000720fe14)
2024-11-27 12:34:11 +11:00
JINMEI Tatuya
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 Tatuya
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
Michal Nowak
a0cf81f366 [9.18] chg: test: Rewrite database system test to pytest
Backport of MR !9156

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

See merge request isc-projects/bind9!9780
2024-11-26 16:11:04 +00:00
Michal Nowak
a21c650ad0 Rewrite database system test to pytest
(cherry picked from commit 8005ad0dcd)
2024-11-26 16:10:27 +00:00
Nicki Křížek
972a6722de Add all env vars to jinja2 templates
Ensure that the jinja2 templates have all the environment variables
which are available to the tests present.

This omission during the original 9.18 backport caused an issue where
port numbers (determined by the pytest framework) wouldn't be available
in jinja2 templates.
2024-11-26 16:10:27 +00:00
Ondřej Surý
8bc6a92111 [9.18] 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

Backport of MR !9349

Merge branch 'backport-4865-remove-contributed-DLZ-modules-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9778
2024-11-26 15:44:00 +00:00
Ondřej Surý
4fbdad515c 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.

(cherry picked from commit a6cce753e2)
2024-11-26 16:24:35 +01:00
Arаm Sаrgsyаn
eda40c3685 [9.18] fix: dev: Fix error path bugs in the manager's "recursing-clients" list management
In two places, after linking the client to the manager's
"recursing-clients" list using the check_recursionquota()
function, the query.c module fails to unlink it on error
paths. Fix the bugs by unlinking the client from the list.

Backport of MR !9586

Merge branch 'backport-aram/unlink-recursing-clients-on-error-paths-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9605
2024-11-26 13:45:29 +00:00
Aram Sargsyan
b91b7093f2 Fix error path bugs in the "recursing-clients" list management
In two places, after linking the client to the manager's
"recursing-clients" list using the check_recursionquota()
function, the query.c module fails to unlink it on error
paths. Fix the bugs by unlinking the client from the list.

Also make sure that unlinking happens before detaching the
client's handle, as it is the logically correct order, e.g.
in case if it's the last handle and ns__client_reset_cb()
can be called because of the detachment.

(cherry picked from commit 36c4808903)
2024-11-26 12:40:04 +00:00
Nicki Křížek
2fa9d5b801 [9.18] 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

Backport of MR !9766

Merge branch 'backport-5055-ignore-libs-artifacts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9774
2024-11-26 12:29:39 +00:00
Nicki Křížek
bbd398d846 Ignore test artifacts in .libs
Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.

(cherry picked from commit cf606a9ead)
2024-11-26 10:10:44 +01:00
Mark Andrews
4b0114ffce [9.18] fix: usr: '{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
`dig` fails to parse a valid (as far as I can tell, and accepted by `kdig` and `Wireshark`) `SVCB` record with a `dohpath` URI template containing a `{&dns}`, like `dohpath=/some/path?key=value{&dns}"`. If the URI template contains a `{?dns}` instead `dig` is happy, but my understanding of rfc9461 and section 1.2. "Levels and Expression Types" of rfc6570 is that `{&dns}` is valid.
See for example section 1.2. "Levels and Expression Types" of rfc6570.

Note that Peter van Dijk suggested that `{dns}` and `{dns,someothervar}` might be valid forms as well, so my patch might be too restrictive, although it's anyone's guess how DoH clients would handle complex templates.

Closes https://gitlab.isc.org/isc-projects/bind9/-/issues/4922

Backport of MR !9455

Merge branch 'backport-svcb-dohpath-uri-template-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9770
2024-11-26 05:22:09 +00:00
Mark Andrews
2d55935c6e Parse the URI template and check for a dns variable
The 'dns' variable in dohpath can be in various forms ({?dns},
{dns}, {&dns} etc.).  To check for a valid dohpath it ends up
being simpler to just parse the URI template rather than looking
for all the various forms if substring.

(cherry picked from commit af54ef9f5d)
2024-11-26 03:41:51 +00:00
Remi Gacogne
e12e91b90d '{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
See for example section 1.2. "Levels and Expression Types" of rfc6570.

(cherry picked from commit e74052ea71)
2024-11-26 03:41:51 +00:00
Mark Andrews
f63a0ebdfe [9.18] fix: usr: Provide more visibility into configuration errors
by logging SSL_CTX_use_certificate_chain_file and SSL_CTX_use_PrivateKey_file errors individually.

Closes #5008

Backport of MR !9683

Merge branch 'backport-5008-provide-more-visibility-into-ssl-errors-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9768
2024-11-26 02:33:11 +00:00
Mark Andrews
6fc76a1e87 Provide more visibility into configuration errors
by logging SSL_CTX_use_certificate_chain_file and
SSL_CTX_use_PrivateKey_file errors

(cherry picked from commit 9006839ed7)
2024-11-26 12:24:41 +11:00
Nicki Křížek
327b70855e [9.18] fix: test: Allow re-run of mkeys system test
On some slow systems, the test might intermittently fail due to inherent
timing issues. In our CI, this most often happens in the
system:gcc:8fips:amd64 jobs.

Closes #3098

Backport of MR !9732

Merge branch 'backport-3098-allow-re-run-of-mkeys-test-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9765
2024-11-25 16:23:18 +00:00
Nicki Křížek
2f54aa22c7 Allow re-run of mkeys system test
On some slow systems, the test might intermittently fail due to inherent
timing issues. In our CI, this most often happens in the
system:gcc:8fips:amd64 jobs.

(cherry picked from commit a299650a6f)
2024-11-25 15:39:11 +01:00
Michal Nowak
cfa26b9bd1 [9.18] fix: ci: Fix paths to binaries in cross-version-config-tests job
The cross-version-config-tests job has never functioned in CI because
the testing framework changed after the testing was completed. To run
the new "named" binary using the old configurations, paths in the test
framework must be updated to point to the location of the new binaries.

Closes #4977

Backport of MR !9702

Merge branch 'backport-4977-fix-cross-version-config-tests-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9763
2024-11-25 12:36:24 +00:00
Michal Nowak
299b8408c2 Fix paths to binaries in cross-version-config-tests job
The cross-version-config-tests job has never functioned in CI because
the testing framework changed after the testing was completed. To run
the new "named" binary using the old configurations, paths in the test
framework must be updated to point to the location of the new binaries.

(cherry picked from commit 09d7e2430a)
2024-11-25 13:15:39 +01:00
Mark Andrews
e35636912d [9.18] chg: nil: Re-split format strings lib/ns/update.c
Re-split format strings that had been poorly split by multiple
clang-format runs using different versions of clang-format. 

Closes #5043

Backport of MR !9752

Merge branch 'backport-5043-re-split-format-strings-lib-ns-update-c-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9756
2024-11-21 06:50:10 +00:00
Mark Andrews
2f26d2fde7 Re-split format strings
Re-split format strings that had been poorly split by multiple
clang-format runs using different versions of clang-format.

(cherry picked from commit a24d6e1654)
2024-11-21 04:22:15 +00:00
Ondřej Surý
aa10ae45fd [9.18] chg: dev: Add two new clang-format options that help with code formatting
* Add new clang-format option to remove redundant semicolons
* Add new clang-format option to remove redundant parentheses

Backport of MR !9749

Merge branch 'backport-ondrej/code-style-2024-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9751
2024-11-19 16:09:35 +00:00
Ondřej Surý
cb63c2f2d5 Ignore clang-format reformatting commit
(cherry picked from commit 82f0c31c0d)
2024-11-19 16:07:41 +01:00
Ondřej Surý
b3d8f2796a Remove redundant semicolons after the closing braces of functions
(cherry picked from commit 1a19ce39db)
2024-11-19 16:06:49 +01:00