Commit graph

39664 commits

Author SHA1 Message Date
Aram Sargsyan
006130a35c Test resolver statistics when responses time out
Add a test to check that the timed out responses do not skew the
normal responses statistics counters, and that they do update the
timeouts counter.

(cherry picked from commit 0c7fa8d572)
2025-03-31 19:06:42 +00:00
Aram Sargsyan
df0fe93fa5 Fix the resolvers RTT-ranged responses statistics counters
When a response times out the fctx_cancelquery() function
incorrectly calculates it in the 'dns_resstatscounter_queryrtt5'
counter (i.e. >=1600 ms). To avoid this, the rctx_timedout()
function should make sure that 'rctx->finish' is NULL. And in order
to adjust the RTT values for the timed out server, 'rctx->no_response'
should be true. Update the rctx_timedout() function to make those
changes.

(cherry picked from commit 830e548111)
2025-03-31 18:35:45 +00:00
Aram Sargsyan
9a3ba4856a Fix resolver responses statistics counter
The resquery_response() function increases the response counter without
checking if the response was successful. Increase the counter only when
the result indicates success.

(cherry picked from commit 12e7dfa397)
2025-03-31 18:35:45 +00:00
Nicki Křížek
fb2c709c35 [9.18] chg: doc: Remove -S changelog templates from open-source edition
These changelogs meant for -S edition were introduced to avoid rebase
conflicts. However, the same result can be achieved by linking the -S
changelogs directly from their open-source variants, rather than
including the -S changelogs directly in changelog.rst.

Mattermost discussion: https://mattermost.isc.org/isc/pl/1gioy1gatifttborqx5qhc9paw

Merge branch 'nicki/remove-s-specific-changelog-files-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10337
2025-03-28 12:22:51 +00:00
Nicki Křížek
66dfacc258 Remove -S changelog templates from open-source edition
These changelogs meant for -S edition were introduced to avoid rebase
conflicts. However, the same result can be achieved by linking the -S
changelogs directly from their open-source variants, rather than
including the -S changelogs directly in changelog.rst.
2025-03-27 13:53:56 +01:00
Ondřej Surý
f24bacb190 [9.18] fix: dev: Validating ADB fetches could cause a crash in import_rdataset()
Previously, in some cases, the resolver could return rdatasets of type CNAME or DNAME without the result code being set to `DNS_R_CNAME` or `DNS_R_DNAME`. This could trigger an assertion failure in the ADB. The resolver error has been fixed.

Closes #5201

Backport of MR !10172

Backport of MR !10178

Merge branch 'backport-5201-adb-cname-error-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10330
2025-03-26 12:09:19 +00:00
Evan Hunt
04d18f31ce
fix the fetchresponse result for CNAME/DNAME
the fix in commit 1edbbc32b4 was incomplete; the wrong
event result could also be set in cache_name() and validated().

(cherry picked from commit 9ebeb60174)
2025-03-26 12:04:07 +01:00
Evan Hunt
46e793a3b4
set eresult based on the type in ncache_adderesult()
when the caching of a negative record failed because of the
presence of a positive one, ncache_adderesult() could override
this to ISC_R_SUCCESS. this could cause CNAME and DNAME responses
to be handled incorrectly.  ncache_adderesult() now sets the result
code correctly in such cases.

(cherry picked from commit 1edbbc32b4)
2025-03-26 12:01:59 +01:00
Michal Nowak
4c8e1b8256 [9.18] fix: test: Limit X-Bloat header size to 100KB
Otherwise curl 8.13 rejects the line with:

    I:Check HTTP/1.1 keep-alive with truncated stream (21)
    curl: option --header: error encountered when reading a file
    curl: try 'curl --help' or 'curl --manual' for more information

Also, see https://github.com/curl/curl/pull/16572.

Closes #5249

Backport of MR !10319

Merge branch 'backport-5249-statschannel-limit-http-header-size-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10322
2025-03-25 16:51:00 +00:00
Michal Nowak
43552a0ab6 Limit X-Bloat header size to 100KB
Otherwise curl 8.13 rejects the line with:

    I:Check HTTP/1.1 keep-alive with truncated stream (21)
    curl: option --header: error encountered when reading a file
    curl: try 'curl --help' or 'curl --manual' for more information

Also, see https://github.com/curl/curl/pull/16572.

(cherry picked from commit bcb931f4a8)
2025-03-25 15:53:29 +00:00
Evan Hunt
ddbea0b94b [9.18] fix: usr: Don't enforce NOAUTH/NOCONF flags in DNSKEYs
All DNSKEY keys are able to authenticate. The `DNS_KEYTYPE_NOAUTH` (and `DNS_KEYTYPE_NOCONF`) flags were defined for the KEY rdata type, and are not applicable to DNSKEY. Previously, however, because the DNSKEY implementation was built on top of KEY, the `_NOAUTH` flag prevented authentication in DNSKEYs as well. This has been corrected.

Closes #5240

Backport of MR !10261

Merge branch 'backport-5240-ignore-noauth-flag-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10316
2025-03-25 07:34:26 +00:00
Mark Andrews
f095d22adf DNS_KEYTYPE_NOKEY is only applicable to KEY
(cherry picked from commit 53c6721abc)
2025-03-25 00:04:36 -07:00
Evan Hunt
4b81333567 Don't check DNS_KEYFLAG_NOAUTH
All DNSKEY keys are able to authenticate. The DNS_KEYTYPE_NOAUTH
(and DNS_KEYTYPE_NOCONF) flags were defined for the KEY rdata type,
and are not applicable to DNSKEY.

Previously, because the DNSKEY implementation was built on top of
KEY, the NOAUTH flag prevented authentication in DNSKEYs as well.
This has been corrected.

(cherry picked from commit 5c21576f82)
2025-03-25 00:04:34 -07:00
Evan Hunt
07b599748f Tidy up keyvalue.h definitions
Use enums for DNS_KEYFLAG_, DNS_KEYTYPE_, DNS_KEYOWNER_, DNS_KEYALG_,
and DNS_KEYPROTO_ values.

Remove values that are never used.

Eliminate the obsolete DNS_KEYFLAG_SIGNATORYMASK. Instead, add three
more RESERVED bits for the key flag values that it covered but which
were never used.

(cherry picked from commit fee1ba40df)
2025-03-25 00:04:31 -07:00
Artem Boldariev
d4cc98a175 chg: usr: Fix network manager issue when both success and timeout callbacks can be called for the same read request
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.

Closes #5247

Merge branch '5247-unexpected-callbacks' into 'bind-9.18'

See merge request isc-projects/bind9!10294
2025-03-24 09:34:21 +00:00
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