]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoTweak CHANGES entry for [GL #4260]
Michał Kępień [Thu, 9 Nov 2023 11:36:34 +0000 (12:36 +0100)] 
Tweak CHANGES entry for [GL #4260]

2 years agoTweak CVE-2021-25219 reference
Michał Kępień [Thu, 9 Nov 2023 11:36:34 +0000 (12:36 +0100)] 
Tweak CVE-2021-25219 reference

2 years agoMerge branch 'matthijs-remove-deprecation-warning-on-dnssec-policy-max-zone-ttl'...
Petr Špaček [Sun, 5 Nov 2023 13:10:03 +0000 (13:10 +0000)] 
Merge branch 'matthijs-remove-deprecation-warning-on-dnssec-policy-max-zone-ttl' into 'main'

Remove deprecation warning on dnssec policy max zone ttl

See merge request isc-projects/bind9!8467

2 years agoRemove dnssec-policy/max-zone-ttl deprecation text
Matthijs Mekking [Sun, 5 Nov 2023 10:18:34 +0000 (11:18 +0100)] 
Remove dnssec-policy/max-zone-ttl deprecation text

The readthedocs also placed a deprecation warning on 'max-zone-ttl'
that is part of 'dnssec-policy'. This option is of course not being
deprecated.

2 years agoMerge branch 'fanf-rndc-nta-newlines' into 'main'
Evan Hunt [Thu, 2 Nov 2023 16:31:25 +0000 (16:31 +0000)] 
Merge branch 'fanf-rndc-nta-newlines' into 'main'

Fix missing newlines in output of `rndc nta -dump`

See merge request isc-projects/bind9!8454

2 years agoCHANGES for [GL !8454]
Evan Hunt [Wed, 1 Nov 2023 16:38:22 +0000 (17:38 +0100)] 
CHANGES for [GL !8454]

2 years agoFix missing newlines in output of `rndc nta -dump`
Tony Finch [Tue, 15 Oct 2019 14:36:55 +0000 (15:36 +0100)] 
Fix missing newlines in output of `rndc nta -dump`

There were no newlines between each view in the list of negative trust
anchors.

2 years agoMerge branch '4401-make-check-fix-junitxml-output-processing' into 'main'
Tom Krizek [Thu, 2 Nov 2023 09:02:01 +0000 (09:02 +0000)] 
Merge branch '4401-make-check-fix-junitxml-output-processing' into 'main'

Fix pytest junitxml output processing for make check

Closes #4401

See merge request isc-projects/bind9!8443

2 years agoFix pytest junitxml output processing for make check
Tom Krizek [Mon, 30 Oct 2023 15:16:33 +0000 (16:16 +0100)] 
Fix pytest junitxml output processing for make check

Not every element tagged `skipped` in the JUnitXML tree has to contain
the `type` attribute. An example of that is a test that results in
xpass.

This has been verified with pytest version 7.4.2 and prior.

2 years agoMerge branch 'michal/add-a-release-signing-job-to-gitlab-ci' into 'main'
Michał Kępień [Thu, 2 Nov 2023 06:23:15 +0000 (06:23 +0000)] 
Merge branch 'michal/add-a-release-signing-job-to-gitlab-ci' into 'main'

Add a release signing job to GitLab CI

See merge request isc-projects/bind9!8418

2 years agoAdd a release signing job to GitLab CI
Michał Kępień [Thu, 2 Nov 2023 06:22:20 +0000 (07:22 +0100)] 
Add a release signing job to GitLab CI

Add a GitLab CI job that is only run for tags and makes signing BIND 9
releases more convenient by utilizing a signing VM that is registered as
a GitLab CI runner.  This pulls the signing process into the release
pipelines in GitLab CI, resulting in job artifacts containing the
signatures for BIND 9 releases, which in turns simplifies the subsequent
release publication steps.

2 years agoMerge branch '4406-cleanup-b-in-dnstap-main' into 'main'
Mark Andrews [Thu, 2 Nov 2023 04:25:19 +0000 (04:25 +0000)] 
Merge branch '4406-cleanup-b-in-dnstap-main' into 'main'

Resolve "cleanup 'b' in dnstap-read main"

Closes #4406

See merge request isc-projects/bind9!8455

2 years agoCleanup dead code in dnstap-read
Mark Andrews [Wed, 1 Nov 2023 17:09:25 +0000 (04:09 +1100)] 
Cleanup dead code in dnstap-read

Remove 'b' from main as it is unused.

2 years agoMerge branch '4209-turn-on-qname-minimisation-for-adb-name-fetches' into 'main'
Mark Andrews [Wed, 1 Nov 2023 17:13:47 +0000 (17:13 +0000)] 
Merge branch '4209-turn-on-qname-minimisation-for-adb-name-fetches' into 'main'

Resolve "Turn on QNAME minimisation for adb name fetches."

Closes #4209

See merge request isc-projects/bind9!8107

2 years agoAdd release note for [GL #4209]
Mark Andrews [Tue, 18 Jul 2023 02:24:07 +0000 (12:24 +1000)] 
Add release note for [GL #4209]

2 years agoAdd CHANGES note for [GL #4209]
Mark Andrews [Tue, 18 Jul 2023 02:21:32 +0000 (12:21 +1000)] 
Add CHANGES note for [GL #4209]

2 years agoif GLUEOK is set, and glue is found in a zone DB, don't check the cache
Evan Hunt [Mon, 14 Aug 2023 21:28:53 +0000 (14:28 -0700)] 
if GLUEOK is set, and glue is found in a zone DB, don't check the cache

EXPERIMENT: when DNS_DB_GLUEOK is set, dns_view_find() will now return
glue if it is found it a local zone database, without checking to see
if a better answer has been cached previously.

2 years agoAlso look for additional records in dns_adb_find
Mark Andrews [Mon, 14 Aug 2023 00:26:18 +0000 (10:26 +1000)] 
Also look for additional records in dns_adb_find

If a child zone is served by the same servers as a parent zone and
a NS query is made for the zone name then the addresses of the
nameservers are returned in the additional section are tagged as
trust additional.

2 years agoTurn on QNAME minimisation when fetching nameserver addresses
Mark Andrews [Tue, 18 Jul 2023 02:18:05 +0000 (12:18 +1000)] 
Turn on QNAME minimisation when fetching nameserver addresses

2 years agoMerge branch '4340-fix-max-cache-size' into 'main'
Evan Hunt [Wed, 1 Nov 2023 15:18:18 +0000 (15:18 +0000)] 
Merge branch '4340-fix-max-cache-size' into 'main'

restore isc_mem_setwater() call in the cache

Closes #4340

See merge request isc-projects/bind9!8445

2 years agoAdd release note for GL #4340
Michał Kępień [Wed, 1 Nov 2023 06:22:03 +0000 (07:22 +0100)] 
Add release note for GL #4340

2 years agoCHANGES for [GL #4340]
Evan Hunt [Tue, 31 Oct 2023 11:04:38 +0000 (12:04 +0100)] 
CHANGES for [GL #4340]

2 years agorestore isc_mem_setwater() call in the cache
Evan Hunt [Tue, 31 Oct 2023 11:00:14 +0000 (12:00 +0100)] 
restore isc_mem_setwater() call in the cache

Commit 4db150437e14b28c5b50ae466af9ce502fd73185 incorrectly removed the
call to isc_mem_setwater() from dns_cache_setcachesize().  The water()
function is a no-op, but we still need to set high- and low-water marks
in the memory context, otherwise overmem conditions will not be
detected.

2 years agoMerge branch 'tkrizek/perf-tests-shotgun' into 'main'
Tom Krizek [Wed, 1 Nov 2023 13:38:35 +0000 (13:38 +0000)] 
Merge branch 'tkrizek/perf-tests-shotgun' into 'main'

Add DNS Shotgun performance tests to nightly pipelines

See merge request isc-projects/bind9!8373

2 years agoUpdate release checklist
Tom Krizek [Wed, 25 Oct 2023 13:51:23 +0000 (15:51 +0200)] 
Update release checklist

Add a step to verify results of shotgun:* jobs.

2 years agoci: trigger a DNS Shotgun performance test
Tom Krizek [Wed, 27 Sep 2023 13:48:31 +0000 (15:48 +0200)] 
ci: trigger a DNS Shotgun performance test

Run comparative performance tests against the latest released version of
the same branch. This is done for different protocols with an
appropriate load the server is expected to be able to handle.

Currently, the results need to be inspected manually, since a success of
the job doesn't indicate there is no issue. Instead, the job provides an
URL to an overview with latency, memory and CPU charts which display the
test results with the current code against the reference version. There
should be no major unexplained and reproducible differences in the
charts.

2 years agoutil: script to get DNS Shotgun pipeline results
Tom Krizek [Wed, 27 Sep 2023 15:41:26 +0000 (17:41 +0200)] 
util: script to get DNS Shotgun pipeline results

The shotgun performance tests are executed in a different repository, in
a couple of different pipelines. To hide away the complexity, this
script takes the pipeline ID of the triggered pipeline and then takes
care of the rest - waits for the pipeline to finish, locates the child
pipeline and the relevant results. The output from this script is a
convenient link to the charts with the results once they're available.

GitLab also has a mechanism which can wait for another pipeline.
However, it can't be utilized here, since there are variables which
need to be passed in when the pipeline is triggered (like protocol to be
tested, load, runtime etc.). This isn't currently supported by the
GitLab feature.

2 years agoci: move baseline version detection into separate job
Tom Krizek [Wed, 27 Sep 2023 13:26:10 +0000 (15:26 +0200)] 
ci: move baseline version detection into separate job

Multiple CI jobs may utilize a baseline version, i.e. the version that
the current code should be tested against when doing comparative
testing. To avoid repeating the non-trivial detection of the baseline
version, move it into a separate job which creates an environment file
that subsequent jobs may require via `needs` option. It is then possible
to use the variable(s) defined in the script section of the new job.

2 years agoMerge branch '4355-serve-stale-unexpected-recursion' into 'main'
Matthijs Mekking [Tue, 31 Oct 2023 12:49:51 +0000 (12:49 +0000)] 
Merge branch '4355-serve-stale-unexpected-recursion' into 'main'

Don't ignore authoritative local zones when in serve-stale mode

Closes #4355

See merge request isc-projects/bind9!8415

2 years agoAdd release note and CHANGES for #4355
Matthijs Mekking [Mon, 23 Oct 2023 12:38:47 +0000 (14:38 +0200)] 
Add release note and CHANGES for #4355

2 years agoDon't ignore auth zones when in serve-stale mode
Matthijs Mekking [Mon, 30 Oct 2023 18:33:19 +0000 (19:33 +0100)] 
Don't ignore auth zones when in serve-stale mode

When serve-stale is enabled and recursive resolution fails, the fallback
to lookup stale data always happens in the cache database. Any
authoritative data is ignored, and only information learned through
recursive resolution is examined.

If there is data in the cache that could lead to an answer, and this can
be just the root delegation, the resolver will iterate further, getting
closer to the answer that can be found by recursing down the root, and
eventually puts the final response in the cache.

Change the fallback to serve-stale to use 'query_getdb()', that finds
out the best matching database for the given query.

2 years agoTest case for issue #4355
Matthijs Mekking [Mon, 23 Oct 2023 11:52:12 +0000 (13:52 +0200)] 
Test case for issue #4355

Add a test case where serve-stale is enabled on a server that also
servers a local authoritative zone.

The particular case tests a lame delegation and checks if falling
back to serving stale data does not attempt to retrieve the query
by recursing from the root down.

2 years agoMerge branch 'ondrej/bump-dns_message-pools-size' into 'main'
Ondřej Surý [Sat, 28 Oct 2023 06:52:30 +0000 (06:52 +0000)] 
Merge branch 'ondrej/bump-dns_message-pools-size' into 'main'

Bump the mempool sizes in dns_message

See merge request isc-projects/bind9!8439

2 years agoBump the mempool sizes in dns_message
Ondřej Surý [Fri, 27 Oct 2023 06:54:59 +0000 (08:54 +0200)] 
Bump the mempool sizes in dns_message

Increasing the initial and freemax sizes for dns_message memory pools
restores the root zone performance.  The former sizes were suited for
per-dns_message memory pools and we need to bump the sizes up for
per-thread memory pools.

2 years agoMerge branch '4390-always-use-default-rcu-variant-in-pairwise-builds' into 'main'
Michał Kępień [Fri, 27 Oct 2023 11:59:46 +0000 (11:59 +0000)] 
Merge branch '4390-always-use-default-rcu-variant-in-pairwise-builds' into 'main'

Always use default RCU variant in pairwise builds

Closes #4390

See merge request isc-projects/bind9!8438

2 years agoAlways use default RCU variant in pairwise builds
Michał Kępień [Fri, 27 Oct 2023 11:19:03 +0000 (13:19 +0200)] 
Always use default RCU variant in pairwise builds

Commit 42d43aa0758513a45b54e0fd0bff4381fdc4d803 made --with-liburcu
depend on --enable-developer.  This broke pairwise testing as this new
dependency was not codified in configure.ac.  Since the --with-liburcu
option is currently just a convenience for developers, there is no need
to test building against all possible RCU variants in GitLab CI until
they actually work with BIND 9.  Update the pairwise testing
"configuration" in configure.ac so that builds with non-standard RCU
variants are not tested.

2 years agoMerge branch '4392-increase-dispatch_test-timeouts' into 'main'
Ondřej Surý [Fri, 27 Oct 2023 11:00:20 +0000 (11:00 +0000)] 
Merge branch '4392-increase-dispatch_test-timeouts' into 'main'

Bump the timeouts in the dispatch_test

Closes #4392

See merge request isc-projects/bind9!8437

2 years agoBump the timeouts in the dispatch_test
Ondřej Surý [Fri, 27 Oct 2023 09:44:02 +0000 (11:44 +0200)] 
Bump the timeouts in the dispatch_test

The client connection timeout was set to just one second, which might
not be enough on busy systems (and the CI machines are oh-boy-busy).
Bump the server timeouts to 10 seconds and client timeouts to 5 seconds,
this will make the unit test run a little bit longer, but it should be
more reliable.

2 years agoAdd tests/dns/badcache.out to .gitignore
Ondřej Surý [Fri, 27 Oct 2023 09:46:38 +0000 (11:46 +0200)] 
Add tests/dns/badcache.out to .gitignore

2 years agoMerge branch '4211-fix-data-race-in-controlconf' into 'main'
Ondřej Surý [Fri, 27 Oct 2023 10:47:57 +0000 (10:47 +0000)] 
Merge branch '4211-fix-data-race-in-controlconf' into 'main'

Call isccc_ccmsg_invalidate() when shutting down the connection

Closes #4211

See merge request isc-projects/bind9!8426

2 years agoCall isccc_ccmsg_invalidate() when shutting down the connection
Ondřej Surý [Fri, 27 Oct 2023 08:16:13 +0000 (10:16 +0200)] 
Call isccc_ccmsg_invalidate() when shutting down the connection

Previously, the isccc_ccmsg_invalidate() was called from conn_free() and
this could lead to netmgr calling control_recvmessage() after we
detached the reading controlconnection_t reference, but it wouldn't be
the last reference because controlconnection_t is also attached/detached
when sending response or running command asynchronously.

Instead, move the isccc_ccmsg_invalidate() call to control_recvmessage()
error handling path to make sure that control_recvmessage() won't be
ever called again from the netmgr.

2 years agoReplace mutex for listener->connections with TID check
Ondřej Surý [Thu, 26 Oct 2023 08:47:03 +0000 (10:47 +0200)] 
Replace mutex for listener->connections with TID check

The controlconf channel runs single-threaded on the main thread.
Replace the listener->connections locking with check that we are still
running on the thread with TID 0.

2 years agoMerge branch '4391-remove-lock-file-and--X' into 'main'
Ondřej Surý [Fri, 27 Oct 2023 06:36:16 +0000 (06:36 +0000)] 
Merge branch '4391-remove-lock-file-and--X' into 'main'

Remove the lock-file configuration and -X argument to named

Closes #4391

See merge request isc-projects/bind9!8428

2 years agoAdd CHANGES and release note for [GL #4391]
Ondřej Surý [Thu, 26 Oct 2023 10:00:32 +0000 (12:00 +0200)] 
Add CHANGES and release note for [GL #4391]

2 years agoRemove the lock-file configuration and -X argument to named
Ondřej Surý [Thu, 26 Oct 2023 09:55:54 +0000 (11:55 +0200)] 
Remove the lock-file configuration and -X argument to named

The lock-file configuration (both from configuration file and -X
argument to named) has better alternatives nowadays.  Modern process
supervisor should be used to ensure that a single named process is
running on a given configuration.

Alternatively, it's possible to wrap the named with flock(1).

2 years agoMark the lock-file configuration option as deprecated
Ondřej Surý [Thu, 26 Oct 2023 09:08:49 +0000 (11:08 +0200)] 
Mark the lock-file configuration option as deprecated

This is first step in removing the lock-file configuration option, it
marks both the `lock-file` configuration directive and -X option to
named as deprecated.

2 years agoMerge branch 'mnowak/openbsd-7.4' into 'main'
Michal Nowak [Thu, 26 Oct 2023 14:31:13 +0000 (14:31 +0000)] 
Merge branch 'mnowak/openbsd-7.4' into 'main'

Add OpenBSD 7.4

See merge request isc-projects/bind9!8395

2 years agoAdd OpenBSD 7.4
Michal Nowak [Tue, 17 Oct 2023 14:31:51 +0000 (16:31 +0200)] 
Add OpenBSD 7.4

2 years agoMerge branch 'aram/fix-lock-file-option-and--X-argument-issues' into 'main'
Arаm Sаrgsyаn [Thu, 26 Oct 2023 13:11:30 +0000 (13:11 +0000)] 
Merge branch 'aram/fix-lock-file-option-and--X-argument-issues' into 'main'

Fix assertion failure when using -X none and lock-file in configuration

See merge request isc-projects/bind9!8432

2 years agoDo not warn about lock-file option change when -X is used
Aram Sargsyan [Thu, 26 Oct 2023 12:28:25 +0000 (12:28 +0000)] 
Do not warn about lock-file option change when -X is used

When -X is used the 'lock-file' option change detection condition
is invalid, because it compares the 'lock-file' option's value to
the '-X' argument's value instead of the older 'lock-file' option
value (which was ignored because of '-X').

Don't warn about changing 'lock-file' option if '-X' is used.

2 years agoFix an invalid condition check when detecting a lock-file change
Aram Sargsyan [Thu, 26 Oct 2023 12:24:17 +0000 (12:24 +0000)] 
Fix an invalid condition check when detecting a lock-file change

It is obvious that the '!cfg_obj_asstring(obj)' check should be
'cfg_obj_asstring(obj)' instead, because it is an AND logic chain
which further uses 'obj' as a string.

Fix the error.

2 years agoFix assertion failure when using -X none and lock-file in configuration
Aram Sargsyan [Thu, 26 Oct 2023 12:21:57 +0000 (12:21 +0000)] 
Fix assertion failure when using -X none and lock-file in configuration

When 'lock-file <lockfile>' is used in configuration at the same time
as using '-X none' in 'named' invocation, there is an invalid
logic that would lead to a isc_mem_strdup() call on a NULL value.

Also, contradicting to ARM, 'lock-file none' is overriding the '-X'
argument.

Fix the overall logic, and make sure that the '-X' takes precedence to
'lock-file'.

2 years agoMerge branch '4386-fix-assertion-failure-when-using--X-named-option' into 'main'
Ondřej Surý [Thu, 26 Oct 2023 11:43:13 +0000 (11:43 +0000)] 
Merge branch '4386-fix-assertion-failure-when-using--X-named-option' into 'main'

Fix assertion failure when using -X and lock-file in configuration

Closes #4386

See merge request isc-projects/bind9!8427

2 years agoAdd CHANGES and release note for [GL #4386]
Ondřej Surý [Thu, 26 Oct 2023 08:59:53 +0000 (10:59 +0200)] 
Add CHANGES and release note for [GL #4386]

2 years agoFix assertion failure when using -X and lock-file in configuration
Ondřej Surý [Thu, 26 Oct 2023 08:54:28 +0000 (10:54 +0200)] 
Fix assertion failure when using -X and lock-file in configuration

When 'lock-file <lockfile1>' was used in configuration at the same time
as using `-X <lockfile2>` in `named` invocation, there was an invalid
logic that would lead to a double isc_mem_strdup() call on the
<lockfile2> value.

Skip the second allocation if `lock-file` is being used in
configuration, so the <lockfile2> is used only single time.

2 years agoMerge branch 'tkrizek/shfmt' into 'main'
Tom Krizek [Thu, 26 Oct 2023 09:01:06 +0000 (09:01 +0000)] 
Merge branch 'tkrizek/shfmt' into 'main'

Enforce shell script codestyle with shfmt

See merge request isc-projects/bind9!8419

2 years agoIgnore shell script formatting in git blame
Tom Krizek [Tue, 24 Oct 2023 12:55:07 +0000 (14:55 +0200)] 
Ignore shell script formatting in git blame

2 years agoAdd editorconfig file for shell style
Tom Krizek [Wed, 25 Oct 2023 08:14:12 +0000 (10:14 +0200)] 
Add editorconfig file for shell style

2 years agoRun shfmt in CI
Tom Krizek [Tue, 24 Oct 2023 12:56:06 +0000 (14:56 +0200)] 
Run shfmt in CI

Ensure our shell script format stays consistent in the future.

2 years agoReformat shell scripts with shfmt
Tom Krizek [Tue, 24 Oct 2023 12:43:14 +0000 (14:43 +0200)] 
Reformat shell scripts with shfmt

All changes in this commit were automated using the command:

  shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)

2 years agoMerge branch '4390-allow-changing-liburcu-mode-only-in-developer-mode' into 'main'
Ondřej Surý [Thu, 26 Oct 2023 08:21:49 +0000 (08:21 +0000)] 
Merge branch '4390-allow-changing-liburcu-mode-only-in-developer-mode' into 'main'

Allowing changing Userspace-RCU variant only in developer mode

Closes #4390

See merge request isc-projects/bind9!8425

2 years agoRemove Userspace-RCU signal variant
Ondřej Surý [Thu, 26 Oct 2023 07:17:17 +0000 (09:17 +0200)] 
Remove Userspace-RCU signal variant

The signal variant of Userspace-RCU has been deprecated upstream.
Remove the support for compiling with it from configure.ac.

2 years agoAllowing changing Userspace-RCU variant only in developer mode
Ondřej Surý [Thu, 26 Oct 2023 07:14:10 +0000 (09:14 +0200)] 
Allowing changing Userspace-RCU variant only in developer mode

The Userspace-RCU variants other than membarrier is untested and at
least in QSBR case it's broken.  Allow changing the Userspace-RCU
variant only in the developer's mode.

2 years agoMerge branch '4385-qp-lookup-race' into 'main'
Evan Hunt [Thu, 26 Oct 2023 07:34:57 +0000 (07:34 +0000)] 
Merge branch '4385-qp-lookup-race' into 'main'

prevent a possible race in dns_qpmulti_query()

Closes #4385

See merge request isc-projects/bind9!8421

2 years agoPrevent a possible race in dns_qpmulti_query() and _snapshot()
Evan Hunt [Wed, 25 Oct 2023 21:59:55 +0000 (14:59 -0700)] 
Prevent a possible race in dns_qpmulti_query() and _snapshot()

The `.reader` member of dns_qpmulti_t was accessed without RCU
protection; reader_open() calls rcu_dereference() on it, and this
call needs to be inside an RCU critical section.

A similar problem was identified in the dns_qpmulti_snapshot() - the
RCU critical section was completely missing.

These are relicts of the isc_qsbr - in the QSBR mode the rcu_read_lock()
and rcu_read_unlock() are no-ops and whole event loop is a critical section.

2 years agoMerge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed'...
Mark Andrews [Thu, 26 Oct 2023 07:02:01 +0000 (07:02 +0000)] 
Merge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed' into 'main'

Resolve "lock file is deleted on exit even if lock acquisition failed"

Closes #4387

See merge request isc-projects/bind9!8422

2 years agoAdd release note for [GL #4387]
Mark Andrews [Thu, 26 Oct 2023 05:14:02 +0000 (16:14 +1100)] 
Add release note for [GL #4387]

2 years agoAdd CHANGES note for [GL #4387]
Mark Andrews [Thu, 26 Oct 2023 04:07:58 +0000 (15:07 +1100)] 
Add CHANGES note for [GL #4387]

2 years agoCheck that the lock file was not removed too early
Mark Andrews [Thu, 26 Oct 2023 04:07:58 +0000 (15:07 +1100)] 
Check that the lock file was not removed too early

When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

2 years agoOnly remove the lock file if we managed to lock it
Mark Andrews [Thu, 26 Oct 2023 03:50:43 +0000 (14:50 +1100)] 
Only remove the lock file if we managed to lock it

The lock file was being removed when we hadn't successfully locked
it which defeated the purpose of the lockfile.  Adjust cleanup_lockfile
such that it only unlinks the lockfile if we have successfully locked
the lockfile and it is still active (lockfile != NULL).

2 years agoMerge branch 'ondrej/dns_message-refactoring' into 'main'
Ondřej Surý [Wed, 25 Oct 2023 10:37:16 +0000 (10:37 +0000)] 
Merge branch 'ondrej/dns_message-refactoring' into 'main'

Refactor and cleanup the dns_message unit

See merge request isc-projects/bind9!8400

2 years agoRefactor dns_message using ISC_LIST_FOREACH macros
Ondřej Surý [Thu, 19 Oct 2023 08:22:59 +0000 (10:22 +0200)] 
Refactor dns_message using ISC_LIST_FOREACH macros

Do a light refactoring and cleanups that replaces common list walking
patterns with ISC_LIST_FOREACH macros and split some nested loops into
separate static functions to reduce the nesting depth.

2 years agoAdd ISC_LIST_FOREACH_REV(_SAFE) macros
Ondřej Surý [Thu, 19 Oct 2023 08:21:20 +0000 (10:21 +0200)] 
Add ISC_LIST_FOREACH_REV(_SAFE) macros

Add complementary macros to ISC_LIST_FOREACH(_SAFE) that walk the lists
in reverse.

  * ISC_LIST_FOREACH_REV(list, elt, link) - walk the static list from
    tail to head
  * ISC_LIST_FOREACH_REV_SAFE(list, elt, link, next) - walk the list
    from tail to head in a manner that's safe against list member
    deletions

2 years agoAdd dns__message_putassociatedrdataset() to deduplicate code
Ondřej Surý [Thu, 19 Oct 2023 07:41:55 +0000 (09:41 +0200)] 
Add dns__message_putassociatedrdataset() to deduplicate code

There was a lot of internal code looking like this:

    INSIST(dns_rdataset_isassociated(rdataset));
    dns_rdataset_disassociated(rdataset)
    isc_mempool_put(msg->rdspool, rdataset);

Deduplicate the code into local dns__message_puttemprdataset() routine,
and drop the INSIST() which is checked in dns_rdataset_disassociate().

2 years agoRemove unused dns_message_movename() method
Ondřej Surý [Wed, 18 Oct 2023 14:19:41 +0000 (16:19 +0200)] 
Remove unused dns_message_movename() method

Since dns_message_movename() was unused, it could be removed from the
code based to declutter the API.

2 years agoMerge branch '4379-dont-reuse-TCP-dispatches-in-dns_xfrin' into 'main'
Ondřej Surý [Tue, 24 Oct 2023 12:19:23 +0000 (12:19 +0000)] 
Merge branch '4379-dont-reuse-TCP-dispatches-in-dns_xfrin' into 'main'

Add option to mark TCP dispatch as unshared

Closes #4379

See merge request isc-projects/bind9!8408

2 years agoAdd CHANGES note for [GL #4379]
Ondřej Surý [Fri, 20 Oct 2023 06:20:30 +0000 (08:20 +0200)] 
Add CHANGES note for [GL #4379]

2 years agoAdd dispatch_getcp and dispatch_newtcp tests
Ondřej Surý [Mon, 23 Oct 2023 10:26:50 +0000 (12:26 +0200)] 
Add dispatch_getcp and dispatch_newtcp tests

Refactor the dispatch unit test to use more local variables (previously
dispatchmgr, dispatch and dispentry were all global), and add two new
tests:

* dispatch_getcp - test whether the TCP connection will get reused
* dispatch_newtcp - test that the TCP connection will not get reused
                    when DNS_DISPATCHOPT_UNSHARED is in effect

2 years agoAdd option to mark TCP dispatch as unshared
Ondřej Surý [Fri, 20 Oct 2023 06:14:27 +0000 (08:14 +0200)] 
Add option to mark TCP dispatch as unshared

The current dispatch code could reuse the TCP connection when
dns_dispatch_gettcp() would be used first.  This is problematic as the
dns_resolver doesn't use TCP connection sharing, but dns_request could
get the TCP stream that was created outside of the dns_request.

Add new DNS_DISPATCHOPT_UNSHARED option to dns_dispatch_createtcp() that
would prevent the TCP stream to be reused.  Use that option in the
dns_resolver call to dns_dispatch_createtcp() to prevent dns_request
from reusing the TCP connections created by dns_resolver.

Additionally, the dns_xfrin unit added TCP connection sharing for
incoming transfers.  While interleaving *xfr streams on a TCP connection
should work this should be a deliberate change and be property of the
server that can be controlled.  Additionally some level of parallel TCP
streams is desirable.  Revert to the old behaviour by removing the
dns_dispatch_gettcp() calls from dns_xfrin and use the new option to
prevent from sharing the transfer streams with dns_request.

2 years agoMerge branch '4380-keep-the-offloaded-work-result-local' into 'main'
Ondřej Surý [Tue, 24 Oct 2023 10:49:42 +0000 (10:49 +0000)] 
Merge branch '4380-keep-the-offloaded-work-result-local' into 'main'

Don't set the offloaded work result from main thread

Closes #4380

See merge request isc-projects/bind9!8407

2 years agoDon't set the offloaded work result from main thread
Ondřej Surý [Fri, 20 Oct 2023 05:58:26 +0000 (07:58 +0200)] 
Don't set the offloaded work result from main thread

The xfrin_recv_done() was accessing xfr->result where we stored the
result of the offloaded work from a thread that could receive data while
processing the transfer on the offloaded thread.

Completely remove the offloaded result from the dns_xfrin_t structure
and keep it local for *xfr_apply() and *xfr_apply_done() as the failure
is already recorded in .shutdown_result and we now that the processing
has failed because .shuttingdown has been already set.

2 years agoMerge branch '4377-sd_notify-RELOADING-add-MONOTONIC_USEC-field' into 'main'
Arаm Sаrgsyаn [Mon, 23 Oct 2023 14:49:14 +0000 (14:49 +0000)] 
Merge branch '4377-sd_notify-RELOADING-add-MONOTONIC_USEC-field' into 'main'

Resolve "named support of a systemd unit with 'notify-reload' service type is incomplete"

Closes #4377

See merge request isc-projects/bind9!8403

2 years agoAdd a CHANGES note for [GL #4377]
Aram Sargsyan [Thu, 19 Oct 2023 13:08:26 +0000 (13:08 +0000)] 
Add a CHANGES note for [GL #4377]

2 years agosd_notify(3): set the MONOTONIC_USEC field with RELOADING=1
Aram Sargsyan [Thu, 19 Oct 2023 12:57:13 +0000 (12:57 +0000)] 
sd_notify(3): set the MONOTONIC_USEC field with RELOADING=1

When using sd_notify(3) to send a message to the service manager
about named being reloaded, systemd also requires the MONOTONIC_USEC
field to be set to the current monotonic time in microseconds,
otherwise the 'systemctl reload' command fails.

Add the MONOTONIC_USEC field to the message.

See 'man 5 systemd.service' for more information.

2 years agoMerge branch '4381-assert-in-dns__catz_update_cb-on-shutdown' into 'main'
Arаm Sаrgsyаn [Mon, 23 Oct 2023 09:39:14 +0000 (09:39 +0000)] 
Merge branch '4381-assert-in-dns__catz_update_cb-on-shutdown' into 'main'

Resolve "Assertion failure in dns__catz_update_cb() on shutdown"

Closes #4381

See merge request isc-projects/bind9!8409

2 years agoAdd a CHANGES note for [GL #4381]
Aram Sargsyan [Fri, 20 Oct 2023 10:55:14 +0000 (10:55 +0000)] 
Add a CHANGES note for [GL #4381]

2 years agoFix shutdown races in catzs
Aram Sargsyan [Fri, 20 Oct 2023 10:45:35 +0000 (10:45 +0000)] 
Fix shutdown races in catzs

The dns__catz_update_cb() does not expect that 'catzs->zones'
can become NULL during shutdown.

Add similar checks in the dns__catz_update_cb() and dns_catz_zone_get()
functions to protect from such a case. Also add an INSIST in the
dns_catz_zone_add() function to explicitly state that such a case
is not expected there, because that function is called only during a
reconfiguration.

2 years agoMerge branch '4152-reproducer-stack-exhaustion' into 'main'
Michal Nowak [Fri, 20 Oct 2023 14:23:20 +0000 (14:23 +0000)] 
Merge branch '4152-reproducer-stack-exhaustion' into 'main'

Add test for CVE-2023-3341

See merge request isc-projects/bind9!8410

2 years agoAdd test for CVE-2023-3341
Michal Nowak [Wed, 12 Jul 2023 08:26:53 +0000 (10:26 +0200)] 
Add test for CVE-2023-3341

2 years agoMerge branch '4372-assertion-failure-in-dispatch-c' into 'main'
Mark Andrews [Fri, 20 Oct 2023 09:26:07 +0000 (09:26 +0000)] 
Merge branch '4372-assertion-failure-in-dispatch-c' into 'main'

Resolve "Assertion failure in dispatch.c"

Closes #4372

See merge request isc-projects/bind9!8397

2 years agoAdd CHANGES note for [GL #4372]
Mark Andrews [Thu, 19 Oct 2023 03:52:15 +0000 (14:52 +1100)] 
Add CHANGES note for [GL #4372]

2 years agoTest xfrin's handing of EDNS failure scenarios
Mark Andrews [Thu, 19 Oct 2023 03:38:59 +0000 (14:38 +1100)] 
Test xfrin's handing of EDNS failure scenarios

We test EDNS requests returning FORMERR where named is expected
to retry without EDNS.

We test EDNS requests returning NOTIMP where named is expected
to fail the transfer as the remote end is not protocol compliant.

2 years agohandle pre-existing disp/dispentry when retrying
Evan Hunt [Wed, 18 Oct 2023 20:07:24 +0000 (13:07 -0700)] 
handle pre-existing disp/dispentry when retrying

when xfrin_start() is called to retry a transfer, close the existing
dispatch entry and reuse the existing dispatch.

2 years agoTest NOTIMP being returned to an IXFR request in xfrin
Mark Andrews [Wed, 18 Oct 2023 07:13:52 +0000 (18:13 +1100)] 
Test NOTIMP being returned to an IXFR request in xfrin

The server is expected to retry the transfer using SOA and if
the returned serial is greater than the current serial AXFR.

Check the log that IXFR is request.

2 years agoMerge branch '4101-update-b-root-server-net-addresses' into 'main'
Mark Andrews [Fri, 20 Oct 2023 03:44:36 +0000 (03:44 +0000)] 
Merge branch '4101-update-b-root-server-net-addresses' into 'main'

Resolve "Update b.root-server.net addresses"

Closes #4101

See merge request isc-projects/bind9!8371

2 years agoAdd release note for [GL #4101]
Mark Andrews [Wed, 11 Oct 2023 23:26:38 +0000 (10:26 +1100)] 
Add release note for [GL #4101]

2 years agoAdd CHANGES note for [GL #4101]
Mark Andrews [Wed, 11 Oct 2023 23:24:50 +0000 (10:24 +1100)] 
Add CHANGES note for [GL #4101]

2 years agoSuppress reporting upcoming changes in root hints
Mark Andrews [Tue, 17 Oct 2023 23:45:41 +0000 (10:45 +1100)] 
Suppress reporting upcoming changes in root hints

To reduce the amount of log spam when root servers change their
addresses keep a table of upcoming changes by expected date and time
and suppress reporting differences for them until then.

Add initial entry for B.ROOT-SERVERS.NET, Nov 27, 2023.

2 years agoUpdate b.root-servers.net IP addresses
Mark Andrews [Wed, 11 Oct 2023 23:19:38 +0000 (10:19 +1100)] 
Update b.root-servers.net IP addresses

This covers both root hints and the default primaries for the root
zone mirror.  The official change date is Nov 27, 2023.

2 years agoMerge branch '4367-offload-ixfr-processing' into 'main'
Ondřej Surý [Thu, 19 Oct 2023 13:40:09 +0000 (13:40 +0000)] 
Merge branch '4367-offload-ixfr-processing' into 'main'

Offload AXFR and IXFR processing

Closes #4367

See merge request isc-projects/bind9!8399