]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agorename 'ret' to 'result'
Evan Hunt [Thu, 13 Apr 2023 16:25:13 +0000 (09:25 -0700)] 
rename 'ret' to 'result'

purely to assuage my desire for consistency across modules,
result variables have been renamed to 'result' as they are
throughout most of BIND. there are no other changes.

3 years agoconvert TSIG keyring storage from RBT to hash table
Evan Hunt [Wed, 12 Apr 2023 07:14:04 +0000 (00:14 -0700)] 
convert TSIG keyring storage from RBT to hash table

since it is not necessary to find partial matches when looking
up names in a TSIG keyring, we can use a hash table instead of
an RBT to store them.

the tsigkey object now stores the key name as a dns_fixedname
rather than allocating memory for it.

the `name` parameter to dns_tsigkeyring_add() has been removed;
it was unneeded since the tsigkey object already contains a copy
of the name.

the opportunistic cleanup_ring() function has been removed;
it was only slowing down lookups.

3 years agoremove dns__tsig_algallocated()
Evan Hunt [Wed, 12 Apr 2023 07:17:30 +0000 (00:17 -0700)] 
remove dns__tsig_algallocated()

this function was no longer needed, because the algorithm name is no
longer copied into the tsigkey object by dns_tsigkey_createfromkey();
it's always just a pointer to a statically defined name.

3 years agoget_key_struct() can no longer fail
Evan Hunt [Wed, 12 Apr 2023 06:43:19 +0000 (23:43 -0700)] 
get_key_struct() can no longer fail

remove checks for NULL return values.

3 years agouse algorithm number instead of name to create TSIG keys
Evan Hunt [Wed, 12 Apr 2023 02:01:31 +0000 (19:01 -0700)] 
use algorithm number instead of name to create TSIG keys

the prior practice of passing a dns_name containing the
expanded name of an algorithm to dns_tsigkey_create() and
dns_tsigkey_createfromkey() is unnecessarily cumbersome;
we can now pass the algorithm number instead.

3 years agofurther dns_tsigkey API tweaks
Evan Hunt [Tue, 11 Apr 2023 23:10:07 +0000 (16:10 -0700)] 
further dns_tsigkey API tweaks

- remove the 'ring' parameter from dns_tsigkey_createfromkey(),
  and use dns_tsigkeyring_add() to add key objects to a keyring instead.
- add a magic number to dns_tsigkeyring_t
- change dns_tsigkeyring_dumpanddetach() to dns_tsigkeyring_dump();
  we now call dns_tsigkeyring_detach() separately.
- remove 'maxgenerated' from dns_tsigkeyring_t since it never changes.

3 years agoclean up reference counting in dns_tsigkey
Evan Hunt [Tue, 11 Apr 2023 19:56:57 +0000 (12:56 -0700)] 
clean up reference counting in dns_tsigkey

the reference counter in dns_tsigkey was being computed differently
depending on whether there was a keyring or not. this is prone to
error.

3 years agouse ISC_REFCOUNT_IMPL for dns_tsigkey and dns_tsigkeyring
Evan Hunt [Tue, 11 Apr 2023 18:35:01 +0000 (11:35 -0700)] 
use ISC_REFCOUNT_IMPL for dns_tsigkey and dns_tsigkeyring

use the ISC_REFCOUNT attach/detach implementation in dns/tsig.c
so that detailed tracing can be used during refactoring.

dns_tsig_keyring_t has been renamed dns_tsigkeyring_t so the type
and the attach/detach function names will match.

3 years agominor tsig.c cleanups
Evan Hunt [Tue, 11 Apr 2023 06:46:10 +0000 (23:46 -0700)] 
minor tsig.c cleanups

- style cleanups.
- simplify the function parameters to dns_tsigkey_create():
  + remove 'restored' and 'generated', they're only ever set to false.
  + remove 'creator' because it's only ever set to NULL.
  + remove 'inception' and 'expiry' because they're only ever set to
    (0, 0) or (now, now), and either way, this means "never expire".
  + remove 'ring' because we can just use dns_tsigkeyring_add() instead.
- rename dns_keyring_restore() to dns_tsigkeyring_restore() to match the
  rest of the functions operating on dns_tsigkeyring objects.

3 years agoMerge branch '4141-find-zone_keys' into 'main'
Matthijs Mekking [Wed, 14 Jun 2023 08:05:55 +0000 (08:05 +0000)] 
Merge branch '4141-find-zone_keys' into 'main'

Update find_zone_keys for dynamic update

Closes #4141

See merge request isc-projects/bind9!8029

3 years agoUpdate findzonekeys function name in log message
Matthijs Mekking [Wed, 14 Jun 2023 07:05:31 +0000 (09:05 +0200)] 
Update findzonekeys function name in log message

The "dns_dnssec_findzonekeys2" log message is a leftover from when that
was the name of the function. Rename to match the current name of the
function.

3 years agoAdd dynamic update prepub and doubleksk test case
Matthijs Mekking [Tue, 13 Jun 2023 15:45:08 +0000 (17:45 +0200)] 
Add dynamic update prepub and doubleksk test case

Add two test cases for zones that use auto-dnssec, but not
inline-signing, and make sure that the change for find_zone_keys()
do not affect introducing a new key that is intended for signing.

See note https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/7638#note_355944

3 years agoAdd CHANGES for find_zone_keys() function update
Matthijs Mekking [Thu, 2 Mar 2023 10:04:59 +0000 (11:04 +0100)] 
Add CHANGES for find_zone_keys() function update

Probably a useful point in history.

3 years agoUpdate find_zone_keys for dynamic update
Matthijs Mekking [Tue, 4 Oct 2022 13:54:30 +0000 (15:54 +0200)] 
Update find_zone_keys for dynamic update

The find_zone_keys() function was not working properly for
inline-signed zones. It only worked if the DNSKEY records were also
published in the unsigned version of the zone. But this is not the
case when you use dnssec-policy, the DNSKEY records will only occur
in the signed version of the zone. Therefor, when looking for keys
to sign the zone, only the newly added keys in the dynamic update
were found (which could be zero), ignoring existing keys.

Also, if a DNSKEY was added, it would try to sign the zone with just
this new key, and this would only work if the key files for that key
were imported into the key-directory.

This is a design error, because the goal is to sign the zone with the
keys for which we actually have key files for. So instead of looking
for DNSKEY records to then search for the matching key files, call
dns_dnssec_findmatchingkeys() which just looks for the keys we have
on disk for the given zone. It will also set the correct DNSSEC
signing hints.

3 years agoAdd log check in multisigner system test
Matthijs Mekking [Tue, 13 Jun 2023 13:59:53 +0000 (15:59 +0200)] 
Add log check in multisigner system test

When we add DNSKEY records via dynamic update, this should no longer
trigger signing the zone with these keys. This currently happens when
'find_zone_keys()' looks up the keys by inspecting the DNSKEY RRset,
then attempting to read the corresponding key files.

Add checks that inspect the logs whether an attempt to read the key
files for the newly added keys was done (and failed because these files
are not available).

3 years agoMerge branch 'tkrizek/remove-trailing-whitespace' into 'main'
Tom Krizek [Tue, 13 Jun 2023 13:31:32 +0000 (13:31 +0000)] 
Merge branch 'tkrizek/remove-trailing-whitespace' into 'main'

Remove trailing whitespace from all text files

See merge request isc-projects/bind9!8012

3 years agoAdd utility script to detect trailing whitespace
Tom Krizek [Tue, 13 Jun 2023 08:26:26 +0000 (10:26 +0200)] 
Add utility script to detect trailing whitespace

Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.

3 years agoIgnore trailing whitespace removal commit in git blame
Tom Krizek [Wed, 7 Jun 2023 14:30:06 +0000 (16:30 +0200)] 
Ignore trailing whitespace removal commit in git blame

3 years agoRemove trailing whitespace from all text files
Tom Krizek [Wed, 7 Jun 2023 14:00:00 +0000 (16:00 +0200)] 
Remove trailing whitespace from all text files

I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'

3 years agoMerge branch '4136-catz-db-update-notify-bug' into 'main'
Arаm Sаrgsyаn [Tue, 13 Jun 2023 13:01:05 +0000 (13:01 +0000)] 
Merge branch '4136-catz-db-update-notify-bug' into 'main'

Fix catz db update callback registration logic error

Closes #4136

See merge request isc-projects/bind9!8025

3 years agoAdd a CHANGES note for [GL #4136]
Aram Sargsyan [Tue, 13 Jun 2023 10:52:05 +0000 (10:52 +0000)] 
Add a CHANGES note for [GL #4136]

3 years agoFix catz db update callback registration logic error
Aram Sargsyan [Tue, 13 Jun 2023 09:58:29 +0000 (09:58 +0000)] 
Fix catz db update callback registration logic error

When a catalog zone is updated using AXFR, the zone database is changed,
so it is required to unregister the update notification callback from
the old database, and register it for the new one.

Currently, here is the order of the steps happening in such scenario:

1. The zone.c:zone_startload() function registers the notify callback
   on the new database using dns_zone_catz_enable_db()
2. The callback, when called, notices that the new 'db' is different
   than 'catz->db', and unregisters the old callback for 'catz->db',
   marks that it's unregistered by setting 'catz->db_registered' to
   false, then it schedules an update if it isn't already scheduled.
3. The offloaded update process, after completing its job, notices that
   'catz->db_registered' is false, and (re)registers the update callback
   for the current database it is working on. There is no harm here even
   if it was registered also on step 1, and we can't skip it, because
   this function can also be called "artificially" during a
   reconfiguration, and in that case the registration step is required
   here.

A problem arises when before step 1 an update process was already
in a running state, operating on the old database, and finishing its
work only after step 2. As described in step 3, dns__catz_update_cb()
notices that 'catz->db_registered' is false and registers the callback
on the current database it is working on, which, at that state, is
already obsolete and unused by the zone. When it detaches the database,
the function which is responsible for its cleanup (e.g. free_rbtdb())
asserts because there is a registered update notify callback there.

To fix the problem, instead of delaying the (re)registration to step 3,
make sure that the new callback is registered and 'catz->db_registered'
is accordingly marked on step 2.

3 years agoMerge branch '4117-serve-stale-check' into 'main'
Tom Krizek [Tue, 13 Jun 2023 12:10:25 +0000 (12:10 +0000)] 
Merge branch '4117-serve-stale-check' into 'main'

Avoid false positive in serve-stale system test check

Closes #4117

See merge request isc-projects/bind9!8026

3 years agoAvoid false positive in serve-stale system test check
Tom Krizek [Tue, 13 Jun 2023 08:52:01 +0000 (10:52 +0200)] 
Avoid false positive in serve-stale system test check

The purpose of the check is to verify the server has survived the
previous barrage of queries. This is done by sending a query and
checking we get a NOERROR response back.

Previously, that query could've been affected by a servfail cache - the
server would return a SERVFAIL answer, thus failing the check, despite
being up and running. Use version.bind txt ch query to avoid the
interference of servfail cache.

3 years agoMerge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.15' into 'main'
Michal Nowak [Mon, 12 Jun 2023 15:12:13 +0000 (15:12 +0000)] 
Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.15' into 'main'

Set up version and release notes for BIND 9.19.15

See merge request isc-projects/bind9!8021

3 years agoSet up release notes for BIND 9.19.15
Michal Nowak [Mon, 12 Jun 2023 14:12:40 +0000 (16:12 +0200)] 
Set up release notes for BIND 9.19.15

3 years agoUpdate BIND version to 9.19.15-dev
Michal Nowak [Mon, 12 Jun 2023 14:12:27 +0000 (16:12 +0200)] 
Update BIND version to 9.19.15-dev

3 years agoUpdate BIND version for release v9.19.14
Michal Nowak [Fri, 9 Jun 2023 10:17:36 +0000 (12:17 +0200)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Michal Nowak [Fri, 9 Jun 2023 10:16:22 +0000 (12:16 +0200)] 
Add a CHANGES marker

3 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.14' into 'security-main'
Michal Nowak [Fri, 9 Jun 2023 10:11:45 +0000 (10:11 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.14' into 'security-main'

Prepare documentation for BIND 9.19.14

See merge request isc-private/bind9!530

3 years agoAdd release note for #4049
Michał Kępień [Fri, 2 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
Add release note for #4049

3 years agoReorder release notes
Michał Kępień [Fri, 2 Jun 2023 10:29:53 +0000 (12:29 +0200)] 
Reorder release notes

3 years agoTweak and reword release notes
Michał Kępień [Fri, 2 Jun 2023 10:28:23 +0000 (12:28 +0200)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.14
Michał Kępień [Fri, 2 Jun 2023 10:24:48 +0000 (12:24 +0200)] 
Prepare release notes for BIND 9.19.14

3 years agoDrop "Known Issues" entry for #4006 as it is fixed
Michał Kępień [Fri, 2 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
Drop "Known Issues" entry for #4006 as it is fixed

3 years agoRe-add a code comment to the "hooks" system test
Michał Kępień [Fri, 2 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
Re-add a code comment to the "hooks" system test

Commit 5a84c7a09bccf124b9f10a2bc25bb635d822eec2 removed a useful code
comment from the "hooks" system test.  Add it back to prevent confusion.

3 years agoAdd a missing word to the release note for #4004
Michał Kępień [Fri, 2 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
Add a missing word to the release note for #4004

3 years agoMerge branch '4055-improve-the-overmem-cache-cleaning' into 'security-main'
Michal Nowak [Fri, 9 Jun 2023 09:50:19 +0000 (09:50 +0000)] 
Merge branch '4055-improve-the-overmem-cache-cleaning' into 'security-main'

Improve RBT overmem cache cleaning

See merge request isc-private/bind9!520

3 years agoSet max-cache-size expectations for low values
Michal Nowak [Wed, 7 Jun 2023 12:03:01 +0000 (14:03 +0200)] 
Set max-cache-size expectations for low values

3 years agoAdd CHANGES and release note for [GL #4055]
Ondřej Surý [Thu, 1 Jun 2023 13:46:23 +0000 (15:46 +0200)] 
Add CHANGES and release note for [GL #4055]

3 years agoImprove RBT overmem cache cleaning
Ondřej Surý [Tue, 30 May 2023 06:46:17 +0000 (08:46 +0200)] 
Improve RBT overmem cache cleaning

When cache memory usage is over the configured cache size (overmem) and
we are cleaning unused entries, it might not be enough to clean just two
entries if the entries to be expired are smaller than the newly added
rdata.  This could be abused by an attacker to cause a remote Denial of
Service by possibly running out of the operating system memory.

Currently, the addrdataset() tries to do a single TTL-based cleaning
considering the serve-stale TTL and then optionally moves to overmem
cleaning if we are in that condition.  Then the overmem_purge() tries to
do another single TTL based cleaning from the TTL heap and then continue
with LRU-based cleaning up to 2 entries cleaned.

Squash the TTL-cleaning mechanism into single call from addrdataset(),
but ignore the serve-stale TTL if we are currently overmem.

Then instead of having a fixed number of entries to clean, pass the size
of newly added rdatasetheader to the overmem_purge() function and
cleanup at least the size of the newly added data.  This prevents the
cache going over the configured memory limit (`max-cache-size`).

Additionally, refactor the overmem_purge() function to reduce for-loop
nesting for readability.

3 years agoMerge branch '4105-QryDropped-stats-counter-documentation-update' into 'main'
Arаm Sаrgsyаn [Wed, 7 Jun 2023 14:00:50 +0000 (14:00 +0000)] 
Merge branch '4105-QryDropped-stats-counter-documentation-update' into 'main'

QryDropped stats counter documentation update

Closes #4105

See merge request isc-projects/bind9!8006

3 years agoQryDropped stats counter documentation update
Aram Sargsyan [Tue, 6 Jun 2023 13:01:03 +0000 (13:01 +0000)] 
QryDropped stats counter documentation update

Document which dropped queries are calculated by the QryDropped
statistics counter.

3 years agoMerge branch 'mnowak/placeholder-for-issue-4055' into 'main'
Michal Nowak [Wed, 7 Jun 2023 11:42:58 +0000 (11:42 +0000)] 
Merge branch 'mnowak/placeholder-for-issue-4055' into 'main'

Add CHANGES placeholder for [GL #4055]

See merge request isc-projects/bind9!8010

3 years agoAdd CHANGES placeholder for [GL #4055]
Michal Nowak [Wed, 7 Jun 2023 11:39:12 +0000 (13:39 +0200)] 
Add CHANGES placeholder for [GL #4055]

3 years agoMerge branch 'mnowak/placeholder-for-issue-4089' into 'main'
Michal Nowak [Wed, 7 Jun 2023 11:18:10 +0000 (11:18 +0000)] 
Merge branch 'mnowak/placeholder-for-issue-4089' into 'main'

Add CHANGES placeholder for [GL #4089]

See merge request isc-projects/bind9!8009

3 years agoAdd CHANGES placeholder for [GL #4089]
Michal Nowak [Wed, 7 Jun 2023 11:07:51 +0000 (13:07 +0200)] 
Add CHANGES placeholder for [GL #4089]

3 years agoMerge branch 'mnowak/placeholder-for-issue-3835' into 'main'
Michal Nowak [Wed, 7 Jun 2023 09:00:42 +0000 (09:00 +0000)] 
Merge branch 'mnowak/placeholder-for-issue-3835' into 'main'

Add CHANGES placeholder for [GL #3835]

See merge request isc-projects/bind9!8008

3 years agoAdd CHANGES placeholder for [GL #3835]
Michal Nowak [Wed, 7 Jun 2023 08:47:37 +0000 (10:47 +0200)] 
Add CHANGES placeholder for [GL #3835]

3 years agoMerge branch '4115-fix-extra-dns_validator-detach' into 'main'
Ondřej Surý [Tue, 6 Jun 2023 17:34:22 +0000 (17:34 +0000)] 
Merge branch '4115-fix-extra-dns_validator-detach' into 'main'

Fix extra detach when dns_validator create_fetch() detects deadlock

Closes #4115

See merge request isc-projects/bind9!8003

3 years agoAdd CHANGES note for [GL #4115]
Ondřej Surý [Tue, 6 Jun 2023 11:05:35 +0000 (13:05 +0200)] 
Add CHANGES note for [GL #4115]

3 years agoFix extra detach when dns_validator create_fetch() detects deadlock
Ondřej Surý [Tue, 6 Jun 2023 10:48:23 +0000 (12:48 +0200)] 
Fix extra detach when dns_validator create_fetch() detects deadlock

When create_fetch() in the dns_validator unit detects deadlock, it
returns DNS_R_NOVALIDSIG, but it didn't attach to the validator.  The
other condition to returning result != ISC_R_SUCCESS would be error from
dns_resolver_createfetch().  The caller (in two places out of three)
would detect the error condition and always detach from the validator.

Move the dns_validator_detach() on dns_resolver_createfetch() error
condition to create_fetch() function and cleanup the extra detaches in
seek_dnskey() and get_dsset().

3 years agoMerge branch '4038-resize-send-buffers-to-avoid-excessive-memory-allocation' into...
Ondřej Surý [Tue, 6 Jun 2023 11:41:44 +0000 (11:41 +0000)] 
Merge branch '4038-resize-send-buffers-to-avoid-excessive-memory-allocation' into 'main'

Use appropriately sized send buffers for DNS messages over TCP

Closes #4038

See merge request isc-projects/bind9!8004

3 years agoMerge branch 'ondrej/print-library-versions' into 'main'
Ondřej Surý [Tue, 6 Jun 2023 11:40:51 +0000 (11:40 +0000)] 
Merge branch 'ondrej/print-library-versions' into 'main'

Print the libuv, liburcu and OpenSSL versions from configure script

See merge request isc-projects/bind9!7998

3 years agoUpdate CHANGES and release note [GL #4038]
Artem Boldariev [Fri, 2 Jun 2023 09:49:15 +0000 (12:49 +0300)] 
Update CHANGES and release note [GL #4038]

Mention that memory usage was reduced by allocating properly sized
send buffers for stream-based transports.

3 years agoUse appropriately sized send buffers for DNS messages over TCP
Artem Boldariev [Fri, 2 Jun 2023 11:28:50 +0000 (14:28 +0300)] 
Use appropriately sized send buffers for DNS messages over TCP

This commit changes send buffers allocation strategy for stream based
transports. Before that change we would allocate a dynamic buffers
sized at 64Kb even when we do not need that much. That could lead to
high memory usage on server. Now we resize the send buffer to match
the size of the actual data, freeing the memory at the end of the
buffer for being reused later.

3 years agoPrint the libuv, liburcu and OpenSSL versions from configure script
Ondřej Surý [Thu, 1 Jun 2023 11:38:42 +0000 (13:38 +0200)] 
Print the libuv, liburcu and OpenSSL versions from configure script

The configure summary now prints versions of the mandatory libraries
found when configuring.

3 years agoMerge branch '4116-building-with-with-liburcu-qsbr-fails' into 'main'
Mark Andrews [Mon, 5 Jun 2023 23:46:49 +0000 (23:46 +0000)] 
Merge branch '4116-building-with-with-liburcu-qsbr-fails' into 'main'

Resolve "Building with --with-liburcu=qsbr fails"

Closes #4116

See merge request isc-projects/bind9!8002

3 years agoFix typo in synchronize_rcu macro (add h)
Mark Andrews [Mon, 5 Jun 2023 22:08:57 +0000 (08:08 +1000)] 
Fix typo in synchronize_rcu macro (add h)

synchronize_rcu has not been used until now in BIND9 and there
was a typo in the define (a 'h' was missing).

3 years agoMerge branch '4093-use-rcu-for-view-zonetable' into 'main'
Mark Andrews [Fri, 2 Jun 2023 00:39:07 +0000 (00:39 +0000)] 
Merge branch '4093-use-rcu-for-view-zonetable' into 'main'

Use RCU for view->zonetable

Closes #4093

See merge request isc-projects/bind9!7990

3 years agoAdd CHANGES note for [GL #4093]
Mark Andrews [Wed, 31 May 2023 07:20:27 +0000 (17:20 +1000)] 
Add CHANGES note for [GL #4093]

3 years agoUse dns_view_findzone instead of dns_zt_find
Mark Andrews [Wed, 31 May 2023 06:13:29 +0000 (16:13 +1000)] 
Use dns_view_findzone instead of dns_zt_find

This ensures that rcu locking is properly applied for
view->zonetable.

3 years agoExtend dns_view_findzone to take an options argument
Mark Andrews [Wed, 31 May 2023 06:03:56 +0000 (16:03 +1000)] 
Extend dns_view_findzone to take an options argument

This is in preparation to allow the few remaining direct
dns_zt_find(view->zonetable, ...) to use it for rcu mediated
access to view->zonetable.

3 years agoAdd dns_view_apply
Mark Andrews [Wed, 31 May 2023 05:52:36 +0000 (15:52 +1000)] 
Add dns_view_apply

Add dns_view_apply to allow dns_zt_apply to be called on
view->zonetable with rcu locking applied.

3 years agoAdd dns_view_delzone
Mark Andrews [Wed, 31 May 2023 02:59:03 +0000 (12:59 +1000)] 
Add dns_view_delzone

dns_view_delzone performs the rcu locking required around accessing
view->zonetable.

3 years agoUse rcu methods to lock access view->zonetable
Mark Andrews [Wed, 31 May 2023 02:40:37 +0000 (12:40 +1000)] 
Use rcu methods to lock access view->zonetable

dns_view_find* may be called after the final call to dns_view_detach
is made which detaches view->zonetable to permit the server to
shutdown.  We need to detect if view->zonetable is NULL during this
stage and appropriately recover.

3 years agoDisable URCU inlining if inlined rcu_dereference() fails to compile
Ondřej Surý [Thu, 1 Jun 2023 11:38:42 +0000 (13:38 +0200)] 
Disable URCU inlining if inlined rcu_dereference() fails to compile

In some cases, the inlined version rcu_dereference() would not compile
when working on pointer to opaque struct (namely Ubuntu Jammy).  Detect
such condition in the autoconf and disable the inlining of the small
functions if it breaks the build.

3 years agoMerge branch '4074-fix-stale-answer-client-timeout-with-clients-per-query' into ...
Arаm Sаrgsyаn [Thu, 1 Jun 2023 09:21:10 +0000 (09:21 +0000)] 
Merge branch '4074-fix-stale-answer-client-timeout-with-clients-per-query' into 'main'

Fix a clients-per-query miscalculation bug

Closes #4074

See merge request isc-projects/bind9!7977

3 years agoAdd CHANGES and release notes for [GL #4074]
Aram Sargsyan [Sat, 27 May 2023 11:30:56 +0000 (11:30 +0000)] 
Add CHANGES and release notes for [GL #4074]

3 years agoFix a clients-per-query miscalculation bug
Aram Sargsyan [Sat, 27 May 2023 11:01:28 +0000 (11:01 +0000)] 
Fix a clients-per-query miscalculation bug

The number of clients per query is calculated using the pending
fetch responses in the list. The dns_resolver_createfetch() function
includes every item in the list when deciding whether the limit is
reached (i.e. fctx->spilled is true). Then, when the limit is reached,
there is another calculation in fctx_sendevents(), when deciding
whether it is needed to increase the limit, but this time the TRYSTALE
responses are not included in the calculation (because of early break
from the loop), and because of that the limit is never increased.

A single client can have more than one associated response/event in the
list (currently max. two), and calculating them as separate "clients"
is unexpected. E.g. if 'stale-answer-enable' is enabled and
'stale-answer-client-timeout' is enabled and is larger than 0, then
each client will have two events, which will effectively halve the
clients-per-query limit.

Fix the dns_resolver_createfetch() function to calculate only the
regular FETCHDONE responses/events.

Change the fctx_sendevents() function to also calculate only FETCHDONE
responses/events. Currently, this second change doesn't have any impact,
because the TRYSTALE events were already skipped, but having the same
condition in both places will help prevent similar bugs in the future
if a new type of response/event is ever added.

3 years agoAdd clients-per-query checks for the fetchlimit system test
Aram Sargsyan [Mon, 29 May 2023 17:47:55 +0000 (17:47 +0000)] 
Add clients-per-query checks for the fetchlimit system test

Check if clients-per-query quota works as expected with or without
a positive stale-answer-client-timeout value and serve-stale answers
enabled.

3 years agoLight refactoring of the fetchlimit system test
Aram Sargsyan [Mon, 29 May 2023 17:34:13 +0000 (17:34 +0000)] 
Light refactoring of the fetchlimit system test

Prepare the fetchlimit system test for adding a clients-per-query
check. Change some functions and commands to accept a destination
NS IP address instead of using the hardcoded 10.53.0.3.

3 years agoFix fetchlimit system test issues
Aram Sargsyan [Mon, 29 May 2023 14:17:01 +0000 (14:17 +0000)] 
Fix fetchlimit system test issues

1. Fix the numbering.
2. Fix an artifacts rewriting issue.
3. Add missing checks of 'ret' after some checks.

3 years agoMerge branch 'mnowak/alpine-3.18' into 'main'
Michal Nowak [Wed, 31 May 2023 10:02:52 +0000 (10:02 +0000)] 
Merge branch 'mnowak/alpine-3.18' into 'main'

Add Alpine Linux 3.18

See merge request isc-projects/bind9!7985

3 years agoAdd Alpine Linux 3.18
Michal Nowak [Mon, 29 May 2023 13:48:56 +0000 (15:48 +0200)] 
Add Alpine Linux 3.18

3 years agoMerge branch 'aram/statschannel-spilled-clients-counter' into 'main'
Arаm Sаrgsyаn [Wed, 31 May 2023 09:52:29 +0000 (09:52 +0000)] 
Merge branch 'aram/statschannel-spilled-clients-counter' into 'main'

Add ClientQuota statistics channel counter

See merge request isc-projects/bind9!7978

3 years agoAdd a CHANGES note for [GL !7978]
Aram Sargsyan [Mon, 29 May 2023 18:01:31 +0000 (18:01 +0000)] 
Add a CHANGES note for [GL !7978]

3 years agoUpdate the documentation of the resolver statistics counters
Aram Sargsyan [Mon, 29 May 2023 15:20:02 +0000 (15:20 +0000)] 
Update the documentation of the resolver statistics counters

The reference manual doesn't document all the available resolver
statistics counters. Add information about the missing counters.

3 years agoAdd ClientQuota statistics channel counter
Aram Sargsyan [Mon, 29 May 2023 15:19:49 +0000 (15:19 +0000)] 
Add ClientQuota statistics channel counter

This counter indicates the number of the resolver's spilled
queries due to reaching the clients per query quota.

3 years agoMerge branch '4012-remove-win2k-hacks' into 'main'
Evan Hunt [Wed, 31 May 2023 08:29:20 +0000 (08:29 +0000)] 
Merge branch '4012-remove-win2k-hacks' into 'main'

remove win2k gss-tsig hacks

Closes #4012

See merge request isc-projects/bind9!7843

3 years agoCHANGES and release notes for [GL #4012]
Evan Hunt [Fri, 14 Apr 2023 20:03:27 +0000 (13:03 -0700)] 
CHANGES and release notes for [GL #4012]

3 years agoremove win2k gss-tsig hacks
Evan Hunt [Fri, 14 Apr 2023 19:56:24 +0000 (12:56 -0700)] 
remove win2k gss-tsig hacks

Remove the code implementing nonstardard behaviors that were formerly
needed to allow GSS-TSIG to work with Windows 2000, which passed
End-of-Life in 2010.

Deprecate the "oldgsstsig" command and "-o" command line option
to nsupdate; these are now treated as synonyms for "gsstsig" and "-g"
respectively.

3 years agoMerge branch 'mnowak/custom-userspace-rcu-library' into 'main'
Michal Nowak [Tue, 30 May 2023 18:27:12 +0000 (18:27 +0000)] 
Merge branch 'mnowak/custom-userspace-rcu-library' into 'main'

Drop liburcu-related TSAN suppressions

See merge request isc-projects/bind9!7971

3 years agoChange images for TSAN jobs
Michal Nowak [Fri, 26 May 2023 08:50:58 +0000 (10:50 +0200)] 
Change images for TSAN jobs

Fedora 38 and Debian "bullseye" images were "forked" to images used only
for TSAN CI jobs. The new images contain TSAN-aware liburcu that does
not fit well with ASAN CI jobs for which original images were also used.

Also, drop liburcu-related TSAN suppressions because they are
unnecessary with TSAN-aware liburcu.

3 years agoMerge branch 'mnowak/look-for-core-files-in-TOP_BUILDDIR' into 'main'
Michal Nowak [Tue, 30 May 2023 17:54:48 +0000 (17:54 +0000)] 
Merge branch 'mnowak/look-for-core-files-in-TOP_BUILDDIR' into 'main'

Look for core files in $TOP_BUILDDIR

See merge request isc-projects/bind9!7869

3 years agoLook for core files in $TOP_BUILDDIR
Michal Nowak [Wed, 26 Apr 2023 09:21:28 +0000 (11:21 +0200)] 
Look for core files in $TOP_BUILDDIR

The get_core_dumps.sh script couldn't find and process core files of
out-of-tree configurations because it looked for them in the source
instead of the build directory.

3 years agoMerge branch 'tkrizek-fix-pytest-base-port' into 'main'
Tom Krizek [Tue, 30 May 2023 13:36:42 +0000 (13:36 +0000)] 
Merge branch 'tkrizek-fix-pytest-base-port' into 'main'

Fix base_port calculation in pytest runner

See merge request isc-projects/bind9!7981

3 years agoFix base_port calculation in pytest runner
Tom Krizek [Tue, 30 May 2023 12:11:14 +0000 (14:11 +0200)] 
Fix base_port calculation in pytest runner

The selected base port should be in the range <port_min, port_max), the
formula was incorrect.

Credit for discovering this fault goes to Ondrej Sury.

3 years agoMerge branch '3950-serve-stale-strikes-again' into 'main'
Matthijs Mekking [Tue, 30 May 2023 11:02:13 +0000 (11:02 +0000)] 
Merge branch '3950-serve-stale-strikes-again' into 'main'

Fix serve-stale bug when cache has no data

Closes #3950

See merge request isc-projects/bind9!7856

3 years agoAdd release note and changes for #3950
Matthijs Mekking [Mon, 1 May 2023 13:04:42 +0000 (15:04 +0200)] 
Add release note and changes for #3950

Fixing another serve-stale bug is still news.

3 years agoExtend serve-stale logging
Matthijs Mekking [Mon, 1 May 2023 12:43:59 +0000 (14:43 +0200)] 
Extend serve-stale logging

Print the database lookup result in serve-stale logs for debugging
potential future serve-stale issues.

3 years agoFix serve-stale bug when cache has no data
Matthijs Mekking [Thu, 20 Apr 2023 14:22:53 +0000 (16:22 +0200)] 
Fix serve-stale bug when cache has no data

We recently fixed a bug where in some cases (when following an
expired CNAME for example), named could return SERVFAIL if the target
record is still valid (see isc-projects/bind9#3678, and
isc-projects/bind9!7096). We fixed this by considering non-stale
RRsets as well during the stale lookup.

However, this triggered a new bug because despite the answer from
cache not being stale, the lookup may be triggered by serve-stale.
If the answer from database is not stale, the fix in
isc-projects/bind9!7096 erroneously skips the serve-stale logic.

Add 'answer_found' checks to the serve-stale logic to fix this issue.

3 years agoAdd serve-stale test case for GL #3950
Matthijs Mekking [Mon, 1 May 2023 12:46:29 +0000 (14:46 +0200)] 
Add serve-stale test case for GL #3950

Add a test case where when priming the cache with a slow authoritative
resolver, the stale-answer-client-timeout option should not return
a delegation to the client (it should wait until an applicable answer
is found, if no entry is found in the cache).

3 years agoMerge branch '3905-placeholder' into 'main'
Ondřej Surý [Mon, 29 May 2023 06:02:51 +0000 (06:02 +0000)] 
Merge branch '3905-placeholder' into 'main'

Add CHANGES placeholder for [GL #3905]

Closes #3905

See merge request isc-projects/bind9!7976

3 years agoAdd CHANGES placeholder for [GL #3905]
Ondřej Surý [Mon, 29 May 2023 06:00:16 +0000 (08:00 +0200)] 
Add CHANGES placeholder for [GL #3905]

3 years agoMerge branch '4098-remove-cruft-epoll-kqueue-configure-options' into 'main'
Ondřej Surý [Mon, 29 May 2023 05:57:03 +0000 (05:57 +0000)] 
Merge branch '4098-remove-cruft-epoll-kqueue-configure-options' into 'main'

Remove obsolete epoll/kqueue/devpoll configure options

Closes #4098

See merge request isc-projects/bind9!7973

3 years agoAdd CHANGES note for [GL #4098]
Ondřej Surý [Sat, 27 May 2023 06:51:47 +0000 (08:51 +0200)] 
Add CHANGES note for [GL #4098]

3 years agoRemove obsolete epoll/kqueue/devpoll configure options
Ondřej Surý [Sat, 27 May 2023 06:47:55 +0000 (08:47 +0200)] 
Remove obsolete epoll/kqueue/devpoll configure options

Since we don't use networking directly but rather via libuv, these
configure options were no-op.  Remove the configure checks for epoll
(Linux), kqueue (BSDs) and /dev/poll (Solaris).

3 years agoMerge branch '4090-corrected-bad-insist-logic-in-isc_radix_remove' into 'main'
Mark Andrews [Mon, 29 May 2023 02:22:18 +0000 (02:22 +0000)] 
Merge branch '4090-corrected-bad-insist-logic-in-isc_radix_remove' into 'main'

Resolve "Corrected bad INSIST logic in isc_radix_remove()"

Closes #4090

See merge request isc-projects/bind9!7966

3 years agoAdd regression test for [GL # 4090]
Mark Andrews [Fri, 26 May 2023 01:09:33 +0000 (11:09 +1000)] 
Add regression test for [GL # 4090]

These insertions are added to produce a radix tree that will trigger
the INSIST reported in [GL #4090].  Due to fixes added since BIND 9.9
an extra insert in needed to ensure node->parent is non NULL.