]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
4 years agoMerge branch 'ondrej-listen-on-specified-number-of-threads' into 'main'
Ondřej Surý [Tue, 19 Apr 2022 10:36:51 +0000 (10:36 +0000)] 
Merge branch 'ondrej-listen-on-specified-number-of-threads' into 'main'

Allow listening on less than nworkers threads

See merge request isc-projects/bind9!6032

4 years agoAdd CHANGES note for [GL !6032]
Ondřej Surý [Fri, 25 Mar 2022 15:46:31 +0000 (16:46 +0100)] 
Add CHANGES note for [GL !6032]

4 years agoAllow listening on less than nworkers threads
Ondřej Surý [Fri, 25 Mar 2022 15:44:21 +0000 (16:44 +0100)] 
Allow listening on less than nworkers threads

For some applications, it's useful to not listen on full battery of
threads.  Add workers argument to all isc_nm_listen*() functions and
convenience ISC_NM_LISTEN_ONE and ISC_NM_LISTEN_ALL macros.

4 years agoMerge branch '3234-check-the-oid-in-privateoid-keys' into 'main'
Mark Andrews [Tue, 19 Apr 2022 04:53:59 +0000 (04:53 +0000)] 
Merge branch '3234-check-the-oid-in-privateoid-keys' into 'main'

Resolve "Check the OID in PRIVATEOID keys"

Closes #3234

See merge request isc-projects/bind9!6045

4 years agoAdd release note for [GL #3234]
Mark Andrews [Tue, 5 Apr 2022 00:29:08 +0000 (10:29 +1000)] 
Add release note for [GL #3234]

4 years agoAdd CHANGES note for [GL #3234]
Mark Andrews [Tue, 5 Apr 2022 00:26:48 +0000 (10:26 +1000)] 
Add CHANGES note for [GL #3234]

4 years agoCheck PRIVATEDNS and PRIVATEOID key identifiers
Mark Andrews [Tue, 29 Mar 2022 07:08:59 +0000 (18:08 +1100)] 
Check PRIVATEDNS and PRIVATEOID key identifiers

dns_rdata_fromtext and dns_rdata_fromwire now checks that there is
a valid name or oid at the start of the keydata when the key algorithm
is PRIVATEDNS and PRIVATEOID respectively.

dns_rdata_totext now prints out the oid if the algorithm is PRIVATEOID.

4 years agoMerge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called...
Mark Andrews [Mon, 18 Apr 2022 23:36:59 +0000 (23:36 +0000)] 
Merge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called-rdataset' into 'main'

Resolve "lib/dns/ncache.c:rdataset_settrust() fails to set trust on called rdataset"

Closes #3279

See merge request isc-projects/bind9!6129

4 years agoAdd CHANGES entry for [GL #3279]
Mark Andrews [Thu, 14 Apr 2022 01:19:23 +0000 (11:19 +1000)] 
Add CHANGES entry for [GL #3279]

4 years agoUpdate the rdataset->trust field in ncache.c:rdataset_settrust
Mark Andrews [Thu, 14 Apr 2022 01:16:32 +0000 (11:16 +1000)] 
Update the rdataset->trust field in ncache.c:rdataset_settrust

Both the trust recorded in the slab stucture and the trust on
rdataset need to be updated.

4 years agoCheck that pending negative cache entries for DS can be used successfully
Mark Andrews [Thu, 14 Apr 2022 00:57:11 +0000 (10:57 +1000)] 
Check that pending negative cache entries for DS can be used successfully

Prime the cache with a negative cache DS entry then make a query for
name beneath that entry. This will cause the DS entry to be retieved
as part of the validation process.  Each RRset in the ncache entry
will be validated and the trust level for each will be updated.

4 years agoMerge branch '3235-dig-exitcode' into 'main'
Evan Hunt [Fri, 15 Apr 2022 18:08:10 +0000 (18:08 +0000)] 
Merge branch '3235-dig-exitcode' into 'main'

ensure dig sets exitcode after local UDP connection failure

Closes #3235

See merge request isc-projects/bind9!6107

4 years agoCHANGES for [GL #3235]
Evan Hunt [Fri, 8 Apr 2022 07:39:46 +0000 (00:39 -0700)] 
CHANGES for [GL #3235]

4 years agoensure dig sets exitcode after local UDP connection failure
Evan Hunt [Fri, 8 Apr 2022 07:33:24 +0000 (00:33 -0700)] 
ensure dig sets exitcode after local UDP connection failure

dig previously set an exit code of 9 when a TCP connection failed
or when a UDP connection timed out, but when the server address is
localhost it's possible for a UDP query to fail with ISC_R_CONNREFUSED.
that code path didn't update the exit code, causing dig to exit with
status 0. we now set the exit code to 9 in this failure case.

4 years agoMerge branch '3223-catz-change-of-ownership-aka-coo-support' into 'main'
Arаm Sаrgsyаn [Thu, 14 Apr 2022 22:48:41 +0000 (22:48 +0000)] 
Merge branch '3223-catz-change-of-ownership-aka-coo-support' into 'main'

[3/5] Implement catalog zones change of ownership (coo) support

Closes #3223

See merge request isc-projects/bind9!6013

4 years agoDo not use REQUIRE in dns_catz_entry_detach() after other code
Aram Sargsyan [Fri, 25 Mar 2022 11:49:12 +0000 (11:49 +0000)] 
Do not use REQUIRE in dns_catz_entry_detach() after other code

The REQUIRE checks should be at the top of the function before
any assignments or code.

Move the REQUIRE check to the top.

4 years agoReplace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES
Aram Sargsyan [Fri, 25 Mar 2022 11:28:07 +0000 (11:28 +0000)] 
Replace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES

Update the enum entry in the continued effort of replacing some
DNS terminology.

4 years agoAdd CHANGES note for [GL #3223]
Aram Sargsyan [Wed, 23 Mar 2022 11:00:18 +0000 (11:00 +0000)] 
Add CHANGES note for [GL #3223]

4 years agoImplement catalog zones change of ownership (coo) support
Aram Sargsyan [Thu, 17 Mar 2022 13:09:11 +0000 (13:09 +0000)] 
Implement catalog zones change of ownership (coo) support

Catalog zones change of ownership is special mechanism to facilitate
controlled migration of a member zone from one catalog to another.

It is implemented using catalog zones property named "coo" and is
documented in DNS catalog zones draft version 5 document.

Implement the feature using a new hash table in the catalog zone
structure, which holds the added "coo" properties for the catalog zone
(containing the target catalog zone's name), and the key for the hash
table being the member zone's name for which the "coo" property is being
created.

Change some log messages to have consistent zone name quoting types.

Update the ARM with change of ownership documentation and usage
examples.

Add tests which check newly the added features.

4 years agoMerge branch '3222-catz-options-new-syntax-based-on-custom-properties' into 'main'
Arаm Sаrgsyаn [Thu, 14 Apr 2022 19:49:00 +0000 (19:49 +0000)] 
Merge branch '3222-catz-options-new-syntax-based-on-custom-properties' into 'main'

[2/5] Implement catalog zones options new syntax based on custom properties

Closes #3222

See merge request isc-projects/bind9!6012

4 years agoDo not cancel processing record datasets in catalog zone after an error
Aram Sargsyan [Thu, 24 Mar 2022 21:38:08 +0000 (21:38 +0000)] 
Do not cancel processing record datasets in catalog zone after an error

When there are multiple record datasets in a database node of a catalog
zone, and BIND encounters a soft error during processing of a dataset,
it breaks from the loop and doesn't process the other datasets in the
node.

There are cases when this is not desired. For example, the catalog zones
draft version 5 states that there must be a TXT RRset named
`version.$CATZ` with exactly one RR, but it doesn't set a limitation
on possible non-TXT RRsets named `version.$CATZ` existing alongside
with the TXT one. In case when one exists, we will get a processing
error and will not continue the loop to process the TXT RRset coming
next.

Remove the "break" statement to continue processing all record datasets.

4 years agoProcess the 'version' record of the catalog zone first
Aram Sargsyan [Thu, 24 Mar 2022 20:24:00 +0000 (20:24 +0000)] 
Process the 'version' record of the catalog zone first

When processing a new or updated catalog zone, the record datasets
from the database are being processed in order. This creates a
problem because we need to know the version of the catalog zone
schema to process some of the records differently, but we do not
know the version until the 'version' record gets processed.

Find the 'version' record and process it first, only then iterate over
the database to process the rest, making sure not to process the
'version' record twice.

4 years agoAdd CHANGES note for [GL #3222]
Aram Sargsyan [Wed, 23 Mar 2022 10:58:39 +0000 (10:58 +0000)] 
Add CHANGES note for [GL #3222]

4 years agoImplement catalog zones options new syntax based on custom properties
Aram Sargsyan [Wed, 16 Mar 2022 20:11:17 +0000 (20:11 +0000)] 
Implement catalog zones options new syntax based on custom properties

According to DNS catalog zones draft version 5 document, catalog
zone custom properties must be placed under the "ext" label.

Make necessary changes to support the new custom properties syntax in
catalog zones with version "2" of the schema.

Change the default catalog zones schema version from "1" to "2" in
ARM to prepare for the new features and changes which come starting
from this commit in order to support the latest DNS catalog zones draft
document.

Make some restructuring in ARM and rename the term catalog zone "option"
to "custom property" to better reflect the terms used in the draft.

Change the version of 'catalog1.zone.' catalog zone in the "catz" system
test to "2", and leave the version of 'catalog2.zone.' catalog zone at
version "1" to test both versions.

Add tests to check that the new syntax works only with the new schema
version, and that the old syntax works only with the legacy schema
version catalog zones.

4 years agoMerge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes' into 'main'
Arаm Sаrgsyаn [Thu, 14 Apr 2022 10:46:16 +0000 (10:46 +0000)] 
Merge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes' into 'main'

Unify dig +nssearch next query starting code for TCP and UDP protocols

Closes #3144

See merge request isc-projects/bind9!6109

4 years agoAdd CHANGES note for [GL #3144]
Aram Sargsyan [Fri, 8 Apr 2022 10:04:57 +0000 (10:04 +0000)] 
Add CHANGES note for [GL #3144]

4 years agodetach unfinished query when canceling
Evan Hunt [Mon, 11 Apr 2022 00:42:49 +0000 (17:42 -0700)] 
detach unfinished query when canceling

when a query was canceled while still in the process of connecting,
tcp_connected() and udp_ready() didn't detach the query object.

4 years agoUnify dig +nssearch next query starting code for TCP and UDP protocols
Aram Sargsyan [Thu, 7 Apr 2022 09:23:49 +0000 (09:23 +0000)] 
Unify dig +nssearch next query starting code for TCP and UDP protocols

In `+nssearch` mode `dig` starts the next query of the followup lookup
using `start_udp()` or `start_tcp()` calls without waiting for the
previous query to complete.

In UDP mode that happens in the `send_done()` callback of the previous
query, but in TCP mode that happens in the `start_tcp()` call of the
previous query (recursion) which doesn't work because `start_tcp()`
attaches the `lookup->current_query` to the query it is starting, so a
recursive call will result in an assertion failure.

Make the TCP mode to start the next query in `send_done()`, just like in
the UDP mode. During that time the `lookup->current_query` is already
detached by the `tcp_connected()`/`udp_ready()` callbacks.

4 years agoMerge branch '2931-cds-delete-removed-on-signing' into 'main'
Matthijs Mekking [Wed, 13 Apr 2022 12:37:39 +0000 (12:37 +0000)] 
Merge branch '2931-cds-delete-removed-on-signing' into 'main'

Don't delete CDS DELETE after zone sign

Closes #2931

See merge request isc-projects/bind9!5706

4 years agoAdd CDS/CDNSKEY DELETE documentation
Matthijs Mekking [Tue, 12 Apr 2022 13:26:18 +0000 (15:26 +0200)] 
Add CDS/CDNSKEY DELETE documentation

Mention in the DNSSEC guide in the "revert to unsigned" recipe that you
can publish CDS and CDNSKEY DELETE records to remove the corresponding
DS records from the parent zone.

4 years agoAdd CHANGE and release note for #2931
Matthijs Mekking [Mon, 10 Jan 2022 16:45:00 +0000 (17:45 +0100)] 
Add CHANGE and release note for #2931

Release note worthy.

4 years agoUpdate dns_dnssec_syncdelete() function
Matthijs Mekking [Mon, 10 Jan 2022 16:18:47 +0000 (17:18 +0100)] 
Update dns_dnssec_syncdelete() function

Update the function that synchronizes the CDS and CDNSKEY DELETE
records. It now allows for the possibility that the CDS DELETE record
is published and the CDNSKEY DELETE record is not, and vice versa.

Also update the code in zone.c how 'dns_dnssec_syncdelete()' is called.

With KASP, we still maintain the DELETE records our self. Otherwise,
we publish the CDS and CDNSKEY DELETE record only if they are added
to the zone. We do still check if these records can be signed by a KSK.

This change will allow users to add a CDS and/or CDNSKEY DELETE record
manually, without BIND removing them on the next zone sign.

Note that this commit removes the check whether the key is a KSK, this
check is redundant because this check is also made in
'dst_key_is_signing()' when the role is set to DST_BOOL_KSK.

4 years agoTest CDS DELETE persists after zone sign
Matthijs Mekking [Mon, 10 Jan 2022 14:46:25 +0000 (15:46 +0100)] 
Test CDS DELETE persists after zone sign

Add a test case for a dynamically added CDS DELETE record and make
sure it is not removed when signing the zone. This happens because
BIND maintains CDS and CDNSKEY publishing and it will only allow
CDS DELETE records if the zone is transitioning to insecure. This is
a state that can be identified when using KASP through 'dnssec-policy',
but not when using 'auto-dnssec'.

4 years agoMerge branch 'michal/fix-forward-system-test-requirements' into 'main'
Michał Kępień [Tue, 12 Apr 2022 13:30:06 +0000 (13:30 +0000)] 
Merge branch 'michal/fix-forward-system-test-requirements' into 'main'

Fix "forward" system test requirements

See merge request isc-projects/bind9!6117

4 years agoFix "forward" system test requirements
Michał Kępień [Tue, 12 Apr 2022 13:29:26 +0000 (15:29 +0200)] 
Fix "forward" system test requirements

Commit bf3fffff67e1de78e9387a93674d471bf4291604 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "forward" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.

4 years agoMerge branch 'michal/set-up-release-notes-for-bind-9.19.1' into 'main'
Michał Kępień [Tue, 12 Apr 2022 12:12:15 +0000 (12:12 +0000)] 
Merge branch 'michal/set-up-release-notes-for-bind-9.19.1' into 'main'

Set up release notes for BIND 9.19.1

See merge request isc-projects/bind9!6118

4 years agoSet up release notes for BIND 9.19.1
Michał Kępień [Tue, 12 Apr 2022 11:41:18 +0000 (13:41 +0200)] 
Set up release notes for BIND 9.19.1

4 years agoMerge branch 'michal/update-bind-version-to-9.19.1-dev' into 'main'
Michał Kępień [Tue, 12 Apr 2022 11:10:32 +0000 (11:10 +0000)] 
Merge branch 'michal/update-bind-version-to-9.19.1-dev' into 'main'

Update BIND version to 9.19.1-dev

See merge request isc-projects/bind9!6114

4 years agoUpdate BIND version to 9.19.1-dev
Michał Kępień [Tue, 12 Apr 2022 09:15:13 +0000 (11:15 +0200)] 
Update BIND version to 9.19.1-dev

4 years agoMerge branch '3256-adb-crash' into 'main'
Evan Hunt [Tue, 12 Apr 2022 07:15:12 +0000 (07:15 +0000)] 
Merge branch '3256-adb-crash' into 'main'

ADB entries could be unlinked too soon

Closes #3256

See merge request isc-projects/bind9!6113

4 years agoCHANGES for [GL #3256]
Evan Hunt [Tue, 12 Apr 2022 00:32:55 +0000 (17:32 -0700)] 
CHANGES for [GL #3256]

4 years agoADB entries could be unlinked too soon
Evan Hunt [Tue, 12 Apr 2022 00:29:03 +0000 (17:29 -0700)] 
ADB entries could be unlinked too soon

due to a typo in the code, ADB entries were unlinked from their entry
buckets during shutdown if they had a nonzero reference count. they
were only supposed to be unlinked if the reference count was exactly
one (that being the reference held by the bucket itself).

4 years agoUpdate BIND version to 9.19.0 v9.19.0
Michał Kępień [Mon, 11 Apr 2022 08:08:24 +0000 (10:08 +0200)] 
Update BIND version to 9.19.0

4 years agoAdd a CHANGES marker
Michał Kępień [Mon, 11 Apr 2022 08:08:24 +0000 (10:08 +0200)] 
Add a CHANGES marker

4 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.0' into 'v9_19_0-release'
Michał Kępień [Mon, 11 Apr 2022 08:06:22 +0000 (08:06 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.0' into 'v9_19_0-release'

Prepare documentation for BIND 9.19.0

See merge request isc-private/bind9!396

4 years agoPrepare release notes for BIND 9.19.0
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Prepare release notes for BIND 9.19.0

4 years agoReorder release notes
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Reorder release notes

4 years agoTweak and reword release notes
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Tweak and reword release notes

4 years agoUpdate BIND 9 versions mentioned in release notes
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Update BIND 9 versions mentioned in release notes

4 years agoRemove release notes applying to BIND 9.18.x
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Remove release notes applying to BIND 9.18.x

4 years agoRemove release notes for BIND 9.17.x
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Remove release notes for BIND 9.17.x

4 years agoFix CHANGES marker location for BIND 9.17.22
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Fix CHANGES marker location for BIND 9.17.22

4 years agoUpdate release checklist
Michał Kępień [Mon, 11 Apr 2022 08:05:50 +0000 (10:05 +0200)] 
Update release checklist

4 years agoMerge branch '3129-test-check-fetch-shutting-down-in-resume_dslookup' into 'main'
Michal Nowak [Fri, 8 Apr 2022 10:15:26 +0000 (10:15 +0000)] 
Merge branch '3129-test-check-fetch-shutting-down-in-resume_dslookup' into 'main'

[CVE-2022-0667] Add reproducer

Closes #3129

See merge request isc-projects/bind9!6063

4 years agoAdd a hung fetch check while chasing DS in the forward system test
Aram Sargsyan [Fri, 11 Feb 2022 15:10:39 +0000 (15:10 +0000)] 
Add a hung fetch check while chasing DS in the forward system test

Implement TCP support in the `ans11` Python-based DNS server.

Implement a control command channel in `ans11` to support an optional
silent mode of operation, which, when enabled, will ignore incoming
queries.

In the added check, make the `ans11` the NS server of
"a.root-servers.nil." for `ns3`, so it uses `ans11` (in silent mode)
for the regular (non-forwarded) name resolutions.

This will trigger the "hung fetch" scenario, which was causing `named`
to crash.

4 years agoMerge branch '2950-cache-acceptance-rules-test' into 'main'
Petr Špaček [Thu, 7 Apr 2022 17:29:34 +0000 (17:29 +0000)] 
Merge branch '2950-cache-acceptance-rules-test' into 'main'

[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios

Closes #2950

See merge request isc-projects/bind9!6062

4 years agoAdd tests for forwarder cache poisoning scenarios
Mark Andrews [Mon, 17 Jan 2022 13:19:47 +0000 (00:19 +1100)] 
Add tests for forwarder cache poisoning scenarios

- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).

4 years agoMerge branch '3226-fix-pools-cleaning-in-dns_zone' into 'main'
Ondřej Surý [Thu, 7 Apr 2022 16:12:26 +0000 (16:12 +0000)] 
Merge branch '3226-fix-pools-cleaning-in-dns_zone' into 'main'

Don't destroy mctx and task pools until we are destroying zonemgr

Closes #3226

See merge request isc-projects/bind9!6102

4 years agoDon't destroy mctx and task pools until we are destroying zonemgr
Ondřej Surý [Thu, 7 Apr 2022 13:40:38 +0000 (15:40 +0200)] 
Don't destroy mctx and task pools until we are destroying zonemgr

The mctx, zonetask and loadtask pools were being destroyed in the
shutdown function where in theory a dangling zone could be still
attached to it.

Move the isc_mem_put() on the pools to the destroy() function.

4 years agoMerge branch '3112-test-lingering-tcp-sockets-in-closewait' into 'main'
Michal Nowak [Thu, 7 Apr 2022 16:06:21 +0000 (16:06 +0000)] 
Merge branch '3112-test-lingering-tcp-sockets-in-closewait' into 'main'

[CVE-2022-0396] Add system test lingering CLOSE_WAIT TCP sockets

Closes #3112

See merge request isc-projects/bind9!6046

4 years agoAdd system test **/named.* modifier files to .reuse/dep5
Ondřej Surý [Wed, 2 Mar 2022 15:12:19 +0000 (16:12 +0100)] 
Add system test **/named.* modifier files to .reuse/dep5

There's couple of files that modify behaviour of named when started via
bin/tests/system/start.pl.  Add those files as CC-1.0 to .reuse/dep5 as
they are just empty placeholders.

4 years agoAdd system test lingering CLOSE_WAIT TCP sockets
Matthijs Mekking [Thu, 3 Feb 2022 09:49:25 +0000 (10:49 +0100)] 
Add system test lingering CLOSE_WAIT TCP sockets

Add a test case to check for lingering TCP sockets stuck in the
CLOSE_WAIT state. This can happen if a client sends some garbage after
its first query.

The system test runs the reproducer script and then sends another TCP
query to the resolver. The resolver is configured to allow one TCP
client only. If BIND has its TCP socket stuck in CLOSE_WAIT, it does
not have the resources available to answer the second query.

Note: A better test would be to check if the named daemon does not
have a TCP socket stuck in CLOSE_WAIT for example with netstat. When
running this test locally you can examine named with netstat manually.
But since netstat is platform specific it is not a good candidate to do
this as a system test.

If you, if you could return, don't let it burn.
Do you have to let it linger?
- Cranberries

4 years agoMerge branch '3208-add-CHANGES-entry' into 'main'
Michał Kępień [Thu, 7 Apr 2022 13:05:37 +0000 (13:05 +0000)] 
Merge branch '3208-add-CHANGES-entry' into 'main'

Add CHANGES entry for GL #3208

Closes #3208

See merge request isc-projects/bind9!6099

4 years agoAdd CHANGES entry for GL #3208
Michał Kępień [Thu, 7 Apr 2022 13:01:16 +0000 (15:01 +0200)] 
Add CHANGES entry for GL #3208

4 years agoMerge branch 'pspacek/junit-report' into 'main'
Petr Špaček [Wed, 6 Apr 2022 19:15:19 +0000 (19:15 +0000)] 
Merge branch 'pspacek/junit-report' into 'main'

Generate JUnit reports for unit & system tests

See merge request isc-projects/bind9!6088

4 years agoGenerate JUnit reports for unit & system tests
Petr Špaček [Fri, 1 Apr 2022 17:49:44 +0000 (19:49 +0200)] 
Generate JUnit reports for unit & system tests

This allows Gitlab to show nice summary for individual tests/test
directories and to expose the results in Gitlab API for consumption
elsewhere.

A catch: As of Gitlab 14.7.7, the detailed results are stored
only in artifacts and thus expire. All consumers (including API) need
to be "fast enough" to get the data before they disappear.
This also forces us to always store the artifacts intead of storing them
only on failure.

4 years agoMerge branch '3242-notify-notimeout' into 'main'
Tony Finch [Wed, 6 Apr 2022 17:15:45 +0000 (17:15 +0000)] 
Merge branch '3242-notify-notimeout' into 'main'

Ensure that zone maintenance queries have a retry limit

Closes #3242

See merge request isc-projects/bind9!6051

4 years agoEnsure that dns_request_createvia() has a retry limit
Tony Finch [Fri, 1 Apr 2022 12:46:39 +0000 (13:46 +0100)] 
Ensure that dns_request_createvia() has a retry limit

There are a couple of problems with dns_request_createvia(): a UDP
retry count of zero means unlimited retries (it should mean no
retries), and the overall request timeout is not enforced. The
combination of these bugs means that requests can be retried forever.

This change alters calls to dns_request_createvia() to avoid the
infinite retry bug by providing an explicit retry count. Previously,
the calls specified infinite retries and relied on the limit implied
by the overall request timeout and the UDP timeout (which did not work
because the overall timeout is not enforced). The `udpretries`
argument is also changed to be the number of retries; previously, zero
was interpreted as infinity because of an underflow to UINT_MAX, which
appeared to be a mistake. And `mdig` is updated to match the change in
retry accounting.

The bug could be triggered by zone maintenance queries, including
NOTIFY messages, DS parental checks, refresh SOA queries and stub zone
nameserver lookups. It could also occur with `nsupdate -r 0`.
(But `mdig` had its own code to avoid the bug.)

4 years agoMake notify test shellcheck clean
Tony Finch [Wed, 6 Apr 2022 12:57:36 +0000 (13:57 +0100)] 
Make notify test shellcheck clean

Use POSIX shell syntax, and use functions to reduce repetition.

4 years agoMerge branch 'artem-tls-ctx-refcount' into 'main'
Artem Boldariev [Wed, 6 Apr 2022 16:09:04 +0000 (16:09 +0000)] 
Merge branch 'artem-tls-ctx-refcount' into 'main'

Implement reference counting for TLS contexts, Resolve #3122 DoT stops working after "rndc reconfigure" when running named as non-root

Closes #3122

See merge request isc-projects/bind9!6087

4 years agoExtend the doth system test
Artem Boldariev [Wed, 6 Apr 2022 13:10:05 +0000 (16:10 +0300)] 
Extend the doth system test

This commit adds simple checks that the TLS contexts in question are
indeed being updated on DoT and DoH listeners.

4 years agoUpdate CHANGES [GL #3122]
Artem Boldariev [Tue, 5 Apr 2022 15:36:19 +0000 (18:36 +0300)] 
Update CHANGES [GL #3122]

Add an entry that reloading TLS certificates without destroying
underlying TCP listening sockets.

4 years agoReplace listener TLS contexts on reconfiguration
Artem Boldariev [Thu, 31 Mar 2022 10:48:14 +0000 (13:48 +0300)] 
Replace listener TLS contexts on reconfiguration

This commit makes use of isc_nmsocket_set_tlsctx(). Now, instead of
recreating TLS-enabled listeners (including the underlying TCP
listener sockets), only the TLS context in use is replaced.

4 years agoAdd isc_nmsocket_set_tlsctx()
Artem Boldariev [Thu, 31 Mar 2022 10:47:48 +0000 (13:47 +0300)] 
Add isc_nmsocket_set_tlsctx()

This commit adds isc_nmsocket_set_tlsctx() - an asynchronous function
that replaces the TLS context within a given TLS-enabled listener
socket object. It is based on the newly added reference counting
functionality.

The intention of adding this function is to add functionality to
replace a TLS context without recreating the whole socket object,
including the underlying TCP listener socket, as a BIND process might
not have enough permissions to re-create it fully on reconfiguration.

4 years agoMaintain a per-thread TLS ctx reference in TLS stream code
Artem Boldariev [Tue, 29 Mar 2022 17:42:16 +0000 (20:42 +0300)] 
Maintain a per-thread TLS ctx reference in TLS stream code

This commit changes the generic TLS stream code to maintain a
per-worker thread TLS context reference.

4 years agoUse isc_tlsctx_attach() in TLS DNS code
Artem Boldariev [Wed, 16 Mar 2022 15:02:46 +0000 (17:02 +0200)] 
Use isc_tlsctx_attach() in TLS DNS code

This commit adds proper reference counting for TLS contexts into
generic TLS DNS (DoT) code.

4 years agoUse isc_tlsctx_attach() in TLS stream code
Artem Boldariev [Tue, 22 Feb 2022 19:22:04 +0000 (21:22 +0200)] 
Use isc_tlsctx_attach() in TLS stream code

This commit adds proper reference counting for TLS contexts into
generic TLS stream code.

4 years agoAdd isc_tlsctx_attach()
Artem Boldariev [Tue, 22 Feb 2022 15:07:57 +0000 (17:07 +0200)] 
Add isc_tlsctx_attach()

The implementation is done on top of the reference counting
functionality found in OpenSSL/LibreSSL, which allows for avoiding
wrapping the object.

Adding this function allows using reference counting for TLS contexts
in BIND 9's codebase.

4 years agoMerge branch '3249-rename-configuration-option-to-reuseport' into 'main'
Ondřej Surý [Wed, 6 Apr 2022 15:23:16 +0000 (15:23 +0000)] 
Merge branch '3249-rename-configuration-option-to-reuseport' into 'main'

Rename the configuration option to load balance sockets to reuseport

Closes #3249

See merge request isc-projects/bind9!6093

4 years agoRename the configuration option to load balance sockets to reuseport
Ondřej Surý [Wed, 6 Apr 2022 15:00:24 +0000 (17:00 +0200)] 
Rename the configuration option to load balance sockets to reuseport

After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

4 years agoMerge branch '3259-cid-351372-concurrent-data-access-violations-atomicity' into ...
Mark Andrews [Wed, 6 Apr 2022 07:53:59 +0000 (07:53 +0000)] 
Merge branch '3259-cid-351372-concurrent-data-access-violations-atomicity' into 'main'

Resolve "CID 351372:  Concurrent data access violations  (ATOMICITY)"

Closes #3259

See merge request isc-projects/bind9!6090

4 years agoUnlink the timer event before trying to purge it
Mark Andrews [Wed, 6 Apr 2022 05:52:24 +0000 (15:52 +1000)] 
Unlink the timer event before trying to purge it

as far as I can determine the order of operations is not important.

    *** CID 351372:  Concurrent data access violations  (ATOMICITY)
    /lib/isc/timer.c: 227 in timer_purge()
    221      LOCK(&timer->lock);
    222      if (!purged) {
    223      /*
    224       * The event has already been executed, but not
    225       * yet destroyed.
    226       */
    >>>     CID 351372:  Concurrent data access violations  (ATOMICITY)
    >>>     Using an unreliable value of "event" inside the second locked section. If the data that "event" depends on was changed by another thread, this use might be incorrect.
    227      timerevent_unlink(timer, event);
    228      }
    229      }
    230     }
    231
    232     void

4 years agoMerge branch '3258-cid-351370-cid-351371-after-adb-refactoring' into 'main'
Mark Andrews [Wed, 6 Apr 2022 07:33:19 +0000 (07:33 +0000)] 
Merge branch '3258-cid-351370-cid-351371-after-adb-refactoring' into 'main'

Resolve "CID 351370 & CID 351371 after ADB refactoring"

Closes #3258

See merge request isc-projects/bind9!6089

4 years agoMove lock to before label to prevent duplicate lock
Mark Andrews [Wed, 6 Apr 2022 02:56:17 +0000 (12:56 +1000)] 
Move lock to before label to prevent duplicate lock

    *** CID 351370:  Program hangs  (LOCK)
    /lib/dns/adb.c: 2699 in dns_adb_cancelfind()
    2693
    2694      LOCK(&nbucket->lock);
    2695      ISC_LIST_UNLINK(adbname->finds, find, plink);
    2696      UNLOCK(&nbucket->lock);
    2697
    2698     cleanup:
    >>>     CID 351370:  Program hangs  (LOCK)
    >>>     "pthread_mutex_lock" locks "find->lock" while it is locked.
    2699      LOCK(&find->lock);
    2700      if (!FIND_EVENTSENT(find)) {
    2701      ev = &find->event;
    2702      task = ev->ev_sender;
    2703      ev->ev_sender = find;
    2704      ev->ev_type = DNS_EVENT_ADBCANCELED;

4 years agoRemove unnecessary NULL test leading to REVERSE_INULL false positive
Mark Andrews [Wed, 6 Apr 2022 02:54:08 +0000 (12:54 +1000)] 
Remove unnecessary NULL test leading to REVERSE_INULL false positive

    *** CID 351371:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/adb.c: 2615 in dns_adb_createfind()
    2609      /*
    2610       * Copy out error flags from the name structure into the find.
    2611       */
    2612      find->result_v4 = find_err_map[adbname->fetch_err];
    2613      find->result_v6 = find_err_map[adbname->fetch6_err];
    2614
    >>>     CID 351371:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "find" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    2615      if (find != NULL) {
    2616      if (want_event) {
    2617      INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
    2618      isc_task_attach(task, &(isc_task_t *){ NULL });
    2619      find->event.ev_sender = task;
    2620      find->event.ev_action = action;

4 years agoMerge branch 'artem-fix-return-value-x509_store_up_ref' into 'main'
Artem Boldariev [Tue, 5 Apr 2022 12:51:00 +0000 (12:51 +0000)] 
Merge branch 'artem-fix-return-value-x509_store_up_ref' into 'main'

Change X509_STORE_up_ref() shim return value

See merge request isc-projects/bind9!6084

4 years agoChange X509_STORE_up_ref() shim return value
Artem Boldariev [Tue, 5 Apr 2022 10:33:40 +0000 (13:33 +0300)] 
Change X509_STORE_up_ref() shim return value

X509_STORE_up_ref() must return 1 on success, while the previous
implementation would return the references count. This commit fixes
that.

4 years agoMerge branch '3244-dig-use-after-free' into 'main'
Arаm Sаrgsyаn [Tue, 5 Apr 2022 11:52:00 +0000 (11:52 +0000)] 
Merge branch '3244-dig-use-after-free' into 'main'

Resolve "use-after-free in dighost.c/dig.c"

Closes #3244

See merge request isc-projects/bind9!6052

4 years agoAdd CHANGES note for [GL #3244]
Aram Sargsyan [Thu, 31 Mar 2022 23:17:56 +0000 (23:17 +0000)] 
Add CHANGES note for [GL #3244]

4 years agoFix using unset pointer when printing a debug message in dighost.c
Aram Sargsyan [Thu, 31 Mar 2022 22:00:21 +0000 (22:00 +0000)] 
Fix using unset pointer when printing a debug message in dighost.c

The used `query->handle` is always `NULL` at this point.

Change the code to use `handle` instead.

4 years agoAdd a missing clear_current_lookup() call in recv_done()
Aram Sargsyan [Tue, 29 Mar 2022 13:01:24 +0000 (13:01 +0000)] 
Add a missing clear_current_lookup() call in recv_done()

The error code path handling the `ISC_R_CANCELED` code lacks a
`clear_current_lookup()` call, without which dig hangs indefinitely
when handling the error.

Add the missing call to account for all references of the lookup so
it can be destroyed.

4 years agoWhen using +qr in dig print the data of the current query
Aram Sargsyan [Thu, 31 Mar 2022 14:33:49 +0000 (14:33 +0000)] 
When using +qr in dig print the data of the current query

In `send_udp()` and `launch_next_query()` functions, when calling
`dighost_printmessage()` to print detailed information about the
sent query, dig always prints the data of the first query in the
lookup's queries list.

The first query in the list can be already finished, having its handles
freed, and accessing this information results in assertion failure.

Print the current query's information instead.

4 years agoMerge branch '3158-only-set-foundname-on-success-test' into 'main'
Michal Nowak [Tue, 5 Apr 2022 09:02:09 +0000 (09:02 +0000)] 
Merge branch '3158-only-set-foundname-on-success-test' into 'main'

[CVE-2022-0635] Add regression test

Closes #3158

See merge request isc-projects/bind9!6060

4 years agoAdd regression test for CVE-2022-0635
Mark Andrews [Thu, 17 Feb 2022 04:03:52 +0000 (15:03 +1100)] 
Add regression test for CVE-2022-0635

4 years agoMerge branch '3220-digdelv-test-uses-address-outside-of-our-control' into 'main'
Mark Andrews [Tue, 5 Apr 2022 04:22:11 +0000 (04:22 +0000)] 
Merge branch '3220-digdelv-test-uses-address-outside-of-our-control' into 'main'

Handle "network unreachable" error messages in digdelv system test

See merge request isc-projects/bind9!6010

4 years agoUse multiple fixed expressions for portable grep usage
Mark Andrews [Wed, 23 Mar 2022 00:53:00 +0000 (11:53 +1100)] 
Use multiple fixed expressions for portable grep usage

Additionally add "network unreachable" as an expected error message.

4 years agoMerge branch 'ondrej-dont-use-shutdown-function-name' into 'main'
Ondřej Surý [Mon, 4 Apr 2022 23:54:13 +0000 (23:54 +0000)] 
Merge branch 'ondrej-dont-use-shutdown-function-name' into 'main'

Rename shutdown() to test_shutdown() in timer_test.c

See merge request isc-projects/bind9!6078

4 years agoRename shutdown() to test_shutdown() in timer_test.c
Ondřej Surý [Mon, 4 Apr 2022 23:49:04 +0000 (01:49 +0200)] 
Rename shutdown() to test_shutdown() in timer_test.c

The shutdown() is part of standard library (POSIX-1), don't use such
name in the timer_test.c, but rather rename it to test_shutdown().

4 years agoMerge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix' into...
Ondřej Surý [Mon, 4 Apr 2022 23:37:32 +0000 (23:37 +0000)] 
Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix' into 'main'

Enable the load-balance-sockets configuration

Closes #3249

See merge request isc-projects/bind9!6076

4 years agoEnable the load-balance-sockets configuration
Ondřej Surý [Mon, 4 Apr 2022 23:20:13 +0000 (01:20 +0200)] 
Enable the load-balance-sockets configuration

Previously, HAVE_SO_REUSEPORT_LB has been defined only in the private
netmgr-int.h header file, making the configuration of load balanced
sockets inoperable.

Move the missing HAVE_SO_REUSEPORT_LB define the isc/netmgr.h and add
missing isc_nm_getloadbalancesockets() implementation.