]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoList supported DNSSEC algorithms at log level NOTICE
Tony Finch [Tue, 13 Dec 2022 13:02:19 +0000 (13:02 +0000)] 
List supported DNSSEC algorithms at log level NOTICE

NOTICE matches the other startup messages. WARNING weirdly
suggests the list is a problem.

3 years agoMerge branch '3736-fix-intermittent-memory-leak-in-forward-system-test' into 'main'
Ondřej Surý [Wed, 14 Dec 2022 09:48:37 +0000 (09:48 +0000)] 
Merge branch '3736-fix-intermittent-memory-leak-in-forward-system-test' into 'main'

Fix intermittent memory leak in dns_resolver unit

Closes #3736

See merge request isc-projects/bind9!7214

3 years agoFix intermittent memory leak in dns_resolver unit
Ondřej Surý [Tue, 13 Dec 2022 10:02:47 +0000 (11:02 +0100)] 
Fix intermittent memory leak in dns_resolver unit

A rdataset could have been left unassociated on the error path in the
resume_dslookup() in the dns_resolver unit.  Clone the rdataset after
the error check, so it's not cloned before we check whether we can make
further progress chasing DS records.

3 years agoMerge branch '3737-fix-initialisation-of-local-in-isdotlocal-in-dig' into 'main'
Mark Andrews [Tue, 13 Dec 2022 23:27:50 +0000 (23:27 +0000)] 
Merge branch '3737-fix-initialisation-of-local-in-isdotlocal-in-dig' into 'main'

Resolve "fix initialisation of local. in isdotlocal in dig"

Closes #3737

See merge request isc-projects/bind9!7213

3 years agoProperly initialise local_ndata in isdotlocal in dig
Mark Andrews [Tue, 13 Dec 2022 01:03:49 +0000 (12:03 +1100)] 
Properly initialise local_ndata in isdotlocal in dig

Remove the trailing '\0' so that the length field of the dns_name_t
structure is correct.  The old data just happens to work with
dns_name_issubdomain but would fail with dns_name_equal.

3 years agoMerge branch 'fanf-rsasha236' into 'main'
Tony Finch [Tue, 13 Dec 2022 16:58:59 +0000 (16:58 +0000)] 
Merge branch 'fanf-rsasha236' into 'main'

Fix a typo RSASHA236 -> RSASHA256

See merge request isc-projects/bind9!7206

3 years agoFix a typo RSASHA236 -> RSASHA256
Tony Finch [Fri, 9 Dec 2022 12:52:05 +0000 (12:52 +0000)] 
Fix a typo RSASHA236 -> RSASHA256

Use dns_secalg_format() to avoid error-prone repetition.

3 years agoMerge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.19.9' into 'main'
Tom Krizek [Tue, 13 Dec 2022 16:18:03 +0000 (16:18 +0000)] 
Merge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.19.9' into 'main'

Set up version and release notes for bind  9.19.9

See merge request isc-projects/bind9!7218

3 years agoSet up release notes for BIND 9.19.9
Tom Krizek [Tue, 13 Dec 2022 15:45:13 +0000 (16:45 +0100)] 
Set up release notes for BIND 9.19.9

3 years agoUpdate BIND version to 9.19.9-dev
Tom Krizek [Tue, 13 Dec 2022 15:44:52 +0000 (16:44 +0100)] 
Update BIND version to 9.19.9-dev

3 years agoUpdate BIND version for release v9.19.8
Tom Krizek [Mon, 12 Dec 2022 13:20:08 +0000 (14:20 +0100)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Tom Krizek [Mon, 12 Dec 2022 13:02:56 +0000 (14:02 +0100)] 
Add a CHANGES marker

3 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.8' into 'v9_19_8-release'
Tom Krizek [Mon, 12 Dec 2022 12:56:59 +0000 (12:56 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.8' into 'v9_19_8-release'

Prepare documentation for BIND 9.19.8

See merge request isc-private/bind9!487

3 years agoAdd release note for GL #3721
Michał Kępień [Mon, 12 Dec 2022 11:11:01 +0000 (12:11 +0100)] 
Add release note for GL #3721

3 years agoReorder release notes
Michał Kępień [Mon, 12 Dec 2022 11:11:01 +0000 (12:11 +0100)] 
Reorder release notes

3 years agoTweak and reword release notes
Michał Kępień [Mon, 12 Dec 2022 11:11:01 +0000 (12:11 +0100)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.8
Michał Kępień [Mon, 12 Dec 2022 11:11:01 +0000 (12:11 +0100)] 
Prepare release notes for BIND 9.19.8

3 years agoRestore release note for GL #3570
Michał Kępień [Mon, 12 Dec 2022 11:11:01 +0000 (12:11 +0100)] 
Restore release note for GL #3570

3 years agoMerge branch '3731-attach-keyfileio-to-zone' into 'main'
Ondřej Surý [Fri, 9 Dec 2022 14:14:25 +0000 (14:14 +0000)] 
Merge branch '3731-attach-keyfileio-to-zone' into 'main'

Implement proper reference counting for dns_keyfileio_t

Closes #3731

See merge request isc-projects/bind9!7203

3 years agoImplement proper reference counting for dns_keyfileio_t
Ondřej Surý [Fri, 9 Dec 2022 07:53:20 +0000 (08:53 +0100)] 
Implement proper reference counting for dns_keyfileio_t

Instead of relying on hash table search when using the keys, implement a
proper reference counting in dns_keyfileio_t objects, and attach/detach
the objects to the zone.

3 years agoMerge branch 'pspacek/configure-doh-help-fix' into 'main'
Petr Špaček [Thu, 8 Dec 2022 09:49:27 +0000 (09:49 +0000)] 
Merge branch 'pspacek/configure-doh-help-fix' into 'main'

Fix configure --disable-doh help text

See merge request isc-projects/bind9!7118

3 years agoFix configure --disable-doh help text
Petr Špaček [Thu, 24 Nov 2022 09:44:53 +0000 (10:44 +0100)] 
Fix configure --disable-doh help text

This is technically fixup for 2bb454182bb499990e191e098a8a33082c672a94.

Related: !4926

3 years agoMerge branch 'tkrizek/revert-3678-serve-stale-servfail' into 'main'
Tom Krizek [Thu, 8 Dec 2022 09:31:29 +0000 (09:31 +0000)] 
Merge branch 'tkrizek/revert-3678-serve-stale-servfail' into 'main'

Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'"

See merge request isc-projects/bind9!7183

3 years agoRevert "Merge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'"
Tom Krizek [Wed, 7 Dec 2022 20:29:11 +0000 (21:29 +0100)] 
Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'"

This reverts commit 629f66ea8e7a3455f22f57394eef54cfabcb8860, reversing
changes made to 84a7be327e801cfda207629285bf3302a71e8119.

It also removes release note 6038, since the fix is reverted.

3 years agoMerge branch '3727-fix-off-by-one-reference-counting-in-zonemgr_keymgmt_delete' into...
Ondřej Surý [Thu, 8 Dec 2022 09:24:10 +0000 (09:24 +0000)] 
Merge branch '3727-fix-off-by-one-reference-counting-in-zonemgr_keymgmt_delete' into 'main'

Release unused key file IO lock objects

Closes #3727

See merge request isc-projects/bind9!7178

3 years agoAdd CHANGES and release note for [GL #3727]
Ondřej Surý [Wed, 7 Dec 2022 15:52:07 +0000 (16:52 +0100)] 
Add CHANGES and release note for [GL #3727]

3 years agoRelease unused key file IO lock objects
Ondřej Surý [Wed, 7 Dec 2022 15:45:33 +0000 (16:45 +0100)] 
Release unused key file IO lock objects

Due to off-by-one error in zonemgr_keymgmt_delete, unused key file IO
lock objects were never freed and they were kept until the server
shutdown.  Adjust the returned value by -1 to accomodate the fact that
the atomic_fetch_*() functions return the value before the operation and
not current value after the operation.

3 years agoMerge branch '3613-redo-dumping-expired-rdatasets' into 'main'
Mark Andrews [Wed, 7 Dec 2022 22:46:45 +0000 (22:46 +0000)] 
Merge branch '3613-redo-dumping-expired-rdatasets' into 'main'

Resolve "TTL issue with resolver's cached and expired results for qtype ANY queries"

Closes #3613

See merge request isc-projects/bind9!7085

3 years agoAdd CHANGES note for [GL #3613]
Mark Andrews [Thu, 17 Nov 2022 00:23:31 +0000 (11:23 +1100)] 
Add CHANGES note for [GL #3613]

3 years agoRemove different zero TTL handling for rdataset iterator
Mark Andrews [Mon, 21 Nov 2022 00:59:45 +0000 (11:59 +1100)] 
Remove different zero TTL handling for rdataset iterator

Zero TTL handling does not need to be different for 'rdatasetiter_first'
and 'rdatasetiter_next' and it interacts badly with 'bind_rdatadataset'
which makes different determinations.

3 years agoAdd dns_db_allrdatasets options
Mark Andrews [Wed, 16 Nov 2022 00:40:33 +0000 (11:40 +1100)] 
Add dns_db_allrdatasets options

'DNS_DB_STALEOK' returns stale rdatasets as well as current rdatasets.

'DNS_DB_EXPIREDOK' returns expired rdatasets as well as current
rdatasets. This option is currently only set when DNS_DB_STALEOK is
also set.

3 years agoExtend dns_db_allrdatasets to control interation results
Mark Andrews [Tue, 15 Nov 2022 23:47:40 +0000 (10:47 +1100)] 
Extend dns_db_allrdatasets to control interation results

Add an options parameter to control what rdatasets are returned when
iteratating over the node.  Specific modes will be added later.

3 years agoProperly select active rdatasets when iterating across node
Mark Andrews [Tue, 15 Nov 2022 23:09:56 +0000 (10:09 +1100)] 
Properly select active rdatasets when iterating across node

Active rdatasets where not being properly selected in rdatasetiter_first
and rdatasetiter_next.

3 years agoCheck TTLs of mixed TTL ANY response with expired records
Mark Andrews [Tue, 25 Oct 2022 04:57:33 +0000 (15:57 +1100)] 
Check TTLs of mixed TTL ANY response with expired records

3 years agoRevert "Fix rndc dumpdb -expired for stuck cache contents"
Mark Andrews [Tue, 15 Nov 2022 05:35:32 +0000 (16:35 +1100)] 
Revert "Fix rndc dumpdb -expired for stuck cache contents"

This reverts commit f8d866c6efa4c9c2726f8ebcf2e66122198576c4.

3 years agoMerge branch '3724-update-dig-tcp-documentation' into 'main'
Mark Andrews [Wed, 7 Dec 2022 21:59:25 +0000 (21:59 +0000)] 
Merge branch '3724-update-dig-tcp-documentation' into 'main'

Resolve "Update dig +tcp documentation"

Closes #3724

See merge request isc-projects/bind9!7172

3 years agoAdd reference to +tcp for +ignore
Mark Andrews [Wed, 7 Dec 2022 04:51:34 +0000 (15:51 +1100)] 
Add reference to +tcp for +ignore

3 years agoMerge branch '3676-remove-operating-system-resource-limits' into 'main'
Ondřej Surý [Wed, 7 Dec 2022 18:50:30 +0000 (18:50 +0000)] 
Merge branch '3676-remove-operating-system-resource-limits' into 'main'

Mark setting operating system limits from named.conf as ancient

Closes #3676

See merge request isc-projects/bind9!7079

3 years agoAdd CHANGES and release note for [GL #3676]
Ondřej Surý [Sun, 13 Nov 2022 10:21:45 +0000 (11:21 +0100)] 
Add CHANGES and release note for [GL #3676]

3 years agoRemove isc_resource API and set limits directly in named_os unit
Ondřej Surý [Sun, 13 Nov 2022 10:04:30 +0000 (11:04 +0100)] 
Remove isc_resource API and set limits directly in named_os unit

The only function left in the isc_resource API was setting the file
limit.  Replace the whole unit with a simple getrlimit to check the
maximum value of RLIMIT_NOFILE and set the maximum back to rlimit_cur.

This is more compatible than trying to set RLIMIT_UNLIMITED on the
RLIMIT_NOFILE as it doesn't work on Linux (see man 5 proc on
/proc/sys/fs/nr_open), neither it does on Darwin kernel (see man 2
getrlimit).

The only place where the maximum value could be raised under privileged
user would be BSDs, but the `named_os_adjustnofile()` were not called
there before.  We would apply the increased limits only on Linux and Sun
platforms.

3 years agoMark setting operating system limits from named.conf as ancient
Ondřej Surý [Sun, 13 Nov 2022 09:28:17 +0000 (10:28 +0100)] 
Mark setting operating system limits from named.conf as ancient

After deprecating the operating system limits settings (coresize,
datasize, files and stacksize), mark them as ancient and remove the code
that sets the values from config.

3 years agoMerge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test' into 'main'
Ondřej Surý [Wed, 7 Dec 2022 18:14:34 +0000 (18:14 +0000)] 
Merge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test' into 'main'

Fix missing zone_check() call in checkds test

See merge request isc-projects/bind9!7161

3 years agoFix missing zone_check() call in checkds test
Ondřej Surý [Sun, 4 Dec 2022 13:50:54 +0000 (14:50 +0100)] 
Fix missing zone_check() call in checkds test

The bad2-dswithdrawn.checkds tests were missing call to the
zone_checks() contributing to intermittent timing failures of the
checkds system test.

3 years agoMerge branch '3708-remove-dead-code-from-dns_cache-unit' into 'main'
Ondřej Surý [Wed, 7 Dec 2022 18:11:32 +0000 (18:11 +0000)] 
Merge branch '3708-remove-dead-code-from-dns_cache-unit' into 'main'

Remove dead code from dns_cache_flush()

Closes #3708

See merge request isc-projects/bind9!7141

3 years agoRemove dead code from dns_cache_flush()
Ondřej Surý [Wed, 30 Nov 2022 10:33:33 +0000 (11:33 +0100)] 
Remove dead code from dns_cache_flush()

After removing the cache cleaning mechanism, we don't need to db
iterator in dns_cache_flush() anymore.

3 years agoMerge branch '3183-send-shutdown-to-ns_client-on-shutdown' into 'main'
Ondřej Surý [Wed, 7 Dec 2022 17:08:24 +0000 (17:08 +0000)] 
Merge branch '3183-send-shutdown-to-ns_client-on-shutdown' into 'main'

Propagate the shutdown event to the recursing ns_client(s)

Closes #3183

See merge request isc-projects/bind9!7027

3 years agoAdd CHANGES and release notes for [GL #3183]
Ondřej Surý [Thu, 3 Nov 2022 17:01:22 +0000 (18:01 +0100)] 
Add CHANGES and release notes for [GL #3183]

3 years agoPropagate the shutdown event to the recursing ns_client(s)
Ondřej Surý [Thu, 3 Nov 2022 16:42:12 +0000 (17:42 +0100)] 
Propagate the shutdown event to the recursing ns_client(s)

Send the ns_query_cancel() on the recursing clients when we initiate the
named shutdown for faster shutdown.

When we are shutting down the resolver, we cancel all the outstanding
fetches, and the ISC_R_CANCEL events doesn't propagate to the ns_client
callback.

In the future, the better solution how to fix this would be to look at
the shutdown paths and let them all propagate from bottom (loopmgr) to
top (f.e. ns_client).

3 years agoMerge branch '3712-fix-reference-counting-in-dns_adb-get_attached_entry' into 'main'
Ondřej Surý [Wed, 7 Dec 2022 15:16:50 +0000 (15:16 +0000)] 
Merge branch '3712-fix-reference-counting-in-dns_adb-get_attached_entry' into 'main'

Fix reference counting in get_attached_entry

Closes #3712

See merge request isc-projects/bind9!7168

3 years agoFix reference counting in get_attached_entry
Ondřej Surý [Tue, 6 Dec 2022 14:59:35 +0000 (15:59 +0100)] 
Fix reference counting in get_attached_entry

When get_attached_entry() encounters entry that would be expired, it
needs to get reference to the entry before calling maybe_expire_entry(),
so the ADB entry doesn't get destroyed inside the its own lock.

3 years agoMerge branch 'matthijs-document-ns-minimal-responses' into 'main'
Matthijs Mekking [Wed, 7 Dec 2022 11:19:20 +0000 (11:19 +0000)] 
Merge branch 'matthijs-document-ns-minimal-responses' into 'main'

Document NS queries are excempt from minimal-responses

See merge request isc-projects/bind9!7072

3 years agoDocument NS queries are excempt from minimal-responses
Matthijs Mekking [Fri, 11 Nov 2022 09:23:04 +0000 (10:23 +0100)] 
Document NS queries are excempt from minimal-responses

Also document that DNSKEY, DS, CDNSKEY, and CDS never do additional
section processing.

3 years agoMerge branch 'mnowak/asan-tsan-respdiff-jobs' into 'main'
Michal Nowak [Wed, 7 Dec 2022 07:26:21 +0000 (07:26 +0000)] 
Merge branch 'mnowak/asan-tsan-respdiff-jobs' into 'main'

Add ASAN- and TSAN-enabled respdiff jobs

See merge request isc-projects/bind9!7115

3 years agoAdd ASAN- and TSAN-enabled respdiff jobs
Michal Nowak [Tue, 22 Nov 2022 09:27:17 +0000 (10:27 +0100)] 
Add ASAN- and TSAN-enabled respdiff jobs

Neither of the new CI jobs can reliably pass at the moment; hence they
are defined with "allow_failure: true" until issues in the code base are
resolved.

3 years agoExtract TSAN parsing code
Michal Nowak [Tue, 22 Nov 2022 10:51:23 +0000 (11:51 +0100)] 
Extract TSAN parsing code

3 years agoMerge branch '3683-use-after-free-in-catalog-zone-processing' into 'main'
Mark Andrews [Tue, 6 Dec 2022 22:29:46 +0000 (22:29 +0000)] 
Merge branch '3683-use-after-free-in-catalog-zone-processing' into 'main'

Resolve "use after free in catalog zone processing"

Closes #3683

See merge request isc-projects/bind9!7137

3 years agoAdd release note for [GL #3683]
Mark Andrews [Wed, 30 Nov 2022 07:56:53 +0000 (18:56 +1100)] 
Add release note for [GL #3683]

3 years agoAdd CHANGES note for [GL #3683]
Mark Andrews [Wed, 30 Nov 2022 07:54:18 +0000 (18:54 +1100)] 
Add CHANGES note for [GL #3683]

3 years agoCheck that restored catalog zone works
Mark Andrews [Wed, 30 Nov 2022 08:32:11 +0000 (19:32 +1100)] 
Check that restored catalog zone works

Using a restored catalog zone excercised a use-after-free bug.
The test checks that the use-after-free bug is gone and is just
a reasonable behaviour check in its own right.

3 years agoAdd missing DbC magic checks
Mark Andrews [Thu, 1 Dec 2022 01:51:30 +0000 (12:51 +1100)] 
Add missing DbC magic checks

Checking for value != NULL is not sufficient to detect use after
free errors.

3 years agoCall dns_db_updatenotify_unregister earlier
Mark Andrews [Wed, 30 Nov 2022 07:44:37 +0000 (18:44 +1100)] 
Call dns_db_updatenotify_unregister earlier

dns_db_updatenotify_unregister needed to be called earlier to ensure
that listener->onupdate_arg always points to a valid object.  The
existing lazy cleanup in rbtdb_free did not ensure that.

3 years agoSuppress duplicate dns_db_updatenotify_register registrations
Mark Andrews [Wed, 30 Nov 2022 07:40:27 +0000 (18:40 +1100)] 
Suppress duplicate dns_db_updatenotify_register registrations

Duplicate dns_db_updatenotify_register registrations need to be
suppressed to ensure that dns_db_updatenotify_unregister is successful.

3 years agoMerge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'
Arаm Sаrgsyаn [Tue, 6 Dec 2022 14:53:16 +0000 (14:53 +0000)] 
Merge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'

Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

Closes #3678

See merge request isc-projects/bind9!7096

3 years agoAdd a CHANGES note for [GL #3678]
Aram Sargsyan [Thu, 17 Nov 2022 14:21:31 +0000 (14:21 +0000)] 
Add a CHANGES note for [GL #3678]

3 years agoConsider non-stale data when in serve-stale mode
Matthijs Mekking [Thu, 17 Nov 2022 13:52:26 +0000 (13:52 +0000)] 
Consider non-stale data when in serve-stale mode

With 'stale-answer-enable yes;' and 'stale-answer-client-timeout off;',
consider the following situation:

A CNAME record and its target record are in the cache, then the CNAME
record expires, but the target record is still valid.

When a new query for the CNAME record arrives, and the query fails,
the stale record is used, and then the query "restarts" to follow
the CNAME target. The problem is that the query's multiple stale
options (like DNS_DBFIND_STALEOK) are not reset, so 'query_lookup()'
treats the restarted query as a lookup following a failed lookup,
and returns a SERVFAIL answer when there is no stale data found in the
cache, even if there is valid non-stale data there available.

With this change, query_lookup() now considers non-stale data in the
cache in the first place, and returns it if it is available.

3 years agoAdd serve-stale CNAME check with stale-answer-client-timeout off
Aram Sargsyan [Thu, 17 Nov 2022 13:48:36 +0000 (13:48 +0000)] 
Add serve-stale CNAME check with stale-answer-client-timeout off

Prime the cache with the following records:

    shortttl.cname.example. 1 IN CNAME longttl.target.example.
    longttl.target.example. 600 IN A 10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

3 years agoMerge branch '3697-reject-zones-with-ds-records-not-at-delegations' into 'main'
Mark Andrews [Tue, 6 Dec 2022 13:07:00 +0000 (13:07 +0000)] 
Merge branch '3697-reject-zones-with-ds-records-not-at-delegations' into 'main'

Resolve "Reject zones with DS records not at delegations"

Closes #3697

See merge request isc-projects/bind9!7116

3 years agoAdd CHANGES note for [GL #3697]
Mark Andrews [Thu, 24 Nov 2022 00:19:13 +0000 (11:19 +1100)] 
Add CHANGES note for [GL #3697]

3 years agoCheck that DS records are only present at delegations
Mark Andrews [Thu, 24 Nov 2022 00:10:58 +0000 (11:10 +1100)] 
Check that DS records are only present at delegations

This extends the integrity check to look for stray DS records
in the zone.

3 years agoMerge branch '3721-the-nslookup-command-does-not-obey-the-port-option-when-record...
Mark Andrews [Mon, 5 Dec 2022 22:19:23 +0000 (22:19 +0000)] 
Merge branch '3721-the-nslookup-command-does-not-obey-the-port-option-when-record-type-any-is-used' into 'main'

Resolve "The nslookup command does not obey the port option when record type ANY is used."

Closes #3721

See merge request isc-projects/bind9!7162

3 years agoAdd CHANGES note for [GL #3721]
Mark Andrews [Sun, 4 Dec 2022 22:27:13 +0000 (09:27 +1100)] 
Add CHANGES note for [GL #3721]

3 years agoRemember that the port was set in host and nslookup
Mark Andrews [Sun, 4 Dec 2022 22:21:35 +0000 (09:21 +1100)] 
Remember that the port was set in host and nslookup

Set 'port_set = true;' so that the TCP/DOT/DOH code doesn't reset
the port when making connections.

3 years agoAdd checks for 'host'
Mark Andrews [Sun, 4 Dec 2022 23:08:54 +0000 (10:08 +1100)] 
Add checks for 'host'

3 years agoCheck ANY lookup using nslookup
Mark Andrews [Sun, 4 Dec 2022 22:18:51 +0000 (09:18 +1100)] 
Check ANY lookup using nslookup

3 years agoMerge branch '3633-cid-361427-error-handling-issues-in-lib-dns-rdata-c' into 'main'
Mark Andrews [Sun, 4 Dec 2022 23:16:53 +0000 (23:16 +0000)] 
Merge branch '3633-cid-361427-error-handling-issues-in-lib-dns-rdata-c' into 'main'

Resolve "CID 361427: Error handling issues in lib/dns/rdata.c"

Closes #3633

See merge request isc-projects/bind9!7056

3 years agoAdd RUNTIME_CHECK for dns_rdata_tostruct
Mark Andrews [Tue, 8 Nov 2022 13:06:52 +0000 (13:06 +0000)] 
Add RUNTIME_CHECK for dns_rdata_tostruct

3 years agoMerge branch 'artem-tls-check-for-recv_cb' into 'main'
Artem Boldariev [Fri, 2 Dec 2022 12:11:41 +0000 (12:11 +0000)] 
Merge branch 'artem-tls-check-for-recv_cb' into 'main'

TLS: check for sock->recv_cb when handling received data

See merge request isc-projects/bind9!7158

3 years agoTLS: check for sock->recv_cb when handling received data
Artem Boldariev [Tue, 22 Nov 2022 13:11:57 +0000 (15:11 +0200)] 
TLS: check for sock->recv_cb when handling received data

This commit adds a check if 'sock->recv_cb' might have been nullified
during the call to 'sock->recv_cb'. That could happen, e.g. by an
indirect call to 'isc_nmhandle_close()' from within the callback when
wrapping up.

In this case, let's close the TLS connection.

3 years agoMerge branch 'artem-tls-doh-listeners-avoid-acessing-non-atomic-flags-on-handshake...
Artem Boldariev [Fri, 2 Dec 2022 11:18:56 +0000 (11:18 +0000)] 
Merge branch 'artem-tls-doh-listeners-avoid-acessing-non-atomic-flags-on-handshake-or-accept' into 'main'

TLS and DoH: Avoid accessing non-atomic listener socket flags during HS/when accepting a caonnection

See merge request isc-projects/bind9!7155

3 years agoDoH: Avoid accessing non-atomic listener socket flags when accepting
Artem Boldariev [Fri, 2 Dec 2022 08:41:28 +0000 (10:41 +0200)] 
DoH: Avoid accessing non-atomic listener socket flags when accepting

This commit ensures that the non-atomic flags inside a DoH listener
socket object (and associated worker) are accessed when doing accept
for a connection only from within the context of the dedicated thread,
but not other worker threads.

The purpose of this commit is to avoid TSAN errors during
isc__nmsocket_closing() calls. It is a continuation of
4b5559cd8f41e67bf03e92d9d0338dee9d549b48.

3 years agoTLS: Avoid accessing non-atomic listener socket flags during HS
Artem Boldariev [Thu, 1 Dec 2022 20:42:54 +0000 (22:42 +0200)] 
TLS: Avoid accessing non-atomic listener socket flags during HS

This commit ensures that the non-atomic flags inside a TLS listener
socket object (and associated worker) are accessed when doing
handshake for a connection only from within the context of the
dedicated thread, but not other worker threads.

The purpose of this commit is to avoid TSAN errors during
isc__nmsocket_closing() calls. It is a continuation of
4b5559cd8f41e67bf03e92d9d0338dee9d549b48.

3 years agoMerge branch 'tkrizek/system-tests-prereqs' into 'main'
Tom Krizek [Fri, 2 Dec 2022 09:44:29 +0000 (09:44 +0000)] 
Merge branch 'tkrizek/system-tests-prereqs' into 'main'

Unify system test feature detection and add missing prerequisites

See merge request isc-projects/bind9!7151

3 years agoAdd dnstap prerequisite for dnstap system test
Tom Krizek [Thu, 1 Dec 2022 09:52:56 +0000 (10:52 +0100)] 
Add dnstap prerequisite for dnstap system test

3 years agoAdd libnghttp2 prerequisite for doth system test
Tom Krizek [Wed, 30 Nov 2022 16:44:27 +0000 (17:44 +0100)] 
Add libnghttp2 prerequisite for doth system test

While some of these tests are for DoT which doesn't require nghttp2,
the server configs won't allow the server to start without nghttp2
support during compile time.

It might be possible to split these tests into DoT and DoH and only
require nghttp2 for DoH tests, but since almost all of our CI jobs are
compiled with nghttp2, we wouldn't gain a lot of coverage, so it's
probably not worth the effort.

3 years agoAdd lmdb prerequisite for nzd2nzf system test
Tom Krizek [Wed, 30 Nov 2022 16:43:56 +0000 (17:43 +0100)] 
Add lmdb prerequisite for nzd2nzf system test

3 years agoCheck for pkcs11-tool in keyfromlabel system test
Tom Krizek [Fri, 23 Sep 2022 13:25:31 +0000 (15:25 +0200)] 
Check for pkcs11-tool in keyfromlabel system test

pkcs11-tool which is typically part of the opensc package is required
for the keyfromlabel test.

3 years agoUse feature-test feature detection in pytests
Tom Krizek [Thu, 1 Dec 2022 14:21:22 +0000 (15:21 +0100)] 
Use feature-test feature detection in pytests

Avoid using the environment variables for feature detection and use the
feature-test utility instead.

Remove the obsolete environment variables from conf.sh, since they're no
longer used anywhere.

3 years agoUse feature-test to detect feature support in system tests
Tom Krizek [Thu, 1 Dec 2022 14:12:28 +0000 (15:12 +0100)] 
Use feature-test to detect feature support in system tests

Previously, there were two different ways to detect feature support.
Either through an environment variable set by configure in conf.sh, or
using the feature-test utility.

It is more simple and consistent to have only one way of detecting the
feature support. Using the feature-test utility seems superior the the
environment variables set by configure.

3 years agoAdd missing options to feature-test utility
Tom Krizek [Thu, 1 Dec 2022 14:08:36 +0000 (15:08 +0100)] 
Add missing options to feature-test utility

3 years agoMerge branch 'artem-tls-listener-avoid-acessing-flags-on-accept' into 'main'
Artem Boldariev [Thu, 1 Dec 2022 20:00:35 +0000 (20:00 +0000)] 
Merge branch 'artem-tls-listener-avoid-acessing-flags-on-accept' into 'main'

TLS: Avoid accessing listener socket flags from other threads when accepting a connection

See merge request isc-projects/bind9!7154

3 years agoTLS: Avoid accessing listener socket flags from other threads
Artem Boldariev [Wed, 30 Nov 2022 20:58:13 +0000 (22:58 +0200)] 
TLS: Avoid accessing listener socket flags from other threads

This commit ensures that the flags inside a TLS listener socket
object (and associated worker) are accessed when accepting a
connection only from within the context of the dedicated thread, but
not other worker threads.

3 years agoMerge branch 'ondrej-fix-single-read-tlsdns-client' into 'main'
Ondřej Surý [Thu, 1 Dec 2022 18:06:45 +0000 (18:06 +0000)] 
Merge branch 'ondrej-fix-single-read-tlsdns-client' into 'main'

Honour single read per client isc_nm_read() call in the TLSDNS

See merge request isc-projects/bind9!7152

3 years agoHonour single read per client isc_nm_read() call in the TLSDNS
Ondřej Surý [Thu, 1 Dec 2022 17:31:05 +0000 (18:31 +0100)] 
Honour single read per client isc_nm_read() call in the TLSDNS

The TLSDNS transport was not honouring the single read callback for
TLSDNS client.  It would call the read callbacks repeatedly in case the
single TLS read would result in multiple DNS messages in the decoded
buffer.

3 years agoMerge branch '3709-fix-dns_resolver-hash-tables' into 'main'
Ondřej Surý [Thu, 1 Dec 2022 13:35:08 +0000 (13:35 +0000)] 
Merge branch '3709-fix-dns_resolver-hash-tables' into 'main'

Refactor the dns_resolver fetch context hash tables and locking

Closes #3709

See merge request isc-projects/bind9!7142

3 years agoAdd CHANGES note for [GL #3709]
Ondřej Surý [Wed, 30 Nov 2022 10:43:20 +0000 (11:43 +0100)] 
Add CHANGES note for [GL #3709]

3 years agoRefactor the dns_resolver fetch context hash tables and locking
Ondřej Surý [Fri, 4 Nov 2022 14:04:29 +0000 (15:04 +0100)] 
Refactor the dns_resolver fetch context hash tables and locking

This is second in the series of fixing the usage of hashtables in the
dns_adb and the dns_resolver units.

Currently, the fetch buckets (used to hold the fetch context) and zone
buckets (used to hold per-domain counters) would never get cleaned from
the memory.  Combined with the fact that the hashtable now grows as
needed (instead of using hashtable as buckets), the memory usage in the
resolver can just grow and it never drops down.

In this commit, the usage of hashtables (hashmaps) has been completely
rewritten, so there are no "buckets" and all the matching conditions are
directly mapped into the hashtable key:

 1. For per-domain counter hashtable, this is simple as the lowercase
    domain name is used directly as a counter.

 2. For fetch context hashtable, this requires copying some extra flags
    back and forth in the key.

As we don't hold the "buckets" forever, the cleaning mechanism has been
rewritten as well:

 1. For per-domain counter hashtable, this is again much simpler, as we
    only need to check whether the usage counter is still zero under the
    lock and bail-out on cleaning if the counter is in use.

 2. For fetch context hashtable, this is more complicated as the fetch
    context cannot be reused after it has been finished.  The algorithm
    is different, the fetch context is always removed from the
    hashtable, but if we find the fetch context that has been marked
    as finished in the lookup function, we help with the cleaning from
    the hashtable and try again.

Couple of additional changes have been implemented in this refactoring
as those were needed for correct functionality and could not be split
into individual commits (or would not make sense as seperate commits):

 1. The dns_resolver_createfetch() has an option to create "unshared"
    fetch.  The "unshared" fetch will never get matched, so there's
    little point in storing the "unshared" fetch in the hashtable.
    Therefore the "unshared" fetches are now detached from the
    hashtable and live just on their own.

 2. Replace the custom reference counting with ISC_REFCOUNT_DECL/IMPL
    macros for better tracing.

 3. fctx_done_detach() is idempotent, it makes the "final" detach (the
    one matching the create function) only once.  But that also means
    that it has to be called before the detach that kept the fetch
    context alive in the callback.  A new macro fctx_done_unref() has
    been added to allow this code flow:

    fctx_done_unref(fctx, result);
    fctx_detach(&fctx);

    Doing this the other way around could cause fctx to get destroyed in
    the fctx_unref() first and fctx_done_detach() would cause UAF.

 4. The resume_qmin() and resume_dslookup() callbacks have been
    refactored for more readability and simpler code paths.  The
    validated() callback has also received some of the simplifications,
    but it should be refactored in the future as it is bit of spaghetti
    now.

3 years agoMerge branch 'each-cache-use-loops' into 'main' 7148/head
Evan Hunt [Wed, 30 Nov 2022 20:12:29 +0000 (20:12 +0000)] 
Merge branch 'each-cache-use-loops' into 'main'

change cache cleaning to use loops instead of tasks

See merge request isc-projects/bind9!7136

3 years agochange dns_db_settask() to _setloop()
Evan Hunt [Thu, 27 Oct 2022 05:36:04 +0000 (22:36 -0700)] 
change dns_db_settask() to _setloop()

The mechanism for associating a worker task to a database now
uses loops rather than tasks.

For this reason, the parameters to dns_cache_create() have been
updated to take a loop manager rather than a task manager.

3 years agoMerge branch 'artem-tls-tcp-compatibility-fixes' into 'main'
Artem Boldariev [Wed, 30 Nov 2022 16:30:03 +0000 (16:30 +0000)] 
Merge branch 'artem-tls-tcp-compatibility-fixes' into 'main'

TLS Stream: TCP transport compatibility fixes

See merge request isc-projects/bind9!7127

3 years agoTLS stream: always handle send callbacks asynchronously
Artem Boldariev [Fri, 28 Oct 2022 16:08:50 +0000 (19:08 +0300)] 
TLS stream: always handle send callbacks asynchronously

This commit ensures that send callbacks are always called from within
the context of its worker thread even in the case of
shuttigdown/inactive socket, just like TCP transport does and with
which TLS attempts to be as compatible as possible.