Commit graph

39649 commits

Author SHA1 Message Date
Artem Boldariev
d0907a3a1f TLS DNS: Simplify tls_cycle_input()
This commit simplifies code flow in the tls_cycle_input() and makes
the incoming data processing similar to that in TCP DNS. In
particular, now we decipher all the the incoming data before making a
single isc__nm_process_sock_buffer() call. Previously we would try to
decipher data bit-by-bit before trying to process the deciphered bit
via isc__nm_process_sock_buffer(). Doing like before made the code
much less predictable, in particular in the areas like when reading is
paused or resumed.

The newer approach also allowed us to get rid of some old kludges.
2025-03-24 09:49:38 +02:00
Andoni Duarte Pintado
21260b835f Merge tag 'v9.18.35' into bind-9.18 2025-03-19 17:32:17 +01:00
Nicki Křížek
29b5b1ffde [9.18] chg: ci: Allow re-run of the shotgun jobs to reduce false positives
The false positive rate is about 10-20 % when evaluating shotgun results
from a single run. Attempt to reduce the false positive rate by allowing
a re-run of failed jobs.

Backport of MR !10271

Merge branch 'backport-nicki/ci-shotgun-reduce-false-positives-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10280
2025-03-18 13:20:06 +00:00
Nicki Křížek
cb81260e4a Allow re-run of the shotgun jobs to reduce false positive
The false positive rate is about 10-20 % when evaluating shotgun results
from a single run. Attempt to reduce the false positive rate by allowing
a re-run of failed jobs.

While there is a slight risk that barely noticable decreases in
performance might slip by more easily in MRs, they'd still likely pop up
during nightly or pre-release testing.

Also increase the tolerance threshold for DoH latency comparisons, as
those tests often experience increased jitter in the tail end latencies.

(cherry picked from commit 5eab352478)
2025-03-18 13:25:34 +01:00
Nicki Křížek
61443486bb Adjust the load factor for shotgun:dot test
With the slightly increased load for the DoT test, the results appear to
be a little bit more stable.
2025-03-18 13:25:03 +01:00
Michal Nowak
0781912a22 [9.18] chg: ci: Disable linkcheck on dl.acm.org
The check fails with the following error for some time:

    403 Client Error: Forbidden for url: https://dl.acm.org/doi/10.1145/1315245.1315298

Backport of MR !10272

Merge branch 'backport-mnowak/linkcheck-disable-dl-acm-org-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10274
2025-03-17 17:26:19 +00:00
Michal Nowak
a5514de0fe Disable linkcheck on dl.acm.org
The check fails with the following error for some time:

    403 Client Error: Forbidden for url: https://dl.acm.org/doi/10.1145/1315245.1315298

(cherry picked from commit 1ab889ee21)
2025-03-17 17:08:27 +00:00
Arаm Sаrgsyаn
efbd698a2d [9.18] new: dev: Implement -T cookiealwaysvalid
When `-T cookiealwaysvalid` is passed to `named`, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

Backport of MR !10232

Merge branch 'backport-aram/new-named-minus-T-option-of-cookiealwaysvalid-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10265
2025-03-17 13:32:04 +00:00
Aram Sargsyan
517386866d Test -T cookiealwaysvalid
Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

(cherry picked from commit 4e75a20b6a)
2025-03-17 12:01:55 +00:00
Aram Sargsyan
ac15d3dede Implement -T cookiealwaysvalid
When -T cookiealwaysvalid is passed to named, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

(cherry picked from commit 807ef8545d)
2025-03-17 12:01:42 +00:00
Mark Andrews
ae573fd9dc [9.18] fix: dev: Add missing locks when returning addresses
Add missing locks in dns_zone_getxfrsource4 et al.  Addresses CID 468706, 468708, 468741, 468742, 468785, and 468778.

Cleanup dns_zone_setxfrsource4 et al to now return void.

Remove double copies with dns_zone_getprimaryaddr and dns_zone_getsourceaddr.

Closes #4933

Backport of MR !9485

Merge branch 'backport-4933-add-missing-locks-when-returning-addresses-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10260
2025-03-16 08:04:33 +00:00
Mark Andrews
89e76eec70 Add missing locks when returning addresses
Add missing locks in dns_zone_getxfrsource4 et al. Addresses CID
468706, 468708, 468741, 468742, 468785 and 468778.

Cleanup dns_zone_setxfrsource4 et al to now return void.

Remove double copies with dns_zone_getprimaryaddr and dns_zone_getsourceaddr.

(cherry picked from commit d0a59277fb)
2025-03-16 15:26:12 +11:00
Mark Andrews
bf3b14b964 [9.18] fix: test: Tune many types tests in reclimit test
The `I:checking that lifting the limit will allow everything to get
cached (20)` test was failing due to the TTL of the records being
too short for the elapsed time of the test.  Raise the TTL to fix
this and adjust other tests as needed.

Closes #5206

Backport of MR !10177

Merge branch 'backport-5206-tune-last-sub-test-of-reclimit-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10250
2025-03-15 00:33:04 +00:00
Mark Andrews
dcd816fbfb Tune many types tests in reclimit test
The 'I:checking that lifting the limit will allow everything to get
cached (20)' test was failing due to the TTL of the records being
too short for the elapsed time of the test.  Raise the TTL to fix
this and adjust other tests as needed.

(cherry picked from commit 1a58bd2113)
2025-03-14 05:29:35 +00:00
Andoni Duarte
2b1b28615d chg: doc: Set up version for BIND 9.18.36
Merge branch 'andoni/set-up-version-for-bind-9.18.36' into 'bind-9.18'

See merge request isc-projects/bind9!10235
2025-03-12 13:07:06 +00:00
Andoni Duarte Pintado
cb3b5a5881 Update BIND version to 9.18.36-dev 2025-03-12 12:07:23 +01:00
Andoni Duarte Pintado
f506f80a7e Update BIND version for release 2025-03-11 11:38:57 +01:00
Andoni Duarte
c3c9c83957 new: doc: Prepare documentation for BIND 9.18.35
Merge branch 'andoni/prepare-documentation-for-bind-9.18.35' into 'v9.18.35-release'

See merge request isc-private/bind9!786
2025-03-11 10:13:01 +00:00
Andoni Duarte Pintado
ee61da934a Tweak and reword relase notes 2025-03-11 10:39:11 +01:00
Andoni Duarte Pintado
c6869f1e4d Prepare release notes for BIND 9.18.35 2025-03-07 20:38:43 +01:00
Andoni Duarte Pintado
84d9529560 Generate changelog for BIND 9.18.35 2025-03-07 20:38:25 +01:00
Michal Nowak
ffbeaaa485 [9.18] chg: ci: Move FreeBSD jobs to AWS autoscalers
Backport of MR !10214

Merge branch 'backport-mnowak/freebsd-aws-autoscaling-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10221
2025-03-05 11:25:37 +00:00
Michal Nowak
c1d236233a Move FreeBSD jobs to AWS autoscalers
From technical reasons --with-readline=libedit is not being tested on
FreeBSD anymore as it's hard to have anchors both unified and specific.

(cherry picked from commit e0df774ca0)
2025-03-05 11:19:20 +00:00
Mark Andrews
7f4023fe7d [9.18] new: dev: Add digest methods for SIG and RRSIG
ZONEMD digests RRSIG records and potentially digests SIG record. Add digests
methods for both record types.

Closes #5219

Backport of MR !10217

Merge branch 'backport-5219-add-digest-methods-for-sig-and-rrsig-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10219
2025-03-05 11:08:41 +00:00
Mark Andrews
54c89f75f3 Implement digest_sig and digest_rrsig for ZONEMD
ZONEMD needs to be able to digest SIG and RRSIG records.  The signer
field can be compressed in SIG so we need to call dns_name_digest().
While for RRSIG the records the signer field is not compressed the
canonical form has the signer field downcased (RFC 4034, 6.2).  This
also implies that compare_rrsig needs to downcase the signer field
during comparison.

(cherry picked from commit 006c5990ce)
2025-03-05 10:34:52 +00:00
Ondřej Surý
22fd7c4eb4 [9.18] fix: dev: Sync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job
Backport of MR !10209

Merge branch 'backport-ondrej/sync-tsan-options-in-gitlab-ci-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10213
2025-03-05 09:59:20 +00:00
Ondřej Surý
ea4704590b
Sync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job
(cherry picked from commit 23394afa9e)
2025-03-05 10:59:07 +01:00
Evan Hunt
42afefe031 [9.18] fix: dev: When recording an rr trace, use libtool
When a system test is run with the `USE_RR` environment variable set to 1, an `rr` trace is now correctly generated for each instance of `named`.

Closes #5079

Backport of MR !10197

Merge branch 'backport-5079-fix-rr-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10208
2025-03-05 08:34:36 +00:00
Evan Hunt
76b6b3ffbf when recording an rr trace, use libtool
when running a system test with the USE_RR environment
variable set to 1, an rr trace is generated for named.
because rr wasn't run using libtool --mode=execute, the
trace would actually be generated for the wrapper script
generated by libtool, not for the actual named binary.

(cherry picked from commit 00d7c7c346)
2025-03-05 08:34:25 +00:00
Arаm Sаrgsyаn
86f02349e5 [9.18] fix: dev: Fix memory ordering issues with atomic operations in the quota.c module
Change all the non-locked operations on `quota->used` and
`quota->waiting` to "acq/rel" for inter-thread synchronization. Some
loads are left as "relaxed", because they are under a locked mutex
which also provides protection.

Also use relaxed memory ordering for `quota->max` and `quota->soft`,
as done in the main branch; possible ordering issues for these
variables are acceptable.

Closes #5018

Merge branch '5018-quota-memory-ordering-fixes-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10203
2025-03-04 10:49:30 +00:00
Aram Sargsyan
df373d7d99 Fix memory ordering for operations with quota->used and quota->waiting
Change all the non-locked operations on 'quota->used' and
'quota->waiting' to "acq/rel" for inter-thread synchronization. Some
loads are left as "relaxed", because they are under a locked mutex
which also provides protection.
2025-03-04 09:57:34 +00:00
Aram Sargsyan
80d7d11f37 Use relaxed memory ordering for quota->max and quota->soft
These variables are not critical for memory ordering issues
and we can use the relaxed memory ordering, as done in the
main branch.
2025-03-04 09:57:34 +00:00
Artem Boldariev
e811f444b7 [9.18] fix: dev: Post [CVE-2024-12705] Performance Drop Fixes, Part 2
Backport of !10192.

Merge branch 'artem-doh-performance-drop-post-fix-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10193
2025-03-03 10:43:50 +00:00
Artem Boldariev
94bcd8c253 DoH: Bump the active streams processing limit
This commit bumps the total number of active streams (= the opened
streams for which a request is received, but response is not ready) to
60% of the total streams limit.

The previous limit turned out to be too tight as revealed by
longer (≥1h) runs of "stress:long:rpz:doh+udp:linux:*" tests.

(cherry picked from commit eaad0aefe6)
2025-03-03 12:08:15 +02:00
Artem Boldariev
aa6fd85b0b DoH: remove obsolete INSIST() check
The check, while not active by default, is not valid since the commit
8b8f4d500d.

See 'if (total == 0) { ...' below branch to understand why.

(cherry picked from commit 217a1ebd79)
2025-03-03 12:07:48 +02:00
Artem Boldariev
d9928ccb62 DoH: Flush HTTP write buffer on an outgoing DNS message
Previously, the code would try to avoid sending any data regardless of
what it is unless:

a) The flush limit is reached;
b) There are no sends in flight.

This strategy is used to avoid too numerous send requests with little
amount of data. However, it has been proven to be too aggressive and,
in fact, harms performance in some cases (e.g., on longer (≥1h) runs
of "stress:long:rpz:doh+udp:linux:*").

Now, additionally to the listed cases, we also:

c) Flush the buffer and perform a send operation when there is an
outgoing DNS message passed to the code (which is indicated by the
presence of a send callback).

That helps improve performance for "stress:long:rpz:doh+udp:linux:*"
tests.

(cherry picked from commit c5f7968856)
2025-03-03 12:07:15 +02:00
Artem Boldariev
b4e8089694 DoH: Limit the number of delayed IO processing requests
Previously, a function for continuing IO processing on the next UV
tick was introduced (http_do_bio_async()). The intention behind this
function was to ensure that http_do_bio() is eventually called at
least once in the future. However, the current implementation allows
queueing multiple such delayed requests needlessly. There is currently
no need for these excessive requests as http_do_bio() can requeue them
if needed. At the same time, each such request can lead to a memory
allocation, particularly in BIND 9.18.

This commit ensures that the number of enqueued delayed IO processing
requests never exceeds one in order to avoid potentially bombarding IO
threads with the delayed requests needlessly.

(cherry picked from commit 0e1b02868a)
2025-03-03 12:06:44 +02:00
Artem Boldariev
e525029b89 DoH: Simplify http_do_bio()
This commit significantly simplifies the code flow in the
http_do_bio() function, which is responsible for processing incoming
and outgoing HTTP/2 data. It seems that the way it was structured
before was indirectly caused by the presence of the missing callback
calls bug, fixed in 8b8f4d500d.

The change introduced by this commit is known to remove a bottleneck
and allows reproducible and measurable performance improvement for
long runs (>= 1h) of "stress:long:rpz:doh+udp:linux:*" tests.

Additionally, it fixes a similar issue with potentially missing send
callback calls processing and hardens the code against use-after-free
errors related to the session object (they can potentially occur).

(cherry picked from commit 0956fb9b9e)
2025-03-03 12:06:05 +02:00
Michal Nowak
587e4a2984 [9.18] new: ci: Check dangling symlinks in the repository
Backport of MR !10120

Merge branch 'backport-mnowak/check-dangling-symlinks-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10190
2025-02-28 11:12:40 +00:00
Michal Nowak
32e0847604 Link ChangeLog to doc/arm/changelog.rst
Currently, the ChangeLog file is a dangling symlink pointing to the
removed CHANGES file. Fix the link by pointing to doc/arm/changelog.rst.

(cherry picked from commit de0598cbc3)
2025-02-28 11:07:57 +00:00
Michal Nowak
0fd362ba91 Check dangling symlinks in the repository
(cherry picked from commit f3087f1299)
2025-02-28 11:07:57 +00:00
Michal Nowak
637dfa01ea [9.18] fix: ci: No need to delete the "only" keyword in generate-tsan-stress-jobs.py
29fd756408 replaced "only" with "rules" in
.gitlab-ci.yml but forgot to drop the removal from here, hence the
script was broken.

(cherry picked from commit 6e2272d769)

Backport of MR !10185

Merge branch 'mnowak/do-not-delete-only-keyword-in-generate-tsan-stress-jobs' into 'bind-9.18'

See merge request isc-projects/bind9!10188
2025-02-28 10:50:43 +00:00
Michal Nowak
1a93617b08
No need to delete the "only" keyword in generate-tsan-stress-jobs.py
29fd756408 replaced "only" with "rules" in
.gitlab-ci.yml but forgot to drop the removal from here, hence the
script was broken.

(cherry picked from commit 6e2272d769)
2025-02-28 11:20:43 +01:00
Nicki Křížek
492637c294 [9.18] new: ci: Run shotgun tests on MRs
Execute DNS Shotgun performance tests on the regular MRs and compare the changes they introduce against the MR diff base. The results are evaluated automatically - the shotgun jobs will fail if thresholds for CPU/memory/latency difference is exceeded.

Backport of MR !10127

Merge branch 'backport-nicki/ci-shotgun-eval-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10184
2025-02-27 14:30:05 +00:00
Nicki Křížek
2a207bc0b2 Replace deprecated only/except with rules in .gitlab-ci.yml
The keyword rules allows more flexible and complex conditions when
deciding whether to create the job and also makes it possible run tweak
variables or job properties depending on arbitraty rules. Since it's
not possible to combine only/except and rules together, replace all
uses of only/except to avoid any potential future issues.

(cherry picked from commit 29fd756408)
2025-02-27 14:55:30 +01:00
Nicki Křížek
f6349371f7 Run shotgun tests on MRs
If the shotgun tests are executed for MRs, compare it against the MR's
base rather than the previous release. Only fail the job in case the
performance drops (pass on performance improvements).

Note that start_in optimization was removed, since it isn't properly
supported with rules as of February 2025
(https://gitlab.com/gitlab-org/gitlab/-/issues/424203). Without this
optimization, container test images are likely to be re-built
unnecessarily when testing different protocols. A workaround for the
.gitlab-ci.yml exists, but the extra complexity doesn't seem justified.
The container image builds might change or be optimized in the future,
so let's just go with the build duplication for now.

(cherry picked from commit 4214c1e8a7)
2025-02-27 14:54:29 +01:00
Evan Hunt
8d0d08ec00 [9.18] fix: dev: Prevent a reference leak when using plugins
The `NS_QUERY_DONE_BEGIN` and `NS_QUERY_DONE_SEND` plugin hooks could cause a reference leak if they returned `NS_HOOK_RETURN` without cleaning up the query context properly.

Closes #2094

Backport of MR !9971

Merge branch 'backport-2094-plugin-reference-leak-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10171
2025-02-26 00:59:10 +00:00
Evan Hunt
6b22c9a989 wrap ns_client_error() for unit testing
When testing, the client object doesn't have a proper
netmgr handle, so ns_client_error() needs to be a no-op.

(cherry picked from commit ae37ef45ff)
2025-02-25 16:23:14 -08:00
Evan Hunt
90989bfdfb prevent a reference leak from the ns_query_done hooks
if the NS_QUERY_DONE_BEGIN or NS_QUERY_DONE_SEND hook is
used in a plugin and returns NS_HOOK_RETURN, some of the
cleanup in ns_query_done() can be skipped over, leading
to reference leaks that can cause named to hang on shut
down.

this has been addressed by adding more housekeeping
code after the cleanup: tag in ns_query_done().

(cherry picked from commit c2e4358267)
2025-02-25 22:41:27 +00:00
Evan Hunt
ab047ff47f [9.18] fix: dev: Fix a logic error in cache_name()
A change in 6aba56ae8 (checking whether a rejected RRset was identical
to the data it would have replaced, so that we could still cache a
signature) inadvertently introduced cases where processing of a
response would continue when previously it would have been skipped.

Closes #5197

Backport of MR !10157

Merge branch 'backport-5197-cache_name-logic-error-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10159
2025-02-25 00:23:37 +00:00