]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoMerge branch 'fanf/add-SET_IF_NOT_NULL-macro' into 'main'
Ondřej Surý [Tue, 15 Aug 2023 11:23:27 +0000 (11:23 +0000)] 
Merge branch 'fanf/add-SET_IF_NOT_NULL-macro' into 'main'

A SET_IF_NOT_NULL() macro for optional return values

See merge request isc-projects/bind9!8201

2 years agoApply the SET_IF_NOT_NULL() semantic patch
Tony Finch [Thu, 6 Apr 2023 15:32:16 +0000 (16:32 +0100)] 
Apply the SET_IF_NOT_NULL() semantic patch

    spatch --sp-file cocci/set_if_not_null.spatch --use-gitgrep --dir "." --include-headers --in-place

2 years agoA SET_IF_NOT_NULL() macro for optional return values
Tony Finch [Thu, 6 Apr 2023 10:30:00 +0000 (11:30 +0100)] 
A SET_IF_NOT_NULL() macro for optional return values

The SET_IF_NOT_NULL() macro avoids a fair amount of tedious boilerplate,
checking pointer parameters to see if they're non-NULL and updating
them if they are.  The macro was already in the dns_zone unit, and this
commit moves it to the <isc/util.h> header.

I have included a Coccinelle semantic patch to use SET_IF_NOT_NULL()
where appropriate. The patch needs an #include in `openssl_shim.c`
in order to work.

2 years agoMerge branch '4259-statschannel-leftovers' into 'main'
Mark Andrews [Tue, 15 Aug 2023 04:21:33 +0000 (04:21 +0000)] 
Merge branch '4259-statschannel-leftovers' into 'main'

Resolve "Statschannel leftovers"

Closes #4259

See merge request isc-projects/bind9!8199

2 years agoRemove bind9.xsl.1, bind9.xsl.2 and bind9.xsl.3
Mark Andrews [Tue, 15 Aug 2023 00:26:29 +0000 (10:26 +1000)] 
Remove bind9.xsl.1, bind9.xsl.2 and bind9.xsl.3

2 years agoMerge branch '4238-the-mkeys-system-test-can-update-the-root-zone-too-fast' into...
Mark Andrews [Mon, 14 Aug 2023 23:23:33 +0000 (23:23 +0000)] 
Merge branch '4238-the-mkeys-system-test-can-update-the-root-zone-too-fast' into 'main'

Resolve "The mkeys system test can update the root zone too fast"

Closes #4238

See merge request isc-projects/bind9!8161

2 years agoAdd sleeps so that the modification time changes
Mark Andrews [Wed, 2 Aug 2023 06:16:30 +0000 (16:16 +1000)] 
Add sleeps so that the modification time changes

The mkeys system test could fail because root zone was resigned
within the same second as it was previously signed causing reloads
to fail.  Add delays to the test to prevent this.

2 years agoMerge branch '4124-check-statschannel-if-modified-since' into 'main'
Ondřej Surý [Mon, 14 Aug 2023 10:59:02 +0000 (10:59 +0000)] 
Merge branch '4124-check-statschannel-if-modified-since' into 'main'

Fix a stack buffer overflow in the statistics channel

Closes #4124

See merge request isc-projects/bind9!8195

2 years agoAdd CHANGES and release notes for [GL #4124]
Ondřej Surý [Mon, 14 Aug 2023 09:20:41 +0000 (11:20 +0200)] 
Add CHANGES and release notes for [GL #4124]

2 years agoFix a stack buffer overflow in the statistics channel
Tony Finch [Tue, 6 Jun 2023 17:06:43 +0000 (18:06 +0100)] 
Fix a stack buffer overflow in the statistics channel

A long timestamp in an If-Modified-Since header could overflow a
fixed-size buffer.

2 years agoMerge branch 'marka-fix-formatting-errors' into 'main'
Mark Andrews [Wed, 9 Aug 2023 23:49:25 +0000 (23:49 +0000)] 
Merge branch 'marka-fix-formatting-errors' into 'main'

Follow-up: Fixes to provider/engine based ECDSA key handling

See merge request isc-projects/bind9!8186

2 years agoRevert a337dbef
Matthijs Mekking [Wed, 9 Aug 2023 12:16:11 +0000 (14:16 +0200)] 
Revert a337dbef

Revert commit that always uses OpenSSL 3.0 API when available,
the new APIs should work always, but OpenSSL has non-obvious
omissions in the automatic mappings it provides.

2 years agoOnly set key->engine if engine != NULL
Mark Andrews [Wed, 9 Aug 2023 05:20:36 +0000 (15:20 +1000)] 
Only set key->engine if engine != NULL

2 years agoFix clang formatting
Mark Andrews [Wed, 9 Aug 2023 01:43:36 +0000 (11:43 +1000)] 
Fix clang formatting

2 years agoFix line wrap
Mark Andrews [Wed, 9 Aug 2023 01:43:18 +0000 (11:43 +1000)] 
Fix line wrap

2 years agoMerge branch '4245-incorrect-return-values-in-rpz-s-addr-and-drop-function' into...
Mark Andrews [Wed, 9 Aug 2023 23:33:25 +0000 (23:33 +0000)] 
Merge branch '4245-incorrect-return-values-in-rpz-s-addr-and-drop-function' into 'main'

Resolve "Incorrect return values in rpz's addr and drop functions"

Closes #4245

See merge request isc-projects/bind9!8172

2 years agoFix 'addr', 'ckresult' and 'drop' functions
Mark Andrews [Mon, 7 Aug 2023 08:22:29 +0000 (18:22 +1000)] 
Fix 'addr', 'ckresult' and 'drop' functions

'addr', 'ckresult' and 'drop' should return 0 rather than 1 after
calling 'setret' as the error has been logged and these functions
are not expect to fail.

2 years agoMerge branch 'mnowak/cross-version-test' into 'main'
Michal Nowak [Tue, 8 Aug 2023 17:37:19 +0000 (17:37 +0000)] 
Merge branch 'mnowak/cross-version-test' into 'main'

Cross-version testing with named configurations

See merge request isc-projects/bind9!7863

2 years agoExclude dupsigs and keymgr2kasp from cross-version-config-tests
Michal Nowak [Mon, 7 Aug 2023 16:28:34 +0000 (18:28 +0200)] 
Exclude dupsigs and keymgr2kasp from cross-version-config-tests

pytest should not schedule dupsigs and keymgr2kasp system tests removed
in BIND 9 mainline but still present in BIND 9 baseline version
(v9.19.15). (Can be dropped once the v9.19.16 tag is present.)

2 years agoCross-version testing with named configurations
Michal Nowak [Wed, 25 Jan 2023 20:38:56 +0000 (21:38 +0100)] 
Cross-version testing with named configurations

In #3381 (and #3385), we committed a backward-incompatible change to
BIND 9.19.5, 9.18.7, and 9.16.33, explicitly requiring "inline-signing"
for every "dnssec-policy".

We did this backward-incompatible change deliberately, knowing the
consequences for users and their configurations. But if we didn't, say,
we were unaware this is a backward-incompatible change and fixed failing
systems test by "tweaking a knob to make the CI pass", we would not have
a second look before the change hits user configurations.

"cross-version-config-tests" CI job is such a second look. It will run
system tests from the latest release tag specific to the particular
branch (e.g., v9.19.12 for the "main" branch) with BIND 9 binaries from
the current "HEAD" (the future v9.19.13). This Frankenstein build gets
conceived by altering the "TOP_BUILDDIR" variable in
"bin/tests/system/conf.sh".

Caveats:
- Only system test configurations are tested; no actual test code is
  run.
- Problems with namedN.conf configurations are not identified.

When backward-incompatible change is introduced, the CI job is expected
to fail. If the change is deliberate, the job will keep failing until
the version with the backward-incompatible change is tagged, and the
minor version in configure.ac is bumped.

2 years agoMerge branch 'tt-provider-engine' into 'main'
Matthijs Mekking [Tue, 8 Aug 2023 14:26:15 +0000 (14:26 +0000)] 
Merge branch 'tt-provider-engine' into 'main'

Fix keyfromlabel to not use engine parameter for provider keys

See merge request isc-projects/bind9!8153

2 years agoFix keyfromlabel to not use engine parameter for provider keys
Timo Teräs [Fri, 28 Jul 2023 10:44:13 +0000 (13:44 +0300)] 
Fix keyfromlabel to not use engine parameter for provider keys

- Rework key checks to not require 'engine' tag, private key
  is valid with 'label' tag alone

- Fix _fromlabel() functions to work with engine == NULL

- Update dst__openssl_fromlabel_engine() to do provider lookup
  only when engine is not set

2 years agoMerge branch 'tt-ecdsa-fixes' into 'main'
Matthijs Mekking [Tue, 8 Aug 2023 14:13:21 +0000 (14:13 +0000)] 
Merge branch 'tt-ecdsa-fixes' into 'main'

Fixes to provider/engine based ECDSA key handling

See merge request isc-projects/bind9!8152

2 years agoAdd CHANGES for GL !8152
Timo Teräs [Thu, 3 Aug 2023 09:45:07 +0000 (12:45 +0300)] 
Add CHANGES for GL !8152

2 years agoAlways use OpenSSL 3.0 API when available
Timo Teräs [Fri, 28 Jul 2023 10:21:09 +0000 (13:21 +0300)] 
Always use OpenSSL 3.0 API when available

The new APIs work always as OpenSSL provides glue to access also
old style engines using the new APIs.

2 years agoFix support for engine/provider ECDSA keys
Timo Teräs [Fri, 28 Jul 2023 10:18:40 +0000 (13:18 +0300)] 
Fix support for engine/provider ECDSA keys

Exporting private key of on-token keys is not possible. Fix code
to not fail in this case.

2 years agoFix OpenSSL 3.0 API EC curve names
Timo Teräs [Fri, 28 Jul 2023 10:15:48 +0000 (13:15 +0300)] 
Fix OpenSSL 3.0 API EC curve names

The OpenSSL man page examples used the NIST curve names which
are supported. But when querying the name, the native OpenSSL
name is returned. Use these names to pass curve type checks for
engine/provider objects.

2 years agoMerge branch 'mnowak/pytest_rewrite_stress' into 'main'
Michal Nowak [Tue, 8 Aug 2023 12:29:24 +0000 (12:29 +0000)] 
Merge branch 'mnowak/pytest_rewrite_stress' into 'main'

Rewrite stress test to pytest

See merge request isc-projects/bind9!7905

2 years agoConvert setup.pl into static configurations
Michał Kępień [Tue, 11 Jul 2023 13:56:31 +0000 (15:56 +0200)] 
Convert setup.pl into static configurations

The setup.pl script has been replaced with static BIND configurations,
and in the course of this change, the unused ns1 server was removed.
This enhancement has greatly improved the overall test's readability.

2 years agoRewrite stress test to pytest
Michal Nowak [Tue, 9 May 2023 17:11:00 +0000 (19:11 +0200)] 
Rewrite stress test to pytest

The shell version of the test was completed only after all DNS zone
updates were sent, even if the BIND server crashed while processing
them, leading to prolonged execution and potential hang in the CI
environment. The Python rewrite of the test ensures that DNS update
tasks finish within five minutes of starting, irrespective of a BIND
crash possibility or DNS zone updates not finishing in time.

2 years agoMerge branch '4240-dnstap-system-test-fixes' into 'main'
Michał Kępień [Mon, 7 Aug 2023 11:58:54 +0000 (11:58 +0000)] 
Merge branch '4240-dnstap-system-test-fixes' into 'main'

"dnstap" system test fixes

Closes #4240

See merge request isc-projects/bind9!8177

2 years agoLower the minimum expected dnstap output file size
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Lower the minimum expected dnstap output file size

Lower the size requirement for the dnstap output file produced during
the "dnstap" system test from 454 to 450 bytes; while files of that size
are not generated in any GitLab CI job, they are in other environments
where the test passes.

2 years agoWait until fstrm_capture is ready
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Wait until fstrm_capture is ready

The fstrm_capture utility is started in the background during the
"dnstap" system test.  Consequently, "rndc dnstap-reopen" and similar
commands may be executed before fstrm_capture starts listening on the
Unix domain socket it is configured to receive dnstap data on.  This
results in the dnstap data sent to that socket in the meantime to be
lost; while the fstrm writer thread is able to recover from such a
scenario within a couple of seconds (by reopening the configured dnstap
destination itself), only one write attempt is made for data
successfully queued to the writer thread, so dnstap frames can still be
lost in the process.  This may happen during the "dnstap" system test,
leading to the dnstap output file being empty, which in turn causes the
test to fail.

Fix by waiting until fstrm_capture starts listening on the Unix domain
socket it is configured to use before asking named to reopen the
configured dnstap destination.  Since various fstrm_capture versions log
different messages when the listening socket is set up, wait for a
common string that works for all fstrm_capture versions released to
date.  Add a few extra debug messages indicating test progress and make
the test fail if the expected fstrm_capture log message is not generated
within 10 seconds.

2 years agoCapture all fstrm_capture output
Michał Kępień [Mon, 7 Aug 2023 09:26:58 +0000 (11:26 +0200)] 
Capture all fstrm_capture output

The fstrm_capture.out file is overwritten when the fstrm_capture utility
is restarted during the "dnstap" system test.  Use a separate output
file for each fstrm_capture instance to ensure all output produced by
that tool during the "dnstap" system test is preserved for forensic
purposes.

2 years agoMerge branch '4243-_wait_for_stats-errors-not-detected-in-ixfr-system-test' into...
Mark Andrews [Mon, 7 Aug 2023 09:16:55 +0000 (09:16 +0000)] 
Merge branch '4243-_wait_for_stats-errors-not-detected-in-ixfr-system-test' into 'main'

Resolve "_wait_for_stats errors not detected in ixfr system test"

Closes #4243

See merge request isc-projects/bind9!8171

2 years agoSet ret=1 if _wait_for_stats does not succeed
Mark Andrews [Sun, 6 Aug 2023 23:38:56 +0000 (09:38 +1000)] 
Set ret=1 if _wait_for_stats does not succeed

Errors getting transfer statistics from named.run where not detected
as ret was not set to one if there hadn't been a success after looping
for a while.

2 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.17' into 'main'
Michał Kępień [Mon, 7 Aug 2023 08:26:04 +0000 (08:26 +0000)] 
Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.17' into 'main'

Set up version and release notes for BIND 9.19.17

See merge request isc-projects/bind9!8173

2 years agoSet up release notes for BIND 9.19.17
Michał Kępień [Mon, 7 Aug 2023 08:23:55 +0000 (10:23 +0200)] 
Set up release notes for BIND 9.19.17

2 years agoUpdate BIND version to 9.19.17-dev
Michał Kępień [Mon, 7 Aug 2023 08:23:55 +0000 (10:23 +0200)] 
Update BIND version to 9.19.17-dev

2 years agoUpdate BIND version for release v9.19.16
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Update BIND version for release

2 years agoAdd a CHANGES marker
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Add a CHANGES marker

2 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.16' into 'v9.19.16-release'
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.16' into 'v9.19.16-release'

Prepare documentation for BIND 9.19.16

See merge request isc-private/bind9!559

2 years agoAdd release note for GL #4215
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Add release note for GL #4215

2 years agoReorder release notes
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Reorder release notes

2 years agoTweak and reword release notes
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Tweak and reword release notes

2 years agoPrepare release notes for BIND 9.19.16
Michał Kępień [Fri, 4 Aug 2023 09:17:54 +0000 (11:17 +0200)] 
Prepare release notes for BIND 9.19.16

2 years agoMerge branch '4232-rbtdb-performance-fix' into 'main'
Evan Hunt [Fri, 4 Aug 2023 09:12:45 +0000 (09:12 +0000)] 
Merge branch '4232-rbtdb-performance-fix' into 'main'

use read lock in rdataset_getownercase()

Closes #4232

See merge request isc-projects/bind9!8169

2 years agouse read lock in rdataset_getownercase()
Evan Hunt [Thu, 3 Aug 2023 19:51:41 +0000 (12:51 -0700)] 
use read lock in rdataset_getownercase()

we were incorrectly write-locking the node when retrieving
the owner case of an rdataset.

2 years agoMerge branch 'matthijs-followup-4032' into 'main'
Matthijs Mekking [Wed, 2 Aug 2023 10:21:32 +0000 (10:21 +0000)] 
Merge branch 'matthijs-followup-4032' into 'main'

Change default TTLsig to one week

See merge request isc-projects/bind9!8164

2 years agoChange default TTLsig to one week
Matthijs Mekking [Wed, 2 Aug 2023 09:16:50 +0000 (11:16 +0200)] 
Change default TTLsig to one week

Commit dc6dafdad1bce4c59bec0dbc355650c384cfc4d9 allows larger TTL values
in zones that go insecure, and ignores the maximum zone TTL.

This means that if you use TTL values larger than 1 day in your zone,
your zone runs the risk of going bogus before it moves safely to
insecure.

Most resolvers by default cap the maximum TTL that they cache RRsets,
at one day (Unbound, Knot, PowerDNS) so that is fine. However, BIND 9's
default is one week.

Change the default TTLsig to one week, so that also for BIND 9
resolvers in the default cases responses for zones that are going
insecure will not be evaluated as bogus.

This change does mean that when unsigning your zone, it will take six
days longer to safely go insecure, regardless of what TTL values you
use in the zone.

2 years agoMerge branch 'michal/add-changes-entry-for-rbtdb-split-up' into 'main'
Michał Kępień [Wed, 2 Aug 2023 08:44:11 +0000 (08:44 +0000)] 
Merge branch 'michal/add-changes-entry-for-rbtdb-split-up' into 'main'

Add CHANGES entry for GL !7873

See merge request isc-projects/bind9!8162

2 years agoAdd CHANGES entry for GL !7873
Michał Kępień [Wed, 2 Aug 2023 08:40:09 +0000 (10:40 +0200)] 
Add CHANGES entry for GL !7873

2 years agoMerge branch '3700-deprecate-dialup' into 'main'
Evan Hunt [Wed, 2 Aug 2023 01:38:27 +0000 (01:38 +0000)] 
Merge branch '3700-deprecate-dialup' into 'main'

deprecate "dialup" and "heartbeat-interval"

Closes #3700

See merge request isc-projects/bind9!8080

2 years agoCHANGES and release note for [GL #3700]
Evan Hunt [Mon, 3 Jul 2023 23:40:56 +0000 (16:40 -0700)] 
CHANGES and release note for [GL #3700]

2 years agodeprecate "dialup" and "heartbeat-interval"
Evan Hunt [Mon, 3 Jul 2023 23:34:22 +0000 (16:34 -0700)] 
deprecate "dialup" and "heartbeat-interval"

these options concentrate zone maintenance actions into
bursts for the benefit of servers with intermittent connections.
that's no longer something we really need to optimize.

2 years agoMerge branch '4229-nextpart-failed-set-e-fallout' into 'main'
Mark Andrews [Wed, 2 Aug 2023 00:21:26 +0000 (00:21 +0000)] 
Merge branch '4229-nextpart-failed-set-e-fallout' into 'main'

Resolve "nextpart failed, set -e fallout?"

Closes #4229

See merge request isc-projects/bind9!8149

2 years agoAdd sleep 1 so that the signing happens in a different second
Mark Andrews [Thu, 27 Jul 2023 22:38:20 +0000 (08:38 +1000)] 
Add sleep 1 so that the signing happens in a different second

2 years agoUse $() instead of backticks
Mark Andrews [Thu, 27 Jul 2023 19:24:01 +0000 (05:24 +1000)] 
Use $() instead of backticks

2 years agoCorrectly grep nextpart output
Mark Andrews [Thu, 27 Jul 2023 19:22:43 +0000 (05:22 +1000)] 
Correctly grep nextpart output

2 years agoMerge branch '4059-oracle-linux-8-shell-doesn-t-always-restore-environment-variable...
Mark Andrews [Tue, 1 Aug 2023 23:47:38 +0000 (23:47 +0000)] 
Merge branch '4059-oracle-linux-8-shell-doesn-t-always-restore-environment-variable-correctly' into 'main'

Resolve "Oracle Linux 8 shell doesn't always restore environment variable correctly"

Closes #4059

See merge request isc-projects/bind9!7908

2 years agoUse sub shell to isolate enviroment changes
Mark Andrews [Thu, 11 May 2023 02:09:26 +0000 (12:09 +1000)] 
Use sub shell to isolate enviroment changes

'HOME=value command' should only change HOME for command but on
some platforms this occasionally sets HOME for the rest of the
test. Explicitly isolate the enviroment change using a sub shell.

2 years agoMerge branch '4226-dig-help-message-https-plain-get-vs-http-plain-get' into 'main'
Arаm Sаrgsyаn [Tue, 1 Aug 2023 10:39:26 +0000 (10:39 +0000)] 
Merge branch '4226-dig-help-message-https-plain-get-vs-http-plain-get' into 'main'

Fix dig help message typo in the http-plain-get option

Closes #4226

See merge request isc-projects/bind9!8148

2 years agoFix dig help message typo in the http-plain-get option
Aram Sargsyan [Thu, 27 Jul 2023 11:17:42 +0000 (11:17 +0000)] 
Fix dig help message typo in the http-plain-get option

The option name is misspelled as 'https-plain-get'. Fix the error.

2 years agoMerge branch '4032-ignore-max-zone-ttl-dnssec-policy-insecure' into 'main'
Matthijs Mekking [Tue, 1 Aug 2023 07:46:22 +0000 (07:46 +0000)] 
Merge branch '4032-ignore-max-zone-ttl-dnssec-policy-insecure' into 'main'

Ignore max-zone-ttl on dnssec-policy insecure

Closes #4032

See merge request isc-projects/bind9!8142

2 years agoAdd CHANGES and release note for #4032
Matthijs Mekking [Wed, 26 Jul 2023 09:55:20 +0000 (11:55 +0200)] 
Add CHANGES and release note for #4032

2 years agoIgnore max-zone-ttl on dnssec-policy insecure
Matthijs Mekking [Wed, 26 Jul 2023 09:50:57 +0000 (11:50 +0200)] 
Ignore max-zone-ttl on dnssec-policy insecure

Allow larger TTL values in zones that go insecure. This is necessary
because otherwise the zone will not be loaded due to the max-zone-ttl
of P1D that is part of the current insecure policy.

In the keymgr.c code, default back to P1D if the max-zone-ttl is set
to zero.

2 years agoMerge branch '3677-dnssec-policy-inline-signing' into 'main'
Matthijs Mekking [Tue, 1 Aug 2023 06:55:56 +0000 (06:55 +0000)] 
Merge branch '3677-dnssec-policy-inline-signing' into 'main'

Add inline-signing to dnssec-policy

Closes #3677

See merge request isc-projects/bind9!7204

2 years agoAdd release note and CHANGES for GL #3677
Matthijs Mekking [Fri, 9 Dec 2022 11:42:05 +0000 (12:42 +0100)] 
Add release note and CHANGES for GL #3677

News worthy.

2 years agoRemove redundant inline-signing lines from docs
Matthijs Mekking [Fri, 9 Dec 2022 11:36:38 +0000 (12:36 +0100)] 
Remove redundant inline-signing lines from docs

Now that inline-signing is explicitly set in dnssec-policy, remove
the redundant "inline-signing yes;" lines from the documentation.

2 years agoRemove redundant inline-signing lines from tests
Matthijs Mekking [Mon, 3 Apr 2023 15:13:34 +0000 (17:13 +0200)] 
Remove redundant inline-signing lines from tests

Now that inline-signing is explicitly set in dnssec-policy, remove
the redundant "inline-signing yes;" lines from the system tests.

2 years agoUpdate inline-signing checkconf code
Matthijs Mekking [Fri, 9 Dec 2022 11:22:49 +0000 (12:22 +0100)] 
Update inline-signing checkconf code

When using automated DNSSEC management, it is required that the zone
is dynamic, or that inline-signing is enabled (or both). Update the
checkconf code to also allow inline-signing to be enabled within
dnssec-policy.

2 years agoAdd inline-signing to dnssec-policy
Matthijs Mekking [Mon, 3 Apr 2023 15:00:36 +0000 (17:00 +0200)] 
Add inline-signing to dnssec-policy

Add an option to enable/disable inline-signing inside the
dnssec-policy clause. The existing inline-signing option that is
set in the zone clause takes priority, but if it is omitted, then the
value that is set in dnssec-policy is taken.

The built-in policies use inline-signing.

This means that if you want to use the default policy without
inline-signing you either have to set it explicitly in the zone
clause:

    zone "example" {
        ...
        dnssec-policy default;
        inline-signing no;
    };

Or create a new policy, only overriding the inline-signing option:

    dnssec-policy "default-dynamic" {
        inline-signing no;
    };

    zone "example" {
        ...
        dnssec-policy default-dynamic;
    };

This also means that if you are going insecure with a dynamic zone,
the built-in "insecure" policy needs to be accompanied with
"inline-signing no;".

2 years agoMerge branch '4196-use-rculist-for-dns_db_updatenotify' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 16:12:54 +0000 (16:12 +0000)] 
Merge branch '4196-use-rculist-for-dns_db_updatenotify' into 'main'

Use cds_lfht for updatenotify mechanism in dns_db unit

Closes #4196

See merge request isc-projects/bind9!8097

2 years agofixup! Use cds_lfht for updatenotify mechanism in dns_db unit
Ondřej Surý [Mon, 31 Jul 2023 16:03:45 +0000 (18:03 +0200)] 
fixup! Use cds_lfht for updatenotify mechanism in dns_db unit

2 years agoUse cds_lfht for updatenotify mechanism in dns_db unit
Ondřej Surý [Mon, 10 Jul 2023 09:36:19 +0000 (11:36 +0200)] 
Use cds_lfht for updatenotify mechanism in dns_db unit

The updatenotify mechanism in dns_db relied on unlocked ISC_LIST for
adding and removing the "listeners".  The mechanism relied on the
exclusive mode - it should have been updated only during reconfiguration
of the server.  This turned not to be true anymore in the dns_catz - the
updatenotify list could have been updated during offloaded work as the
offloaded threads are not subject to the exclusive mode.

Change the update_listeners to be cds_lfht (lock-free hash-table), and
slightly refactor how register and unregister the callbacks - the calls
are now idempotent (the register call already was and the return value
of the unregister function was mostly ignored by the callers).

2 years agoMerge branch 'ondrej/add-isc_rwlock-unit-test' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 16:08:46 +0000 (16:08 +0000)] 
Merge branch 'ondrej/add-isc_rwlock-unit-test' into 'main'

Add rwlock unit test

See merge request isc-projects/bind9!7859

2 years agoAdd rwlock unit test
Ondřej Surý [Thu, 30 Mar 2023 08:08:52 +0000 (10:08 +0200)] 
Add rwlock unit test

Add simple rwlock unit test and rwlock benchmark.  The benchmark
compares the pthread rwlock with isc rwlock implementation, so it's
mainly useful when developing a new isc rwlock implementation.

2 years agoMerge branch '4223-replace-dns_badcache-hashtable-implementation' into 'main'
Ondřej Surý [Mon, 31 Jul 2023 13:54:11 +0000 (13:54 +0000)] 
Merge branch '4223-replace-dns_badcache-hashtable-implementation' into 'main'

Refactor dns_badcache to use cds_lfht lock-free hashtable

Closes #4223

See merge request isc-projects/bind9!8139

2 years agoAdd CHANGES note for [GL #4223]
Ondřej Surý [Tue, 27 Jun 2023 07:05:46 +0000 (09:05 +0200)] 
Add CHANGES note for [GL #4223]

2 years agoCall rcu_barrier() five times in the isc__mem_destroy()
Ondřej Surý [Tue, 27 Jun 2023 06:26:12 +0000 (08:26 +0200)] 
Call rcu_barrier() five times in the isc__mem_destroy()

Because rcu_barrier() needs to be called as many times as the number of
nested call_rcu() calls (call_rcu() calls made from call_rcu thread),
and currently there's no mechanism to detect whether there are more
call_rcu callbacks scheduled, we simply call the rcu_barrier() multiple
times.  The overhead is negligible and it prevents rare assertion
failures caused by the check for memory leaks in isc__mem_destroy().

2 years agoDon't cleanup the dns_message_checksig fuzzer in atexit handler
Ondřej Surý [Thu, 22 Jun 2023 13:43:04 +0000 (15:43 +0200)] 
Don't cleanup the dns_message_checksig fuzzer in atexit handler

After the dns_badcache refactoring, the dns_badcache_destroy() would
call call_rcu().  The dns_message_checksig cleanup which calls
dns_view_detach() happens in the atexit handler, so there might be
call_rcu threads started very late in the process.  The liburcu
registers library destructor that destroys the data structured internal
to liburcu and this clashes with the call_rcu thread that just got
started in the atexit() handler causing either (depending on timing):

 - a normal run
 - a straight segfault
 - an assertion failure from liburcu

Instead of trying to cleanup the dns_message_checksig unit, ignore the
leaked memory as we do with all the other fuzzing tests.

2 years agoMake the load-names benchmark multithreaded
Ondřej Surý [Wed, 21 Jun 2023 12:10:28 +0000 (14:10 +0200)] 
Make the load-names benchmark multithreaded

The load-names benchmark was originally only measuring single thread
performance of the data structures.  As this is not how those are used
in the real life, it was refactored to be multi-threaded with proper
protections in place (rwlock for ht, hashmap and rbt; transactions for
qp).

The qp test has been extended to see effect of the dns_qp_compact() and
rcu_barrier() on the overall speed and memory consumption.

2 years agoRefactor dns_badcache to use cds_lfht lock-free hashtable
Ondřej Surý [Mon, 19 Jun 2023 13:43:02 +0000 (15:43 +0200)] 
Refactor dns_badcache to use cds_lfht lock-free hashtable

The dns_badcache unit had (yet another) own locked hashtable
implementation.  Replace the hashtable used by dns_badcache with
lock-free cds_lfht implementation from liburcu.

2 years agoMerge branch 'stepan/fix-check-in-ecdsa-system-test' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 07:14:27 +0000 (07:14 +0000)] 
Merge branch 'stepan/fix-check-in-ecdsa-system-test' into 'main'

Fix ecdsa256 check in ecdsa system test setup

See merge request isc-projects/bind9!8053

2 years agoFix ecdsa256 check in ecdsa system test setup
Štěpán Balážik [Sat, 24 Jun 2023 09:45:50 +0000 (11:45 +0200)] 
Fix ecdsa256 check in ecdsa system test setup

Probably by copy-paste mistake, ecdsa384 was checked twice.

2 years agoMerge branch '4086-run-dispentry_destroy-on-associated-loop' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 07:07:50 +0000 (07:07 +0000)] 
Merge branch '4086-run-dispentry_destroy-on-associated-loop' into 'main'

Pin dns_request to the associated loop

Closes #4086

See merge request isc-projects/bind9!8137

2 years agoAdd CHANGES note for [GL #4086]
Ondřej Surý [Wed, 26 Jul 2023 12:18:31 +0000 (14:18 +0200)] 
Add CHANGES note for [GL #4086]

2 years agoPin dns_request to the associated loop
Ondřej Surý [Tue, 25 Jul 2023 08:30:09 +0000 (10:30 +0200)] 
Pin dns_request to the associated loop

When dns_request was canceled via dns_requestmgr_shutdown() the cancel
event would be propagated on different loop (loop 0) than the loop where
request was created on.  In turn this would propagate down to isc_netmgr
where we require all the events to be called from the matching isc_loop.

Pin the dns_requests to the loops and ensure that all the events are
called on the associated loop.  This in turn allows us to remove the
hashed locks on the requests and change the single .requests list to be
a per-loop list for the request accounting.

Additionally, do some extra cleanup because some race condititions are
now not possible as all events on the dns_request are serialized.

2 years agoMerge branch 'ondrej/remove__tsan_acquire_release-hints' into 'main'
Ondřej Surý [Fri, 28 Jul 2023 06:59:44 +0000 (06:59 +0000)] 
Merge branch 'ondrej/remove__tsan_acquire_release-hints' into 'main'

Cleanup the __tsan_acquire/__tsan_release

See merge request isc-projects/bind9!8114

2 years agoCleanup the __tsan_acquire/__tsan_release
Ondřej Surý [Wed, 19 Jul 2023 06:58:31 +0000 (08:58 +0200)] 
Cleanup the __tsan_acquire/__tsan_release

With ThreadSanitizer support added to the Userspace RCU, we no longer
need to wrap the call_rcu and caa_container_of with
__tsan_{acquire,release} hints.  Remove the direct calls to
__tsan_{acquire,release} and the isc_urcu_{container,cleanup} macros.

2 years agoMerge branch '4225-return-refused-if-gssapi-not-configured' into 'main'
Mark Andrews [Fri, 28 Jul 2023 06:43:58 +0000 (06:43 +0000)] 
Merge branch '4225-return-refused-if-gssapi-not-configured' into 'main'

Resolve "SERVFAIL response to TKEY query"

Closes #4225

See merge request isc-projects/bind9!8146

2 years agoAdd CHANGES for [GL #4225]
Mark Andrews [Wed, 26 Jul 2023 22:51:11 +0000 (08:51 +1000)] 
Add CHANGES for [GL #4225]

2 years agoCheck GSS-API TKEY against non configured server
Mark Andrews [Thu, 27 Jul 2023 07:08:34 +0000 (17:08 +1000)] 
Check GSS-API TKEY against non configured server

Check for the expected error message which includes rcode REFUSED
then reload the server to specify the keytab for the rest of the
GSSAPI tests.

2 years agoReport TKEY query errors in nsupdate
Mark Andrews [Thu, 27 Jul 2023 06:47:09 +0000 (16:47 +1000)] 
Report TKEY query errors in nsupdate

2 years agoReturn REFUSED if GSSAPI is not configured
Mark Andrews [Wed, 26 Jul 2023 22:34:45 +0000 (08:34 +1000)] 
Return REFUSED if GSSAPI is not configured

Return REFUSED if neither a keytab nor a gssapi credential is
configured to GSSAPI/TKEY requests.

2 years agoMerge branch 'ondrej/workaround-the-ASAN-report-for-cds_lfht_for_each_entry' into...
Ondřej Surý [Thu, 27 Jul 2023 13:22:08 +0000 (13:22 +0000)] 
Merge branch 'ondrej/workaround-the-ASAN-report-for-cds_lfht_for_each_entry' into 'main'

Workaround AddressSanitizer overzealous check

See merge request isc-projects/bind9!8116

2 years agoWorkaround AddressSanitizer overzealous check
Ondřej Surý [Thu, 22 Jun 2023 10:25:45 +0000 (12:25 +0200)] 
Workaround AddressSanitizer overzealous check

The cds_lfht_for_each_entry and cds_lfht_for_each_entry_duplicate macros
had a code that operated on the NULL pointer, at the end of the list it
was calling caa_container_of() on the NULL pointer in the init-clause
and iteration-expression, but the result wasn't actually used anywhere
because the cond-expression in the for loop has prevented executing
loop-statement.  This made AddressSanitizer notice the invalid operation
and rightfully complain.

This was reported to the upstream and fixed there.  Pull the upstream
fix into our <isc/urcu.h> header, so our CI checks pass.

2 years agoMerge branch '4227-free-stub_glue_request-in-stub_glue_response' into 'main'
Ondřej Surý [Thu, 27 Jul 2023 10:34:20 +0000 (10:34 +0000)] 
Merge branch '4227-free-stub_glue_request-in-stub_glue_response' into 'main'

Free struct stub_glue_request in stub_glue_response() callback

Closes #4227

See merge request isc-projects/bind9!8147

2 years agoAdd CHANGES note for [GL #4227]
Ondřej Surý [Thu, 27 Jul 2023 09:33:22 +0000 (11:33 +0200)] 
Add CHANGES note for [GL #4227]

2 years agoFree struct stub_glue_request in stub_glue_response() callback
Ondřej Surý [Thu, 27 Jul 2023 09:31:06 +0000 (11:31 +0200)] 
Free struct stub_glue_request in stub_glue_response() callback

When stub_glue_response() is called, the associated data is stored in
newly allocated struct stub_glue_request.  The allocated structure is
never freed in the callback, thus we leak a little bit of memory.