]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoChange the isc_buffer_reserve() to take just buffer pointer
Ondřej Surý [Thu, 15 Dec 2022 10:54:51 +0000 (11:54 +0100)] 
Change the isc_buffer_reserve() to take just buffer pointer

The isc_buffer_reserve() would be passed a reference to the buffer
pointer, which was unnecessary as the pointer would never be changed
in the current implementation.  Remove the extra dereference.

3 years agoMerge branch '3178-dispatch-race' into 'main'
Ondřej Surý [Mon, 19 Dec 2022 12:07:12 +0000 (12:07 +0000)] 
Merge branch '3178-dispatch-race' into 'main'

Fix the thread safety in the dns_dispatch unit

Closes #3178

See merge request isc-projects/bind9!7025

3 years agoAdd CHANGES and release note for [GL #3178] and [GL #3636]
Ondřej Surý [Wed, 30 Nov 2022 17:48:06 +0000 (18:48 +0100)] 
Add CHANGES and release note for [GL #3178] and [GL #3636]

3 years agoFix the thread safety in the dns_dispatch unit
Ondřej Surý [Wed, 30 Nov 2022 16:58:35 +0000 (17:58 +0100)] 
Fix the thread safety in the dns_dispatch unit

The dispatches are not thread-bound, and used freely between various
threads (see the dns_resolver and dns_request units for details).

This refactoring make sure that all non-const dns_dispatch_t and
dns_dispentry_t members are accessed under a lock, and both object now
track their internal state (NONE, CONNECTING, CONNECTED, CANCELED)
instead of guessing the state from the state of various struct members.

During the refactoring, the artificial limit DNS_DISPATCH_SOCKSQUOTA on
UDP sockets per dispatch was removed as the limiting needs to happen and
happens on in dns_resolver and limiting the number of UDP sockets
artificially in dispatch could lead to unpredictable behaviour in case
one dispatch has the limit exhausted by others are idle.

The TCP artificial limit of DNS_DISPATCH_MAXREQUESTS makes even less
sense as the TCP connections are only reused in the dns_request API
that's not a heavy user of the outgoing connections.

As a side note, the fact that UDP and TCP dispatch pretends to be same
thing, but in fact the connected UDP is handled from dns_dispentry_t and
dns_dispatch_t acts as a broker, but connected TCP is handled from
dns_dispatch_t and dns_dispatchmgr_t acts as a broker doesn't really
help the clarity of this unit.

This refactoring kept to API almost same - only dns_dispatch_cancel()
and dns_dispatch_done() were merged into dns_dispatch_done() as we need
to cancel active netmgr handles in any case to not leave dangling
connections around.  The functions handling UDP and TCP have been mostly
split to their matching counterparts and the dns_dispatch_<function>
functions are now thing wrappers that call <udp|tcp>_dispatch_<function>
based on the socket type.

More debugging-level logging was added to the unit to accomodate for
this fact.

3 years agoMerge branch '3712-fix-reference-counting-in-dns_adb-get_attached_entry-v2' into...
Ondřej Surý [Fri, 16 Dec 2022 20:49:49 +0000 (20:49 +0000)] 
Merge branch '3712-fix-reference-counting-in-dns_adb-get_attached_entry-v2' into 'main'

Fix reference counting in get_attached_entry (again)

Closes #3712

See merge request isc-projects/bind9!7250

3 years agoFix reference counting in get_attached_entry (again)
Ondřej Surý [Fri, 16 Dec 2022 20:46:50 +0000 (21:46 +0100)] 
Fix reference counting in get_attached_entry (again)

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.

This creeped into the code base again during review, so I am adding
an extra comment to prevent this.

3 years agoMerge branch 'tkrizek/danger-backports' into 'main'
Tom Krizek [Fri, 16 Dec 2022 13:18:01 +0000 (13:18 +0000)] 
Merge branch 'tkrizek/danger-backports' into 'main'

Check backport workflow in danger CI

See merge request isc-projects/bind9!7243

3 years agodanger: remove obsolete check for cherry pick msg
Tom Krizek [Thu, 15 Dec 2022 16:55:54 +0000 (17:55 +0100)] 
danger: remove obsolete check for cherry pick msg

With proper backport commit detection, this check has been made
redundant.

3 years agodanger: check backport commits for original commit IDs
Tom Krizek [Thu, 15 Dec 2022 16:52:52 +0000 (17:52 +0100)] 
danger: check backport commits for original commit IDs

A full backport must have all the commit from the original MR and the
original commit IDs must be referenced in the backport commit messages.

If the criteria above is not met, the MR should be marked as a partial
backport. In that case, any discrepencies are only logged as informative
messages rather than failures.

3 years agodanger: check that original MR has been merged
Tom Krizek [Thu, 15 Dec 2022 16:51:24 +0000 (17:51 +0100)] 
danger: check that original MR has been merged

When checking a backport MR, ensure that the original MR has been merged
already. This is vital for followup checks that verify commit IDs from
original commits are present in backport commit messages.

3 years agodanger: check backport links to the original MR
Tom Krizek [Thu, 15 Dec 2022 16:48:34 +0000 (17:48 +0100)] 
danger: check backport links to the original MR

When doing archeology, it is much easier to find stuff if it's properly
linked. This check ensures that backport MR are linked to their original
MR via a "Backport of !XXXX" message.

The regular expression is fairly broad and has been tested to accept the
following variants of the message:
Backport of MR !XXXX
Backport of: !XXXX
backport of mr !XXXX
Backport of   !XXXX
Backport of https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/XXXX

3 years agodanger: ensure target branch is in the MR title
Tom Krizek [Thu, 15 Dec 2022 16:45:54 +0000 (17:45 +0100)] 
danger: ensure target branch is in the MR title

Having the MR title clearly marked in its title can be very useful when
looking through older issues/MRs.

This check also ensures that the version from the version label matches
the proper version branch (i.e. v9.16 must be marked with [v9_16]).

3 years agodanger: support partial backport label
Tom Krizek [Thu, 15 Dec 2022 16:39:58 +0000 (17:39 +0100)] 
danger: support partial backport label

Treat the Backport::Partial label as a backport as well.

3 years agoMerge branch '3740-rpz-reconfig' into 'main'
Tony Finch [Fri, 16 Dec 2022 09:48:35 +0000 (09:48 +0000)] 
Merge branch '3740-rpz-reconfig' into 'main'

A couple of RPZ options were not reconfigured as expected

Closes #3740

See merge request isc-projects/bind9!7230

3 years agoA couple of RPZ options were not reconfigured as expected
Tony Finch [Wed, 14 Dec 2022 15:47:03 +0000 (15:47 +0000)] 
A couple of RPZ options were not reconfigured as expected

[bug] Changes to the RPZ response-policy min-update-interval
and add-soa options now take effect as expected when
named is reconfigured. [GL #3740]

3 years agoMerge branch '3739-adb-cleans-overzealously-under-memory-pressure' into 'main'
Ondřej Surý [Thu, 15 Dec 2022 15:44:01 +0000 (15:44 +0000)] 
Merge branch '3739-adb-cleans-overzealously-under-memory-pressure' into 'main'

Exclude the ADB hashmaps from ADB overmem accounting

Closes #3739

See merge request isc-projects/bind9!7228

3 years agoAdd CHANGES and release note for [GL #3739]
Ondřej Surý [Wed, 14 Dec 2022 13:25:23 +0000 (14:25 +0100)] 
Add CHANGES and release note for [GL #3739]

3 years agoDon't expire fresh ADB names and entries
Ondřej Surý [Tue, 13 Dec 2022 13:32:19 +0000 (14:32 +0100)] 
Don't expire fresh ADB names and entries

The overmem cleaning in ADB could become overzealous and clean fresh ADB
names and entries.  Add a safety check to not clean any ADB names and
entries that are below ADB_CACHE_MINIMUM threshold.

3 years agoExclude the ADB hashmaps from ADB overmem accounting
Ondřej Surý [Tue, 13 Dec 2022 13:14:21 +0000 (14:14 +0100)] 
Exclude the ADB hashmaps from ADB overmem accounting

The ADB overmem accounting would include the memory used by hashtables
thus vastly reducing the space that can be used for ADB names and
entries when the hashtables would grow.  Create own memory context for
the ADB names and entries hash tables.

3 years agoMerge branch 'ondrej-fix-data-race-in-dns_adb' into 'main'
Ondřej Surý [Thu, 15 Dec 2022 14:58:56 +0000 (14:58 +0000)] 
Merge branch 'ondrej-fix-data-race-in-dns_adb' into 'main'

Lock the adbname and adbentry prior to unlocking hash locks

See merge request isc-projects/bind9!7216

3 years agoLock the adbname and adbentry prior to unlocking hash locks
Ondřej Surý [Tue, 13 Dec 2022 12:48:55 +0000 (13:48 +0100)] 
Lock the adbname and adbentry prior to unlocking hash locks

There was a datarace that could expire a freshly created ADB names and
entries between the return from get_attached_{name,entry} and locking it
again.  Lock the ADB name and ADB entry inside the hash table lock, so
they won't get expired until the full initialization has been complete.

3 years agoMerge branch '3742-catz-update-log-incorrect-soa-serial-representation' into 'main'
Arаm Sаrgsyаn [Thu, 15 Dec 2022 13:51:18 +0000 (13:51 +0000)] 
Merge branch '3742-catz-update-log-incorrect-soa-serial-representation' into 'main'

Fix an incorrect SOA serial representation in catz

Closes #3742

See merge request isc-projects/bind9!7229

3 years agoAdd a CHANGES note for [GL #3742]
Aram Sargsyan [Wed, 14 Dec 2022 14:46:26 +0000 (14:46 +0000)] 
Add a CHANGES note for [GL #3742]

3 years agoFix logging a uint32_t SOA serial value in dns_catz_update_from_db()
Aram Sargsyan [Wed, 14 Dec 2022 14:40:31 +0000 (14:40 +0000)] 
Fix logging a uint32_t SOA serial value in dns_catz_update_from_db()

The dns_catz_update_from_db() function prints serial number as a signed
number (with "%d" in the format string), but the `vers` variable's type
is 'uint32_t'. This breaks serials bigger than 2^31.

Use PRIu32 instead of "d" in the format string.

3 years agoAdd big SOA serial logging check into the catz system test
Aram Sargsyan [Wed, 14 Dec 2022 14:37:06 +0000 (14:37 +0000)] 
Add big SOA serial logging check into the catz system test

Check that the SOA serial numbers printed when updating a catalog zone
is represented correctly for numbers bigger than 2^31.

3 years agoMerge branch 'aram/dns_adb_getcookie-cleanup' into 'main'
Arаm Sаrgsyаn [Thu, 15 Dec 2022 13:22:54 +0000 (13:22 +0000)] 
Merge branch 'aram/dns_adb_getcookie-cleanup' into 'main'

Clean up and refactor dns_adb_getcookie()

See merge request isc-projects/bind9!7211

3 years agoClean up and refactor dns_adb_getcookie()
Aram Sargsyan [Fri, 9 Dec 2022 15:09:12 +0000 (15:09 +0000)] 
Clean up and refactor dns_adb_getcookie()

The dns_adb_getcookie() doesn't use the 'adb' parameter, remove it.

Refactor the dns_adb_getcookie() function to just return the size of
the cookie when the caller passes 'NULL' as the 'cookie' argument.

3 years agoMerge branch 'ondrej-use-isc_hashmap-for-zonemgr_keymgmt' into 'main'
Ondřej Surý [Wed, 14 Dec 2022 18:39:41 +0000 (18:39 +0000)] 
Merge branch 'ondrej-use-isc_hashmap-for-zonemgr_keymgmt' into 'main'

Replace zonemgr_keymgmt own hash table with isc_hashmap

See merge request isc-projects/bind9!7191

3 years agoReplace zonemgr_keymgmt own hash table with isc_hashmap
Ondřej Surý [Thu, 8 Dec 2022 09:04:41 +0000 (10:04 +0100)] 
Replace zonemgr_keymgmt own hash table with isc_hashmap

Instead of maintaining own hashtable implementation for zonemgr_keymgmt,
use isc_hashmap that already can resize (grow and shrink).

3 years agoMerge branch 'ondrej-add-more-logging-to-netmgr' into 'main'
Ondřej Surý [Wed, 14 Dec 2022 18:35:17 +0000 (18:35 +0000)] 
Merge branch 'ondrej-add-more-logging-to-netmgr' into 'main'

Add internal logging functions to the netmgr

See merge request isc-projects/bind9!7233

3 years agoAdd internal logging functions to the netmgr
Ondřej Surý [Wed, 7 Dec 2022 08:45:34 +0000 (09:45 +0100)] 
Add internal logging functions to the netmgr

Add internal logging functions isc__netmgr_log, isc__nmsocket_log(), and
isc__nmhandle_log() that can be used to add logging messages to the
netmgr, and change all direct use of isc_log_write() to use those
logging functions to properly prefix them with netmgr, nmsocket and
nmsocket+nmhandle.

3 years agoMerge branch '3637-try-next-server-on-resolver-timeout' into 'main'
Ondřej Surý [Wed, 14 Dec 2022 17:52:32 +0000 (17:52 +0000)] 
Merge branch '3637-try-next-server-on-resolver-timeout' into 'main'

Try next server on resolver timeout

Closes #3637

See merge request isc-projects/bind9!7212

3 years agoAdd CHANGES and release notes for [GL #3637]
Ondřej Surý [Mon, 12 Dec 2022 19:05:54 +0000 (20:05 +0100)] 
Add CHANGES and release notes for [GL #3637]

3 years agoExpire names in shutdown_names() under the lock
Ondřej Surý [Wed, 14 Dec 2022 14:07:58 +0000 (15:07 +0100)] 
Expire names in shutdown_names() under the lock

Since there could be fetches running, we need to run expire_name() under
the lock when shutting down the names.

3 years agoAdd comment why statistics/ns3 has misconfigure root.hints
Ondřej Surý [Tue, 13 Dec 2022 14:23:54 +0000 (15:23 +0100)] 
Add comment why statistics/ns3 has misconfigure root.hints

To count pending queries in the statistics, we need the ns3 to be
misconfigured.  Document the fact in the statistics/ns3/root.hints.

3 years agoRevert the statistics system test change after we fixed the resolver
Ondřej Surý [Tue, 13 Dec 2022 14:20:10 +0000 (15:20 +0100)] 
Revert the statistics system test change after we fixed the resolver

When the resolver was refactored, the statistics system test had to be
adjusted in c6b4d8255775a24a12b832a90a78cbf86e9faa8d.  Unfortunately,
this change had to be done because of an error in the resolver
refactoring where timeout would not retry next server, but keep trying
the same server.  As we have now fixed this bug, revert the change to
the test back to the previous state.

3 years agoTry next server on resolver timeout
Ondřej Surý [Mon, 12 Dec 2022 11:06:01 +0000 (12:06 +0100)] 
Try next server on resolver timeout

Instead of resending to the same server on the (dispatch) timeout in the
resolver, try the next server.

3 years agoMerge branch 'ondrej-allow-zero-length-keys-in-isc_hashmap' into 'main'
Ondřej Surý [Wed, 14 Dec 2022 17:01:54 +0000 (17:01 +0000)] 
Merge branch 'ondrej-allow-zero-length-keys-in-isc_hashmap' into 'main'

Allow zero length keys in isc_hashmap

See merge request isc-projects/bind9!7198

3 years agoAllow zero length keys in isc_hashmap
Ondřej Surý [Thu, 8 Dec 2022 09:46:09 +0000 (10:46 +0100)] 
Allow zero length keys in isc_hashmap

In case, we are trying to hash the empty key into the hashmap, the key
is going to have zero length.  This might happen in the unit test.
Allow this and add a unit test to ensure the empty zero-length key
doesn't hash to slot 0 as SipHash 2-4 (our hash function of choice) has
no problem with zero-length inputs.

3 years agoMerge branch '3725-mutual-tls-session-resumption-fix' into 'main'
Artem Boldariev [Wed, 14 Dec 2022 16:36:53 +0000 (16:36 +0000)] 
Merge branch '3725-mutual-tls-session-resumption-fix' into 'main'

Fix TLS session resumption via IDs when Mutual TLS is used

Closes #3725

See merge request isc-projects/bind9!7215

3 years agoUpdate Release notes [GL #3725]
Artem Boldariev [Wed, 14 Dec 2022 16:07:40 +0000 (18:07 +0200)] 
Update Release notes [GL #3725]

Mention that TLS session resumption for Mutual TLS has been fixed.

3 years agoUpdate CHANGES [GL #3725]
Artem Boldariev [Tue, 13 Dec 2022 12:14:43 +0000 (14:14 +0200)] 
Update CHANGES [GL #3725]

Mention that TLS session resumption for Mutual TLS has been fixed.

3 years agoExtend the 'doth' system test with a Mutual TLS resumption check
Artem Boldariev [Fri, 9 Dec 2022 16:47:07 +0000 (18:47 +0200)] 
Extend the 'doth' system test with a Mutual TLS resumption check

This commit adds a simple check to the 'doth' system test which
ensures that session resumption when Mutual TLS is used works as
expected.

3 years agoFix TLS session resumption via IDs when Mutual TLS is used
Artem Boldariev [Fri, 9 Dec 2022 16:44:01 +0000 (18:44 +0200)] 
Fix TLS session resumption via IDs when Mutual TLS is used

This commit fixes TLS session resumption via session IDs when
client certificates are used. To do so it makes sure that session ID
contexts are set within server TLS contexts. See OpenSSL documentation
for 'SSL_CTX_set_session_id_context()', the "Warnings" section.

3 years agoMerge branch 'fanf-dnssec-algorithm-loglevel' into 'main'
Tony Finch [Wed, 14 Dec 2022 11:02:15 +0000 (11:02 +0000)] 
Merge branch 'fanf-dnssec-algorithm-loglevel' into 'main'

List supported DNSSEC algorithms at log level NOTICE

See merge request isc-projects/bind9!7217

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 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