]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoMerge branch '3797-part1-zone-task-refactoring' into 'main'
Evan Hunt [Mon, 23 Jan 2023 21:06:49 +0000 (21:06 +0000)] 
Merge branch '3797-part1-zone-task-refactoring' into 'main'

refactor zone.c to use loop callbacks

See merge request isc-projects/bind9!7365

3 years agoEnforce receive_secure_serial() and setnsec3param() serialization
Ondřej Surý [Mon, 23 Jan 2023 12:40:19 +0000 (13:40 +0100)] 
Enforce receive_secure_serial() and setnsec3param() serialization

Both receive_secure_serial() and setnsec3param() run on the same zone
loop, therefore they are serialized.  Remove the mechanism to enqueue
the nsec3param and secure serial updates in case one of them is
running (as they can not) and replace it with sanity check.

3 years agoReplace the dns_io_t mechanism with offloaded threads
Ondřej Surý [Mon, 23 Jan 2023 11:13:43 +0000 (12:13 +0100)] 
Replace the dns_io_t mechanism with offloaded threads

Previously, the zone loading and dumping was effectively serialized by
the dns_io_t mechanism.  In theory, more IO operations could be run in
parallel, but the zone manager .iolimit was set to 1 and never increased
as dns_zonemgr_setiolimit() was never ever called.

As the dns_master asynchronous load and dump was already offloaded to
non-worker threads with isc_work mechanism, drop the whole dns_io_t
and just rely on the isc_work to do the load and dump scheduling.

3 years agorefactor inline signing processing to use loop callbacks
Evan Hunt [Wed, 26 Oct 2022 05:26:25 +0000 (22:26 -0700)] 
refactor inline signing processing to use loop callbacks

receive_secure_serial() and receive_secure_db() now use
loop callbacks instead of task events.

3 years agorefactor setnsec3param() to use loop callbacks
Evan Hunt [Wed, 26 Oct 2022 04:32:04 +0000 (21:32 -0700)] 
refactor setnsec3param() to use loop callbacks

dynamic nsec3param update processing now uses loop callbacks
instead of task events.

3 years agorefactor asynchronous zone functions to use loop callbacks
Evan Hunt [Tue, 25 Oct 2022 22:23:54 +0000 (15:23 -0700)] 
refactor asynchronous zone functions to use loop callbacks

Use loopmgr callbacks for:
- dns_zone_keydone() (also added missing documentation)
- dns_zone_setserial()
- zmgr_start_xfrin_ifquota()

3 years agorefactor dns_io to use loop callbacks
Evan Hunt [Tue, 25 Oct 2022 22:06:50 +0000 (15:06 -0700)] 
refactor dns_io to use loop callbacks

The zonemgr_getio() system now uses loopmgr callbacks instead of
task events. As zone->loadtasks is now no longer used, it has been
removed.

3 years agoMerge branch '3793-fix-serialized-signing-in-dnssec-signzone' into 'main'
Ondřej Surý [Sun, 22 Jan 2023 20:52:10 +0000 (20:52 +0000)] 
Merge branch '3793-fix-serialized-signing-in-dnssec-signzone' into 'main'

Refactor dnssec-signzone to use loop callbacks

Closes #3793

See merge request isc-projects/bind9!7359

3 years agoAllow interrupting dnssec-signzone during signing
Ondřej Surý [Thu, 12 Jan 2023 20:44:31 +0000 (21:44 +0100)] 
Allow interrupting dnssec-signzone during signing

The signal handler in the isc_loop would wait for all the work to finish
before interrupting the signing.  Add teardown handlers via
isc_loopmgr_teardown() to signal the assignwork() it should stop signing
and bail-out early.

NOTE: The dnssec-signzone binary still can't be interrupted during zone
loading, zone cleaning, nsec(3) chain generation or zone writing.  This
might get addressed in the future if it becomes a problem.

3 years agoDump the signed zone in the text format at the end of dnssec-signzone
Ondřej Surý [Thu, 12 Jan 2023 15:36:43 +0000 (16:36 +0100)] 
Dump the signed zone in the text format at the end of dnssec-signzone

Instead of dumping the signed zone contents node by node during the
signing, dump the entire zone at the end.  This was already done for the
raw zone format, but it shows that the IO is better utilized when the
zone dump is done in one single write rather than in small chunks.

A side effect of dumping node by node was that all names were printed
relative to the zone origin rather than being grouped under different
$ORIGINs as would normally be the case when dumping a zone. Also, state
was not maintained from one node to the next regarding whether the CLASS
has already been printed, so it was always included with the first
record of each node.

Since dnssec-signzone uses the dns_master_style_explicittl text format
style, and is the only application that does so, we can revise that
style and add a new DNS_STYLEFLAG_CLASS_PERNAME flag to get the output
back to what it was before this change.

3 years agoRefactor dnssec-signzone to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 03:10:08 +0000 (20:10 -0700)] 
Refactor dnssec-signzone to use loop callbacks

Use isc_job_run() instead of isc_task_send() for dnssec-signzone
worker threads.

Also fix the issue where the additional assignwork() would be run only
from the main thread effectively serializing all the signing.

3 years agoMerge branch 'each-cleanup-netmgr-trace' into 'main'
Evan Hunt [Fri, 20 Jan 2023 21:12:49 +0000 (21:12 +0000)] 
Merge branch 'each-cleanup-netmgr-trace' into 'main'

complete change of NETMGR_TRACE to ISC_NETMGR_TRACE

See merge request isc-projects/bind9!7390

3 years agocomplete change of NETMGR_TRACE to ISC_NETMGR_TRACE
Evan Hunt [Tue, 17 Jan 2023 21:58:10 +0000 (13:58 -0800)] 
complete change of NETMGR_TRACE to ISC_NETMGR_TRACE

some references to the old ifdef were still in place.

3 years agoMerge branch '3726-query-forward-dot' into 'main'
Arаm Sаrgsyаn [Fri, 20 Jan 2023 15:24:40 +0000 (15:24 +0000)] 
Merge branch '3726-query-forward-dot' into 'main'

Resolve "Forward queries via DoT"

Closes #3726

See merge request isc-projects/bind9!7199

3 years agoAdd CHANGES and release notes for [GL #3726]
Aram Sargsyan [Thu, 8 Dec 2022 13:02:41 +0000 (13:02 +0000)] 
Add CHANGES and release notes for [GL #3726]

3 years agoFix nsupdate system test CA certificate signing validity days
Aram Sargsyan [Thu, 8 Dec 2022 12:34:33 +0000 (12:34 +0000)] 
Fix nsupdate system test CA certificate signing validity days

The validity default days value of 1 was used for debugging and
left as such accidentally.

Use 10950 days, as used elsewhere (for example, in doth test CA).

This does not affect anything, the value will be effective when
generating new test certificates in the future.

3 years agoTest query forwarding to DoT-enabled upstream servers
Aram Sargsyan [Thu, 8 Dec 2022 10:29:15 +0000 (10:29 +0000)] 
Test query forwarding to DoT-enabled upstream servers

Change the 'forward' system test to enable DoT on ns2 server,
and test that forwarding from ns4 to the DoT-enabled ns2 works.

In order to test different scenarios, create a test CA (based on
similar CAs for 'doth' and 'nsupdate' system tests), and test
both insecure (no certificate validation) and secure (also with
mutual TLS) TLS configurations, as well as a configuration with an
expired certificate.

3 years agoResolver query forwarding to DoT-enabled upstream servers
Aram Sargsyan [Thu, 8 Dec 2022 14:18:22 +0000 (14:18 +0000)] 
Resolver query forwarding to DoT-enabled upstream servers

Implement TLS transport usage in the resolver.

Use the configured TLS transport for the forwarders in the resolver.

3 years agoLoad and validate the configured TLS transport for forwarders
Aram Sargsyan [Thu, 8 Dec 2022 14:17:24 +0000 (14:17 +0000)] 
Load and validate the configured TLS transport for forwarders

Add support for loading and validating the 'tls' parameter from
the forwarders' configuration.

This prepares ground for adding support to forward queries to
DoT-enabled upstream servers.

3 years agoAdd 'tls' configuration support for the 'forwarders' option
Aram Sargsyan [Thu, 8 Dec 2022 10:57:37 +0000 (10:57 +0000)] 
Add 'tls' configuration support for the 'forwarders' option

A 'tls' statement can be specified both for individual addresses
and for the whole list (as a default value when an individual
address doesn't have its own 'tls' set), just as it was done
before for the 'port' value.

Create a new function 'print_rawqstring()' to print a string residing
in a 'isc_textregion_t' type parameter.

Create a new function 'copy_string()' to copy a string from a
'cfg_obj_t' object into a 'isc_textregion_t'.

3 years agoMerge branch 'marka-mock-openbsd' into 'main'
Mark Andrews [Fri, 20 Jan 2023 13:53:16 +0000 (13:53 +0000)] 
Merge branch 'marka-mock-openbsd' into 'main'

Enable mock tests for OpenBSD

See merge request isc-projects/bind9!7309

3 years agoRemove conditional around mock tests for OpenBSD
Mark Andrews [Sun, 8 Jan 2023 22:27:42 +0000 (09:27 +1100)] 
Remove conditional around mock tests for OpenBSD

We now use multiple barriers.

3 years agoMerge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'
Mark Andrews [Fri, 20 Jan 2023 13:29:19 +0000 (13:29 +0000)] 
Merge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'

Resolve "MacOS address in use not handled gracefully"

Closes #3800

See merge request isc-projects/bind9!7381

3 years agoAdd CHANGES note for [GL #3800]
Mark Andrews [Tue, 17 Jan 2023 06:40:36 +0000 (17:40 +1100)] 
Add CHANGES note for [GL #3800]

3 years agoUse INSIST rather then REQUIRE to meet DBC usage rules
Mark Andrews [Tue, 17 Jan 2023 06:31:40 +0000 (17:31 +1100)] 
Use INSIST rather then REQUIRE to meet DBC usage rules

3 years agoisc_nm_listentcp: treat socket failures gracefully
Mark Andrews [Tue, 17 Jan 2023 06:47:32 +0000 (17:47 +1100)] 
isc_nm_listentcp: treat socket failures gracefully

The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.

3 years agoisc_nm_listenudp: treat socket failures gracefully
Mark Andrews [Tue, 17 Jan 2023 06:25:25 +0000 (17:25 +1100)] 
isc_nm_listenudp: treat socket failures gracefully

The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.

3 years agoMerge branch 'artem-fix-building-on-dragonflybsd' into 'main'
Artem Boldariev [Thu, 19 Jan 2023 22:55:45 +0000 (22:55 +0000)] 
Merge branch 'artem-fix-building-on-dragonflybsd' into 'main'

Fix building BIND on DragonFly BSD

Closes #3796

See merge request isc-projects/bind9!7379

3 years agoFix building BIND on DragonFly BSD (on both older an newer versions)
Artem Boldariev [Mon, 16 Jan 2023 16:31:08 +0000 (18:31 +0200)] 
Fix building BIND on DragonFly BSD (on both older an newer versions)

This commit ensures that BIND and supplementary tools still can be
built on newer versions of DragonFly BSD. It used to be the case, but
somewhere between versions 6.2 and 6.4 the OS developers rearranged
headers and moved some function definitions around.

Before that the fact that it worked was more like a coincidence, this
time we, at least, looked at the related man pages included with the
OS.

No in depth testing has been done on this OS as we do not really
support this platform - so it is more like a goodwill act. We can,
however, use this platform for testing purposes, too. Also, we know
that the OS users do use BIND, as it is included in its ports
directory.

Building with './configure' and './configure --without-jemalloc' have
been fixed and are known to work at the time the commit is made.

3 years agoMerge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields' into 'main'
Mark Andrews [Thu, 19 Jan 2023 13:24:32 +0000 (13:24 +0000)] 
Merge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields' into 'main'

Add missing lock when setting node->wild

Closes #3799

See merge request isc-projects/bind9!7392

3 years agoAdd CHANGES for [GL #3799]
Mark Andrews [Wed, 18 Jan 2023 05:00:11 +0000 (16:00 +1100)] 
Add CHANGES for [GL #3799]

3 years agoAdd missing node lock when setting node->wild in rbtdb.c
Mark Andrews [Wed, 18 Jan 2023 04:54:42 +0000 (15:54 +1100)] 
Add missing node lock when setting node->wild in rbtdb.c

The write node lock needs to be held when setting node->wild in
add_wildcard_magic except when being called from loading_addrdataset
which is used to load the zone without locking during its initial
load.

3 years agoMerge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'
Arаm Sаrgsyаn [Thu, 19 Jan 2023 11:21:19 +0000 (11:21 +0000)] 
Merge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'

Refactor isc_nm_xfr_allowed()

Closes #3808

See merge request isc-projects/bind9!7395

3 years agoAdd a CHANGES note for [GL #3808]
Aram Sargsyan [Wed, 18 Jan 2023 11:09:31 +0000 (11:09 +0000)] 
Add a CHANGES note for [GL #3808]

3 years agoRefactor isc_nm_xfr_allowed()
Aram Sargsyan [Wed, 18 Jan 2023 10:36:34 +0000 (10:36 +0000)] 
Refactor isc_nm_xfr_allowed()

Return 'isc_result_t' type value instead of 'bool' to indicate
the actual failure. Rename the function to something not suggesting
a boolean type result. Make changes in the places where the API
function is being used to check for the result code instead of
a boolean value.

3 years agoMerge branch '3783-parental-ds-requests-need-rd-bit-set' into 'main'
Matthijs Mekking [Thu, 19 Jan 2023 10:20:35 +0000 (10:20 +0000)] 
Merge branch '3783-parental-ds-requests-need-rd-bit-set' into 'main'

Set RD=1 on DS requests to parental-agents

Closes #3783

See merge request isc-projects/bind9!7361

3 years agoAdd CHANGES and release note for GL #3783
Matthijs Mekking [Fri, 13 Jan 2023 13:50:27 +0000 (14:50 +0100)] 
Add CHANGES and release note for GL #3783

News worthy.

3 years agoSet RD bit on checkds requests
Matthijs Mekking [Fri, 13 Jan 2023 13:20:53 +0000 (14:20 +0100)] 
Set RD bit on checkds requests

It is allowed to point parental-agents to a resolver. Therefore, the
RD bit should be set on requests.

Upon receiving a DS response, ensure that the message has either the
AA or the RA bit set.

3 years agoAdd checkds test case with resolver parental-agent
Matthijs Mekking [Fri, 13 Jan 2023 13:13:59 +0000 (14:13 +0100)] 
Add checkds test case with resolver parental-agent

Add a test case for a server that uses a resolver as an parental-agent.

We need two root servers, ns1 and ns10, one that delegates to the
'checkds' tld with the DS published (ns2), and one that delegates to
the 'checkds' tld with the DS removed (ns5). Both root zones are
being setup in the 'ns1/setup.sh' script.

We also need two resolvers, ns3 and ns8, that use different root hints
(one uses ns1 address as a hint, the other uses ns10).

Then add the checks to test_checkds.py is similar to the existing tests.

Update 'types' because for zones that have the DS withdrawn (or to be
withdrawn), the CDS and CDNSKEY records should not be published and
thus should not be in the NSEC bitmap.

3 years agoMerge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inver...
Ondřej Surý [Thu, 19 Jan 2023 09:21:18 +0000 (09:21 +0000)] 
Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inversion' into 'main'

Detach the zone views outside of the zone lock

Closes #3801

See merge request isc-projects/bind9!7402

3 years agoDetach the zone views outside of the zone lock
Ondřej Surý [Thu, 19 Jan 2023 08:14:53 +0000 (09:14 +0100)] 
Detach the zone views outside of the zone lock

Detaching the views in the zone_shutdown() could lead to
lock-order-inversion between adb->namelocks[bucket], adb->lock,
view->lock and zone->lock.  Detach the views outside of the section that
zone-locked.

3 years agoMerge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply' into 'main'
Ondřej Surý [Thu, 19 Jan 2023 09:11:56 +0000 (09:11 +0000)] 
Merge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply' into 'main'

Add python3-ply for ./configure to succeed on BIND 9.16 branch

See merge request isc-projects/bind9!7405

3 years agoAdd python3-ply to GitHub CodeQL configuration
Ondřej Surý [Thu, 19 Jan 2023 09:00:42 +0000 (10:00 +0100)] 
Add python3-ply to GitHub CodeQL configuration

BIND 9.16 needs Python and PLY packages for configure to succeed.
Unless we want to tweak the build script to exclude python, we need to
add python3-ply package to the CodeQL configuration.

3 years agoMerge branch 'ondrej/replace-lgtm-with-codeql' into 'main'
Ondřej Surý [Thu, 19 Jan 2023 08:45:07 +0000 (08:45 +0000)] 
Merge branch 'ondrej/replace-lgtm-with-codeql' into 'main'

Add CodeQL GitHub Action

See merge request isc-projects/bind9!7393

3 years agoAdd CodeQL GitHub Action
Ondřej Surý [Tue, 17 Jan 2023 23:15:58 +0000 (00:15 +0100)] 
Add CodeQL GitHub Action

Replace the decommissioned LGTM service with CodeQL GitHub action.

3 years agoMerge branch '3795-speed-up-EVP_DigestInit_ex-fixup' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 23:32:06 +0000 (23:32 +0000)] 
Merge branch '3795-speed-up-EVP_DigestInit_ex-fixup' into 'main'

Use thread_local EVP_MD in isc_iterated_hash()

Closes #3795

See merge request isc-projects/bind9!7401

3 years agoUse thread_local EVP_MD in isc_iterated_hash()
Ondřej Surý [Wed, 18 Jan 2023 21:38:27 +0000 (22:38 +0100)] 
Use thread_local EVP_MD in isc_iterated_hash()

Cherry-pick small fixup commit from 9.18/9.16 branches needed for
thread-safety.  This fixup commit is not needed for 9.19+ because of
reworked application setup, but it decouples isc_iterated_hash and
isc_md units and keeps all the branches in sync.

3 years agoMerge branch '3795-speed-up-EVP_DigestInit_ex' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 19:24:29 +0000 (19:24 +0000)] 
Merge branch '3795-speed-up-EVP_DigestInit_ex' into 'main'

Avoid implicit algorithm fetch for OpenSSL EVP_MD family

See merge request isc-projects/bind9!7375

3 years agoAdd CHANGES and release note for [GL #3795]
Ondřej Surý [Mon, 16 Jan 2023 09:09:35 +0000 (10:09 +0100)] 
Add CHANGES and release note for [GL #3795]

3 years agoUse thread_local EVP_MD_CTX in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 10:12:06 +0000 (11:12 +0100)] 
Use thread_local EVP_MD_CTX in isc_iterated_hash()

As this code is on hot path (NSEC3) this introduces an additional
optimization of the EVP_MD API - instead of calling EVP_MD_CTX_new() on
every call to isc_iterated_hash(), we create two thread_local objects
for each thread - a basectx and mdctx, initialize basectx once and then
use EVP_MD_CTX_copy_ex() to flip the initialized state into mdctx.  This
saves us couple more valuable microseconds from the isc_iterated_hash()
call.

3 years agoUse OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 11:56:53 +0000 (12:56 +0100)] 
Use OpenSSL 1.x SHA_CTX API in isc_iterated_hash()

If the OpenSSL SHA1_{Init,Update,Final} API is still available, use it.
The API has been deprecated in OpenSSL 3.0, but it is significantly
faster than EVP_MD API, so make an exception here and keep using it
until we can't.

3 years agoUse OpenSSL EVP_MD API directly in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 10:12:06 +0000 (11:12 +0100)] 
Use OpenSSL EVP_MD API directly in isc_iterated_hash()

Instead of going through another layer, use OpenSSL EVP_MD API directly
in the isc_iterated_hash() implementation.  This shaves off couple of
microseconds in the microbenchmark.

3 years agoAvoid implicit algorithm fetch for OpenSSL EVP_MD family
Ondřej Surý [Mon, 16 Jan 2023 08:16:35 +0000 (09:16 +0100)] 
Avoid implicit algorithm fetch for OpenSSL EVP_MD family

The implicit algorithm fetch causes a lock contention and significant
slowdown for small input buffers.  For more details, see:

https://github.com/openssl/openssl/issues/19612

Instead of using EVP_DigestInit_ex() initialize empty MD_CTX objects for
each algorithm and use EVP_MD_CTX_copy_ex() to initialize MD_CTX from a
static copy.  Additionally avoid implicit algorithm fetching by using
EVP_MD_fetch() for OpenSSL 3.0.

3 years agoAdd microbenchmark for isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 09:54:22 +0000 (10:54 +0100)] 
Add microbenchmark for isc_iterated_hash()

Add microbenchmark for isc_iterated_hash() to measure the speed of NSEC3
per second.

3 years agoMerge branch 'ondrej/openssl3-no-deprecated' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 17:18:09 +0000 (17:18 +0000)] 
Merge branch 'ondrej/openssl3-no-deprecated' into 'main'

Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1

See merge request isc-projects/bind9!7394

3 years agoEnable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1
Ondřej Surý [Wed, 18 Jan 2023 10:10:30 +0000 (11:10 +0100)] 
Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1

Add a CI job where we explicitly disable any use of OpenSSL functions
that have been deprecated in OpenSSL 3.x.

3 years agoMerge branch 'each-remove-reserved-dispatches' into 'main'
Evan Hunt [Wed, 18 Jan 2023 02:53:40 +0000 (02:53 +0000)] 
Merge branch 'each-remove-reserved-dispatches' into 'main'

remove dead code for reserved dispatches

See merge request isc-projects/bind9!7391

3 years agoremove dead code for reserved dispatches
Evan Hunt [Wed, 11 Jan 2023 21:41:48 +0000 (13:41 -0800)] 
remove dead code for reserved dispatches

named formerly reserved a set of dispatch objects for use when
sending requests from user-specified source ports. this objects
are no longer used and have been removed.

3 years agoMerge branch '3781-deprecate-source-port' into 'main'
Evan Hunt [Wed, 18 Jan 2023 01:51:43 +0000 (01:51 +0000)] 
Merge branch '3781-deprecate-source-port' into 'main'

mark "port" as deprecated for source address options

Closes #3781

See merge request isc-projects/bind9!7307

3 years agoCHANGES and release note for [GL #3781]
Evan Hunt [Sat, 7 Jan 2023 01:30:07 +0000 (17:30 -0800)] 
CHANGES and release note for [GL #3781]

3 years agoTest deprecate source port configuration
Matthijs Mekking [Wed, 11 Jan 2023 10:10:05 +0000 (11:10 +0100)] 
Test deprecate source port configuration

Add 'port' token to deprecated.conf. Also add options
'use-v4-udp-ports', 'use-v6-udp-ports', 'avoid-v4-udp-ports',
and 'avoid-v6-udp-ports'.

All of these should trigger warnings (except when deprecation warnings
are being ignored).

3 years agomark "port" as deprecated for source address options
Evan Hunt [Sat, 7 Jan 2023 01:01:06 +0000 (17:01 -0800)] 
mark "port" as deprecated for source address options

Deprecate the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Also deprecate use-{v4,v6}-udp-ports and avoid-{v4,v6}udp-ports.

3 years agoMerge branch '3789-remove-dscp' into 'main'
Evan Hunt [Wed, 18 Jan 2023 00:47:24 +0000 (00:47 +0000)] 
Merge branch '3789-remove-dscp' into 'main'

fully remove DSCP

Closes #3789

See merge request isc-projects/bind9!7338

3 years agoCHANGES and release note revision for [GL #3789]
Evan Hunt [Tue, 10 Jan 2023 00:59:47 +0000 (16:59 -0800)] 
CHANGES and release note revision for [GL #3789]

3 years agofully remove DSCP
Evan Hunt [Tue, 10 Jan 2023 00:57:41 +0000 (16:57 -0800)] 
fully remove DSCP

The "dscp" option is now marked as "ancient" and it is a configuration
error to use it or to configure DSCP values for any source-address
option.

3 years agoMerge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach' into 'main'
Ondřej Surý [Tue, 17 Jan 2023 21:47:14 +0000 (21:47 +0000)] 
Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach' into 'main'

Detach the views in zone_shutdown(), not in zone_free()

Closes #3801

See merge request isc-projects/bind9!7382

3 years agoAdd CHANGES and release note for [GL #3801]
Ondřej Surý [Tue, 17 Jan 2023 06:28:02 +0000 (07:28 +0100)] 
Add CHANGES and release note for [GL #3801]

3 years agoCommit the change of view for view->managed_keys
Ondřej Surý [Tue, 17 Jan 2023 06:21:34 +0000 (07:21 +0100)] 
Commit the change of view for view->managed_keys

When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

3 years agoDetach the views in zone_shutdown(), not in zone_free()
Ondřej Surý [Tue, 17 Jan 2023 06:18:16 +0000 (07:18 +0100)] 
Detach the views in zone_shutdown(), not in zone_free()

The .view (and possibly .prev_view) would be kept attached to the
removed zone until the zone is fully removed from the memory in
zone_free().  If this process is delayed because server is busy
something else like doing constant `rndc reconfig`, it could take
seconds to detach the view, possibly keeping multiple dead views in the
memory.  This could quickly lead to a massive memory bloat.

Release the views early in the zone_shutdown() call, and don't wait
until the zone is freed.

3 years agoMerge branch '3767-dot-no-alpn-transfer-shutdown-crash' into 'main'
Artem Boldariev [Tue, 17 Jan 2023 18:50:10 +0000 (18:50 +0000)] 
Merge branch '3767-dot-no-alpn-transfer-shutdown-crash' into 'main'

XoT: properly handle the case when checking for ALPN failed

Closes #3767

See merge request isc-projects/bind9!7360

3 years agoModify CHANGES [GL #3767]
Artem Boldariev [Thu, 12 Jan 2023 18:51:08 +0000 (20:51 +0200)] 
Modify CHANGES [GL #3767]

Mention that downloading a zone via TLS- from a server which does not
negotiate "dot" ALPN tag could have crashed BIND on shutdown.

3 years agoXoT: properly handle the case when checking for ALPN failed
Artem Boldariev [Thu, 12 Jan 2023 18:09:51 +0000 (20:09 +0200)] 
XoT: properly handle the case when checking for ALPN failed

During XoT it is important to check for "dot" ALPN tag to be
negotiated (according to the RFC 9103). We were doing that, however, the
situation was not handled properly, leading to non-cancelled zone
transfers that would crash (abort()) BIND on shutdown.

In this particular case 'result' might equal 'ISC_R_SUCCESS'. When
this is the case, the part of the code supposed to handle failures
will not cancel the zone transfer.

This situation cannot happen when BIND is a secondary of other BIND
instance. Only primaries following the RFC not closely enough could
trigger such a behaviour.

3 years agoMerge branch '3804-fix-feature-detection-in-pytests' into 'main'
Tom Krizek [Tue, 17 Jan 2023 13:48:57 +0000 (13:48 +0000)] 
Merge branch '3804-fix-feature-detection-in-pytests' into 'main'

Fix feature detection for pytest markers in tests

Closes #3804

See merge request isc-projects/bind9!7383

3 years agoFix feature detection for pytest markers in tests
Tom Krizek [Tue, 17 Jan 2023 13:18:22 +0000 (14:18 +0100)] 
Fix feature detection for pytest markers in tests

The condition was accidentally reversed during refactoring in
9730ac4c5691c36d58c06deec1762a4831b268c5 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

3 years agoMerge branch 'fanf-time-backwards' into 'main'
Tony Finch [Tue, 17 Jan 2023 09:01:32 +0000 (09:01 +0000)] 
Merge branch 'fanf-time-backwards' into 'main'

Fix a typo in the NS_PER_ macros

See merge request isc-projects/bind9!7380

3 years agoFix a typo in the NS_PER_ macros
Tony Finch [Mon, 16 Jan 2023 20:31:36 +0000 (20:31 +0000)] 
Fix a typo in the NS_PER_ macros

Milliseconds and microseconds were swapped.

3 years agoMerge branch 'feature/main/zt-rwlock.h' into 'main'
Ondřej Surý [Mon, 16 Jan 2023 11:06:48 +0000 (11:06 +0000)] 
Merge branch 'feature/main/zt-rwlock.h' into 'main'

Include isc_rwlocktype_t type definition in zt.h

See merge request isc-projects/bind9!7376

3 years agoInclude isc_rwlocktype_t type definition in zt.h
Petr Menšík [Mon, 16 Jan 2023 10:45:31 +0000 (11:45 +0100)] 
Include isc_rwlocktype_t type definition in zt.h

After changes zt.h uses rwlock type, which is not enforced to be always
defined. Ensure full type definition is ready by including appropriate
header.

3 years agoMerge branch 'tkrizek/system-tests-pytest-prep' into 'main'
Tom Krizek [Mon, 16 Jan 2023 09:13:01 +0000 (09:13 +0000)] 
Merge branch 'tkrizek/system-tests-pytest-prep' into 'main'

Various tweaks of system test framework

See merge request isc-projects/bind9!7347

3 years agoUpdate the TEST_PARALLEL_JOBS value in CI
Tom Krizek [Fri, 6 Jan 2023 14:08:27 +0000 (15:08 +0100)] 
Update the TEST_PARALLEL_JOBS value in CI

The authoritative source for this value is in the project's CI/CD
Variables Setting. The reason to keep it in .gitlab-ci.yaml as well is
to have functional testing in forks without the need to manually specify
this variable in Settings.

The tests have been executed with 4 jobs for some time now. This
"change" only brings .gitlab-ci.yaml file up to date, it doesn't
actually change the number of jobs we currently use to test.

3 years agoTweak dupsigs test output
Tom Krizek [Tue, 3 Jan 2023 10:58:43 +0000 (11:58 +0100)] 
Tweak dupsigs test output

Use a different visual separator, since "====", "----" and "____" is
used by pytest to separate the log output.

3 years agoLook for ifconfig.sh.in in testsock.pl parent dir
Tom Krizek [Mon, 2 Jan 2023 16:54:58 +0000 (17:54 +0100)] 
Look for ifconfig.sh.in in testsock.pl parent dir

Instead of using the current working directory to find the ifconfig.sh
script, look for the ifconfig.sh.in template in the directory where the
testsock.pl script is located. This enables the testsock.pl script to be
called from any working directory.

Using the ifconfig.sh.in template is sufficient, since it contains
the necessary information to be extracted: the max= value (which is
hard-coded in the template).

3 years agoFactor out script to handle system test core dumps
Tom Krizek [Tue, 20 Dec 2022 14:09:48 +0000 (15:09 +0100)] 
Factor out script to handle system test core dumps

Move the core dump detection functionality for system test runs into a
separate script. This enables reuse by the pytest runner. The
functionality remains the same.

3 years agotestcrypto.sh: run in TMPDIR if possible
Tom Krizek [Mon, 19 Dec 2022 16:44:35 +0000 (17:44 +0100)] 
testcrypto.sh: run in TMPDIR if possible

Avoid creating any temporary files in the current workdir.

Additional/changing files in the bin/tests/system directory are
problematic for pytest/xdist collection phase, which assumes the list of
files doesn't change between the collection phase of the main pytest
thread and the subsequent collection phase of the xdist worker threads.

Since the testcrypto.sh is also called during pytest initialization
through conf.sh.common (to detect feature support), this could
occasionally cause a race condition when the list of files would be
different for the main pytest thread and the xdist worker.

3 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.10' into 'main'
Michał Kępień [Fri, 13 Jan 2023 14:47:05 +0000 (14:47 +0000)] 
Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.10' into 'main'

Set up version and release notes for BIND 9.19.10

See merge request isc-projects/bind9!7362

3 years agoSet up release notes for BIND 9.19.10
Michał Kępień [Fri, 13 Jan 2023 14:35:32 +0000 (15:35 +0100)] 
Set up release notes for BIND 9.19.10

3 years agoUpdate BIND version to 9.19.10-dev
Michał Kępień [Fri, 13 Jan 2023 14:35:32 +0000 (15:35 +0100)] 
Update BIND version to 9.19.10-dev

3 years agoUpdate BIND version for release v9.19.9
Michał Kępień [Thu, 12 Jan 2023 21:43:01 +0000 (22:43 +0100)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Michał Kępień [Thu, 12 Jan 2023 21:43:01 +0000 (22:43 +0100)] 
Add a CHANGES marker

3 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.9' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 21:41:52 +0000 (21:41 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.9' into 'security-main'

Prepare documentation for BIND 9.19.9

See merge request isc-private/bind9!492

3 years agoAdd release note for GL #3678
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Add release note for GL #3678

3 years agoReorder release notes
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Reorder release notes

3 years agoTweak and reword release notes
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.9
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Prepare release notes for BIND 9.19.9

3 years agoUpdate documentation for GL #3212
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Update documentation for GL #3212

3 years agoFix a typo in the DNSSEC Guide
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Fix a typo in the DNSSEC Guide

3 years agoMerge branch '3619-security-serve-stale-client-timeout-crash' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 11:45:50 +0000 (11:45 +0000)] 
Merge branch '3619-security-serve-stale-client-timeout-crash' into 'security-main'

[CVE-2022-3924] Fix the serve-stale crash when recursive clients soft quota is reached

See merge request isc-private/bind9!475

3 years agoAdd CHANGES and release notes for [GL #3619]
Aram Sargsyan [Mon, 14 Nov 2022 12:30:49 +0000 (12:30 +0000)] 
Add CHANGES and release notes for [GL #3619]

3 years agoCancel all fetch events in dns_resolver_cancelfetch()
Aram Sargsyan [Mon, 14 Nov 2022 12:18:06 +0000 (12:18 +0000)] 
Cancel all fetch events in dns_resolver_cancelfetch()

Although 'dns_fetch_t' fetch can have two associated events, one for
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
dns_resolver_cancelfetch() function is designed in a way that it
expects only one existing event, which it must cancel, and when it
happens so that 'stale-answer-client-timeout' is enabled and there
are two events, only one of them is canceled, and it results in an
assertion in dns_resolver_destroyfetch(), when it finds a dangling
event.

Change the logic of dns_resolver_cancelfetch() function so that it
cancels both the events (if they exist), and in the right order.

3 years agoMerge branch '3622-serve-stale-rrsig-fix-security' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 11:25:54 +0000 (11:25 +0000)] 
Merge branch '3622-serve-stale-rrsig-fix-security' into 'security-main'

[CVE-2022-3736] Properly handle stale RRSIG lookups

See merge request isc-private/bind9!470