2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00
Commit Graph

43024 Commits

Author SHA1 Message Date
Arаm Sаrgsyаn
dbc635c148 [9.20] fix: dev: Fix isc_quota bug
Running jobs which were entered into the isc_quota queue is the
responsibility of the isc_quota_release() function, which, when
releasing a previously acquired quota, checks whether the queue
is empty, and if it's not, it runs a job from the queue without touching
the 'quota->used' counter. This mechanism is susceptible to a possible
hangup of a newly queued job in case when between the time a decision
has been made to queue it (because used >= max) and the time it was
actually queued, the last quota was released. Since there is no more
quotas to be released (unless arriving in the future), the newly
entered job will be stuck in the queue.

Fix the issue by adding checks in both isc_quota_release() and
isc_quota_acquire_cb() to make sure that the described hangup does
not happen. Also see code comments.

Closes #4965

Backport of MR !10082

Merge branch 'backport-4965-isc_quota-bug-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10139
2025-02-20 13:34:58 +00:00
Aram Sargsyan
18fbc3f735 Fix isc_quota bug
Running jobs which were entered into the isc_quota queue is the
responsibility of the isc_quota_release() function, which, when
releasing a previously acquired quota, checks whether the queue
is empty, and if it's not, it runs a job from the queue without touching
the 'quota->used' counter. This mechanism is susceptible to a possible
hangup of a newly queued job in case when between the time a decision
has been made to queue it (because used >= max) and the time it was
actually queued, the last quota was released. Since there is no more
quotas to be released (unless arriving in the future), the newly
entered job will be stuck in the queue.

Fix the wrong memory ordering for 'quota->used', as the relaxed
ordering doesn't ensure that data modifications made by one thread
are visible in other threads.

Add checks in both isc_quota_release() and isc_quota_acquire_cb()
to make sure that the described hangup does not happen. Also see
code comments.

(cherry picked from commit c6529891bb)
2025-02-20 12:20:25 +00:00
Arаm Sаrgsyаn
4a5a9c8256 [9.20] new: usr: Implement the min-transfer-rate-in configuration option
A new option 'min-transfer-rate-in <bytes> <minutes>' has been added
to the view and zone configurations. It can abort incoming zone
transfers which run very slowly due to network related issues, for
example. The default value is set to 10240 bytes in 5 minutes.

Closes #3914

Backport of MR !9098

Merge branch 'backport-3914-detect-and-restart-stalled-zone-transfers-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10137
2025-02-20 12:18:08 +00:00
Aram Sargsyan
0bd251a496 Expose the incoming transfers' rates in the statistics channel
Expose the average transfer rate (in bytes-per-second) during the
last full 'min-transfer-rate-in <bytes> <minutes>' minutes interval.
If no such interval has passed yet, then the overall average rate is
reported instead.

(cherry picked from commit c701b590e4)
2025-02-20 11:05:09 +00:00
Aram Sargsyan
0f5295af40 Test the new min-transfer-rate-in configuration option
Add a new big zone, run a zone transfer in slow mode, and check
whether the zone transfer gets canceled because 100000 bytes are
not transferred in 5 seconds (as it's running in slow mode).

(cherry picked from commit b9c6aa24f8)
2025-02-20 11:05:09 +00:00
Aram Sargsyan
a1e391aeb3 Document the min-transfer-rate-in configuration option
Add a new section in ARM describing min-transfer-rate-in.

(cherry picked from commit f6dfff01ab)
2025-02-20 11:05:09 +00:00
Aram Sargsyan
e6b14365ad Implement the min-transfer-rate-in configuration option
This new option sets a minimum amount of transfer rate for
an incoming zone transfer that will abort a transfer, which
for some network related reasons run very slowly.

(cherry picked from commit 91ea156203)
2025-02-20 11:05:09 +00:00
Evan Hunt
9b3e1facf6 [9.20] fix: dev: Do not cache signatures for rejected data
The cache has been updated so that if new data is rejected - for example, because there was already existing data at a higher trust level - then its covering RRSIG will also be rejected.

Closes #5132

Backport of MR !9999

Merge branch 'backport-5132-improve-cd-behavior-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10134
2025-02-20 03:13:14 +00:00
Evan Hunt
a6a75f8262 add a test with an inconsistent NS RRset
add a zone with different NS RRsets in the parent and child,
and test resolver and forwarder behavior with and without +CD.

(cherry picked from commit e4652a0444)
2025-02-19 18:29:47 -08:00
Evan Hunt
fad9b3771f Check whether a rejected rrset is different
Add a new dns_rdataset_equals() function to check whether two
rdatasets are equal in DNSSEC terms.

When an rdataset being cached is rejected because its trust
level is lower than the existing rdataset, we now check to see
whether the rejected data was identical to the existing data.
This allows us to cache a potentially useful RRSIG when handling
CD=1 queries, while still rejecting RRSIGs that would definitely
have resulted in a validation failure.

(cherry picked from commit 6aba56ae89)
2025-02-19 18:29:34 -08:00
Artem Boldariev
9d4aa15c1f [9.20] fix: dev: Post [CVE-2024-12705] Performance Drop Fixes
This merge request fixes a [performance drop](https://gitlab.isc.org/isc-projects/bind9/-/pipelines/216728) after merging the fixes for #4795, in particular in 9.18.

The MR [fixes the problem](https://gitlab.isc.org/isc-projects/bind9/-/pipelines/219825) without affecting performance for the newer versions, in particular for [the development version](https://gitlab.isc.org/isc-projects/bind9/-/pipelines/220619).

Backport of MR !10109

Merge branch 'backport-artem-doh-performance-drop-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10129
2025-02-19 19:28:34 +00:00
Artem Boldariev
788e925261 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 20:34:29 +02:00
Artem Boldariev
47e9b47742 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 20:34:29 +02:00
Artem Boldariev
6b9387e2ee 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 20:34:29 +02:00
Artem Boldariev
96e8ea1245 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 20:34:29 +02:00
Andoni Duarte Pintado
5f6080a959 Merge tag 'v9.20.6' into bind-9.20 2025-02-19 17:43:41 +01:00
Evan Hunt
0682684028 [9.20] fix: dev: Delete dead nodes when committing a new version
In the qpzone implementation of `dns_db_closeversion()`, if there are changed nodes that have no remaining data, delete them.

Closes #5169

Backport of MR !10089

Merge branch 'backport-5169-qpzone-delete-dead-nodes-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10124
2025-02-18 23:28:41 +00:00
Evan Hunt
e35e701c2c when committing a new qpzone version, delete dead nodes
if all data has been deleted from a node in the qpzone
database, delete the node too.

(cherry picked from commit e58ce19cf2)
2025-02-18 22:55:20 +00:00
Petr Špaček
2ddfb57b45 [9.20] new: usr: Add HTTPS record query to host command line tool
The host command was extended to also query for the HTTPS RR type by default.

Backport of MR !8642

Merge branch 'backport-feature/main/host-rr-https-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10123
2025-02-18 15:04:48 +00:00
Petr Menšík
92ec19add9 Do HTTPS record query from host in addition
Unless explicitly specified type from host command, do fourth query for
type HTTPS RR. It is expected it will become more common and some
systems already query that record for every name.

(cherry picked from commit 82069a5700)
2025-02-18 14:58:14 +00:00
Artem Boldariev
fd623c6ecc [9.20] fix: dev: Fix wrong logging severity in do_nsfetch()
Backport of !10017.

Merge branch '5145-artem-fix-wrong-logging-severity-in-do_nsfetch-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10118
2025-02-18 09:23:05 +00:00
Artem Boldariev
7b0a5596d6 Fix wrong logging severity in do_nsfetch()
ISC_LOG_WARNING was used while ISC_LOG_DEBUG(3) was implied.

(cherry picked from commit fd3beaba2e)
2025-02-18 10:30:18 +02:00
Evan Hunt
11cc40ebf6 [9.20] fix: dev: Fix dns_qp_insert() checks in qpzone
Remove code in the QP zone database to handle failures of `dns_qp_insert()` which can't actually happen.

Closes #5171

Backport of MR !10088

Merge branch 'backport-5171-qpzone-insert-checks-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10114
2025-02-18 08:02:05 +00:00
Evan Hunt
a21168a221 fix dns_qp_insert() checks in qpzone
in some places there were checks for failures of dns_qp_insert()
after dns_qp_getname(). such failures could only happen if another
thread inserted a node between the two calls, and that can't happen
because the calls are serialized with dns_qpmulti_write(). we can
simplify the code and just add an INSIST.

(cherry picked from commit fffa150df3)
2025-02-18 05:55:02 +00:00
Michal Nowak
5aa7a451cc [9.20] chg: test: Rewrite keyfromlabel system test to pytest
Backport of MR !9188

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

See merge request isc-projects/bind9!10112
2025-02-17 20:17:59 +00:00
Michal Nowak
5d615b4797 Rewrite keyfromlabel system test to pytest
(cherry picked from commit 409f394d6e)
2025-02-17 20:17:45 +00:00
Michal Nowak
8713e2f61c [9.20] chg: test: Rewrite keepalive system test to pytest
Backport of MR !9202

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

See merge request isc-projects/bind9!10110
2025-02-17 19:56:29 +00:00
Michal Nowak
6354130bc7 Rewrite keepalive system test to pytest
(cherry picked from commit b804a70fac)
2025-02-17 20:24:36 +01:00
Michal Nowak
10bb9727c6 Add Dig interface
(cherry picked from commit 7347abd01f)
2025-02-17 19:19:04 +00:00
Mark Andrews
ba5fe2dd12 [9.20] 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.20' into 'bind-9.20'

See merge request isc-projects/bind9!10105
2025-02-17 00:41:34 +00:00
Mark Andrews
89122c3fde 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-17 11:04:19 +11:00
Mark Andrews
de8893733f 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-17 11:04:17 +11:00
Mark Andrews
77417f8fc6 Add stripped DS RRSIG senario
(cherry picked from commit 66f293a952)
2025-02-17 11:00:40 +11:00
Mark Andrews
18c1295fdc Add stripped DNSKEY RRSIG senario
(cherry picked from commit a71b617566)
2025-02-17 11:00:39 +11:00
Mark Andrews
a68f5dd74b [9.20] 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.20' into 'bind-9.20'

See merge request isc-projects/bind9!10100
2025-02-14 03:14:48 +00:00
Mark Andrews
1661e7a407 Move SVCB and HTTPS to be in type code order
(cherry picked from commit 559fac329a)
2025-02-14 13:41:11 +11:00
Mark Andrews
3adf4f7d72 Test cname-and-other-data against various types
(cherry picked from commit dfc367f52c)
2025-02-14 13:41:11 +11:00
Mark Andrews
ae3e67717c 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:41:11 +11:00
Michal Nowak
5fb68149a0 [9.20] chg: test: Rewrite nzd2nzf system test to pytest
Backport of MR !9160

Merge branch 'backport-mnowak/pytest_rewrite_nzd2nzf-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10098
2025-02-13 19:23:04 +00:00
Michal Nowak
47d64f944f Rename assert_custom_named_is_alive to named_alive
(cherry picked from commit 38e751d9ac)
2025-02-13 18:47:42 +00:00
Michal Nowak
0d75e15d4d Rewrite nzd2nzf system test to pytest
(cherry picked from commit 7c499d1689)
2025-02-13 18:47:42 +00:00
Michal Nowak
de9e94889e [9.20] chg: test: Rewrite names system test to pytest
Backport of MR !8759

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

See merge request isc-projects/bind9!10096
2025-02-13 18:34:58 +00:00
Michal Nowak
b04d28f1ef 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 17:49:26 +00:00
Michal Nowak
97e7e9ff21 [9.20] 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.20' into 'bind-9.20'

See merge request isc-projects/bind9!10094
2025-02-13 17:42:26 +00:00
Michal Nowak
b4aab2cfa3 Generate TSAN unit stress tests
(cherry picked from commit a03c4b4cf9)
2025-02-13 16:43:31 +00:00
Andoni Duarte
881b9e2417 chg: doc: Set up version for BIND 9.20.7
Merge branch 'andoni/set-up-version-for-bind-9.20.7' into 'bind-9.20'

See merge request isc-projects/bind9!10092
2025-02-13 16:10:37 +00:00
Andoni Duarte Pintado
33988a1600 Update BIND version to 9.20.7-dev 2025-02-13 15:55:19 +01:00
Andoni Duarte Pintado
72cbad0469 Update BIND version for release v9.20.6 2025-02-11 18:11:22 +01:00
Andoni Duarte
af83b48a49 new: doc: Prepare documentation for BIND 9.20.6
Merge branch 'andoni/prepare-documentation-for-bind-9.20.6' into 'v9.20.6-release'

See merge request isc-private/bind9!779
2025-02-11 16:51:37 +00:00
Andoni Duarte Pintado
b1b0681189 Tweak and reword release notes 2025-02-11 15:00:39 +01:00