]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoFix the placement of printing dig output comments in doth system test
Aram Sargsyan [Tue, 7 Mar 2023 14:08:52 +0000 (14:08 +0000)] 
Fix the placement of printing dig output comments in doth system test

There can be comments in dig output for a zone transfer only in case
of an error, so we should print those errors not when wait_for_tls_xfer
succeeds, but when it fails.

Also, there is no point in printing those comments when a failure was
indeed expected.

3 years agoFail early in doth system test when the expected failure doesn't happen
Aram Sargsyan [Tue, 7 Mar 2023 14:03:35 +0000 (14:03 +0000)] 
Fail early in doth system test when the expected failure doesn't happen

If wait_for_tls_xfer succeeds, while a failure was being expected,
set ret=1 to fail without further checking if the zone file exists.

3 years agoMerge branch 'mnowak/stress-test-build-with-default-CFLAGS' into 'main'
Michal Nowak [Thu, 9 Mar 2023 09:58:05 +0000 (09:58 +0000)] 
Merge branch 'mnowak/stress-test-build-with-default-CFLAGS' into 'main'

Build BIND in stress test jobs with common CFLAGS

See merge request isc-projects/bind9!7627

3 years agoBuild BIND in stress test jobs with common CFLAGS
Michal Nowak [Tue, 28 Feb 2023 16:49:43 +0000 (17:49 +0100)] 
Build BIND in stress test jobs with common CFLAGS

By omission, BIND was not built with common CFLAGS in the stress test
jobs. Building with common CFLAGS and -Og should help GDB produce a
backtrace with more information.

3 years agoMerge branch '3929-gcc-12-static-analyzer-use-of-uninitialized-value-ctx-val-1-in...
Mark Andrews [Wed, 8 Mar 2023 23:01:12 +0000 (23:01 +0000)] 
Merge branch '3929-gcc-12-static-analyzer-use-of-uninitialized-value-ctx-val-1-in-base32-c' into 'main'

Resolve "GCC 12 static analyzer: use of uninitialized value '*ctx.val[1]' in base32.c"

Closes #3929

See merge request isc-projects/bind9!7655

3 years agoSilence uninitialized value false positives
Mark Andrews [Wed, 8 Mar 2023 04:16:44 +0000 (15:16 +1100)] 
Silence uninitialized value false positives

In base32_decode_char the GCC 12 static analyser fails to determine
that ctx->val[1], ctx->val[3], ctx->val[4] and ctx->val[6] are
assigned values by the previous call to base32_decode_char.  Initialise
ctx->val to zeros when initalising the rest of ctx to silence the
false positive.

3 years agoMerge branch '3932-gcc-12-static-analyzer-warning-use-of-null-_frm-where-non-null...
Mark Andrews [Wed, 8 Mar 2023 22:36:19 +0000 (22:36 +0000)] 
Merge branch '3932-gcc-12-static-analyzer-warning-use-of-null-_frm-where-non-null-expected-in-cc-c' into 'main'

Resolve "GCC 12 static analyzer: warning: use of NULL '_frm' where non-null expected in cc.c"

Closes #3932

See merge request isc-projects/bind9!7658

3 years agoSilence GCC 12 NULL pointer dereference warnings
Mark Andrews [Wed, 8 Mar 2023 05:53:37 +0000 (16:53 +1100)] 
Silence GCC 12 NULL pointer dereference warnings

When isccc_cc_lookupstring returns ISC_R_SUCCESS the returned pointer
is non NULL.  Add INSISTS do that GCC 12 can determine this.

3 years agoMerge branch '3931-gcc-12-static-analyzer-warning-use-of-uninitialized-value-svcb...
Mark Andrews [Wed, 8 Mar 2023 22:07:46 +0000 (22:07 +0000)] 
Merge branch '3931-gcc-12-static-analyzer-warning-use-of-uninitialized-value-svcb-svclen-in-rdata-c' into 'main'

Resolve "GCC 12 static analyzer: warning: use of uninitialized value 'svcb.svclen' in rdata.c"

Closes #3931

See merge request isc-projects/bind9!7657

3 years agoAdd additional contraints to dns_rdata_checksvcb
Mark Andrews [Wed, 8 Mar 2023 05:38:11 +0000 (16:38 +1100)] 
Add additional contraints to dns_rdata_checksvcb

REQUIRE that rdata->type is dns_rdatatype_svcb to detect when
dns_rdata_checksvcb is called with the wrong rdata type.  There are
no code paths that currently pass the wrong rdata to dns_rdata_checksvcb.

This was found by GCC 12 static analysis.

3 years agoMerge branch '3925-serve-stale-system-test-failure' into 'main'
Matthijs Mekking [Wed, 8 Mar 2023 16:34:46 +0000 (16:34 +0000)] 
Merge branch '3925-serve-stale-system-test-failure' into 'main'

Lower chance of intermittent serve-stale system test failure

Closes #3925

See merge request isc-projects/bind9!7659

3 years agoUpdate serve-stale system test
Matthijs Mekking [Wed, 8 Mar 2023 08:11:19 +0000 (09:11 +0100)] 
Update serve-stale system test

The serve-stale system test was intermittently failing due to a timing
issue:

    I:serve-stale:check stale data.example TXT was refreshed...
    I:serve-stale:failed

The RRset is refreshed, however, it first checks for an expected log
line, prior checking that the stale data.example TXT was refreshed
(using dig). This log line is there to ensure the record is actually
refreshed before we start querying again. Alternatively we could just
retry_quiet 10 <wait for dig output matches expectations>. It would
lower the chances for intermittent test failures, since there is no
longer a "check for log line, sleep one second if check fails, check
for log line, ...", prior to the check.

3 years agoMerge branch 'tt-openssl-dh-refactoring' into 'main'
Ondřej Surý [Wed, 8 Mar 2023 15:13:20 +0000 (15:13 +0000)] 
Merge branch 'tt-openssl-dh-refactoring' into 'main'

Refactor OpenSSL EDDSA code

See merge request isc-projects/bind9!7429

3 years agoConvert OpenSSL EDDSA glue to pkeypair
Timo Teräs [Sat, 28 Jan 2023 19:14:39 +0000 (21:14 +0200)] 
Convert OpenSSL EDDSA glue to pkeypair

Finish the OpenSSL EDSSA glue refactoring to use pkeypair - this is the
same change that has been already applied to RSA and ECDSA glues.

3 years agoOpenSSL EDDSA introduce and use openssleddsa_alg_info()
Timo Teräs [Sat, 28 Jan 2023 10:53:14 +0000 (12:53 +0200)] 
OpenSSL EDDSA introduce and use openssleddsa_alg_info()

Move the common code into a helper function that returns the EDDSA
parameters (pkey type, nid, keysize, sigsize).

3 years agoRemove redundant NULL checks in OpenSSL RSA glue
Timo Teräs [Thu, 26 Jan 2023 14:21:00 +0000 (16:21 +0200)] 
Remove redundant NULL checks in OpenSSL RSA glue

The OpenSSL free functions are no-op when called with NULL argument,
thus remove the extra checks around *_free() calls in the OpenSSL RSA
glue.

3 years agoIntroduce dst__openssl_keypair_{compare,isprivate,destroy}
Timo Teräs [Thu, 26 Jan 2023 14:11:07 +0000 (16:11 +0200)] 
Introduce dst__openssl_keypair_{compare,isprivate,destroy}

Rename and simplify dst__openssl_compare_keypair() to
dst__openssl_keypair_compare(), and introduce two additional functions
dst__openssl_keypair_isprivate and dst__openssl_keypair_destroy.

Use those to de-duplicated openssl{rsa,ecdsa}_isprivate, and
openssl{rsa,ecdsa}_destroy.

3 years agoMerge branch 'fanf-libbind9-remnants' into 'main'
Tony Finch [Wed, 8 Mar 2023 12:04:35 +0000 (12:04 +0000)] 
Merge branch 'fanf-libbind9-remnants' into 'main'

Remove some lingering references to libbind9

See merge request isc-projects/bind9!7660

3 years agoRemove some lingering references to libbind9
Tony Finch [Wed, 8 Mar 2023 10:06:22 +0000 (10:06 +0000)] 
Remove some lingering references to libbind9

Clean up the `.clang-format` #include priority list and
the `\file` declaration in `isc/getaddresses.h`.

3 years agoMerge branch '3905-remove-TKEY-Diffie-Hellman-exchange' into 'main'
Ondřej Surý [Wed, 8 Mar 2023 07:57:52 +0000 (07:57 +0000)] 
Merge branch '3905-remove-TKEY-Diffie-Hellman-exchange' into 'main'

Remove TKEY Mode 2 (Diffie-Hellman)

Closes #3905

See merge request isc-projects/bind9!7626

3 years agoAdd CHANGES and release note for [GL #3905]
Ondřej Surý [Tue, 28 Feb 2023 15:26:31 +0000 (16:26 +0100)] 
Add CHANGES and release note for [GL #3905]

3 years agofurther cleanup after removing diffie-hellman TKEY mode
Evan Hunt [Tue, 28 Feb 2023 23:28:29 +0000 (15:28 -0800)] 
further cleanup after removing diffie-hellman TKEY mode

without diffie-hellman TKEY negotiation, some other code is
now effectively dead or unnecessary, and can be cleaned up:

- the rndc tsig-list and tsig-delete commands.
- a nonoperational command-line option to dnssec-keygen that
  was documented as being specific to DH.
- the section of the ARM that discussed TKEY/DH.
- the functions dns_tkey_builddeletequery(), processdeleteresponse(),
  and tkey_processgssresponse(), which are unused.

3 years agoRemove TKEY Mode 2 (Diffie-Hellman)
Ondřej Surý [Tue, 28 Feb 2023 15:05:34 +0000 (16:05 +0100)] 
Remove TKEY Mode 2 (Diffie-Hellman)

Completely remove the TKEY Mode 2 (Diffie-Hellman Exchanged Keying) from
BIND 9 (from named, named.conf and all the tools).  The TKEY usage is
fringe at best and in all known cases, GSSAPI is being used as it should.

The draft-eastlake-dnsop-rfc2930bis-tkey specifies that:

    4.2 Diffie-Hellman Exchanged Keying (Deprecated)

       The use of this mode (#2) is NOT RECOMMENDED for the following two
       reasons but the specification is still included in Appendix A in case
       an implementation is needed for compatibility with old TKEY
       implementations. See Section 4.6 on ECDH Exchanged Keying.

          The mixing function used does not meet current cryptographic
          standards because it uses MD5 [RFC6151].

          RSA keys must be excessively long to achieve levels of security
          required by current standards.

We might optionally implement Elliptic Curve Diffie-Hellman (ECDH) key
exchange mode 6 if the draft ever reaches the RFC status.  Meanwhile the
insecure DH mode needs to be removed.

3 years agoMerge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.19.12' into 'main'
Tom Krizek [Tue, 7 Mar 2023 16:35:33 +0000 (16:35 +0000)] 
Merge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.19.12' into 'main'

Set up version and release notes for BIND 9.19.12

See merge request isc-projects/bind9!7650

3 years agoSet up release notes for BIND 9.19.12
Tom Krizek [Tue, 7 Mar 2023 13:10:26 +0000 (14:10 +0100)] 
Set up release notes for BIND 9.19.12

3 years agoUpdate BIND version to 9.19.12-dev
Tom Krizek [Tue, 7 Mar 2023 13:09:54 +0000 (14:09 +0100)] 
Update BIND version to 9.19.12-dev

3 years agoUpdate BIND version for release v9.19.11
Tom Krizek [Fri, 3 Mar 2023 14:10:56 +0000 (15:10 +0100)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Tom Krizek [Fri, 3 Mar 2023 14:10:10 +0000 (15:10 +0100)] 
Add a CHANGES marker

3 years agoMerge branch 'tkrizek/prepare-documentation-for-bind-9.19.11' into 'v9_19_11-release'
Tom Krizek [Fri, 3 Mar 2023 14:05:21 +0000 (14:05 +0000)] 
Merge branch 'tkrizek/prepare-documentation-for-bind-9.19.11' into 'v9_19_11-release'

Prepare documentation for BIND 9.19.11

See merge request isc-private/bind9!500

3 years agoAdd release note for GL #3673
Tom Krizek [Thu, 2 Mar 2023 09:43:07 +0000 (10:43 +0100)] 
Add release note for GL #3673

3 years agoReorder release notes
Tom Krizek [Thu, 2 Mar 2023 09:41:54 +0000 (10:41 +0100)] 
Reorder release notes

3 years agoTweak and reword release notes
Tom Krizek [Thu, 2 Mar 2023 09:23:12 +0000 (10:23 +0100)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.11
Tom Krizek [Thu, 2 Mar 2023 09:19:08 +0000 (10:19 +0100)] 
Prepare release notes for BIND 9.19.11

3 years agoAdd release metadata update to release checklist
Tom Krizek [Thu, 2 Mar 2023 12:02:48 +0000 (13:02 +0100)] 
Add release metadata update to release checklist

The release engineering automation we have relies on up-to-date
information about our upcoming release plans. Ensure these are updated
at the end of each release cycle.

3 years agoMove "disallow merging to maintained branches" closer to tagging
Michal Nowak [Thu, 2 Mar 2023 10:42:45 +0000 (11:42 +0100)] 
Move "disallow merging to maintained branches" closer to tagging

Updating GitLab settings for all maintained branches to disallow merging
to them has an unfortunate consequence: daily scheduled pipelines won't
be executed anymore. This is a problem because we need the pipelines to
ensure no new bugs were introduced just before a code freeze.

The "Announce (on Mattermost) that the code freeze is in effect" item is
still in place but is now more of a social "disallow merging to
maintained branches".

3 years agoMerge branch '3917-named-should-log-uv-version-when-starting-up' into 'main'
Tom Krizek [Fri, 3 Mar 2023 08:30:14 +0000 (08:30 +0000)] 
Merge branch '3917-named-should-log-uv-version-when-starting-up' into 'main'

Resolve "Named should log UV version when starting up"

Closes #3917

See merge request isc-projects/bind9!7642

3 years agoNow logs UV versions when starting up
Mark Andrews [Fri, 3 Mar 2023 03:04:34 +0000 (14:04 +1100)] 
Now logs UV versions when starting up

Named now logs both compile time and run time UV versions when
starting up.  This is useful information to have when debugging
network issues involving named.

3 years agoMerge branch '3907-data-race-in-rbtdb' into 'main'
Arаm Sаrgsyаn [Thu, 2 Mar 2023 18:36:01 +0000 (18:36 +0000)] 
Merge branch '3907-data-race-in-rbtdb' into 'main'

Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1365 in newversion"

Closes #3907

See merge request isc-projects/bind9!7637

3 years agoCheck if catz is active in dns__catz_update_cb()
Aram Sargsyan [Thu, 2 Mar 2023 13:32:21 +0000 (13:32 +0000)] 
Check if catz is active in dns__catz_update_cb()

A reconfiguration can deactivate the catalog zone, while the
offloaded update process was preparing to run.

3 years agoCheck if catz is active in dns__catz_timer_cb()
Aram Sargsyan [Thu, 2 Mar 2023 13:19:53 +0000 (13:19 +0000)] 
Check if catz is active in dns__catz_timer_cb()

A reconfiguration can deactivate the catalog zone, while the
update process was deferred using a timer.

3 years agoUse catzs->lock in dns_catz_prereconfig()
Aram Sargsyan [Thu, 2 Mar 2023 13:19:09 +0000 (13:19 +0000)] 
Use catzs->lock in dns_catz_prereconfig()

There can be an update running in another thread, so use a lock,
like it's done in dns_catz_postreconfig().

3 years agoAdd a CHANGES note for [GL #3907]
Aram Sargsyan [Thu, 2 Mar 2023 09:43:01 +0000 (09:43 +0000)] 
Add a CHANGES note for [GL #3907]

3 years agocatz: protect db_registered and db callback (un)registration with a lock
Aram Sargsyan [Thu, 2 Mar 2023 10:18:11 +0000 (10:18 +0000)] 
catz: protect db_registered and db callback (un)registration with a lock

Doing this to avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions.

3 years agocatz: use two pairs of dns_db_t and dns_dbversion_t in a catalog zone
Aram Sargsyan [Thu, 2 Mar 2023 08:52:25 +0000 (08:52 +0000)] 
catz: use two pairs of dns_db_t and dns_dbversion_t in a catalog zone

As it is done in the RPZ module, use 'db' and 'dbversion' for the
database we are going to update to, and 'updb' and 'updbversion' for
the database we are working on.

Doing this should avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions.

3 years agoUpdate the CHANGES note for [GL #3777]
Aram Sargsyan [Thu, 2 Mar 2023 09:39:32 +0000 (09:39 +0000)] 
Update the CHANGES note for [GL #3777]

Remove the part which is no longer true after reverting the commit
in question.

The CHANGES entry was never part of a released BIND 9 version.

3 years agoRevert "Process db callbacks in zone_loaddone() after zone_postload()"
Aram Sargsyan [Wed, 1 Mar 2023 17:26:41 +0000 (17:26 +0000)] 
Revert "Process db callbacks in zone_loaddone() after zone_postload()"

This reverts commit ed268b46f11706bde3da68bd2a4b45752350f736.

The commit introduced a data race, because dns_db_endload() is called
after unfreezing the zone.

3 years agoMerge branch 'aram/catz-add-lock-for-dns_catz_zone_t' into 'main'
Arаm Sаrgsyаn [Wed, 1 Mar 2023 16:59:37 +0000 (16:59 +0000)] 
Merge branch 'aram/catz-add-lock-for-dns_catz_zone_t' into 'main'

Add a lock for dns_catz_zone_t

See merge request isc-projects/bind9!7633

3 years agoAdd a lock for dns_catz_zone_t
Aram Sargsyan [Wed, 1 Mar 2023 14:41:59 +0000 (14:41 +0000)] 
Add a lock for dns_catz_zone_t

Use a lock for the catalog zones during dns__catz_zones_merge() to
avoid races between 'catz' and 'parentcatz'.

3 years agoMerge branch '3911-reconfig-zone-view-revert-bugfix' into 'main'
Arаm Sаrgsyаn [Wed, 1 Mar 2023 15:35:27 +0000 (15:35 +0000)] 
Merge branch '3911-reconfig-zone-view-revert-bugfix' into 'main'

Fix view's zones reverting bug during reconfiguration

Closes #3911

See merge request isc-projects/bind9!7632

3 years agoAdd CHANGES and release notes for [GL #3911]
Aram Sargsyan [Wed, 1 Mar 2023 13:45:03 +0000 (13:45 +0000)] 
Add CHANGES and release notes for [GL #3911]

3 years agoFix view's zones reverting bug during reconfiguration
Aram Sargsyan [Wed, 1 Mar 2023 12:30:46 +0000 (12:30 +0000)] 
Fix view's zones reverting bug during reconfiguration

During reconfiguration, the configure_view() function reverts the
configured zones to the previous view in case if there is an error.

It uses the 'zones_configured' boolean variable to decide whether
it is required to revert the zones, i.e. the error happened after
all the zones were successfully configured.

The problem is that it does not account for the case when an error
happens during the configuration of one of the zones (not the first),
in which case there are zones that are already configured for the
new view (and they need to be reverted), and there are zones that
are not (starting from the failed one).

Since 'zones_configured' remains 'false', the configured zones are
not reverted.

Replace the 'zones_configured' variable with a pointer to the latest
successfully configured zone configuration element, and when reverting,
revert up to and including that zone.

3 years agoAdd a catz system test check for [GL #3911]
Aram Sargsyan [Wed, 1 Mar 2023 12:47:25 +0000 (12:47 +0000)] 
Add a catz system test check for [GL #3911]

The trick is to configure a duplicate zone, which comes after the
catalog zone, where the duplicate zone is an existing member zone.

In that scenario, all the zones which come before the "faulty" zone
in the configuration file will fail to be reverted to the previous
version of the view after a reconfiguration error, and in this
particular case that will result in an assertion failure when the
catalog zone update is initiated, because it will be still tied to
the new version of the view, which was dismissed.

3 years agoMerge branch '3894-emit-coverage-summary-for-the-coverage-badge' into 'main'
Mark Andrews [Tue, 28 Feb 2023 22:43:14 +0000 (22:43 +0000)] 
Merge branch '3894-emit-coverage-summary-for-the-coverage-badge' into 'main'

Resolve "Emit coverage summary for the coverage badge"

Closes #3894

See merge request isc-projects/bind9!7587

3 years agoExtract test coverage statistics from the gcov job
Mark Andrews [Thu, 23 Feb 2023 22:39:34 +0000 (09:39 +1100)] 
Extract test coverage statistics from the gcov job

In older GitLab versions, the regular expression used for extracting
test coverage statistics from the output of GitLab CI jobs was
configured in the project's settings, using GitLab's web interface.
That changed in recent GitLab versions [1]; the previous configuration
method was removed from the web interface altogether as of GitLab 15.0.
The relevant regular expression is now supposed to be set in the
relevant job's definition in .gitlab-ci.yml.

Set the regular expression used for extracting test coverage
statistics in the definition of the "gcov" GitLab CI job.  Use the
regular expression suggested in GitLab's documentation [2].

[1] https://docs.gitlab.com/ee/update/deprecations.html#test-coverage-project-cicd-setting
[2] https://docs.gitlab.com/ee/ci/pipelines/settings.html#test-coverage-examples

3 years agoMerge branch '3898-shutdown-then-detach' into 'main'
Ondřej Surý [Tue, 28 Feb 2023 15:32:40 +0000 (15:32 +0000)] 
Merge branch '3898-shutdown-then-detach' into 'main'

Decouple view->resolver and friends shutdown and detach

Closes #3898

See merge request isc-projects/bind9!7623

3 years agoDecouple view->resolver and friends shutdown and detach
Ondřej Surý [Tue, 28 Feb 2023 13:14:06 +0000 (14:14 +0100)] 
Decouple view->resolver and friends shutdown and detach

In !7538, the shutdown procedure was simplified, but the ordering was
wrong, we need to shutdown the resolver, adb and requestmgr before
detaching those objects from the view, because there are cross
dependencies between at least the resolver and the adb.

Execute the shutdown(s) first, only when all three shutdowns have been
executed, detach those objects from the view.

3 years agoRemove unused .loop member from dns_view
Ondřej Surý [Tue, 28 Feb 2023 13:25:39 +0000 (14:25 +0100)] 
Remove unused .loop member from dns_view

After the last round of refactoring, the .loop member of dns_view
structure was unused, remove it.

3 years agoMerge branch 'aram/catz-refactor-renaming-leftovers-finish' into 'main'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 15:19:05 +0000 (15:19 +0000)] 
Merge branch 'aram/catz-refactor-renaming-leftovers-finish' into 'main'

Finish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming

See merge request isc-projects/bind9!7611

3 years agoFinish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming
Aram Sargsyan [Mon, 27 Feb 2023 19:45:09 +0000 (19:45 +0000)] 
Finish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming

There are leftovers from the previous refactoring effort, which left
some function declarations and comments in the header file unchanged.

Finish the renaming.

3 years agoMerge branch 'aram/catz-remove-redundant-declaration' into 'main'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 14:42:45 +0000 (14:42 +0000)] 
Merge branch 'aram/catz-remove-redundant-declaration' into 'main'

Remove a redundant ISC_REFCOUNT_DECL in catz.h

See merge request isc-projects/bind9!7612

3 years agoRemove a redundant ISC_REFCOUNT_DECL in catz.h
Aram Sargsyan [Mon, 27 Feb 2023 19:48:53 +0000 (19:48 +0000)] 
Remove a redundant ISC_REFCOUNT_DECL in catz.h

The 'ISC_REFCOUNT_DECL(dns_catz_zone)' declaration was provided twice.

3 years agoMerge branch 'michal/add-a-dnsrps-enabled-build-to-regular-ci-pipelines' into 'main'
Michał Kępień [Tue, 28 Feb 2023 11:56:27 +0000 (11:56 +0000)] 
Merge branch 'michal/add-a-dnsrps-enabled-build-to-regular-ci-pipelines' into 'main'

Add a DNSRPS-enabled build to regular CI pipelines

See merge request isc-projects/bind9!7601

3 years agoAdd a DNSRPS-enabled build to regular CI pipelines
Michał Kępień [Tue, 28 Feb 2023 11:54:02 +0000 (12:54 +0100)] 
Add a DNSRPS-enabled build to regular CI pipelines

DNSRPS-enabled builds have recently been silently broken a few times due
to that feature not being tested in regular CI pipelines.  Add the
--enable-dnsrps --enable-dnsrps-dl switches to the ./configure
invocation in one of the CI jobs run for all merge requests so that
DNSRPS-related build issues can be detected in advance.

It is important to note that this change by itself does NOT enable
actual testing of the DNSRPS feature as doing that requires a DNSRPS
provider library to be present on the test host.

3 years ago(Mostly) fix building bin/tests/system/rpz/dnsrps
Michał Kępień [Tue, 28 Feb 2023 11:54:02 +0000 (12:54 +0100)] 
(Mostly) fix building bin/tests/system/rpz/dnsrps

Building the bin/tests/system/rpz/dnsrps helper binary is currently not
possible at all as the necessary compiler and linker flag definitions
are missing from bin/tests/system/Makefile.am.  Add these as a basis for
addressing the problem.

Unfortunately, this is where the "mostly" bit mentioned in this commit's
subject line comes into play.  The dlopen() parts of DNSRPS code have
not yet been reworked to use libuv's dlopen() API (uv_dlopen() etc.)
(See commit 37b9511ce1dd9ba66a6620c5ff617016eb81188f for prior work in
this area.)  While it is certainly possible to do that, implementing
such a change without testing it in practice against a usable librpz.so
(i.e. a DNSRPS provider library) is bound to cause more trouble and
confusion than keeping the code the way it is right now.  However,
making that code buildable as-is requires linking against a C standard
library that exports the dlopen(), dlsym(), and dlclose() symbols used
by the DNSRPS dynamic loading code.  glibc 2.34+ satisfies that
requirement, but older glibc versions do not (these come with a separate
libdl shared library that would need to be linked in as well).  (Other
C standard library implementations have not been examined.)  Since the
long-term plan is to rely on libuv's dlopen() API exclusively and
detecting the shared object containing dlopen() & friends would only
pull in build system complexity for no good reason, assume for now that
the target system provides the dlopen() API in its C standard library.

This change enables the system test suite to be run for a BIND 9 build
prepared using --enable-dnsrps --enable-dnsrps-dl (on systems satisfying
the requirement explained above).  However, it is important to note that
this change by itself does NOT enable actual testing of the DNSRPS
feature as doing that requires a DNSRPS provider library to be present
on the test host.

3 years agoMerge branch 'ondrej/implement-dns_rbtnode_t-reference-tracing' into 'main'
Ondřej Surý [Tue, 28 Feb 2023 10:45:01 +0000 (10:45 +0000)] 
Merge branch 'ondrej/implement-dns_rbtnode_t-reference-tracing' into 'main'

Implement dns_db node tracing

See merge request isc-projects/bind9!7313

3 years agoImplement dns_db node tracing
Ondřej Surý [Thu, 5 Jan 2023 08:12:35 +0000 (09:12 +0100)] 
Implement dns_db node tracing

This implements node reference tracing that passes all the internal
layers from dns_db API (and friends) to increment_reference() and
decrement_reference().

It can be enabled by #defining DNS_DB_NODETRACE in <dns/trace.h> header.

The output then looks like this:

    incr:node:check_address_records:rootns.c:409:0x7f67f5a55a40->references = 1
    decr:node:check_address_records:rootns.c:449:0x7f67f5a55a40->references = 0

    incr:nodelock:check_address_records:rootns.c:409:0x7f67f5a55a40:0x7f68304d7040->references = 1
    decr:nodelock:check_address_records:rootns.c:449:0x7f67f5a55a40:0x7f68304d7040->references = 0

There's associated python script to find the missing detach located at:
https://gitlab.isc.org/isc-projects/bind9/-/snippets/1038

3 years agoMerge branch 'mnowak/make-openbsd-allow_failure-true' into 'main'
Michal Nowak [Tue, 28 Feb 2023 10:27:17 +0000 (10:27 +0000)] 
Merge branch 'mnowak/make-openbsd-allow_failure-true' into 'main'

Do not fail pipeline because of failed OpenBSD system test

See merge request isc-projects/bind9!7609

3 years agoDo not fail pipeline because of failed OpenBSD system test
Michal Nowak [Mon, 27 Feb 2023 18:22:52 +0000 (19:22 +0100)] 
Do not fail pipeline because of failed OpenBSD system test

System test on OpenBSD is unstable even when test parallelism is
disabled.

3 years agoRevert "Disable OpenBSD system test parallelism in CI"
Michal Nowak [Mon, 27 Feb 2023 18:21:58 +0000 (19:21 +0100)] 
Revert "Disable OpenBSD system test parallelism in CI"

This reverts commit d73eba57bd03dce575f4cf4e42c80e1bced08bed.

3 years agoMerge branch '3837-cds-digest-type' into 'main'
Matthijs Mekking [Tue, 28 Feb 2023 10:01:50 +0000 (10:01 +0000)] 
Merge branch '3837-cds-digest-type' into 'main'

Add cds-digest-type configuration option

Closes #3837

See merge request isc-projects/bind9!7457

3 years agoTest dnssec-signzone -G digests
Matthijs Mekking [Mon, 27 Feb 2023 12:40:01 +0000 (13:40 +0100)] 
Test dnssec-signzone -G digests

Add test cases for the new dnssec-signzone -G option.

3 years agoRequire to be dereferenced arguments are non-NULL
Matthijs Mekking [Wed, 22 Feb 2023 11:12:15 +0000 (12:12 +0100)] 
Require to be dereferenced arguments are non-NULL

The function 'dns_dnssec_syncupdate()' is dereferencing arguments
'keys' and 'rmkeys'. There should be a REQUIRE that those are not
null pointers.

3 years agodnssec-signzone can now create multiple CDS RRs
Matthijs Mekking [Tue, 21 Feb 2023 07:50:04 +0000 (08:50 +0100)] 
dnssec-signzone can now create multiple CDS RRs

Change the commandline option -G to take a string that determines what
sync records should be published. It is a comma-separated string with
each element being either "cdnskey", or "cds:<algorithm>", where
<algorithm> is a valid digest type. Duplicates are suppressed.

3 years agoUpdate syncupdate() function to disable CDNSKEY
Matthijs Mekking [Tue, 21 Feb 2023 07:46:43 +0000 (08:46 +0100)] 
Update syncupdate() function to disable CDNSKEY

Add a new function argument so you can choose whether the CDNSKEY
record should be published or not.

3 years agoFix dns_kasp_attach / dns_kasp_detach usage
Mark Andrews [Tue, 21 Feb 2023 01:15:01 +0000 (12:15 +1100)] 
Fix dns_kasp_attach / dns_kasp_detach usage

The kasp pointers in dns_zone_t should consistently be changed by
dns_kasp_attach and dns_kasp_detach so the usage is balanced.

3 years agoSuppress duplicate digest types
Matthijs Mekking [Mon, 13 Feb 2023 15:11:46 +0000 (16:11 +0100)] 
Suppress duplicate digest types

When adding CDS digest types to the kasp structure, check for
duplicates.

3 years agoAdd 'dns_dnssec_syncupdate' argument descriptions
Matthijs Mekking [Mon, 13 Feb 2023 13:36:20 +0000 (14:36 +0100)] 
Add 'dns_dnssec_syncupdate' argument descriptions

3 years agoMake cds-digest-type plural
Matthijs Mekking [Fri, 10 Feb 2023 14:18:36 +0000 (15:18 +0100)] 
Make cds-digest-type plural

Allow for configuring multiple CDS records with different digest
types (currently only SHA-256 and SHA-384 are allowed).

3 years agoNew option to dnssec-signzone to ignore sync rrs
Matthijs Mekking [Fri, 10 Feb 2023 14:05:02 +0000 (15:05 +0100)] 
New option to dnssec-signzone to ignore sync rrs

By default, CDS and CDNSKEY records are generated from the given
key list. In some cases you don't want that.

3 years agoAdd release note and change for cds-digest-type
Matthijs Mekking [Tue, 31 Jan 2023 09:59:45 +0000 (10:59 +0100)] 
Add release note and change for cds-digest-type

3 years agoUpdate code to publish CDS with other digest type
Matthijs Mekking [Tue, 31 Jan 2023 09:25:48 +0000 (10:25 +0100)] 
Update code to publish CDS with other digest type

Now that we can configure a different digest type, update the code
to honor the configuration. Update 'dns_dnssec_syncupdate' so that
the correct CDS record is published, and also when deleting CDS records,
ensure that all possible CDS records are removed from the zone.

3 years agoAdd test case for different digest type
Matthijs Mekking [Tue, 31 Jan 2023 09:20:00 +0000 (10:20 +0100)] 
Add test case for different digest type

Change one of the test cases to use a different digest type (4).  The
system tests and kasp script need to be updated to take into account
the new algorithm (instead of the hard coded 2).

3 years agoTest cds-digest-type configuration
Matthijs Mekking [Mon, 30 Jan 2023 11:42:33 +0000 (12:42 +0100)] 
Test cds-digest-type configuration

Add tests for good and bad configuration values in the checkconf system
test.

3 years agoAdd configuration cds-digest-type
Matthijs Mekking [Mon, 30 Jan 2023 10:20:53 +0000 (11:20 +0100)] 
Add configuration cds-digest-type

Add the 'cds-digest-type' configuration option to 'dnssec-policy'.

3 years agoAdd functions to set CDS digest-type
Matthijs Mekking [Mon, 30 Jan 2023 10:18:42 +0000 (11:18 +0100)] 
Add functions to set CDS digest-type

BIND dnssec-policy currently only supports CDS digest-type 2. Add
API functions to allow other digest-types.

3 years agoFix CDS/CDSNKEY publication logging
Matthijs Mekking [Mon, 30 Jan 2023 09:51:06 +0000 (10:51 +0100)] 
Fix CDS/CDSNKEY publication logging

The CDS and CDNSKEY "is published" logs were mixed up (CDNSKEY was
logged when CDS was published and vice versa).

3 years agoMerge branch '3891-fix-dnsrps-code' into 'main'
Michał Kępień [Tue, 28 Feb 2023 08:17:30 +0000 (08:17 +0000)] 
Merge branch '3891-fix-dnsrps-code' into 'main'

Fix DNSRPS code after struct dns_db refactoring

Closes #3891

See merge request isc-projects/bind9!7595

3 years agoFix DNSRPS code after struct dns_db refactoring
Michał Kępień [Tue, 28 Feb 2023 08:16:05 +0000 (09:16 +0100)] 
Fix DNSRPS code after struct dns_db refactoring

Commits ffa4757c792579e3bc8316df6ce4f47093e0bde3 and
77e7eac54c51c5e23bf6e0349237442ea105d02a inadvertently broke
DNSRPS-enabled builds:

  - the new member of struct dns_db that holds a reference count for the
    database is called 'references', not 'refcount',

  - a syntax error was introduced in the designated initializer for
    'rpsdb_rdataset_methods',

  - rpsdb_destroy() no longer takes a 'dbp' argument.

Address all of the above issues to make DNSRPS-enabled builds work
again.

3 years agoMerge branch '3902-fetchlimit-system-test-failed' into 'main'
Mark Andrews [Tue, 28 Feb 2023 07:23:00 +0000 (07:23 +0000)] 
Merge branch '3902-fetchlimit-system-test-failed' into 'main'

Resolve "'fetchlimit' system test failed"

Closes #3902

See merge request isc-projects/bind9!7615

3 years agoFix 'checking drop statistics' test
Mark Andrews [Tue, 28 Feb 2023 03:24:20 +0000 (14:24 +1100)] 
Fix 'checking drop statistics' test

Wait for the desired log message to appear in ns3/named.stats rather
than the creation of the file.

3 years agoFix 'lame server clients are dropped below the hard limit' test
Mark Andrews [Tue, 28 Feb 2023 03:10:56 +0000 (14:10 +1100)] 
Fix 'lame server clients are dropped below the hard limit' test

The test was setting a minimum count for recursive clients which
was not always being met (e.g. 91 instead of 100) producing a false
positive.  Lower the lower bound on recursive clients for this
test to 1.

3 years agoMerge branch 'fanf-qp-import' into 'main'
Tony Finch [Mon, 27 Feb 2023 14:11:05 +0000 (14:11 +0000)] 
Merge branch 'fanf-qp-import' into 'main'

Import a qp-trie implementation

See merge request isc-projects/bind9!7130

3 years agoImprove qp-trie compaction in write transactions
Tony Finch [Thu, 16 Feb 2023 21:42:04 +0000 (21:42 +0000)] 
Improve qp-trie compaction in write transactions

In general, it's better to do one thorough compaction when a batch of
work is complete, which is the way that `update` transactions work.
Conversely, `write` transactions are designed so that lots of little
transactions are not too inefficient, but they need explicit
compaction. This changes `dns_qp_compact()` so that it is easier to
compact any time that makes sense, if there isn't a better way to
schedule compaction. And `dns_qpmulti_commit()` only recycles garbage
when there is enough to make it worthwhile.

3 years agoImprove qp-trie refcount debugging
Tony Finch [Fri, 17 Feb 2023 18:28:24 +0000 (18:28 +0000)] 
Improve qp-trie refcount debugging

Add some qp-trie tracing macros which can be enabled by a
developer. These print a message when a leaf is attached or
detached, indicating which part of the qp-trie implementation
did so. The refcount methods must now return the refcount value
so it can be printed by the trace macros.

3 years agoMake the qp-trie stats logging quieter
Tony Finch [Thu, 16 Feb 2023 21:41:02 +0000 (21:41 +0000)] 
Make the qp-trie stats logging quieter

Only log when useful work was done

3 years agoRefactor qp-trie to use QSBR
Tony Finch [Thu, 22 Dec 2022 14:55:14 +0000 (14:55 +0000)] 
Refactor qp-trie to use QSBR

The first working multi-threaded qp-trie was stuck with an unpleasant
trade-off:

  * Use `isc_rwlock`, which has acceptable write performance, but
    terrible read scalability because the qp-trie made all accesses
    through a single lock.

  * Use `liburcu`, which has great read scalability, but terrible
    write performance, because I was relying on `rcu_synchronize()`
    which is rather slow. And `liburcu` is LGPL.

To get the best of both worlds, we need our own scalable read side,
which we now have with `isc_qsbr`. And we need to modify the write
side so that it is not blocked by readers.

Better write performance requires an async cleanup function like
`call_rcu()`, instead of the blocking `rcu_synchronize()`. (There
is no blocking cleanup in `isc_qsbr`, because I have concluded
that it would be an attractive nuisance.)

Until now, all my multithreading qp-trie designs have been based
around two versions, read-only and mutable. This is too few to
work with asynchronous cleanup. The bare minimum (as in epoch
based reclamation) is three, but it makes more sense to support an
arbitrary number. Doing multi-version support "properly" makes
fewer assumptions about how safe memory reclamation works, and it
makes snapshots and rollbacks simpler.

To avoid making the memory management even more complicated, I
have introduced a new kind of "packed reader node" to anchor the
root of a version of the trie. This is simpler because it re-uses
the existing chunk lifetime logic - see the discussion under
"packed reader nodes" in `qp_p.h`.

I have also made the chunk lifetime logic simpler. The idea of a
"generation" is gone; instead, chunks are either mutable or
immutable. And the QSBR phase number is used to indicate when a
chunk can be reclaimed.

Instead of the `shared_base` flag (which was basically a one-bit
reference count, with a two version limit) the base array now has a
refcount, which replaces the confusing ad-hoc lifetime logic with
something more familiar and systematic.

3 years agoSome minor qp-trie improvements
Tony Finch [Fri, 6 Jan 2023 19:10:19 +0000 (19:10 +0000)] 
Some minor qp-trie improvements

Adjust the dns_qp_memusage() and dns_qp_compact() functions
to be more informative and flexible about handling fragmentation.

Avoid wasting space in runt chunks.

Switch from twigs_mutable() to cells_immutable() because that is the
sense we usually want.

Drop the redundant evacuate() function and rename evacuate_twigs() to
evacuate(). Move some chunk test functions closer to their point of
use.

Clarify compact_recursive(). Some small cleanups to comments.

Use isc_time_monotonic() for qp-trie timing stats.

Use #define constants to control debug logging.

Set up DNS name label offsets in dns_qpkey_fromname() so it is easier
to use in cases where the name is not fully hydrated.

3 years agoqp-trie naming improvements
Tony Finch [Fri, 6 Jan 2023 18:25:34 +0000 (18:25 +0000)] 
qp-trie naming improvements

Adjust to typename_operation style
s/VALID_QP/QP_VALID/g
s/QP_VALIDMULTI/QPMULTI_VALID/g

Improved greppability
s/\bctx\b/uctx/g

Less cluttered logging
s/QP_TRACE/TRACE/g
s/QP_LOG_STATS/LOG_STATS/g

3 years agoBenchmarks for the qp-trie
Tony Finch [Wed, 28 Sep 2022 15:56:46 +0000 (16:56 +0100)] 
Benchmarks for the qp-trie

The main benchmark is `qpmulti`, which exercizes the qp-trie
transactional API with differing numbers of threads and differing data
sizes, to get some idea of how its performance scales.

The `load-names` benchmark compares the times to populate and query
and the memory used by various BIND data structures: qp-trie, hash
table (chained), hash map (closed), and red-black tree.

The `qp-dump` program is a test utility rather than a benchmark. It
populates a qp-trie and prints it out, either in an ad-hoc text
format, or as input to the graphviz `dot` program.

3 years agoFuzz testing the qp-trie
Tony Finch [Sun, 12 Jun 2022 14:52:35 +0000 (15:52 +0100)] 
Fuzz testing the qp-trie

Ensure dns_qpkey_fromname() and dns_qpkey_toname() are inverses.

Excercise a single-threaded dns_qp_t with a fixed set of random keys
and a small chunk size. Use the table of names to ensure that the trie
is behaving as expected. This is (in effect) randomized testing like
the `qpmulti` unit test, but making use of coverage-guided fuzzing
and (in principle) test case minimization.