Commit Graph
39589 Commits
Author SHA1 Message Date
Artem Boldariev 66bdddc51a DoH: http_send_outgoing() return value is not used
The value returned by http_send_outgoing() is not used anywhere, so we
make it not return anything (void). Probably it is an omission from
older times.

(cherry picked from commit 2adabe835a)
2025-02-19 19:42:15 +02:00
Artem Boldariev 0b9e8e6063 DoH: Fix missing send callback calls
When handling outgoing data, there were a couple of rarely executed
code paths that would not take into account that the callback MUST be
called.

It could lead to potential memory leaks and consequent shutdown hangs.

(cherry picked from commit 8b8f4d500d)
2025-02-19 19:42:15 +02:00
Artem Boldariev f9aa7a298d DoH: change how the active streams number is calculated
This commit changes the way how the number of active HTTP streams is
calculated and allows it to scale with the values of the maximum
amount of streams per connection, instead of effectively capping at
STREAM_CLIENTS_PER_CONN.

The original limit, which is intended to define the pipelining limit
for TCP/DoT. However, it appeared to be too restrictive for DoH, as it
works quite differently and implements pipelining at protocol level by
the means of multiplexing multiple streams. That renders each stream
to be effectively a separate connection from the point of view of the
rest of the codebase.

(cherry picked from commit a22bc2d7d4)
2025-02-19 19:42:15 +02:00
Artem Boldariev 3c49824589 DoH: Track the amount of in flight outgoing data
Previously we would limit the amount of incoming data to process based
solely on the presence of not completed send requests. That worked,
however, it was found to severely degrade performance in certain
cases, as was revealed during extended testing.

Now we switch to keeping track of how much data is in flight (or ready
to be in flight) and limit the amount of processed incoming data when
the amount of in flight data surpasses the given threshold, similarly
to like we do in other transports.

(cherry picked from commit 05e8a50818)
2025-02-19 19:42:15 +02:00
Andoni Duarte Pintado b732b1578c Merge tag 'v9.18.34' into bind-9.18 2025-02-19 17:42:38 +01:00
Mark Andrews 60a26ecd43 [9.18] fix: usr: Fix deferred validation of unsigned DS and DNSKEY records
When processing a query with the "checking disabled" bit set (CD=1), `named` stores the unvalidated result in the cache, marked "pending". When the same query is sent with CD=0, the cached data is validated, and either accepted as an answer, or ejected from the cache as invalid. This deferred validation was not attempted for DS and DNSKEY records if they had no cached signatures, causing spurious validation failures. We now complete the deferred validation in this scenario.

Also, if deferred validation fails, we now re-query the data to find out whether the zone has been corrected since the invalid data was cached.

Closes #5066

Backport of MR !10104

Merge branch 'backport-5066-fix-strip-dnssec-rrsigs-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10106
2025-02-19 01:57:40 +00:00
Mark AndrewsandEvan Hunt 86e65f317a Re-fetch pending records that failed validation
If a deferred validation on data that was originally queried with
CD=1 fails, we now repeat the query, since the zone data may have
changed in the meantime.

(cherry picked from commit 04b1484ed8)
2025-02-18 23:59:10 +00:00
Mark AndrewsandEvan Hunt 48b32e64c4 Complete the deferred validation if there are no RRSIGs
When a query is made with CD=1, we store the result in the
cache marked pending so that it can be validated later, at
which time it will either be accepted as an answer or removed
from the cache as invalid.  Deferred validation was not
attempted when there were no cached RRSIGs for DNSKEY and
DS.  We now complete the deferred validation in this scenario.

(cherry picked from commit 8b900d1808)
2025-02-18 23:59:10 +00:00
Mark AndrewsandEvan Hunt 39bfa739fb Add stripped DS RRSIG senario
(cherry picked from commit 66f293a952)
2025-02-18 23:59:10 +00:00
Mark AndrewsandEvan Hunt 1b814f1ee9 Add stripped DNSKEY RRSIG senario
(cherry picked from commit a71b617566)
2025-02-18 23:59:10 +00:00
Michal Nowak c4295d8509 [9.18] chg: test: Rewrite keyfromlabel system test to pytest
Backport of MR !9188

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

See merge request isc-projects/bind9!10113
2025-02-18 09:47:50 +00:00
Michal Nowak cab3f3bc07 Rewrite keyfromlabel system test to pytest
(cherry picked from commit 409f394d6e)
2025-02-18 10:15:49 +01:00
Matthijs Mekking b1ee33a63a [9.18] fix: doc: Fix typo in ARM related to max-stale-ttl
The text that stale-cache-enable is set to no has no effect on
max-cache-ttl, but on max-stale-ttl.

Closes #5181

Backport of MR !10108

Merge branch 'backport-5181-max-stale-ttl-typo-arm-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10116
2025-02-18 08:24:01 +00:00
Matthijs Mekking 9303684917 Fix typo in ARM related to max-stale-ttl
The text that stale-cache-enable is set to no has no effect on
max-cache-ttl, but on max-stale-ttl.

(cherry picked from commit b017d9fe67)
2025-02-18 08:50:04 +01:00
Michal Nowak 9cf4ba0126 [9.18] chg: test: Rewrite keepalive system test to pytest
Backport of MR !9202

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

See merge request isc-projects/bind9!10111
2025-02-17 20:01:04 +00:00
Michal Nowak 4688e32065 Rewrite keepalive system test to pytest
(cherry picked from commit b804a70fac)
2025-02-17 20:29:01 +01:00
Michal Nowak 8cb3eb5d9d Add Dig interface
(cherry picked from commit 7347abd01f)
2025-02-17 20:27:53 +01:00
Arаm Sаrgsyаn a946528023 [9.18] fix: dev: Fix a race issue in dns_view_addzone()
Views use two types of reference counting - regular and weak, and
when there are no more regular references, the `view_flushanddetach()`
function destroys or detaches some parts of the view, including
`view->zonetable`, while other parts are freed by `destroy()` when
the last weak reference is detached. Since catalog zones use weak
references to attach a view, it's currently possible that during
shutdown catalog zone processing will try to add a new zone into
an otherwise unused view (because it's shutting down) which doesn't
have an attached zonetable any more. This could cause an assertion
failure. Fix this issue by modifying the `dns_view_addzone()` function
to expect that `view->zonetable` can be `NULL`, and in that case just
return `ISC_R_SHUTTINGDOWN`.

Closes #5138

Merge branch '5138-fix-dns_view_addzone-race-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10086
2025-02-17 17:23:38 +00:00
Aram Sargsyan fc24cfd71d Fix a race issue in dns_view_addzone()
Views use two types of reference counting - regular and weak, and
when there are no more regular references, the view_flushanddetach()
function destroys or detaches some parts of the view, including
'view->zonetable', while other parts are freed by destroy() when
the last weak reference is detached. Since catalog zones use weak
references to attach a view, it's currently possible that during
shutdown catalog zone processing will try to add a new zone into
an otherwise unused view (because it's shutting down) which doesn't
have an attached zonetable any more. This could cause an assertion
failure. Fix this issue by modifying the dns_view_addzone() function
to expect that 'view->zonetable' can be NULL, and in that case just
return ISC_R_SHUTTINGDOWN.
2025-02-17 17:21:38 +00:00
Petr Špaček 853a966fe7 fix: dev: Finalize removal of memory debug flags size and mctx [9.18]
Backport of !9606

Merge branch 'bind-9.18-memory-flags-size-mctx' into 'bind-9.18'

See merge request isc-projects/bind9!9607
2025-02-17 16:49:43 +00:00
Petr MenšíkandPetr Špaček b880947188 Finalize removal of memory debug flags size and mctx
Commit 4b3d0c6600 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.
2025-02-17 16:48:43 +00:00
Mark Andrews aaaf2e989a [9.18] fix: usr: "CNAME and other data check" not applied to all types
An incorrect optimization caused "CNAME and other data" errors not to be detected if certain types were at the same node as a CNAME.  This has been fixed.

Closes #5150

Backport of MR !10033

Merge branch 'backport-5150-cname-and-other-data-check-not-applied-to-all-types-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10101
2025-02-14 03:18:41 +00:00
Mark Andrews e0bf0cad08 Move SVCB and HTTPS to be in type code order
(cherry picked from commit 559fac329a)
2025-02-14 13:44:49 +11:00
Mark Andrews 16c6858ebc Test cname-and-other-data against various types
(cherry picked from commit dfc367f52c)
2025-02-14 13:44:49 +11:00
Mark Andrews 7111f5e4c2 Fix "CNAME and other data" detection
prio_type was being used in the wrong place to optimize cname_and_other.
We have to first exclude and accepted types and we also have to
determine that the record exists before we can check if we are at
a point where a later CNAME cannot appear.

(cherry picked from commit 5e49a9e4ae)
2025-02-14 13:44:47 +11:00
Michal Nowak 4adf01503a [9.18] chg: test: Rewrite names system test to pytest
Backport of MR !8759

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

See merge request isc-projects/bind9!10097
2025-02-13 18:29:44 +00:00
Michal Nowak 0a3b450925 Rewrite names system test to pytest
dnspython 2.7.0 or newer is needed because of wire().

(cherry picked from commit 5250ad8720)
2025-02-13 18:29:35 +00:00
Michal Nowak 49229a483c [9.18] chg: test: Generate TSAN unit stress tests
This is a complement to the already present system test "stress" test.

Backport of MR !9474

Merge branch 'backport-mnowak/generate-tsan-unit-stress-tests-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10095
2025-02-13 18:11:56 +00:00
Michal Nowak 032cfc0c4e Generate TSAN unit stress tests
(cherry picked from commit a03c4b4cf9)
2025-02-13 16:43:36 +00:00
Andoni Duarte 5486a93539 chg: doc: Set up version for BIND 9.18.35
Merge branch 'andoni/set-up-version-for-bind-9.18.35' into 'bind-9.18'

See merge request isc-projects/bind9!10091
2025-02-13 16:10:33 +00:00
Andoni Duarte Pintado 121d74a062 Update BIND version to 9.18.35-dev 2025-02-13 15:54:05 +01:00
Andoni Duarte Pintado d8c38c95b6 Update BIND version for release v9.18.34 2025-02-11 18:11:49 +01:00
Andoni Duarte 6028904fd8 new: doc: Prepare documentation for BIND 9.18.34
Merge branch 'andoni/prepare-documentation-for-bind-9.18.34' into 'v9.18.34-release'

See merge request isc-private/bind9!780
2025-02-11 17:01:19 +00:00
Andoni Duarte Pintado 8a40344aa2 Tweak and reword release notes 2025-02-11 12:18:17 +01:00
Andoni Duarte Pintado 5dbb9de071 Prepare release notes for BIND 9.18.34 2025-02-07 20:38:48 +01:00
Andoni Duarte Pintado da12e7ee20 Generate changelog for BIND 9.18.34 2025-02-07 20:34:21 +01:00
Michal Nowak bc1673e49f [9.18] fix: ci: Do not evaluate $CI_PROJECT_DIR in generate-stress-test-configs.py
GitLab CI Runner's $builds_dir variable is set to "/builds" by default.
For technical reasons, the FreeBSD Runners, using the "instance"
executor, sets the path differently.

The value of $CI_PROJECT_DIR is based on $builds_dir, so if the
generate-stress-test-configs.py script generates jobs with
$CI_PROJECT_DIR (or variables like $INSTALL_PATH that are based on it)
evaluated, it is calcified to whatever was the value in the particular
environment, disregarding the FreeBSD "instance" executor specifics in
the child pipeline.

Instead of evaluating $CI_PROJECT_DIR in the script, evaluate it in the
runtime environment.

Backport of MR !10075

Merge branch 'backport-mnowak/fix-CI_PROJECT_DIR-variable-evaluation-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10078
2025-02-05 15:48:36 +00:00
Michal Nowak 4dc1290d92 Do not evaluate $CI_PROJECT_DIR in generate-stress-test-configs.py
GitLab CI Runner's $builds_dir variable is set to "/builds" by default.
For technical reasons, the FreeBSD Runners, using the "instance"
executor, sets the path differently.

The value of $CI_PROJECT_DIR is based on $builds_dir, so if the
generate-stress-test-configs.py script generates jobs with
$CI_PROJECT_DIR (or variables like $INSTALL_PATH that are based on it)
evaluated, it is calcified to whatever was the value in the particular
environment, disregarding the FreeBSD "instance" executor specifics in
the child pipeline.

Instead of evaluating $CI_PROJECT_DIR in the script, evaluate it in the
runtime environment.

(cherry picked from commit dab7d28b09)
2025-02-05 15:04:50 +00:00
Ondřej Surý f04168545d [9.18] new: usr: Print the expiration time of the stale records
Print the expiration time of the stale RRsets in the cache dump.

Backport of MR !10057

Merge branch 'backport-ondrej/print-expiration-time-of-stale-records-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10062
2025-02-04 17:07:54 +00:00
Ondřej Surý c9288ea3d7 Print the expiration time of the stale records (not ancient)
In #1870, the expiration time of ANCIENT records were printed, but
actually the ancient records are very short lived, and the information
carries a little value.

Instead of printing the expiration of ANCIENT records, print the
expiration time of STALE records.
2025-02-04 18:07:30 +01:00
Mark Andrews 444af884b6 [9.18] fix: test: Fix 'ans' servers so they respond with consistent answers to NS queries at QNAME.
The ANS servers were not to written to handle NS queries at the QNAME, resulting in gratuitous protocol errors that will break tests when NS requests are made for the QNAME: i.e., NXDOMAIN for NS vs data for expected type,  CNAME not being returned for all query types.

Prerequisite for !9155 

Closes #5062

Backport of MR !9786

Merge branch 'backport-5062-fix-ans-servers-ns-at-qname-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10065
2025-02-04 04:15:16 +00:00
Mark Andrews 8325f4e872 Fix gratuitious DNS protocol errors in the ANS servers
The ANS servers were not to written to handle NS queries at the
QNAME resulting in gratuitious protocol errors that will break tests
when NS requests are made for the QNAME.

(cherry picked from commit 0680eb6f64)
2025-02-04 02:37:39 +00:00
Ondřej Surý 4c49d99d56 [9.18] fix: usr: Recently expired records could be returned with timestamp in future
Under rare circumstances, the RRSet that expired at the time of
the query could be returned with TTL far in the future.  This
has been fixed.

As a side-effect, the expiration time of expired RRSets are no
longer printed out in the cache dump.

Closes #5094

Backport of MR !10048

Merge branch 'backport-5094-fix-timestamp-in-ttl-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10060
2025-02-03 15:17:42 +00:00
Ondřej Surý 0c064cfde4 Expand the usage of set_ttl() before mark_header_ancient()
When the mark_header_ancient() helper function was introduced, couple of
places with duplicate (or almost duplicate) code was missed.  Add
missing set_ttl() calls before mark_header_ancient(), so the handling of
expiring headers is same in all places.

(concept cherry picked from commit 58179e6a19)
2025-02-03 15:12:59 +01:00
Ondřej Surý 63e8af9270 Add better ZEROTTL handling in bindrdataset()
If we know that the header has ZEROTTL set, the server should never send
stale records for it and the TTL should never be anything else than 0.
The comment was already there, but the code was not matching the
comment.

(cherry picked from commit cfee6aa565)
2025-02-03 15:04:36 +01:00
Ondřej Surý 9a8483bece In cache, set rdataset TTL to 0 when the header is not active
When the header has been marked as ANCIENT, but the ttl hasn't been
reset (this happens in couple of places), the rdataset TTL would be
set to the header timestamp instead to a reasonable TTL value.

Since this header has been already expired (ANCIENT is set), set the
rdataset TTL to 0 and don't reuse this field to print the expiration
time when dumping the cache.  Instead of printing the time, we now
just print 'expired (awaiting cleanup'.

(cherry picked from commit 1bbb57f81b)
2025-02-03 15:04:36 +01:00
Ondřej Surý 368315b3c7 [9.18] fix: dev: Fix the cache findzonecut() implementation
The search for the deepest known zone cut in the cache could improperly reject a node if it contained any stale data, regardless of whether it was the NS RRset that was stale.

Closes #5155

Backport of MR !10047

Merge branch 'backport-5155-fix-findzonecut-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10051
2025-02-02 22:07:27 +00:00
Evan Hunt 291d0d8d90 fix the cache findzonecut implementation
the search for the deepest known zone cut in the cache could
improperly reject a node containing stale data, even if the
NS rdataset wasn't the data that was stale.

this change also improves the efficiency of the search by
stopping it when both NS and RRSIG(NS) have been found.

(cherry picked from commit 1f095b902c)
2025-02-02 13:22:32 -08:00
Petr Špaček 0987d28643 [9.18] fix: ci: Do not trigger post-merge jobs for cross-project pushes
Backport of MR !10029
Backport of MR !10042

Merge branch 'backport-pspacek/no-cross-project-after-merge-jobs-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10044
2025-01-31 14:12:26 +00:00
Petr Špaček 37d3ccf19f Fix shell escaping in post-merge before_script
Fixup for commit 6014060774
"Do not trigger post-merge jobs for cross-project pushes".

Related: isc-projects/bind9!10029
(cherry picked from commit 6276e0b23b)
2025-01-31 15:10:51 +01:00