]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoImprove node reference counting
Matthijs Mekking [Thu, 25 Jan 2024 09:19:00 +0000 (10:19 +0100)] 
Improve node reference counting

QP database node data is not reference counted the same way RBT nodes
were: in the RBT, node->references could be zero if the node was in the
tree but was not in use by any caller, whereas in the QP trie, the
database itself uses reference counting of nodes internally.

this caused some subtle errors. in RBTDB, when the newref() function is
called and the node reference count was zero, the node lock reference
counter would also be incremented. in the QP trie, this can never
happen - because as long as the node is in the database its reference
count cannot be zero - and so the node lock reference counter was never
incremented.

reference counting will probably need to be refactored in more detail
later; the node lock reference count may not be needed at all.  but
for now, as a temporary measure, we add a third reference counter,
'erefs' (external references), to the dns_qpdata structure. this is
counted separately from the main reference counter, and should match
the node reference count as it would have been in RBTDB.

this change revealed a number of places where the node reference counter
was being incremented on behalf of a caller without newref() being
called; those were cleaned up as well.

This is an adaptation of commit 3dd686261d2c4bcd15a96ebfea10baffa277732b

2 years agorevise test for ENT NSEC3 cleanup
Evan Hunt [Mon, 4 Dec 2023 03:35:08 +0000 (19:35 -0800)] 
revise test for ENT NSEC3 cleanup

as a side effect of the switch from RBT to QBDB, NSEC3 records
are no longer created for empty non-terminal nodes when the
node only contains insecure delegations in an opt-out range.

such NSEC3 records are optional according to RFC 5155 (and,
for example, they are not created by dnssec-signzone), but they were
previously created by named, as a harmless side effect of the RBT
structure, which contains empty internal nodes that can be reached
by a DB iterator. these nodes are not present in the QPDB, so
NSEC3 records are not created unless they're actually required.

the autosign system test contained a test case (added in commit
ad91a70d as part of GL #4027) that checked whether ENT NSEC3
records were deleted when the delegations under the ENT removed.
this test no longer passes, because the NSEC3's are not created
in the first place, and therefore cannot be removed.

rather than "fix" the QPDB to add unnecessary NSEC3 records, this
commit instead revises the test to check for removal of ENT NSEC3
records when *not* using opt-out.

2 years agoNo special logic for relative names
Matthijs Mekking [Fri, 19 Jan 2024 14:57:45 +0000 (15:57 +0100)] 
No special logic for relative names

Nodes in a QP-trie contain the full domain name, while nodes in a
red-black tree only contain names relative to a parent.

2 years agoChange free_gluetable
Matthijs Mekking [Fri, 19 Jan 2024 10:46:16 +0000 (11:46 +0100)] 
Change free_gluetable

Fixes a crash at shutdown.

2 years agoCalculating hashsize is obsolete
Matthijs Mekking [Thu, 18 Jan 2024 11:33:01 +0000 (12:33 +0100)] 
Calculating hashsize is obsolete

We don't have hash tables for qp.

2 years agoAdd proper qp cleanup
Matthijs Mekking [Wed, 17 Jan 2024 15:53:27 +0000 (16:53 +0100)] 
Add proper qp cleanup

Fix reference counting: unreference nodes that are succesfully inserted
in the tree, detach created nodes, and cleanup the interior data in
dns_qpdata_destroy().

2 years agoReplace dns_rbtnode_t with dns_qpdata_t
Matthijs Mekking [Tue, 16 Jan 2024 11:09:52 +0000 (12:09 +0100)] 
Replace dns_rbtnode_t with dns_qpdata_t

This for now has almost the same structure contents except for
dns_qpdata_t has 'fn' and 'name' to store the domain name.

2 years agoReplace dns_rbt_nodecount with dns_qp_memusage
Matthijs Mekking [Tue, 16 Jan 2024 10:51:46 +0000 (11:51 +0100)] 
Replace dns_rbt_nodecount with dns_qp_memusage

We now count the nodes by getting the memory usage and return the
number of leaves.

2 years agoReplace dns_rbt_namefromnode with dns_name_copy
Matthijs Mekking [Tue, 16 Jan 2024 10:41:34 +0000 (11:41 +0100)] 
Replace dns_rbt_namefromnode with dns_name_copy

The name will be stored inside the node now so we can just copy it.

These are leftovers, most of the namefromnode code has been replaced
already in previous commits.

2 years agoReplace rbtnodechain with qpchain and qpiter
Matthijs Mekking [Tue, 16 Jan 2024 10:26:20 +0000 (11:26 +0100)] 
Replace rbtnodechain with qpchain and qpiter

The qp approach pulled apart the chain and iterator into two separate
things. Replace the rbtnodechain with qpchain and qpiter. Most of the
times we are interested in the iterator only, the rbtnodechain was
mainly used as an an iterator to get the previous and next name in the
DNS canonical order.

Since dns_qpiter_prev() and dns_qpiter_next() store the name, origin,
and node in the provided parameters, often there is no need to call
a current() function anymore.

Getting the first or last item from the iterator is done by
re-initializing the iterator and then call dns_qpiter_next() or
dns_qpiter_prev() respectively.

The dbiterator no longer needs to maintain a chain, only an iterator.

2 years agoReplace rbt_findnode with qp_lookup
Matthijs Mekking [Fri, 12 Jan 2024 13:11:45 +0000 (14:11 +0100)] 
Replace rbt_findnode with qp_lookup

All dns_qp_lookup() calls assume it is okay to find empty data, so
we don't need to do anything special for the DNS_RBTFIND_EMPTYDATA.

You can pass a callback function to dns_rbt_findnode(), something that
qp does not support. Instead, call the function afterwards. This has
the drawback that we do more lookup work if there was a zonecut.

With dns_qp_lookup() we also don't pass any options. In this case,
when DNS_RBTFIND_NOEXACT was set, we adapt the result after the lookup.

2 years agoReplace rbt_deletenode with qp_deletename
Matthijs Mekking [Thu, 11 Jan 2024 11:33:45 +0000 (12:33 +0100)] 
Replace rbt_deletenode with qp_deletename

Replace dns_rbt_deletenode calls with dns_qp_deletename. For removing
the name from the nsec tree, we no longer first have to find it: we can
just remove the key (retrieved by name).

2 years agoReplace rbt_addnode with qp_insert
Matthijs Mekking [Wed, 10 Jan 2024 15:29:57 +0000 (16:29 +0100)] 
Replace rbt_addnode with qp_insert

Replace dns_rbt_addnode calls with dns_qp_insert. With QP, it sometimes
makes more sense to first lookup the name and see if there is an
existing node (rather than create new data, insert, find out a node
already exists, and destroy the data again). This is done with
dns_qp_getname(), which is more lightweight than dns_qp_lookup(),
and we are only interested in if there is already a leaf node for this
name or not.

2 years agoswitch database defaults from "rbt" to "qp"
Evan Hunt [Tue, 5 Mar 2024 23:43:11 +0000 (15:43 -0800)] 
switch database defaults from "rbt" to "qp"

replace the string "rbt" throughout BIND with "qp" so that
qpdb databases will be used by default instead of rbtdb.
rbtdb databases can still be used by specifying "database rbt;"
in a zone statement.

2 years agorename dns_rbtdb to dns_qpdb
Evan Hunt [Tue, 5 Mar 2024 22:28:43 +0000 (14:28 -0800)] 
rename dns_rbtdb to dns_qpdb

this commit renames all variables and macros with the string "rbtdb"
or "RBDTB" to "qpdb" or "QPDB".

2 years agoBegin replacement of rbt with qp in rbtdb
Matthijs Mekking [Tue, 9 Jan 2024 15:18:57 +0000 (16:18 +0100)] 
Begin replacement of rbt with qp in rbtdb

- Copy rbtdb.c, rbt-zonedb.c and rbt-cachedb.c to qp-*.
- Added qpmethods.
- Added a new structure dns_qpdata that will replace dns_rbtnode.
- Replaced normal, nsec, and nsec3 dns_rbt trees with dns_qp tries.
- Replaced dns_rbt_create() calls with dns_qp_create().
- Replaced the dns_rbt_destroy() call with dns_qp_destroy().
- Create a dns_qpdata struct and create/destroy methods.

This commit will not build.

2 years agoMerge branch '4612-resolver-crashes-on-10-0-0-38-abcdefghijklmnopqrstuvwxyz012345...
Mark Andrews [Wed, 6 Mar 2024 00:16:13 +0000 (00:16 +0000)] 
Merge branch '4612-resolver-crashes-on-10-0-0-38-abcdefghijklmnopqrstuvwxyz012345-plex-direct-ds-query' into 'main'

Resolve "resolver crashes on 10-0-0-38.abcdefghijklmnopqrstuvwxyz012345.plex.direct DS query"

Closes #4612

See merge request isc-projects/bind9!8794

2 years agoAdd CHANGES note for [GL #4612]
Mark Andrews [Thu, 29 Feb 2024 03:10:42 +0000 (14:10 +1100)] 
Add CHANGES note for [GL #4612]

2 years agotest: DS query against broken NODATA responses
Mark Andrews [Tue, 5 Mar 2024 04:51:05 +0000 (15:51 +1100)] 
test: DS query against broken NODATA responses

This is a regresssion test for GL #4621 where the NODATA responses
are SOA records that match the QNAME rather than the zone name. In
particular for NS queries.

2 years agoRestore the disassociate call to before the fetch
Mark Andrews [Thu, 29 Feb 2024 03:00:58 +0000 (14:00 +1100)] 
Restore the disassociate call to before the fetch

[GL #3709] reordered the dns_rdataset_disassociate call to after
the dns_resolver_createfetch call resulting in qctx->nsrrset still
being associated when dns_resolver_createfetch is called in
resume_dslookup (7e4e125e).  Revert that part of the change and add
comments as to why the multiple dns_rdataset_disassociate calls are
where they are.

2 years agoMerge branch '4600-call-dispatch-connect-callbacks-asynchronously' into 'main'
Ondřej Surý [Mon, 4 Mar 2024 15:34:51 +0000 (15:34 +0000)] 
Merge branch '4600-call-dispatch-connect-callbacks-asynchronously' into 'main'

Pin the xfr to a specific loop

Closes #4600

See merge request isc-projects/bind9!8821

2 years agoAlways call the TCP dispatch connected callbacks asynchronously
Ondřej Surý [Mon, 4 Mar 2024 11:58:56 +0000 (12:58 +0100)] 
Always call the TCP dispatch connected callbacks asynchronously

The TCP dispatch connected callbacks could be called synchronously which
in turn could destroy xfrin before we return from dns_xfrin_create().

Delay the calling the callback called from tcp_dispatch_connect() by
calling it always asynchronously.

2 years agoPin the xfr to a specific loop
Ondřej Surý [Mon, 4 Mar 2024 12:21:35 +0000 (13:21 +0100)] 
Pin the xfr to a specific loop

Instead of getting the loop from the zone every time, attach the xfrin
directly to the loop.  This also allows to remove the extra safety tid
checks from the dns_xfrin unit.

2 years agoMerge branch 'pspacek/cve-bug-report-template' into 'main'
Petr Špaček [Mon, 4 Mar 2024 14:18:13 +0000 (14:18 +0000)] 
Merge branch 'pspacek/cve-bug-report-template' into 'main'

Fix typos in Security bug issue template

See merge request isc-projects/bind9!8822

2 years agoFix typos in Security bug issue template
Petr Špaček [Mon, 4 Mar 2024 14:16:10 +0000 (15:16 +0100)] 
Fix typos in Security bug issue template

2 years agoMerge branch 'pspacek/cve-bug-report-template' into 'main'
Petr Špaček [Mon, 4 Mar 2024 13:13:36 +0000 (13:13 +0000)] 
Merge branch 'pspacek/cve-bug-report-template' into 'main'

Security bug issue template improvements

See merge request isc-projects/bind9!8820

2 years agoAdjust line breaks in CVE report template
Petr Špaček [Fri, 1 Mar 2024 16:24:25 +0000 (17:24 +0100)] 
Adjust line breaks in CVE report template

2 years agoAdd questions about multiple implementations into CVE report template
Petr Špaček [Fri, 1 Mar 2024 16:20:25 +0000 (17:20 +0100)] 
Add questions about multiple implementations into CVE report template

2 years agoMerge branch 'each-move-rrl-broken-config-test-case-to-checkconf' into 'main'
Evan Hunt [Fri, 1 Mar 2024 23:34:05 +0000 (23:34 +0000)] 
Merge branch 'each-move-rrl-broken-config-test-case-to-checkconf' into 'main'

Move RRL broken-config check to checkconf

See merge request isc-projects/bind9!8795

2 years agomove RRL broken-config check to checkconf
Evan Hunt [Tue, 6 Feb 2024 21:33:21 +0000 (13:33 -0800)] 
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.

2 years agoMerge branch '4591-improve-ttl-based-cleaning' into 'main'
Ondřej Surý [Thu, 29 Feb 2024 12:33:58 +0000 (12:33 +0000)] 
Merge branch '4591-improve-ttl-based-cleaning' into 'main'

Remove expired rdataset headers from the heap

Closes #4591

See merge request isc-projects/bind9!8754

2 years agoAdd CHANGES note for [GL #4591]
Ondřej Surý [Tue, 20 Feb 2024 12:27:05 +0000 (13:27 +0100)] 
Add CHANGES note for [GL #4591]

2 years agoMake the TTL-based cleaning more aggressive
Ondřej Surý [Tue, 20 Feb 2024 07:50:58 +0000 (08:50 +0100)] 
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.

2 years agoRemove expired rdataset headers from the heap
Ondřej Surý [Tue, 20 Feb 2024 07:50:58 +0000 (08:50 +0100)] 
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.

2 years agoMerge branch '4596-regression-in-cache-cleaning' into 'main'
Ondřej Surý [Thu, 29 Feb 2024 11:33:05 +0000 (11:33 +0000)] 
Merge branch '4596-regression-in-cache-cleaning' into 'main'

Reduce lock contention during RBTDB tree pruning

Closes #4596

See merge request isc-projects/bind9!8765

2 years agoAdd CHANGES and release note for [GL #4596]
Ondřej Surý [Thu, 22 Feb 2024 07:56:46 +0000 (08:56 +0100)] 
Add CHANGES and release note for [GL #4596]

2 years agoSimplify the parent cleaning in the prune_tree() mechanism
Ondřej Surý [Wed, 21 Feb 2024 12:32:09 +0000 (13:32 +0100)] 
Simplify the parent cleaning in the prune_tree() mechanism

Instead of juggling with node locks in a cycle, cleanup the node we are
just pruning and send any the parent that's also subject to the pruning
to the prune tree via normal way (e.g. enqueue pruning on the parent).

This simplifies the code and also spreads the pruning load across more
event loop ticks which is better for lock contention as less things run
in a tight loop.

2 years agoReduce lock contention during RBTDB tree pruning
Ondřej Surý [Wed, 21 Feb 2024 10:45:36 +0000 (11:45 +0100)] 
Reduce lock contention during RBTDB tree pruning

The log message for commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1
explained:

    In some older BIND 9 branches, the extra queuing overhead eliminated by
    this change could be remotely exploited to cause excessive memory use.
    Due to architectural shift, this branch is not vulnerable to that issue,
    but applying the fix to the latter is nevertheless deemed prudent for
    consistency and to make the code future-proof.

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 reverts the change to the pruning mechanism introduced by
commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1 as BIND branches newer
than 9.16 were not affected by the excessive event queueing overhead
issue mentioned in the log message for the above commit.

2 years agoMerge branch '4156-docs-ephemeral-tls-recreation' into 'main'
Artem Boldariev [Wed, 28 Feb 2024 19:40:35 +0000 (19:40 +0000)] 
Merge branch '4156-docs-ephemeral-tls-recreation' into 'main'

Improve documentation on ephemeral TLS configuration

Closes #4156

See merge request isc-projects/bind9!8771

2 years agoImprove documentation on ephemeral TLS configuration
Artem Boldariev [Thu, 22 Feb 2024 17:42:04 +0000 (19:42 +0200)] 
Improve documentation on ephemeral TLS configuration

This commit improves the documentation on the ephemeral TLS
configuration and describes in more detail what is happening with TLS
configurations on reconfiguration in general.

2 years agoMerge branch '4604-fix-initial-tests-in-masterfile-system-test' into 'main'
Mark Andrews [Wed, 28 Feb 2024 00:16:39 +0000 (00:16 +0000)] 
Merge branch '4604-fix-initial-tests-in-masterfile-system-test' into 'main'

Resolve "Fix initial tests in masterfile system test"

Closes #4604

See merge request isc-projects/bind9!8787

2 years agoSplit the first masterfile test into 3
Mark Andrews [Tue, 27 Feb 2024 04:42:06 +0000 (15:42 +1100)] 
Split the first masterfile test into 3

Additionally read the correct zone for BIND 8 ttl checks

2 years agoMerge branch 'mnowak/dialup-watch-log-from-start' into 'main'
Michal Nowak [Mon, 26 Feb 2024 11:10:22 +0000 (11:10 +0000)] 
Merge branch 'mnowak/dialup-watch-log-from-start' into 'main'

Watch logs from start in dialup system test

See merge request isc-projects/bind9!8782

2 years agoWatch logs from start in dialup system test
Michal Nowak [Fri, 23 Feb 2024 13:51:23 +0000 (14:51 +0100)] 
Watch logs from start in dialup system test

When the first parametrized test takes a bit longer than usual, the zone
transfer in ns3 may succeed before the second parametrized test is even
started, and then watch_log_from_here() won't find the "Transfer status:
success" message in the named log. Using watch_log_from_start() instead
makes sure the test is more stable.

2 years agoMerge branch '4413-add-resinfo-261-type-to-named' into 'main'
Mark Andrews [Mon, 26 Feb 2024 02:16:42 +0000 (02:16 +0000)] 
Merge branch '4413-add-resinfo-261-type-to-named' into 'main'

Resolve "Add RESINFO (261) type to named"

Closes #4413

See merge request isc-projects/bind9!8464

2 years agoAdd CHANGES entry for [GL #4413]
Mark Andrews [Sat, 4 Nov 2023 10:41:37 +0000 (21:41 +1100)] 
Add CHANGES entry for [GL #4413]

2 years agoAdd RESINFO record type
Mark Andrews [Sat, 4 Nov 2023 10:41:37 +0000 (21:41 +1100)] 
Add RESINFO record type

This is a TXT clone using code point 261.

2 years agoMerge branch 'mnowak/pytest_rewrite_dsdigest' into 'main'
Michal Nowak [Fri, 23 Feb 2024 13:18:42 +0000 (13:18 +0000)] 
Merge branch 'mnowak/pytest_rewrite_dsdigest' into 'main'

Rewrite dsdigest system test to pytest

See merge request isc-projects/bind9!8770

2 years agoRewrite dsdigest system test to pytest
Michal Nowak [Thu, 22 Feb 2024 15:04:03 +0000 (16:04 +0100)] 
Rewrite dsdigest system test to pytest

2 years agoAdd isctest.check.servfail()
Michal Nowak [Thu, 22 Feb 2024 15:04:40 +0000 (16:04 +0100)] 
Add isctest.check.servfail()

2 years agoMerge branch '4595-fix-expire-lru-headers-race' into 'main'
Ondřej Surý [Fri, 23 Feb 2024 11:00:56 +0000 (11:00 +0000)] 
Merge branch '4595-fix-expire-lru-headers-race' into 'main'

Do not use header_prev in expire_lru_headers

Closes #4595

See merge request isc-projects/bind9!8773

2 years agoAdd CHANGES and release note for [GL #4495]
Mark Andrews [Fri, 23 Feb 2024 02:38:19 +0000 (13:38 +1100)] 
Add CHANGES and release note for [GL #4495]

2 years agoDo not use header_prev in expire_lru_headers
Mark Andrews [Thu, 22 Feb 2024 23:12:47 +0000 (10:12 +1100)] 
Do not use header_prev in expire_lru_headers

dns__cacherbt_expireheader can unlink / free header_prev underneath
it.  Use ISC_LIST_TAIL after calling dns__cacherbt_expireheader
instead to get the next pointer to be processed.

2 years agoMerge branch 'mnowak/pytest_rewrite_xferquota' into 'main'
Michal Nowak [Fri, 23 Feb 2024 10:48:38 +0000 (10:48 +0000)] 
Merge branch 'mnowak/pytest_rewrite_xferquota' into 'main'

Rewrite xferquota system test to pytest

See merge request isc-projects/bind9!8676

2 years agoRewrite xferquota system test to pytest
Michal Nowak [Tue, 30 Jan 2024 11:58:02 +0000 (12:58 +0100)] 
Rewrite xferquota system test to pytest

2 years agoAdd isctest.check.rrsets_equal function
Michal Nowak [Thu, 22 Feb 2024 15:20:30 +0000 (16:20 +0100)] 
Add isctest.check.rrsets_equal function

2 years agoAdd retry_with_timeout() utility function
Michal Nowak [Mon, 19 Feb 2024 17:06:53 +0000 (18:06 +0100)] 
Add retry_with_timeout() utility function

2 years agoAdd RegEx support to wait_for_line() and wait_for_lines()
Michal Nowak [Thu, 22 Feb 2024 15:17:15 +0000 (16:17 +0100)] 
Add RegEx support to wait_for_line() and wait_for_lines()

2 years agoMerge branch '4597-placeholder' into 'main'
Ondřej Surý [Fri, 23 Feb 2024 07:49:48 +0000 (07:49 +0000)] 
Merge branch '4597-placeholder' into 'main'

Add CHANGES placeholder for [GL #4597]

See merge request isc-projects/bind9!8772

2 years agoAdd CHANGES placeholder for [GL #4597]
Ondřej Surý [Fri, 23 Feb 2024 07:40:42 +0000 (08:40 +0100)] 
Add CHANGES placeholder for [GL #4597]

2 years agoMerge branch 'mnowak/pytest_rewrite_sortlist' into 'main'
Michal Nowak [Thu, 22 Feb 2024 17:39:02 +0000 (17:39 +0000)] 
Merge branch 'mnowak/pytest_rewrite_sortlist' into 'main'

Rewrite sortlist system test to pytest

See merge request isc-projects/bind9!8684

2 years agoMake pytest a bit more verbose
Michal Nowak [Wed, 21 Feb 2024 17:02:05 +0000 (18:02 +0100)] 
Make pytest a bit more verbose

The "-vv" option gives us full untruncated diffs of compared data
strustures.

2 years agoRewrite sortlist system test to pytest
Michal Nowak [Wed, 31 Jan 2024 18:14:25 +0000 (19:14 +0100)] 
Rewrite sortlist system test to pytest

2 years agoSupport "source" parameter in isctest.query.(tcp|udp)
Michal Nowak [Wed, 31 Jan 2024 18:11:16 +0000 (19:11 +0100)] 
Support "source" parameter in isctest.query.(tcp|udp)

2 years agoMerge branch 'artem-transferslowly-transferstuck-via-timers' into 'main'
Artem Boldariev [Wed, 21 Feb 2024 23:36:31 +0000 (23:36 +0000)] 
Merge branch 'artem-transferslowly-transferstuck-via-timers' into 'main'

Do not block workers when using -T transferslowly/transferstuck

Closes #4566

See merge request isc-projects/bind9!8751

2 years agoDo not lock workers when using -T transferslowly/transferstuck
Artem Boldariev [Mon, 19 Feb 2024 18:02:38 +0000 (20:02 +0200)] 
Do not lock workers when using -T transferslowly/transferstuck

This commit ensures that worker threads are not sleeping (by using
select()) when '-T transferslowly/transferstuck' test options are
used. This commit converts synchronous implementation of the code into
an asynchronous one based on timers.

2 years agoMerge branch '4572-do-not-crash-resolver-when-tlsctx-creation-failed' into 'main'
Artem Boldariev [Wed, 21 Feb 2024 20:41:26 +0000 (20:41 +0000)] 
Merge branch '4572-do-not-crash-resolver-when-tlsctx-creation-failed' into 'main'

DoT: do not crash resolver on TLS context creation failure

Closes #4572

See merge request isc-projects/bind9!8727

2 years agoUpdate CHANGES [GL #4572]
Artem Boldariev [Mon, 12 Feb 2024 20:58:46 +0000 (22:58 +0200)] 
Update CHANGES [GL #4572]

Mention that BIND should not abort anymore when trying to connect to a
remote server via TLS when using an incorrect 'tls' configuration.

2 years agoAdd a system test for #4572
Artem Boldariev [Tue, 13 Feb 2024 15:17:19 +0000 (17:17 +0200)] 
Add a system test for #4572

This commit adds a test which exactly reproduces the situation give by
the bug reporter.

2 years agoDoT: do not crash resolver on TLS context creation failure
Artem Boldariev [Mon, 12 Feb 2024 20:51:39 +0000 (22:51 +0200)] 
DoT: do not crash resolver on TLS context creation failure

The resolver's code was not ready to failures when trying to establish
a connection via TCP-based transports (e.g. when creating TLS contexts
before establishing a TLS connection).

This commit fixes that.

2 years agoMerge branch '4588-cid-486508-control-flow-issue' into 'main'
Arаm Sаrgsyаn [Wed, 21 Feb 2024 10:51:32 +0000 (10:51 +0000)] 
Merge branch '4588-cid-486508-control-flow-issue' into 'main'

Clean up fetch_answered

Closes #4588

See merge request isc-projects/bind9!8753

2 years agoClean up fetch_answered
Aram Sargsyan [Mon, 19 Feb 2024 16:15:07 +0000 (16:15 +0000)] 
Clean up fetch_answered

After the changes in [GL #4447] the 'fetch_answered' variable is
always false now. Delete the unnecessary code.

2 years agoMerge branch 'tkrizek/pytest-log' into 'main'
Tom Krizek [Fri, 16 Feb 2024 15:00:32 +0000 (15:00 +0000)] 
Merge branch 'tkrizek/pytest-log' into 'main'

Simplify pytest logging

See merge request isc-projects/bind9!8742

2 years agoDon't include temp testdir on each log line
Tom Krizek [Thu, 15 Feb 2024 13:55:56 +0000 (14:55 +0100)] 
Don't include temp testdir on each log line

This was mostly an artifact to tell which log lines belong to which test
from the time when the test output could be all mingled together. Now
this info is reduntant, because the pytest logger already includes both
the system test name, and the specific test.

2 years agoAdd utility logging functions to isctest.log
Tom Krizek [Thu, 15 Feb 2024 13:47:13 +0000 (14:47 +0100)] 
Add utility logging functions to isctest.log

Unify the different loggers (conftest, module, test) into a single
interface. Remove the need to select the proper logger by automatically
selecting the most-specific logger currently available.

This also removes the need to use the logger/mlogger fixtures manually
and pass these around. This was especially annoying and unwieldy when
splitting the test cases into functions, because logger had to always be
passed around. Instead, it is now possible to use the
isctest.log.(debug,info,warning,error) functions.

2 years agoMove watchlog module into isctest.log package
Tom Krizek [Thu, 15 Feb 2024 12:57:42 +0000 (13:57 +0100)] 
Move watchlog module into isctest.log package

Preparation for further logging improvements - keep the watchlog
contents in a separate module inside isctest.log. Export the names in
the log package so the imports don't change for the users of these
classes.

2 years agoRemove accidentally duplicated RNDCExecutor code
Tom Krizek [Tue, 13 Feb 2024 15:42:16 +0000 (16:42 +0100)] 
Remove accidentally duplicated RNDCExecutor code

This code has probably been accidentally added during some rebase. The
actual RNDCExecutor and related classes are in isctest/rndc.py. Remove
the duplicated and unused code from isctest/log.py, as it doesn't belong
there.

2 years agoMerge branch '4447-disallow-stale-answer-client-timeout-non-zero' into 'main'
Arаm Sаrgsyаn [Fri, 16 Feb 2024 09:35:13 +0000 (09:35 +0000)] 
Merge branch '4447-disallow-stale-answer-client-timeout-non-zero' into 'main'

Disallow stale-answer-client-timeout non-zero values

Closes #4447

See merge request isc-projects/bind9!8699

2 years agoAddress scan-build warnings
Aram Sargsyan [Wed, 7 Feb 2024 09:22:55 +0000 (09:22 +0000)] 
Address scan-build warnings

The warnings (see below) seem to be false-positives. Address them
by adding runtime checks.

    resolver.c:1627:10: warning: Access to field 'tid' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     1627 |         REQUIRE(fctx->tid == isc_tid());
          |                 ^~~~~~~~~
    ../../lib/isc/include/isc/util.h:332:34: note: expanded from macro 'REQUIRE'
      332 | #define REQUIRE(e)   ISC_REQUIRE(e)
          |                                  ^
    ../../lib/isc/include/isc/assertions.h:45:11: note: expanded from macro 'ISC_REQUIRE'
       45 |         ((void)((cond) ||                                                  \
          |                  ^~~~
    resolver.c:10335:6: warning: Access to field 'depth' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     10335 |         if (fctx->depth > depth) {
           |             ^~~~~~~~~~~
    2 warnings generated.

2 years agoAdd CHANGES and release notes for [GL #4447]
Aram Sargsyan [Tue, 6 Feb 2024 16:14:22 +0000 (16:14 +0000)] 
Add CHANGES and release notes for [GL #4447]

2 years agoDisallow stale-answer-client-timeout non-zero values
Aram Sargsyan [Wed, 31 Jan 2024 12:59:19 +0000 (12:59 +0000)] 
Disallow stale-answer-client-timeout non-zero values

Remove all the code and tests which support non-zero
stale-answer-client-timeout values, and adjust the
documentation.

2 years agoMerge branch 'each-rbtdb-dbiterator-fixes' into 'main'
Evan Hunt [Thu, 15 Feb 2024 18:52:47 +0000 (18:52 +0000)] 
Merge branch 'each-rbtdb-dbiterator-fixes' into 'main'

fix several bugs in the RBTDB dbiterator implementation

See merge request isc-projects/bind9!8741

2 years agoCHANGES for [GL !8741]
Evan Hunt [Wed, 14 Feb 2024 21:18:34 +0000 (13:18 -0800)] 
CHANGES for [GL !8741]

2 years agofix several bugs in the RBTDB dbiterator implementation
Evan Hunt [Wed, 14 Feb 2024 20:58:01 +0000 (12:58 -0800)] 
fix several bugs in the RBTDB dbiterator implementation

- the DNS_DB_NSEC3ONLY and DNS_DB_NONSEC3 flags are mutually
  exclusive; it never made sense to set both at the same time.
  to enforce this, it is now a fatal error to do so.  the
  dbiterator implementation has been cleaned up to remove
  code that treated the two as independent: if nonsec3 is
  true, we can be certain nsec3only is false, and vice versa.
- previously, iterating a database backwards omitted
  NSEC3 records even if DNS_DB_NONSEC3 had not been set. this
  has been corrected.
- when an iterator reaches the origin node of the NSEC3 tree, we
  need to skip over it and go to the next node in the sequence.
  the NSEC3 origin node is there for housekeeping purposes and
  never contains data.
- the dbiterator_test unit test has been expanded, several
  incorrect expectations have been fixed. (for example, the
  expected number of iterations has been reduced by one; we were
  previously counting the NSEC3 origin node and we should not
  have been doing so.)

2 years agoMerge branch 'each-zone-xfrin-race' into 'main'
Evan Hunt [Wed, 14 Feb 2024 21:50:25 +0000 (21:50 +0000)] 
Merge branch 'each-zone-xfrin-race' into 'main'

prevent a possible race in setting up zone->xfr

See merge request isc-projects/bind9!8716

2 years agoprevent a possible race in setting up zone->xfr
Evan Hunt [Fri, 9 Feb 2024 03:35:29 +0000 (19:35 -0800)] 
prevent a possible race in setting up zone->xfr

the call to dns_xfrin_create() wrote to zone->xfr with
the zone unlocked.

2 years agoMerge branch 'each-fix-missing-comparison' into 'main'
Evan Hunt [Wed, 14 Feb 2024 18:36:45 +0000 (18:36 +0000)] 
Merge branch 'each-fix-missing-comparison' into 'main'

test for SIGTYPE correctly

See merge request isc-projects/bind9!8733

2 years agotest for SIGTYPE correctly
Evan Hunt [Sun, 1 Oct 2023 08:06:49 +0000 (01:06 -0700)] 
test for SIGTYPE correctly

a comparison was incorrectly removed during a previous merge.

2 years agoMerge branch 'michal/post-release-tweaks' into 'main'
Michał Kępień [Wed, 14 Feb 2024 16:17:02 +0000 (16:17 +0000)] 
Merge branch 'michal/post-release-tweaks' into 'main'

Miscellaneous post-release tweaks

See merge request isc-projects/bind9!8738

2 years agoSwap CHANGES entries 6343 and 6344
Michał Kępień [Wed, 14 Feb 2024 13:49:49 +0000 (14:49 +0100)] 
Swap CHANGES entries 6343 and 6344

Fix a CHANGES entries numbering issue that was inadvertently introduced
when change 6344 was backported.  This makes the affected CHANGES
numbers consistent across all branches and releases again.

2 years agoRetroactively add release note for CVE-2023-50868
Michał Kępień [Wed, 14 Feb 2024 13:49:49 +0000 (14:49 +0100)] 
Retroactively add release note for CVE-2023-50868

A release note for CVE-2023-50868 was not included in BIND 9.19.21, even
though that vulnerability was already addressed in that release (by the
fix for CVE-2023-50387).  Retroactively add a relevant release note for
BIND 9.19.21.

2 years agoMention CVE-2023-50868 in CHANGES entry 6322
Michał Kępień [Wed, 14 Feb 2024 13:49:49 +0000 (14:49 +0100)] 
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.

2 years agoMerge tag 'v9.19.21'
Michał Kępień [Wed, 14 Feb 2024 12:24:56 +0000 (13:24 +0100)] 
Merge tag 'v9.19.21'

BIND 9.19.21

2 years agoMerge branch 'mnowak/accommodate-black-24.2.0' into 'main'
Michal Nowak [Wed, 14 Feb 2024 11:31:34 +0000 (11:31 +0000)] 
Merge branch 'mnowak/accommodate-black-24.2.0' into 'main'

Accommodate black 24.2.0

See merge request isc-projects/bind9!8729

2 years agoAccommodate black 24.2.0
Michal Nowak [Tue, 13 Feb 2024 15:48:31 +0000 (16:48 +0100)] 
Accommodate black 24.2.0

2 years agoMerge branch 'each-cleanup-dns_rbt' into 'main'
Evan Hunt [Wed, 14 Feb 2024 09:45:58 +0000 (09:45 +0000)] 
Merge branch 'each-cleanup-dns_rbt' into 'main'

clean up dns_rbt

See merge request isc-projects/bind9!8715

2 years agoclean up dns_rbt
Evan Hunt [Thu, 5 Oct 2023 01:14:55 +0000 (18:14 -0700)] 
clean up dns_rbt

- create_node() in rbt.c cannot fail
- the dns_rbt_*name() functions, which are wrappers around
  dns_rbt_[add|find|delete]node(), were never used except in tests.

this change isn't really necessary since RBT is likely to go away
eventually anyway. but keeping the API as simple as possible while it
persists is a good thing, and may reduce confusion while QPDB is being
developed from RBTDB code.

2 years agoMerge branch 'each-move-DNS_RBT_NSEC_-to-db.h' into 'main'
Evan Hunt [Wed, 14 Feb 2024 09:27:21 +0000 (09:27 +0000)] 
Merge branch 'each-move-DNS_RBT_NSEC_-to-db.h' into 'main'

move DNS_RBT_NSEC_* to db.h

See merge request isc-projects/bind9!8714

2 years agomove DNS_RBT_NSEC_* to db.h
Evan Hunt [Thu, 5 Oct 2023 00:49:51 +0000 (17:49 -0700)] 
move DNS_RBT_NSEC_* to db.h

these values pertain to whether a node is in the main, nsec, or nsec3
tree of an RBTDB. they need to be moved to a more generic location so
they can also be used by QPDB.

(this is in db.h rather than db_p.h because rbt.c needs access to it.
technically, that's a layer violation, but it's a long-existing one;
refactoring to get rid of it would be a large hassle, and eventually
we expect to remove rbt.c anyway.)

2 years agoMerge branch 'each-separate-generic-DB-helpers' into 'main'
Matthijs Mekking [Wed, 14 Feb 2024 08:46:05 +0000 (08:46 +0000)] 
Merge branch 'each-separate-generic-DB-helpers' into 'main'

separate generic DB helpers into db_p.h

See merge request isc-projects/bind9!8713