]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoMerge tag 'v9.19.14'
Michal Nowak [Wed, 21 Jun 2023 17:31:57 +0000 (19:31 +0200)] 
Merge tag 'v9.19.14'

BIND 9.19.14

2 years agoMerge branch '4044-placeholder' into 'main'
Arаm Sаrgsyаn [Tue, 20 Jun 2023 10:20:43 +0000 (10:20 +0000)] 
Merge branch '4044-placeholder' into 'main'

Add a CHANGES placeholder for [GL #4044]

See merge request isc-projects/bind9!8046

2 years agoAdd a CHANGES placeholder for [GL #4044]
Aram Sargsyan [Tue, 20 Jun 2023 10:13:12 +0000 (10:13 +0000)] 
Add a CHANGES placeholder for [GL #4044]

2 years agoMerge branch '2354-add-a-tool-for-reproducing-isc-spnego-bugs' into 'main'
Michał Kępień [Mon, 19 Jun 2023 09:06:56 +0000 (09:06 +0000)] 
Merge branch '2354-add-a-tool-for-reproducing-isc-spnego-bugs' into 'main'

[CVE-2020-8625] [CVE-2021-25216] Add a tool for reproducing ISC SPNEGO bugs

Closes #2354

See merge request isc-projects/bind9!7574

2 years agoAdd a tool for reproducing ISC SPNEGO bugs
Michał Kępień [Mon, 19 Jun 2023 07:20:03 +0000 (09:20 +0200)] 
Add a tool for reproducing ISC SPNEGO bugs

Extend the "tsiggss" system test with reproducers for CVE-2020-8625 and
CVE-2021-25216.

3 years agoMerge branch '4126-statschannel-connection-close-keepalive' into 'main'
Tony Finch [Thu, 15 Jun 2023 16:03:51 +0000 (16:03 +0000)] 
Merge branch '4126-statschannel-connection-close-keepalive' into 'main'

Improve statschannel HTTP Connection: header logic

See merge request isc-projects/bind9!8014

3 years agoImprove statschannel HTTP Connection: header protocol conformance
Tony Finch [Wed, 7 Jun 2023 14:47:47 +0000 (15:47 +0100)] 
Improve statschannel HTTP Connection: header protocol conformance

In HTTP/1.0 and HTTP/1.1, RFC 9112 section 9.6 says the last response
in a connection should include a `Connection: close` header, but the
statschannel server omitted it.

In an HTTP/1.0 response, the statschannel server can sometimes send a
`Connection: keep-alive` header when it is about to close the
connection. There are two ways:

If the first request on a connection is keep-alive and the second
request is not, then _both_ responses have `Connection: keep-alive`
but the connection is (correctly) closed after the second response.

If a single request contains

Connection: close
Connection: keep-alive

then RFC 9112 section 9.3 says the keep-alive header is ignored, but
the statschannel sends a spurious keep-alive in its response, though
it correctly closes the connection.

To fix these bugs, make it more clear that the `httpd->flags` are part
of the per-request-response state. The Connection: flags are now
described in terms of the effect they have instead of what causes them
to be set.

3 years agoMerge branch '4150-fix-entity-renumbering-in-parse_tsan.py' into 'main'
Michał Kępień [Thu, 15 Jun 2023 14:18:30 +0000 (14:18 +0000)] 
Merge branch '4150-fix-entity-renumbering-in-parse_tsan.py' into 'main'

Fix entity renumbering in util/parse_tsan.py

Closes #4150

See merge request isc-projects/bind9!8037

3 years agoFix entity renumbering in util/parse_tsan.py
Michał Kępień [Thu, 15 Jun 2023 14:17:14 +0000 (16:17 +0200)] 
Fix entity renumbering in util/parse_tsan.py

util/parse_tsan.py builds tables of mutexes, threads, and pointers it
finds in the TSAN report provided to it as a command-line argument and
then replaces all mentions of each of these entities so that they are
numbered sequentially in the processed report.  For example, this line:

    Cycle in lock order graph: M0 (...) => M5 (...) => M9 (...) => M0

is expected to become:

    Cycle in lock order graph: M1 (...) => M2 (...) => M3 (...) => M1

Problems arise when the gaps between mutex/thread identifiers present on
a single line are smaller than the total number of mutexes/threads found
by the script so far.  For example, the following line:

    Cycle in lock order graph: M0 (...) => M1 (...) => M2 (...) => M0

first gets turned into:

    Cycle in lock order graph: M1 (...) => M1 (...) => M2 (...) => M1

and then into:

    Cycle in lock order graph: M2 (...) => M2 (...) => M2 (...) => M2

In other words, lines like this become garbled due to information loss.

The problem stems from the fact that the numbering scheme the script
uses for identifying mutexes and threads is exactly the same as the one
used by TSAN itself.  Update util/parse_tsan.py so that it uses
zero-padded numbers instead, making the "overlapping" demonstrated above
impossible.

3 years agoMerge branch '4149-make-isc_result-tables-more-compact' into 'main'
Ondřej Surý [Thu, 15 Jun 2023 13:46:52 +0000 (13:46 +0000)] 
Merge branch '4149-make-isc_result-tables-more-compact' into 'main'

Make isc_result tables smaller

Closes #4149

See merge request isc-projects/bind9!8034

3 years agoAdd CHANGES note for [GL #4149]
Ondřej Surý [Thu, 15 Jun 2023 08:28:47 +0000 (10:28 +0200)] 
Add CHANGES note for [GL #4149]

3 years agoMake isc_result tables smaller
Ondřej Surý [Thu, 15 Jun 2023 08:24:21 +0000 (10:24 +0200)] 
Make isc_result tables smaller

The isc_result_t enum was to sparse when each library code would skip to
next << 16 as a base.  Remove the huge holes in the isc_result_t enum to
make the isc_result tables more compact.

This change required a rewrite how we map dns_rcode_t to isc_result_t
and back, so we don't ever return neither isc_result_t value nor
dns_rcode_t out of defined range.

3 years agoRefactor how we map isc_result_t <-> dns_rcode_t
Ondřej Surý [Thu, 15 Jun 2023 08:24:21 +0000 (10:24 +0200)] 
Refactor how we map isc_result_t <-> dns_rcode_t

The mapping functions between isc_result_t and dns_rcode_t could return
both isc_result_t values not defined in the header and dns_rcode_t
values not defined in the header because it blindly maps anything
withing full 12-bits defined for RCODEs to isc_result_t and back.

Refactor the dns_result_{from,to}rcode() functions to always return
valid isc_result_t and dns_rcode_t values by explicitly mapping the
values to each other and returning DNS_R_SERVFAIL (dns_rcode_servfail)
when encountering value out of the defined range.

3 years agoMerge branch 'tkrizek/ci-system-clang-tsan-disallow-failure' into 'main'
Tom Krizek [Thu, 15 Jun 2023 11:09:48 +0000 (11:09 +0000)] 
Merge branch 'tkrizek/ci-system-clang-tsan-disallow-failure' into 'main'

Mark CI failure of system:clang:tsan as an error again

See merge request isc-projects/bind9!8035

3 years agoMark CI failure of system:clang:tsan as an error again
Tom Krizek [Thu, 15 Jun 2023 08:48:21 +0000 (10:48 +0200)] 
Mark CI failure of system:clang:tsan as an error again

Both the issues causing frequent failures have been resolved. The job
seems to have stabilized and there's no longer a need to mark the
failure as a mere warnings.

3 years agoMerge branch '4132-catz-data-race-in-db.c' into 'main'
Arаm Sаrgsyаn [Thu, 15 Jun 2023 09:50:15 +0000 (09:50 +0000)] 
Merge branch '4132-catz-data-race-in-db.c' into 'main'

Fix a data race between the dns_zone and dns_catz modules

Closes #4132

See merge request isc-projects/bind9!8031

3 years agoAdd a CHANGES note for [GL #4132]
Aram Sargsyan [Wed, 14 Jun 2023 09:02:51 +0000 (09:02 +0000)] 
Add a CHANGES note for [GL #4132]

3 years agoFix a data race between the dns_zone and dns_catz modules
Aram Sargsyan [Fri, 9 Jun 2023 07:13:27 +0000 (07:13 +0000)] 
Fix a data race between the dns_zone and dns_catz modules

The dns_zone_catz_enable_db() and dns_zone_catz_disable_db()
functions can race with similar operations in the catz module
because there is no synchronization between the threads.

Add catz functions which use the view's catalog zones' lock
when registering/unregistering the database update notify callback,
and use those functions in the dns_zone module, instead of doing it
directly.

3 years agoMerge branch '4134-zonefile-erofs' into 'main'
Tony Finch [Wed, 14 Jun 2023 12:44:54 +0000 (12:44 +0000)] 
Merge branch '4134-zonefile-erofs' into 'main'

Translate POSIX errorcode EROFS to ISC_R_NOPERM

Closes #4134

See merge request isc-projects/bind9!8017

3 years agoCHANGES note for [GL #4134]
Tony Finch [Fri, 9 Jun 2023 07:22:47 +0000 (08:22 +0100)] 
CHANGES note for [GL #4134]

[cleanup] Report "permission denied" instead of "unexpected error"
when trying to update a zone file is on a read-only file
system. Thanks to Midnight Veil. [GL #4134]

3 years agoTranslate POSIX errorcode EROFS to ISC_R_NOPERM
Midnight Veil [Thu, 8 Jun 2023 07:11:37 +0000 (17:11 +1000)] 
Translate POSIX errorcode EROFS to ISC_R_NOPERM

Report "permission denied" instead of "unexpected error"
when trying to update a zone file on a read-only file system.

3 years agoMerge branch '4021-tsan-error-view-adb-detached-too-early' into 'main'
Mark Andrews [Wed, 14 Jun 2023 10:36:08 +0000 (10:36 +0000)] 
Merge branch '4021-tsan-error-view-adb-detached-too-early' into 'main'

Resolve "TSAN error: view->adb detached too early."

Closes #4021

See merge request isc-projects/bind9!8016

3 years agoAdd CHANGES note for [GL #4021]
Mark Andrews [Mon, 12 Jun 2023 23:55:22 +0000 (09:55 +1000)] 
Add CHANGES note for [GL #4021]

3 years agoUse RCU for view->adb access
Mark Andrews [Thu, 8 Jun 2023 06:58:45 +0000 (16:58 +1000)] 
Use RCU for view->adb access

view->adb may be referenced while the view is shutting down as the
zone uses a weak reference to the view and examines view->adb but
dns_view_detach call dns_adb_detach to clear view->adb.

3 years agoMerge branch 'each-tsig-refactoring' into 'main'
Evan Hunt [Wed, 14 Jun 2023 08:14:47 +0000 (08:14 +0000)] 
Merge branch 'each-tsig-refactoring' into 'main'

TSIG/TKEY refactoring

See merge request isc-projects/bind9!7828

3 years agoimprove code flow
Evan Hunt [Fri, 14 Apr 2023 00:46:49 +0000 (17:46 -0700)] 
improve code flow

the code in dns_tkey_processquery() was unnecessarily hard to follow.

3 years agominor tkey-related fixups
Evan Hunt [Thu, 13 Apr 2023 08:22:09 +0000 (01:22 -0700)] 
minor tkey-related fixups

- style fixes and general tidying-up in tkey.c
- remove the unused 'intoken' parameter from dns_tkey_buildgssquery()
- remove an unnecessary call to dns_tkeyctx_create() in ns_server_create()
  (the TKEY context that was created there would soon be destroyed and
  another one created when the configuration was loaded).

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.