]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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

2 years agoAdd coccinelle rule to favor DNS_SIGTYPE
Matthijs Mekking [Tue, 13 Feb 2024 15:09:44 +0000 (16:09 +0100)] 
Add coccinelle rule to favor DNS_SIGTYPE

This should error if DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, type) is
used.

2 years agoseparate generic DB helpers into db_p.h
Evan Hunt [Sun, 1 Oct 2023 08:06:49 +0000 (01:06 -0700)] 
separate generic DB helpers into db_p.h

when the QPDB is implemented, we will need to have both qpdb_p.h and
rbtdb_p.h. in order to prevent name collisions or code duplication,
this commit adds a generic private header file, db_p.h, containing
structures and macros that will be used by both databases.

some functions and structs have been renamed to more specifically refer
to the RBT database, in order to avoid namespace collision with similar
things that will be needed by the QPDB later.

2 years agoMerge branch 'each-refactor-wildcard-matching' into 'main'
Evan Hunt [Tue, 13 Feb 2024 22:48:39 +0000 (22:48 +0000)] 
Merge branch 'each-refactor-wildcard-matching' into 'main'

Refactor wildcard matching

See merge request isc-projects/bind9!8712

2 years agorefactor wildcard matching
Evan Hunt [Mon, 6 Nov 2023 16:02:49 +0000 (17:02 +0100)] 
refactor wildcard matching

refactor the wildcard matching code to make it a bit easier to
understand, in hopes that it will reduce the difficulty of converting
from RBTDB to QPDB later.

there are also some minor optimizations: previously, after stepping
backward to find the predecessor, we stepped back foward *from* the
predecessor to find the successor.  we now reset the rbtnode chain to
its original starting point before stepping forward; this eliminates
some unnecessary processing. and, if neither predecessor nor successor
is found, we return early rather than carrying on with an unnecessary
effort to match labels.

2 years agoMerge branch '4571-findnsec3proofs-failed-to-disassociate-all-rdatasets-returned...
Mark Andrews [Tue, 13 Feb 2024 13:06:32 +0000 (13:06 +0000)] 
Merge branch '4571-findnsec3proofs-failed-to-disassociate-all-rdatasets-returned-by-dns_ncache_current' into 'main'

Resolve "findnsec3proofs failed to disassociate all rdatasets returned by dns_ncache_current"

Closes #4571

See merge request isc-projects/bind9!8725

2 years agoAdd CHANGES note for [GL #4571]
Mark Andrews [Mon, 12 Feb 2024 07:51:21 +0000 (18:51 +1100)] 
Add CHANGES note for [GL #4571]

2 years agoDissassociate rdatasets returned from dns_ncache_current
Mark Andrews [Mon, 15 Jan 2024 02:39:44 +0000 (13:39 +1100)] 
Dissassociate rdatasets returned from dns_ncache_current

lib/dns/validator.c:findnsec3proofs failed to disassociate the
temporary rdataset returned by dns_ncache_current on all paths.

2 years agoMerge branch '4569-cid-486326-memory-corruptions-overrun' into 'main'
Mark Andrews [Tue, 13 Feb 2024 00:07:42 +0000 (00:07 +0000)] 
Merge branch '4569-cid-486326-memory-corruptions-overrun' into 'main'

Resolve "** CID 486326:  Memory - corruptions  (OVERRUN)"

Closes #4569

See merge request isc-projects/bind9!8723

2 years agoAddress CID 486326: Memory - corruptions (OVERRUN)
Mark Andrews [Mon, 12 Feb 2024 03:54:36 +0000 (14:54 +1100)] 
Address CID 486326: Memory - corruptions (OVERRUN)

Coverity detected that address->type.sa was too small when copying
a struct sockaddr_sin6, use the alterative union element
address->type.sin6 instead.

2 years agoMerge branch '4570-cid-486327-control-flow-issues-unreachable' into 'main'
Mark Andrews [Mon, 12 Feb 2024 21:59:12 +0000 (21:59 +0000)] 
Merge branch '4570-cid-486327-control-flow-issues-unreachable' into 'main'

Resolve "CID 486327:  Control flow issues  (UNREACHABLE)"

Closes #4570

See merge request isc-projects/bind9!8724

2 years agoRemove duplicate unreachable code block
Mark Andrews [Mon, 12 Feb 2024 04:13:55 +0000 (15:13 +1100)] 
Remove duplicate unreachable code block

This was accidentially left in during the developement of !8299.

2 years agoMerge branch '4568-fix-isc_ht-case-insensitive-matching' into 'main'
Ondřej Surý [Sun, 11 Feb 2024 08:55:52 +0000 (08:55 +0000)] 
Merge branch '4568-fix-isc_ht-case-insensitive-matching' into 'main'

Fix case insensitive matching in isc_ht hash table implementation

Closes #4568

See merge request isc-projects/bind9!8718

2 years agoAdd CHANGES note for [GL #4568]
Ondřej Surý [Sat, 10 Feb 2024 23:59:30 +0000 (00:59 +0100)] 
Add CHANGES note for [GL #4568]

2 years agoAdd a system test for mixed-case data for the same owner
Ondřej Surý [Sun, 11 Feb 2024 08:13:43 +0000 (09:13 +0100)] 
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.

2 years agoFix case insensitive matching in isc_ht hash table implementation
Ondřej Surý [Sat, 10 Feb 2024 23:49:32 +0000 (00:49 +0100)] 
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.

2 years agoMerge branch 'each-placeholder' into 'main'
Evan Hunt [Sun, 11 Feb 2024 07:21:08 +0000 (07:21 +0000)] 
Merge branch 'each-placeholder' into 'main'

add placeholder to CHANGES [GL #4567]

See merge request isc-projects/bind9!8720

2 years agoadd placeholder to CHANGES [GL #4567]
Evan Hunt [Sun, 11 Feb 2024 07:19:57 +0000 (23:19 -0800)] 
add placeholder to CHANGES [GL #4567]

2 years agoMerge branch '4491-use-rcu-instead-of-rwlock-in-isc_log-unit' into 'main'
Aydın Mercan [Fri, 9 Feb 2024 10:56:22 +0000 (10:56 +0000)] 
Merge branch '4491-use-rcu-instead-of-rwlock-in-isc_log-unit' into 'main'

Convert rwlock in isc_log_t to RCU

Closes #4491

See merge request isc-projects/bind9!8593

2 years agoConvert rwlock in isc_log_t to RCU
Aydın Mercan [Tue, 19 Dec 2023 07:41:15 +0000 (10:41 +0300)] 
Convert rwlock in isc_log_t to RCU

The isc_log_t contains a isc_logconfig_t that is swapped, dereferenced
or accessed its fields through a mutex. Instead of protecting it with a
rwlock, use RCU.

2 years agoMerge branch 'ondrej/add-placeholder' into 'main'
Ondřej Surý [Fri, 9 Feb 2024 09:02:01 +0000 (09:02 +0000)] 
Merge branch 'ondrej/add-placeholder' into 'main'

Add placeholder to CHANGES

See merge request isc-projects/bind9!8717

2 years agoAdd placeholder to CHANGES
Ondřej Surý [Fri, 9 Feb 2024 09:01:33 +0000 (10:01 +0100)] 
Add placeholder to CHANGES

2 years agoMerge branch '4549-heap-use-after-free-lib-isccc-ccmsg-c-160-in-ccmsg_senddone' into...
Ondřej Surý [Thu, 8 Feb 2024 17:34:46 +0000 (17:34 +0000)] 
Merge branch '4549-heap-use-after-free-lib-isccc-ccmsg-c-160-in-ccmsg_senddone' into 'main'

Resolve "heap-use-after-free lib/isccc/ccmsg.c:160 in ccmsg_senddone"

Closes #4549

See merge request isc-projects/bind9!8692

2 years agoAdd CHANGES note for [GL #4549]
Mark Andrews [Mon, 5 Feb 2024 07:15:59 +0000 (18:15 +1100)] 
Add CHANGES note for [GL #4549]

2 years agoFix UAF in ccmsg.c when reading stopped before sending
Ondřej Surý [Thu, 8 Feb 2024 11:31:09 +0000 (12:31 +0100)] 
Fix UAF in ccmsg.c when reading stopped before sending

When shutting down the whole server, the reading could stop and detach
from controlconnection before sending is done.  If send callback then
detaches from the last controlconnection handle, the ccmsg would be
invalidated after the send callback and thus we must not access ccmsg
after calling the send_cb().

2 years agoAdd isc_nm_read_stop() and remove .reading member from ccmsg
Ondřej Surý [Thu, 8 Feb 2024 11:31:09 +0000 (12:31 +0100)] 
Add isc_nm_read_stop() and remove .reading member from ccmsg

We need to stop reading when calling isc_ccmsg_disconnect() as the
reading handle doesn't have to be last because sending might be in
progress.  After that, we can safely remove .reading member because the
reading would not be called after the disconnect has been called.

The ccmsg_senddone() should also not call the recv callback if the
sending failed, that's the job of the caller's send callback - in fact
it already does that, so the code in ccmsg_senddone() was superfluous.

2 years agoRefactor the normal vs error path in control_senddone()
Ondřej Surý [Thu, 8 Feb 2024 11:31:09 +0000 (12:31 +0100)] 
Refactor the normal vs error path in control_senddone()

The code flow in control_senddone() was modified to be simpler to follow
and superfluous INSIST() was zapped from control_recvmessage().

2 years agoMerge branch 'ondrej/reduce-netmgr-memory-usage' into 'main'
Ondřej Surý [Thu, 8 Feb 2024 14:45:25 +0000 (14:45 +0000)] 
Merge branch 'ondrej/reduce-netmgr-memory-usage' into 'main'

Reduce memory sizes of common structures

See merge request isc-projects/bind9!8299

2 years agoAdd memory pools for isc_nmsocket_t structures
Ondřej Surý [Tue, 12 Sep 2023 17:13:45 +0000 (19:13 +0200)] 
Add memory pools for isc_nmsocket_t structures

To reduce memory pressure, we can add light per-loop (netmgr worker)
memory pools for isc_nmsocket_t structures.  This will help in
situations where there's a lot of churn creating and destroying the
nmsockets.

2 years agoReduce the isc_nmsocket_t size from 1840 to 1208 bytes
Ondřej Surý [Tue, 12 Sep 2023 07:32:30 +0000 (09:32 +0200)] 
Reduce the isc_nmsocket_t size from 1840 to 1208 bytes

Embedding isc_nmsocket_h2_t directly inside isc_nmsocket_t had increased
the size of isc_nmsocket_t to 1840 bytes.  Making the isc_nmsocket_h2_t
to be a pointer to the structure and allocated on demand allows us to
reduce the size to 1208 bytes.  While there are still some possible
reductions in the isc_nmsocket_t (embedded tlsstream, streamdns
structures), this was the far biggest drop in the memory usage.

2 years agoReduce struct isc__nm_uvreq size from 1560 to 560 bytes
Ondřej Surý [Tue, 12 Sep 2023 07:10:41 +0000 (09:10 +0200)] 
Reduce struct isc__nm_uvreq size from 1560 to 560 bytes

The uv_req union member of struct isc__nm_uvreq contained libuv request
types that we don't use.  Turns out that uv_getnameinfo_t is 1000 bytes
big and unnecessarily enlarged the whole structure.  Remove all the
unused members from the uv_req union.

2 years agoReduce sizeof isc_sockaddr from 152 to 48 bytes
Ondřej Surý [Tue, 12 Sep 2023 07:21:53 +0000 (09:21 +0200)] 
Reduce sizeof isc_sockaddr from 152 to 48 bytes

After removing sockaddr_unix from isc_sockaddr, we can also remove
sockaddr_storage and reduce the isc_sockaddr size from 152 bytes to just
48 bytes needed to hold IPv6 addresses.

2 years agoMerge branch '4560-pytest-junit-xml-compat' into 'main'
Tom Krizek [Thu, 8 Feb 2024 13:57:07 +0000 (13:57 +0000)] 
Merge branch '4560-pytest-junit-xml-compat' into 'main'

Support older junit XML format in test result processing

Closes #4560

See merge request isc-projects/bind9!8696

2 years agoAdd CHANGES note for [GL #4560]
Tom Krizek [Tue, 6 Feb 2024 09:34:41 +0000 (10:34 +0100)] 
Add CHANGES note for [GL #4560]

2 years agoSupport older junit XML format in test result processing
Tom Krizek [Tue, 6 Feb 2024 09:21:45 +0000 (10:21 +0100)] 
Support older junit XML format in test result processing

When running `make check` on a platform which has older (but still
supported) pytest, e.g. 3.4.2 on EL8, the junit to trs conversion would
fail because the junit format has different structure. Make the junit
XML processing more lenient to support both the older and newer junit
XML formats.

2 years agoMerge branch '4562-use-source-port-for-ditch-pl' into 'main'
Tom Krizek [Thu, 8 Feb 2024 12:42:23 +0000 (12:42 +0000)] 
Merge branch '4562-use-source-port-for-ditch-pl' into 'main'

Use a single local port for ditch.pl

Closes #4562

See merge request isc-projects/bind9!8698

2 years agoUse a single local port for ditch.pl
Tom Krizek [Tue, 6 Feb 2024 14:35:49 +0000 (15:35 +0100)] 
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.