Commit graph

39666 commits

Author SHA1 Message Date
Michal Nowak
333834e764 [9.18] fix: test: Various coccinelle fixes
Backport of MR !9836

Merge branch 'backport-mnowak/cocci-more-set-if-not-null-changes-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9917
2024-12-13 15:34:11 +00:00
Michal Nowak
6db006af23
Drop superfluous isc_mem_get() NULL check
coccinelle v1.1 trips over a superfluous isc_mem_get() NULL check in
tests/libtest/ns.c and reports the following failure in CI:

    EXN: Failure("rule starting on line 26: already tagged token:\nC code context\nFile \"./tests/libtest/ns.c\", line 350, column 1, charpos = 7939\n  around = 'if',\n  whole content = \tif (qctx != NULL) {") in ./tests/libtest/ns.c

(cherry picked from commit cf76851c75)
2024-12-13 14:54:48 +01:00
Andoni Duarte Pintado
1d3f2cf624 Merge tag 'v9.18.32' into bind-9.18 2024-12-13 10:41:07 +01:00
Mark Andrews
fdbefcd64f [9.18] fix: test: Fix "checking startup notify rate limit" failure
Fix the loop terminating condition to get consistent sample sizes and increase the minimum number of samples from 20 to 40.

Closes #5091

Backport of MR !9894

Merge branch 'backport-5091-investigate-checking-startup-notify-rate-limit-failure-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9910
2024-12-13 01:40:04 +00:00
Mark Andrews
9fa4bd1c1b Fix startup notify rate test
The terminating conditions for the startup notify test would
occasionally get ~20 records or get +10 seconds of records due to
a bad terminating condition.  Additionally 20 samples lead to test
failures.  Fix the terminating condition to use the correct conditional
(-eq -> -ge) and increase the minimum number of log entries to
average over to 22.

(cherry picked from commit 46388d07a2)
2024-12-13 12:06:33 +11:00
Mark Andrews
7333218a2c [9.18] fix: test: tests/irs/resconf_test.c is missing check callbacks
Closes #5088

Backport of MR !9884

Merge branch 'backport-5088-tests-irs-resconf_test-c-is-missing-check-callbacks-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9908
2024-12-12 23:58:26 +00:00
Mark Andrews
40c616f303 Check that nameservers are parsed correctly
Add checks that the expected nameservers where actuall addes when
parsing resolv.conf.

(cherry picked from commit c38eb87158)
2024-12-13 10:27:22 +11:00
Nicki Křížek
95a159561f [9.18] chg: doc: Update CONTRIBUTING.md and developer docs
Include the recent changes such as:
- changes to running system tests
- gitlab development workflow
- changelog and release note process

Closes #5045

Backport of MR !9784

Merge branch 'backport-5045-update-contributing-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9903
2024-12-12 17:13:39 +00:00
Nicki Křížek
5db64b5898 Update CONTRIBUTING.md and developer doc
Include the recent changes such as:
- changes to running system tests
- gitlab development workflow
- changelog and release note process

(cherry picked from commit 39485c1f70)
2024-12-12 17:40:50 +01:00
Michal Nowak
41302f8535 [9.18] fix: test: Wait for "all zones loaded" after rndc reload in "database" test
After the rndc reload command finished, we might have queried the
database zone sooner than it was reloaded because rndc reloads zones
asynchronously if no specific zone was provided. We should wait for "all
zones loaded" in the ns1 log to be sure.

Closes #5075

Backport of MR !9829

Merge branch 'backport-5075-database-rndc-reload-ensure-all-zones-loaded-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9901
2024-12-12 12:51:46 +00:00
Michal Nowak
5825e79375 Wait for "all zones loaded" after rndc reload in "database" test
After the rndc reload command finished, we might have queried the
database zone sooner than it was reloaded because rndc reloads zones
asynchronously if no specific zone was provided. We should wait for "all
zones loaded" in the ns1 log to be sure.

(cherry picked from commit 0bdd03db66)
2024-12-12 12:09:35 +00:00
Evan Hunt
3f95283d76 [9.18] fix: nil: update style guideline to reflect current practice
The style guide now mentions clang-format, doesn't parenthesize return values, and no longer calls for backward compatibility in public function names.

Backport of MR !9892

Merge branch 'backport-each-style-update-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9897
2024-12-11 15:53:26 +00:00
Evan Hunt
bd904e8808 update style guideline to reflect current practice
It now mentions clang-format, doesn't parenthesize return values,
and no longer calls for backward compatibility in public function names.

(cherry picked from commit 9f7314eaa4)
2024-12-11 03:40:02 +00:00
Michal Nowak
e28a85fc03 [9.18] fix: test: Add rr-related common test artifacts
Backport of MR !9830

Merge branch 'backport-mnowak/add-rr-related-common-artifacts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9890
2024-12-10 18:22:55 +00:00
Michal Nowak
ab5309164b
Add rr-related common test artifacts
(cherry picked from commit c607237b77)
2024-12-10 18:51:21 +01:00
Michal Nowak
ef5abda0db [9.18] fix: ci: Set cross-version-config-tests to allow_failure in CI
Address failing cross-version-config-tests job.

Closes #5087

Backport of MR !9833

Merge branch 'backport-mnowak/cross-version-config-tests-allow-fail-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9887
2024-12-10 10:22:16 +00:00
Michal Nowak
86db625ffd
Set cross-version-config-tests to allow_failure in CI
The December releases suffer from the ns2/managed1.conf file not being
in the mkeys extra_artifacts. This manifests only when pytest is run
with the --setup-only option, which is the case in the
cross-version-config-tests CI job. The original issue is fixed in !9815,
but the fix will be effective only when subsequent releases are out.

(cherry picked from commit 97a9d7287c)
2024-12-10 11:09:58 +01:00
Mark Andrews
3e70fbf69d [9.18] chg: test: Use a different burst name to identify test queries
This allows easier identification of which burst is which in
named.run.

Backport of MR !9881

Merge branch 'backport-marka-use-different-burst-name-for-forensics-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9883
2024-12-10 06:43:23 +00:00
Mark Andrews
2bef516b1c Use a different burst name to identify test queries
This allows easier identification of which burst is which in
named.run.

(cherry picked from commit e02d66b279)
2024-12-10 05:56:28 +00:00
Mark Andrews
2c5db4b038 [9.18] fix: test: Fix static stub subtest description
This subtest exercises static stub behaviour when server-addresses has an address.  This was misidentified in the description.

Closes !9799

Backport of MR !9799

Merge branch 'backport-marka-fix-stub-subtest-description-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9880
2024-12-10 04:36:32 +00:00
Mark Andrews
e7a16f2e6e Fix static stub subtest description
(cherry picked from commit f173a01454)
2024-12-10 03:37:26 +00:00
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