Commit Graph

35717 Commits

Author SHA1 Message Date
Matthijs Mekking
f59ed64cd8 Add RFC 9460 to list of supported RFCs
The specification was implemented (#1132) when it was a draft. Now that
it is RFC, add the RFC to the list of supported RFCs.

(cherry picked from commit 5b5f43babc)
2024-03-14 13:57:42 +01:00
Mark Andrews
23d8f148b3 Merge branch '4633-undefined-behaviour-in-rdataslab-c-bind-9.16' into 'bind-9.16'
[9.16] Resolve "Undefined behaviour in rdataslab.c"

See merge request isc-projects/bind9!8861
2024-03-14 00:50:22 +00:00
Mark Andrews
3bcd6385d4 Only call memmove if the rdata length is non zero
This avoids undefined behaviour on zero length rdata where the
data pointer is NULL.

(cherry picked from commit 228cc557fe)
2024-03-14 11:06:25 +11:00
Michał Kępień
93b877527c Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.50' into 'bind-9.16'
Set up version and release notes for BIND 9.16.50

See merge request isc-projects/bind9!8858
2024-03-13 08:59:32 +00:00
Michał Kępień
ab5c429349 Set up release notes for BIND 9.16.50 2024-03-13 09:56:26 +01:00
Michał Kępień
0c2b5b41b5 Update BIND version to 9.16.50-dev 2024-03-13 09:56:26 +01:00
Matthijs Mekking
a1ac1e7cf2 Merge branch '4625-broken-trust-chain-on-corner-case-secure-chain-fixup-keytrap-test-only-v9_16' into 'bind-9.16'
[9.16] Test secure chain that includes inactive KSK

See merge request isc-projects/bind9!8851
2024-03-12 12:48:58 +00:00
Matthijs Mekking
0040947ae7 Test secure chain that includes inactive KSK
Add a regression test case for the scenario where a secure chain of
trust includes an inactive KSK, that is a KSK that is not signing the
DNSKEY RRset.

(cherry picked from commit f0bfd276e0)
2024-03-12 11:50:08 +01:00
Michał Kępień
95e0ccf683 Merge branch '4621-account-for-changes-to-struct-dns_rbtnode' into 'bind-9.16'
Account for changes to struct dns_rbtnode

See merge request isc-projects/bind9!8840
2024-03-07 09:02:45 +00:00
Michał Kępień
52fe0b6be7 Account for changes to struct dns_rbtnode
Commit 540a5b5a2c modified the definition
of struct dns_rbtnode.  Doing that changes the layout of map-format zone
files.  Bump MAPAPI and update the offsets used in map-format zone file
checks in the "masterformat" system test, as these changes were
inadvertently omitted from the aforementioned change.
2024-03-07 09:42:38 +01:00
Michał Kępień
336096cdd1 Merge branch '4621-fix-cache-pruning-after-rndc-flush-9.16' into 'bind-9.16'
[9.16] Move the task creation into cache_create_db()

See merge request isc-projects/bind9!8831
2024-03-06 18:16:26 +00:00
Ondřej Surý
bde5e18cb1 Add CHANGES and release note for [GL #4621]
(cherry picked from commit 79ee08c337)
2024-03-06 18:43:49 +01:00
Ondřej Surý
d4bc4e5cc6 Move the task creation into cache_create_db()
The dns_cache_flush() drops the old database and creates a new one, but
it forgets to create the task(s) that runs the node pruning and cleaning
the rbtdb when flushing it next time.  This causes the cleaning to skip
cleaning the parent nodes (with .down == NULL) leading to increased
memory usage over time until the database is unable to keep up and just
stays overmem all the time.

(cherry picked from commit 79040a669c)
2024-03-06 18:43:49 +01:00
Ondřej Surý
540a5b5a2c Create a second pruning task for rbtdb with unlimited quantum
Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.

(cherry picked from commit 231b2375e5)
2024-03-06 18:43:49 +01:00
Ondřej Surý
12c42a6c07 Restore the parent cleaning logic in prune_tree()
Reconstruct the variant of the prune_tree() parent cleaning to consider
all elibible parents in a single loop as we were doing before all the
changes that led to this commit.

Update code comments so that they more precisely describe what the
relevant bits of code actually do.

(cherry picked from commit 454c75a33a)
2024-03-06 18:43:49 +01:00
Michał Kępień
dc7eec86fb Merge branch '4596-check-the-prunelink-member-of-the-correct-node' into 'bind-9.16'
[9.16] Check the prunelink member of the correct node

See merge request isc-projects/bind9!8814
2024-03-02 05:37:21 +00:00
Michał Kępień
7d9be24bb1 Check the prunelink member of the correct node
Commit 4b6fc97af6 checks the prunelink
member of the node that was just pruned, not its parent node that was
intended to be examined.  Fix by checking the prunelink member of the
parent node, so that adding the latter to its relevant prunenodes list
twice is properly guarded against.
2024-03-02 06:36:37 +01:00
Evan Hunt
5095a05c13 Merge branch 'each-move-rrl-broken-config-test-case-to-checkconf-bind-9.18-bind-9.16' into 'bind-9.16'
[9.16] Move RRL broken-config check to checkconf

See merge request isc-projects/bind9!8813
2024-03-02 01:11:18 +00:00
Evan Hunt
0a019e8f9e move RRL broken-config check to checkconf
the RRL test included a test case that tried to start named with
a broken configuration.  the same error could be found with
named-checkconf, so it should have been tested in the checkconf
system test.

(cherry picked from commit 05398c1488)
(cherry picked from commit 046b62bf02)
2024-03-01 16:36:51 -08:00
Michał Kępień
57dbcac057 Merge branch '4596-do-not-re-add-a-node-to-the-same-prunenodes-list' into 'bind-9.16'
Do not re-add a node to the same prunenodes list

See merge request isc-projects/bind9!8810
2024-03-01 17:19:15 +00:00
Michał Kępień
4b6fc97af6 Do not re-add a node to the same prunenodes list
If a node cleaned up by prune_tree() happens to belong to the same node
bucket as its parent, the latter is directly appended to the prunenodes
list currently processed by prune_tree().  However, the relevant code
branch does not account for the fact that the parent might already be on
the list it is trying to append it to.  Fix by only calling
ISC_LIST_APPEND() for parent nodes not yet added to their relevant
prunenodes list.
2024-03-01 18:12:37 +01:00
Michał Kępień
e368de1c92 Merge branch '4596-gracefully-handle-resending-a-node-to-prune_tree' into 'bind-9.16'
[9.16] Gracefully handle resending a node to prune_tree()

See merge request isc-projects/bind9!8804
2024-02-29 17:04:50 +00:00
Michał Kępień
f6289ad931 Gracefully handle resending a node to prune_tree()
Commit 2df147cb12 made the prune_tree()
function use send_to_prune_tree() for triggering pruning of deleted leaf
nodes' parents.  This enabled the following sequence of events to
happen:

 1. Node A, which is a leaf node, is passed to send_to_prune_tree() and
    its pruning is queued.

 2. Node B is added to the RBTDB as a child of node A before the latter
    gets pruned.

 3. Node B, which is now a leaf node itself (and is likely to belong to
    a different node bucket than node A), is passed to
    send_to_prune_tree() and its pruning gets queued.

 4. Node B gets pruned.  Its parent, node A, now becomes a leaf again
    and therefore the prune_tree() call that handled node B calls
    send_to_prune_tree() for node A.

 5. Since node A was already queued for pruning in step 1 (but not yet
    pruned), the INSIST(!ISC_LINK_LINKED(node, prunelink)); assertion
    fails for node A in send_to_prune_tree().

The above sequence of events is not a sign of pathological behavior.
Replace the assertion check with a conditional early return from
send_to_prune_tree().
2024-02-29 17:38:52 +01:00
Ondřej Surý
a2b9adb1c7 Merge branch '4591-improve-ttl-based-cleaning-9.16' into 'bind-9.16'
[9.16] Remove expired rdataset headers from the heap

See merge request isc-projects/bind9!8764
2024-02-29 15:10:56 +00:00
Ondřej Surý
99d0ba4420 Add CHANGES note for [GL #4591]
(cherry picked from commit db69cc7891)
2024-02-29 16:09:37 +01:00
Ondřej Surý
496fe6bc60 Make the TTL-based cleaning more aggressive
It was discovered that the TTL-based cleaning could build up
a significant backlog of the rdataset headers during the periods where
the top of the TTL heap isn't expired yet.  Make the TTL-based cleaning
more aggressive by cleaning more headers from the heap when we are
adding new header into the RBTDB.

(cherry picked from commit d8220ca4ca)
2024-02-29 16:09:36 +01:00
Ondřej Surý
abe080d16e Remove expired rdataset headers from the heap
It was discovered that an expired header could sit on top of the heap
a little longer than desireable.  Remove expired headers (headers with
rdh_ttl set to 0) from the heap completely, so they don't block the next
TTL-based cleaning.

(cherry picked from commit a9383e4b95)
2024-02-29 16:09:34 +01:00
Ondřej Surý
5709230a3e Merge branch '4596-regression-in-cache-cleaning-9.16' into 'bind-9.16'
[9.16] Remove the contention when pruning RBTDB nodes

See merge request isc-projects/bind9!8767
2024-02-29 11:46:55 +00:00
Ondřej Surý
774204ea74 Add CHANGES and release note for [GL #4596] 2024-02-29 12:18:00 +01:00
Ondřej Surý
2df147cb12 Reduce lock contention during RBTDB tree pruning
The log message for commit c3377cbfaa
explained:

    Instead of issuing a separate isc_task_send() call for every RBTDB node
    that triggers tree pruning, maintain a list of nodes from which tree
    pruning can be started from and only issue an isc_task_send() call if
    pruning has not yet been triggered by another RBTDB node.

    The extra queuing overhead eliminated by this change could be remotely
    exploited to cause excessive memory use.

However, it turned out that having a single queue for the nodes to be
pruned increased lock contention to a level where cleaning up nodes from
the RBTDB took too long, causing the amount of memory used by the cache
to grow indefinitely over time.

This commit makes the prunenodes list bucketed, adds a quantum of 10
items per prune_tree() run, and simplifies parent node cleaning in the
prune_tree() logic.

Instead of juggling node locks in a cycle, only clean up the node
currently being pruned and queue its parent (if it is also eligible) for
pruning in the same way (by sending an event).

This simplifies the code and also spreads the pruning load across more
task loop ticks, which is better for lock contention as less things run
in a tight loop.
2024-02-29 12:18:00 +01:00
Mark Andrews
d172b933fb Merge branch '4604-fix-initial-tests-in-masterfile-system-test-bind-9.16' into 'bind-9.16'
[9.16] Resolve "Fix initial tests in masterfile system test"

See merge request isc-projects/bind9!8789
2024-02-28 01:56:11 +00:00
Mark Andrews
32b1d00afb Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4)
2024-02-28 12:26:31 +11:00
Michał Kępień
03fdd3f12c Merge branch 'michal/post-release-tweaks-9.16' into 'bind-9.16'
[9.16] Miscellaneous post-release tweaks

See merge request isc-projects/bind9!8740
2024-02-14 16:23:14 +00:00
Michał Kępień
ec1afa639f Mention CVE-2023-50868 in CHANGES entry 6322
Since CVE-2023-50868 does not have a dedicated fix in BIND 9, mention
its CVE identifier in the CHANGES entry for CVE-2023-50387 (KeyTrap),
which accompanied the code change that addresses both of these
vulnerabilities.

(cherry picked from commit 2fd20bbaf5)
2024-02-14 17:19:44 +01:00
Michał Kępień
b56c18b477 Merge tag 'v9.16.48' into bind-9.16
BIND 9.16.48
2024-02-14 13:41:33 +01:00
Michał Kępień
0dab57e15f Merge branch 'prep-release' into v9.16.48-release v9.16.48 2024-02-11 12:31:39 +01:00
Michał Kępień
7fc5ef173b prep 9.16.48 2024-02-11 12:31:23 +01:00
Michał Kępień
2cdf003dae Merge branch 'michal/prepare-documentation-for-bind-9.16.48' into 'v9.16.48-release'
Prepare documentation for BIND 9.16.48

See merge request isc-private/bind9!658
2024-02-11 11:29:36 +00:00
Michał Kępień
43a6b02728 Add release note for GL #4459 2024-02-11 12:10:17 +01:00
Michał Kępień
659e0d80fd Prepare release notes for BIND 9.16.48 2024-02-11 12:10:17 +01:00
Michał Kępień
81ac09c421 Merge branch '4568-fix-isc_ht-case-insensitive-matching-9.16' into 'v9.16.48-release'
[9.16] Fix case insensitive matching in isc_ht hash table implementation

See merge request isc-private/bind9!654
2024-02-11 11:06:57 +00:00
Ondřej Surý
81479eaa63 Add CHANGES note for [GL #4568]
(cherry picked from commit e91884553f)
2024-02-11 11:57:58 +01:00
Ondřej Surý
b9c10a194d Add a system test for mixed-case data for the same owner
We were missing a test where a single owner name would have multiple
types with a different case.  The generated RRSIGs and NSEC records will
then have different case than the signed records and message parser have
to cope with that and treat everything as the same owner.

(cherry picked from commit a114042059)
2024-02-11 11:57:58 +01:00
Ondřej Surý
f493a83941 Fix case insensitive matching in isc_ht hash table implementation
The case insensitive matching in isc_ht was basically completely broken
as only the hashvalue computation was case insensitive, but the key
comparison was always case sensitive.

(cherry picked from commit 175655b771)
2024-02-11 11:57:58 +01:00
Michał Kępień
d03f7933ae Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.49' into 'bind-9.16'
Set up version and release notes for BIND 9.16.49

See merge request isc-projects/bind9!8722
2024-02-11 10:12:13 +00:00
Michał Kępień
ae9d795a13 Set up release notes for BIND 9.16.49 2024-02-11 11:10:14 +01:00
Michał Kępień
8e4896ffa4 Update BIND version to 9.16.49-dev 2024-02-11 11:10:14 +01:00
Tom Krizek
5b7a0f02c1 Merge branch '4562-use-source-port-for-ditch-pl-9.16' into 'bind-9.16'
[9.16] Use a single local port for ditch.pl

See merge request isc-projects/bind9!8708
2024-02-08 13:41:18 +00:00
Tom Krizek
be735330bb Use a single local port for ditch.pl
The ditch.pl script is used to generate burst traffic without waiting
for the responses. When running other tests in parallel, this can result
in a ephemeral port clash, since the ditch.pl process closes the socket
immediately. In rare occasions when the message ID also clashes with
other tests' queries, it might result in an UnexpectedSource error from
dnspython.

Use a dedicated port EXTRAPORT8 which is reserved for each test as a
source port for the burst traffic.

(cherry picked from commit 339fa5690a)
2024-02-08 13:46:52 +01:00
Ondřej Surý
ac12ddb6e1 Merge branch 'ondrej/various-rbtdb-fixes-9.16' into 'bind-9.16'
[9.16] Fix missing RRSIG for CNAME with different slabheader order

See merge request isc-projects/bind9!8705
2024-02-08 09:11:09 +00:00