]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoenable detailed db tracing
Evan Hunt [Fri, 17 Feb 2023 21:04:12 +0000 (13:04 -0800)] 
enable detailed db tracing

move database attach/detach functions to db.c, instead of
requiring them to be implemented for every database type.
instead, they must implement a 'destroy' function that is
called when references go to zero.

this enables us to use ISC_REFCOUNT_IMPL for databases,
with detailed tracing enabled by setting DNS_DB_TRACE to 1.

3 years agosimplify dns_sdb API
Evan Hunt [Fri, 17 Feb 2023 20:04:32 +0000 (12:04 -0800)] 
simplify dns_sdb API

SDB is currently (and foreseeably) only used by the named
builtin databases, so it only needs as much of its API as
those databases use.

- removed three flags defined for the SDB API that were always
  set the same by builtin databases.

- there were two different types of lookup functions defined for
  SDB, using slightly different function signatures. since backward
  compatibility is no longer a concern, we can eliminate the 'lookup'
  entry point and rename 'lookup2' to 'lookup'.

- removed the 'allnodes' entry point and all database iterator
  implementation code

- removed dns_sdb_putnamedrr() and dns_sdb_putnamedrdata() since
  they were never used.

3 years agouse member name initialization for methods
Evan Hunt [Fri, 17 Feb 2023 19:46:58 +0000 (11:46 -0800)] 
use member name initialization for methods

initialize dns_dbmethods, dns_sdbmethods and dns_rdatasetmethods
using explicit struct member names, so we don't have to keep track
of NULLs for unimplemented functions any longer.

3 years agomake fewer dns_db functions mandatory-to-implement
Evan Hunt [Fri, 17 Feb 2023 20:05:25 +0000 (12:05 -0800)] 
make fewer dns_db functions mandatory-to-implement

some dns_db functions would have crashed if the DB implementation failed
to implement them, requiring the implementations to add functions that
did nothing but return ISC_R_NOTIMPLEMENTED or some obvious default
value. we can just have the dns_db wrapper functions themselves return
those values, and clean up the implementations accordingly.

3 years agoremove rdatalist_p.h
Evan Hunt [Fri, 17 Feb 2023 19:57:05 +0000 (11:57 -0800)] 
remove rdatalist_p.h

make the private isc__rdatalist_* functions public dns_rdatalist
functions so that all the rdatalist primitives can be used by
callers to libdns. (this will be needed later for moving SDB and
SDLZ out of libdns.)

3 years agoMerge branch 'matthijs-fix-kasp-attach-detach-usage' into 'main'
Matthijs Mekking [Tue, 21 Feb 2023 15:45:12 +0000 (15:45 +0000)] 
Merge branch 'matthijs-fix-kasp-attach-detach-usage' into 'main'

Fix kasp attach detach usage

See merge request isc-projects/bind9!7563

3 years agoFix dns_kasp_attach / dns_kasp_detach usage
Mark Andrews [Tue, 21 Feb 2023 01:15:01 +0000 (12:15 +1100)] 
Fix dns_kasp_attach / dns_kasp_detach usage

The kasp pointers in dns_zone_t should consistently be changed by
dns_kasp_attach and dns_kasp_detach so the usage is balanced.

3 years agoMerge branch 'fanf-prune-libbind9' into 'main'
Tony Finch [Tue, 21 Feb 2023 13:12:44 +0000 (13:12 +0000)] 
Merge branch 'fanf-prune-libbind9' into 'main'

Move the last bits of libbind9 into libisc

See merge request isc-projects/bind9!7462

3 years agoAdd CHANGES and release note
Tony Finch [Fri, 16 Dec 2022 12:57:36 +0000 (12:57 +0000)] 
Add CHANGES and release note

[cleanup] Move bind9_getaddresses() to isc_getaddresses()
and remove the now empty libbind9.

3 years agoRemove libbind9
Tony Finch [Fri, 16 Dec 2022 10:51:36 +0000 (10:51 +0000)] 
Remove libbind9

It is now empty.

3 years agoMove bind9_getaddresses() to isc_getaddresses()
Tony Finch [Fri, 16 Dec 2022 10:19:16 +0000 (10:19 +0000)] 
Move bind9_getaddresses() to isc_getaddresses()

No need to have a whole library for one function.

3 years agoMerge branch '3884-cid-436299-null-pointer-dereference-in-lib-dns-resolver-c' into...
Mark Andrews [Tue, 21 Feb 2023 12:58:25 +0000 (12:58 +0000)] 
Merge branch '3884-cid-436299-null-pointer-dereference-in-lib-dns-resolver-c' into 'main'

Resolve "CID 436299: Null pointer dereference in lib/dns/resolver.c"

Closes #3884

See merge request isc-projects/bind9!7562

3 years agoCleanup left over 'fctx != NULL' test following refactoring
Mark Andrews [Tue, 21 Feb 2023 02:37:24 +0000 (13:37 +1100)] 
Cleanup left over 'fctx != NULL' test following refactoring

This was causing 'CID 436299: Null pointer dereferences (REVERSE_INULL)'
in Coverity.  Also removed an 'INSIST(fctx != NULL);' that should
no longer be needed.

3 years agoMerge branch '3880-fix-rpz-assertion-failure-during-failed-reconfiguration' into...
Arаm Sаrgsyаn [Tue, 21 Feb 2023 09:01:27 +0000 (09:01 +0000)] 
Merge branch '3880-fix-rpz-assertion-failure-during-failed-reconfiguration' into 'main'

Detach rpzs and catzs from the previous view

Closes #3880

See merge request isc-projects/bind9!7552

3 years agoAdd a CHANGES note for [GL #3880]
Aram Sargsyan [Fri, 17 Feb 2023 13:12:05 +0000 (13:12 +0000)] 
Add a CHANGES note for [GL #3880]

3 years agoDetach rpzs and catzs from the previous view
Aram Sargsyan [Fri, 17 Feb 2023 12:41:29 +0000 (12:41 +0000)] 
Detach rpzs and catzs from the previous view

When switching to a new view during a reconfiguration (or reverting
to the old view), detach the 'rpzs' and 'catzs' from the previuos view.

The 'catzs' case was earlier solved slightly differently, by detaching
from the new view when reverting to the old view, but we can not solve
this the same way for 'rpzs', because now in BIND 9.19 and BIND 9.18
a dns_rpz_shutdown_rpzs() call was added in view's destroy() function
before detaching the 'rpzs', so we can not leave the 'rpzs' attached to
the previous view and let it be shut down when we intend to continue
using it with the new view.

Instead, "re-fix" the issue for the 'catzs' pointer the same way as
for 'rpzs' for consistency, and also because a similar shutdown call
is likely to be implemented for 'catzs' in the near future.

3 years agoAdd an "rpz" system test check for a failed reconfiguration
Aram Sargsyan [Fri, 17 Feb 2023 12:38:40 +0000 (12:38 +0000)] 
Add an "rpz" system test check for a failed reconfiguration

The faulty "DLZ" configuration triggers a reconfiguration failure
in such a place where view reverting code is covered.

3 years agoMerge branch 'each-cleanup-gethostname' into 'main'
Evan Hunt [Sat, 18 Feb 2023 20:23:56 +0000 (20:23 +0000)] 
Merge branch 'each-cleanup-gethostname' into 'main'

remove named_os_gethostname()

See merge request isc-projects/bind9!7555

3 years agoremove named_os_gethostname()
Evan Hunt [Thu, 9 Feb 2023 20:48:07 +0000 (12:48 -0800)] 
remove named_os_gethostname()

this function was just a front-end for gethostname(). it was
needed when we supported windows, which has a different function
for looking up the hostname; it's not needed any longer.

3 years agoMerge branch '3879-hmac_createctx-fails-to-free-context-on-isc_hmac_init-failure...
Mark Andrews [Fri, 17 Feb 2023 22:29:28 +0000 (22:29 +0000)] 
Merge branch '3879-hmac_createctx-fails-to-free-context-on-isc_hmac_init-failure' into 'main'

Resolve "hmac_createctx fails to free context on isc_hmac_init failure"

Closes #3879

See merge request isc-projects/bind9!7549

3 years agoIn hmac_createctx free ctx on isc_hmac_init failure
Mark Andrews [Fri, 17 Feb 2023 00:44:45 +0000 (11:44 +1100)] 
In hmac_createctx free ctx on isc_hmac_init failure

3 years agoMerge branch 'mnowak/qa-tools-update' into 'main'
Michal Nowak [Fri, 17 Feb 2023 15:00:07 +0000 (15:00 +0000)] 
Merge branch 'mnowak/qa-tools-update' into 'main'

Python formatting updates

See merge request isc-projects/bind9!7551

3 years agoFix unnecessary "else" after "raise" with pylint 2.16.2
Michal Nowak [Fri, 17 Feb 2023 12:21:55 +0000 (13:21 +0100)] 
Fix unnecessary "else" after "raise" with pylint 2.16.2

    bin/tests/system/get_algorithms.py:225:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)

3 years agoAdapt to Python scripts to black 23.1.0
Michal Nowak [Fri, 17 Feb 2023 12:16:13 +0000 (13:16 +0100)] 
Adapt to Python scripts to black 23.1.0

3 years agoMerge branch 'fanf-libbind9-libisccfg' into 'main'
Tony Finch [Fri, 17 Feb 2023 12:50:39 +0000 (12:50 +0000)] 
Merge branch 'fanf-libbind9-libisccfg' into 'main'

Move bind9/check to isccfg/check

See merge request isc-projects/bind9!7461

3 years agoMove bind9/check to isccfg/check
Tony Finch [Fri, 16 Dec 2022 10:39:15 +0000 (10:39 +0000)] 
Move bind9/check to isccfg/check

Since it is part of the configuration machinery

3 years agoMerge branch 'ondrej-further-dns_validator-refactoring' into 'main'
Ondřej Surý [Fri, 17 Feb 2023 06:22:03 +0000 (06:22 +0000)] 
Merge branch 'ondrej-further-dns_validator-refactoring' into 'main'

additional refactoring of dns_validator

See merge request isc-projects/bind9!7546

3 years agoCHANGES for [GL #3797]
Evan Hunt [Thu, 16 Feb 2023 19:32:20 +0000 (11:32 -0800)] 
CHANGES for [GL #3797]

3 years agoremove validator lock
Evan Hunt [Thu, 16 Feb 2023 19:05:39 +0000 (11:05 -0800)] 
remove validator lock

as every validator function is loop-synchronized, it should no longer be
necessary to use a validator lock.

calling dns_validator_send(), dns_validator_cancel() or
dns_validator_destroy() from a thread other than the one on which the
validator is running will now cause an assertion failure; this should be
fine since the validator and resolver are tightly coupled, and the fetch
contexts and validators run in the same loops.

3 years agoImplement proper reference counting in dns_validator
Ondřej Surý [Thu, 16 Feb 2023 13:37:55 +0000 (14:37 +0100)] 
Implement proper reference counting in dns_validator

use reference counting in dns_validator to prevent use after free.

3 years agoadditional refactoring of dns_validator
Evan Hunt [Wed, 15 Feb 2023 19:32:00 +0000 (11:32 -0800)] 
additional refactoring of dns_validator

refactor validator so that the validation status object (previously
called dns_valstatus_t, which was derived from dns_validatorevent_t), is
now part of the dns_validator object.  when calling validator callbacks,
the validator itself is now sent as the argument.

(note: this necessitates caution in the callback functions that are
internal to validator.c validators spawn other validators, and it can be
confusing at times whether we need to be looking at val, val->subvalidator,
or val->parent.)

3 years agoMerge branch '3875-dont-unlink-before-expire_entry' into 'main'
Ondřej Surý [Fri, 17 Feb 2023 06:18:15 +0000 (06:18 +0000)] 
Merge branch '3875-dont-unlink-before-expire_entry' into 'main'

Don't remove ADB entry from LRU before trying to expire it

Closes #3875

See merge request isc-projects/bind9!7544

3 years agoDon't remove ADB entry from LRU before trying to expire it
Ondřej Surý [Thu, 16 Feb 2023 11:26:01 +0000 (12:26 +0100)] 
Don't remove ADB entry from LRU before trying to expire it

There was a code flow error that would remove the expired ADB entry from
the LRU list and then a check in the expire_entry() would cause
assertion error because it expect the ADB entry to be linked.

Additionally, the expire mechanism would loop for cases when we would
held only a read rwlock; in such case we need to upgrade the lock and
try again, not just try again.

3 years agoMerge branch '3797-part9-remove-isc_task-completely' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 17:35:49 +0000 (17:35 +0000)] 
Merge branch '3797-part9-remove-isc_task-completely' into 'main'

remove isc_task completely

Closes #3797

See merge request isc-projects/bind9!7537

3 years agoremove isc_task completely
Evan Hunt [Sat, 29 Oct 2022 21:22:56 +0000 (14:22 -0700)] 
remove isc_task completely

as there is no further use of isc_task in BIND, this commit removes
it, along with isc_taskmgr, isc_event, and all other related types.

functions that accepted taskmgr as a parameter have been cleaned up.
as a result of this change, some functions can no longer fail, so
they've been changed to type void, and their callers have been
updated accordingly.

the tasks table has been removed from the statistics channel and
the stats version has been updated. dns_dyndbctx has been changed
to reference the loopmgr instead of taskmgr, and DNS_DYNDB_VERSION
has been udpated as well.

3 years agoMerge branch '3797-part8-catz-delzone-refactoring' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 17:35:09 +0000 (17:35 +0000)] 
Merge branch '3797-part8-catz-delzone-refactoring' into 'main'

refactor catz and addzone/delzone to use task

See merge request isc-projects/bind9!7373

3 years agorefactor dns_catz to use loop callbacks
Evan Hunt [Sat, 29 Oct 2022 10:53:47 +0000 (03:53 -0700)] 
refactor dns_catz to use loop callbacks

catz events are now scheduled using isc_task_async() instead
of isc_task_send().

3 years agorefactor delzone to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 06:43:45 +0000 (23:43 -0700)] 
refactor delzone to use loop callbacks

the rmzone() function is now posted using isc_async_run().

dns_zone_gettask() is no longer used anywhere, and has been
removed.

3 years agoswitch to using isc_loopmgr_pause() instead of task exclusive
Evan Hunt [Sat, 29 Oct 2022 10:33:05 +0000 (03:33 -0700)] 
switch to using isc_loopmgr_pause() instead of task exclusive

change functions using isc_taskmgr_beginexclusive() to use
isc_loopmgr_pause() instead.

also, removed an unnecessary use of exclusive mode in
named_server_tcptimeouts().

most functions that were implemented as task events because they needed
to be running in a task to use exclusive mode have now been changed
into loop callbacks instead. (the exception is catz, which is being
changed in a separate commit because it's a particularly complex change.)

3 years agoMerge branch '3797-part7-resolver-refactoring' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 16:50:46 +0000 (16:50 +0000)] 
Merge branch '3797-part7-resolver-refactoring' into 'main'

refactor dns_resolver to use loop callbacks

See merge request isc-projects/bind9!7372

3 years agorefactor dns_resolver to use loop callbacks
Evan Hunt [Fri, 28 Oct 2022 08:33:40 +0000 (01:33 -0700)] 
refactor dns_resolver to use loop callbacks

callback events from dns_resolver_createfetch() are now posted
using isc_async_run.

other modules which called the resolver and maintained task/taskmgr
objects for this purpose have been cleaned up.

3 years agoMerge branch '3797-part6-refactor-callbacks' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 16:20:26 +0000 (16:20 +0000)] 
Merge branch '3797-part6-refactor-callbacks' into 'main'

refactor various callbacks

See merge request isc-projects/bind9!7371

3 years agorefactor dns_client to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 18:45:33 +0000 (11:45 -0700)] 
refactor dns_client to use loop callbacks

dns_client now uses isc_async_run() internally to post
client-resume events. (a task is still used for
dns_resolver_createfetch(), however.)

3 years agorefactor dyndb sample driver to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 06:55:35 +0000 (23:55 -0700)] 
refactor dyndb sample driver to use loop callbacks

the syncptr function in the dyndb sample driver now uses
isc_async_run().

3 years agorefactor plugin hook resumption to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 16:54:27 +0000 (09:54 -0700)] 
refactor plugin hook resumption to use loop callbacks

plugins supporting asynchronous operation now use a loop callback
to resume operation in query_hookresume() rather than a task.

3 years agorefactor TAT queries to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 20:01:48 +0000 (13:01 -0700)] 
refactor TAT queries to use loop callbacks

trust anchor telemetry events are now posted via isc_async_run().
(an isc_task is still used for dns_resolver_createfetch().)

3 years agoMerge branch '3797-part5-update-processing' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 16:11:53 +0000 (16:11 +0000)] 
Merge branch '3797-part5-update-processing' into 'main'

refactor update processing to use loop callbacks

See merge request isc-projects/bind9!7370

3 years agorefactor update processing to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 06:35:47 +0000 (23:35 -0700)] 
refactor update processing to use loop callbacks

update processing now uses loop callbacks instead of task events.

3 years agoMerge branch '3797-part3-request-refactoring' into 'main'
Ondřej Surý [Thu, 16 Feb 2023 15:15:18 +0000 (15:15 +0000)] 
Merge branch '3797-part3-request-refactoring' into 'main'

refactor libdns modules to use loop callbacks

See merge request isc-projects/bind9!7367

3 years agorefactor dns_validator to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 23:51:10 +0000 (16:51 -0700)] 
refactor dns_validator to use loop callbacks

The validator now uses loop callbacks to post its completion
events. (A task is still used for the fetches.)

3 years agorefactor dns_adb to use loop callbacks
Evan Hunt [Fri, 28 Oct 2022 05:55:47 +0000 (22:55 -0700)] 
refactor dns_adb to use loop callbacks

The callbacks from dns_abd_createfind() are now posted using
isc_async_run() instead of isc_task_send().  ADB event types
have been replaced with a new dns_adbstatus_t type which is
included as find->status.

(The ADB still uses a task for dns_resolver_createfetch().)

3 years agorefactor dns_request to use loopmgr callbacks
Evan Hunt [Wed, 26 Oct 2022 05:56:48 +0000 (22:56 -0700)] 
refactor dns_request to use loopmgr callbacks

dns_request_create() and _createraw() now take a 'loop' parameter
and run the callback event on the specified loop.

as the task manager is no longer used, it has been removed from
the dns_requestmgr structure.  the dns_resolver_taskmgr() function
is also no longer used and has been removed.

3 years agoMerge branch 'fanf-simplify-view-detach' into 'main'
Tony Finch [Thu, 16 Feb 2023 13:44:28 +0000 (13:44 +0000)] 
Merge branch 'fanf-simplify-view-detach' into 'main'

Simplify locking in dns_view_detach()

See merge request isc-projects/bind9!7538

3 years agoSimplify locking in dns_view_detach()
Tony Finch [Tue, 14 Feb 2023 16:52:26 +0000 (16:52 +0000)] 
Simplify locking in dns_view_detach()

Lock just once, and shut down the resolver, adb, and requestmgr after
unlocking, like the zone table, managed keys zone, and redirect zone.

3 years agoMerge branch 'fanf-avoid-fortify-source-redefinition' into 'main'
Tony Finch [Thu, 16 Feb 2023 13:43:56 +0000 (13:43 +0000)] 
Merge branch 'fanf-avoid-fortify-source-redefinition' into 'main'

Avoid redefining _FORTIFY_SOURCE

See merge request isc-projects/bind9!7539

3 years agoAvoid redefining _FORTIFY_SOURCE
Tony Finch [Wed, 15 Feb 2023 19:00:37 +0000 (19:00 +0000)] 
Avoid redefining _FORTIFY_SOURCE

Some compilers have a built-in definition of the _FORTIFY_SOURCE macro
that differs from BIND's preferred setting. This causes errors like
the one quoted below. The solution is to undefine the macro before
defining it. A similar fix was recently committed to glibc.

    <command line>: error: '_FORTIFY_SOURCE' macro redefined
    #define _FORTIFY_SOURCE 2
            ^
    <built-in>: note: previous definition is here
    #define _FORTIFY_SOURCE 0
    ^

https://sourceware.org/git/glibc.git/commitdiff/35bcb08eaa953c9b

3 years agoMerge tag 'v9_19_10'
Michal Nowak [Thu, 16 Feb 2023 12:38:33 +0000 (13:38 +0100)] 
Merge tag 'v9_19_10'

BIND 9.19.10

3 years agoMerge branch '3869-dig-fails-to-cleanup-openssl-references' into 'main'
Mark Andrews [Thu, 16 Feb 2023 00:16:49 +0000 (00:16 +0000)] 
Merge branch '3869-dig-fails-to-cleanup-openssl-references' into 'main'

Resolve "Dig fails to cleanup OpenSSL references"

Closes #3869

See merge request isc-projects/bind9!7535

3 years agoCleanup OpenSSL reference on bad option
Mark Andrews [Mon, 30 Jan 2023 04:26:52 +0000 (15:26 +1100)] 
Cleanup OpenSSL reference on bad option

Another exit path that needs to be cleaned up.

3 years agoCleanup OpenSSL reference on bad domain name
Mark Andrews [Sun, 29 Jan 2023 23:47:57 +0000 (10:47 +1100)] 
Cleanup OpenSSL reference on bad domain name

Free/detach tsigkey and sig0key when exiting and then call
dst_lib_destroy if we have previously called dst_lib_init.  This will,
in theory, allow OPENSSL_cleanup to free all memory.

3 years agoMerge branch 'fanf-prune-isc-headers' into 'main'
Tony Finch [Wed, 15 Feb 2023 16:45:51 +0000 (16:45 +0000)] 
Merge branch 'fanf-prune-isc-headers' into 'main'

Remove several do-nothing headers from libisc

See merge request isc-projects/bind9!7464

3 years agoAdd CHANGES note
Tony Finch [Fri, 16 Dec 2022 12:57:36 +0000 (12:57 +0000)] 
Add CHANGES note

[cleanup] Several nugatory headers have been removed from libisc

3 years agoRemove do-nothing header <isc/stat.h>
Tony Finch [Fri, 16 Dec 2022 11:59:48 +0000 (11:59 +0000)] 
Remove do-nothing header <isc/stat.h>

Use <sys/stat.h> instead

3 years agoRemove do-nothing header <isc/print.h>
Tony Finch [Fri, 16 Dec 2022 12:35:31 +0000 (12:35 +0000)] 
Remove do-nothing header <isc/print.h>

This one really truly did nothing. No lines added!

3 years agoRemove do-nothing header <isc/offset.h>
Tony Finch [Fri, 16 Dec 2022 11:47:40 +0000 (11:47 +0000)] 
Remove do-nothing header <isc/offset.h>

And replace all uses of isc_offset_t with standard off_t

3 years agoRemove do-nothing header <isc/netdb.h>
Tony Finch [Fri, 16 Dec 2022 11:04:39 +0000 (11:04 +0000)] 
Remove do-nothing header <isc/netdb.h>

Not needed since we dropped Windows support

3 years agoMerge branch 'fanf-clarify-strerror' into 'main'
Tony Finch [Wed, 15 Feb 2023 16:44:30 +0000 (16:44 +0000)] 
Merge branch 'fanf-clarify-strerror' into 'main'

Explain <isc/strerr.h> a little more

See merge request isc-projects/bind9!7465

3 years agoExplain <isc/strerr.h> a little more
Tony Finch [Fri, 16 Dec 2022 13:30:39 +0000 (13:30 +0000)] 
Explain <isc/strerr.h> a little more

The purpose of the `strerror_r()` wrapper was not obvious.

3 years agoMerge branch 'fanf-deprecate-deprecated' into 'main'
Tony Finch [Wed, 15 Feb 2023 16:04:28 +0000 (16:04 +0000)] 
Merge branch 'fanf-deprecate-deprecated' into 'main'

Deprecate <isc/deprecated.h>

See merge request isc-projects/bind9!7466

3 years agoDeprecate <isc/deprecated.h>
Tony Finch [Fri, 16 Dec 2022 11:31:08 +0000 (11:31 +0000)] 
Deprecate <isc/deprecated.h>

We refactor more freely these days.

3 years agoRemove deprecated dns_db_rpz_*() methods
Tony Finch [Fri, 16 Dec 2022 11:27:01 +0000 (11:27 +0000)] 
Remove deprecated dns_db_rpz_*() methods

As well as the function wrappers, their slots have been removed from
the dns_dbmethods table.

3 years agoMerge branch '1609-add-modified-C-RW-WP-rwlock' into 'main'
Ondřej Surý [Wed, 15 Feb 2023 09:22:15 +0000 (09:22 +0000)] 
Merge branch '1609-add-modified-C-RW-WP-rwlock' into 'main'

Add the reader-writer synchronization with modified C-RW-WP

Closes #1609

See merge request isc-projects/bind9!7528

3 years agoAdd CHANGES note for [GL #1609]
Ondřej Surý [Tue, 14 Feb 2023 11:11:03 +0000 (12:11 +0100)] 
Add CHANGES note for [GL #1609]

3 years agoUse C-RW-WP lock in the dns_adb unit
Ondřej Surý [Mon, 13 Feb 2023 14:52:51 +0000 (15:52 +0100)] 
Use C-RW-WP lock in the dns_adb unit

Replace the isc_mutex in the dns_adb unit with isc_rwlock for better
performance.  Both ADB names and ADB entries hashtables and LRU are now
using isc_rwlock.

3 years agoUse C-RW-WP lock in the dns_resolver unit
Ondřej Surý [Mon, 13 Feb 2023 14:52:47 +0000 (15:52 +0100)] 
Use C-RW-WP lock in the dns_resolver unit

Replace the isc_mutex with isc_rwlock in the dns_resolver unit,
specifically, both fetch context and fetch counters now uses the C-RW-WP
locks.

3 years agoAdd the reader-writer synchronization with modified C-RW-WP
Ondřej Surý [Wed, 24 Mar 2021 16:52:56 +0000 (17:52 +0100)] 
Add the reader-writer synchronization with modified C-RW-WP

This changes the internal isc_rwlock implementation to:

  Irina Calciu, Dave Dice, Yossi Lev, Victor Luchangco, Virendra
  J. Marathe, and Nir Shavit.  2013.  NUMA-aware reader-writer locks.
  SIGPLAN Not. 48, 8 (August 2013), 157–166.
  DOI:https://doi.org/10.1145/2517327.24425

(The full article available from:
  http://mcg.cs.tau.ac.il/papers/ppopp2013-rwlocks.pdf)

The implementation is based on the The Writer-Preference Lock (C-RW-WP)
variant (see the 3.4 section of the paper for the rationale).

The implemented algorithm has been modified for simplicity and for usage
patterns in rbtdb.c.

The changes compared to the original algorithm:

  * We haven't implemented the cohort locks because that would require a
    knowledge of NUMA nodes, instead a simple atomic_bool is used as
    synchronization point for writer lock.

  * The per-thread reader counters are not being used - this would
    require the internal thread id (isc_tid_v) to be always initialized,
    even in the utilities; the change has a slight performance penalty,
    so we might revisit this change in the future.  However, this change
    also saves a lot of memory, because cache-line aligned counters were
    used, so on 32-core machine, the rwlock would be 4096+ bytes big.

  * The readers use a writer_barrier that will raise after a while when
    readers lock can't be acquired to prevent readers starvation.

  * Separate ingress and egress readers counters queues to reduce both
    inter and intra-thread contention.

3 years agoAdd missing <isc/atomic.h> include to dns/badcache.c
Ondřej Surý [Tue, 14 Feb 2023 12:40:45 +0000 (13:40 +0100)] 
Add missing <isc/atomic.h> include to dns/badcache.c

The dns_badcache was pulling the <isc/atomic.h> header only indirectly
via <isc/rwlock.h>, add the direct include as the <isc/rwlock.h> no
longer pulls the header when pthread_rwlock is used.

3 years agoAdd isc_hashmap_find() DbC check for valuep
Ondřej Surý [Mon, 13 Feb 2023 15:16:26 +0000 (16:16 +0100)] 
Add isc_hashmap_find() DbC check for valuep

This adds DbC check, so we don't pass non-NULL memory for a valued to
the isc_hashmap_find() function.

3 years agoMerge branch 'feature/main/fips-tests' into 'main'
Mark Andrews [Wed, 15 Feb 2023 08:16:52 +0000 (08:16 +0000)] 
Merge branch 'feature/main/fips-tests' into 'main'

FIPS tests changes for RHEL

Closes #3871

See merge request isc-projects/bind9!7417

3 years agoAdd CHANGES note for [GL !7417]
Mark Andrews [Wed, 15 Feb 2023 03:42:34 +0000 (14:42 +1100)] 
Add CHANGES note for [GL !7417]

3 years agoFIPS tests changes for RHEL
Petr Menšík [Thu, 2 Aug 2018 21:46:45 +0000 (23:46 +0200)] 
FIPS tests changes for RHEL

Include MD5 feature detection in featuretest tool and use it in some
places. When RHEL distribution or Fedora ELN is in FIPS mode, then MD5
algorithm is unavailable completely and even hmac-md5 algorithm usage
will always fail. Work that around by checking MD5 works and if not,
skipping its usage.

Those changes were dragged as downstream patch bind-9.11-fips-tests.patch
in Fedora and RHEL.

3 years agoMerge branch '3862-recusive-stress-crash' into 'main'
Ondřej Surý [Tue, 14 Feb 2023 18:19:54 +0000 (18:19 +0000)] 
Merge branch '3862-recusive-stress-crash' into 'main'

Fix change 6093 which broke rbtdb when it grew too large

Closes #3862

See merge request isc-projects/bind9!7533

3 years agoFix change 6093 which broke rbtdb when it grew too large
Tony Finch [Tue, 14 Feb 2023 12:26:28 +0000 (12:26 +0000)] 
Fix change 6093 which broke rbtdb when it grew too large

I misunderstood the purpose of the `heap_index` rdataset header
member; I thought it identified which heap to use, and could therefore
be smaller, the same size as `locknum` indexes. But in fact it is a
position within a heap, so it needs to be able to count up to the
total number of rdatasets in the rbtdb.

So this changes `heap_index` from `uint16_t` back to `unsigned int`.

To avoid re-embiggening the rdatasetheader, shrink the `count` member
from `uint32` to `uint16`. The `count` is used to rotate RRsets in
`dns_rdataset_towiresorted()`, so 16 bits is more than large enough.
This change also means we no longer need to avoid colliding with
`DNS_RDATASET_COUNT_UNDEFINED` i.e. UINT32_MAX.

Closes #3862

3 years agoMerge branch 'fanf-arm-spinloop' into 'main'
Tony Finch [Tue, 14 Feb 2023 17:53:26 +0000 (17:53 +0000)] 
Merge branch 'fanf-arm-spinloop' into 'main'

Improve the spinloop pause / yield hint

See merge request isc-projects/bind9!7469

3 years agoImprove the spinloop pause / yield hint
Tony Finch [Wed, 24 Mar 2021 16:52:56 +0000 (17:52 +0100)] 
Improve the spinloop pause / yield hint

Unfortunately, C still lacks a standard function for pause (x86,
sparc) or yeild (arm) instructions, for use in spin lock or CAS loops.
BIND has its own based on vendor intrinsics or inline asm.

Previously, it was buried in the `isc_rwlock` implementation. This
commit renames `isc_rwlock_pause()` to `isc_pause()` and moves
it into <isc/pause.h>.

This commit also fixes the configure script so that it detects ARM
yield support on systems that identify as `aarch*` instead of `arm*`.

On 64-bit ARM systems we now use the ISB (instruction synchronization
barrier) instruction in preference to yield. The ISB instruction
pauses the CPU for longer, several nanoseconds, which is more like the
x86 pause instruction. There are more details in a Rust pull request,
which also refers to MySQL making the same change:
https://github.com/rust-lang/rust/pull/84725

3 years agoMerge branch '3849-relax-diff-on-dig-short-output' into 'main'
Tom Krizek [Tue, 14 Feb 2023 12:39:38 +0000 (12:39 +0000)] 
Merge branch '3849-relax-diff-on-dig-short-output' into 'main'

Ignore dig errors in +short comparisons in tests

Closes #3849

See merge request isc-projects/bind9!7488

3 years agoIgnore dig errors in +short comparisons in tests
Tom Krizek [Mon, 13 Feb 2023 12:58:47 +0000 (13:58 +0100)] 
Ignore dig errors in +short comparisons in tests

Tests using diff to compare outputs of dig +short shall ignore lines
starting with ";". In dig +short output, such lines should only be
present for errors such as network issues. Since we utilize dig's
default timeout/retry mechanisms, these transitory issues should be
ignored and only the final output should be considered during the diff
comparison.

3 years agoMerge branch '3866-fix-rpz-reference-counting-bug' into 'main'
Arаm Sаrgsyаn [Tue, 14 Feb 2023 09:59:41 +0000 (09:59 +0000)] 
Merge branch '3866-fix-rpz-reference-counting-bug' into 'main'

Fix RPZ reference counting error on shutdown

Closes #3866

See merge request isc-projects/bind9!7526

3 years agoAdd a CHANGES note for [GL #3866]
Aram Sargsyan [Mon, 13 Feb 2023 15:19:08 +0000 (15:19 +0000)] 
Add a CHANGES note for [GL #3866]

3 years agoFix RPZ reference counting error on shutdown
Aram Sargsyan [Mon, 13 Feb 2023 14:47:09 +0000 (14:47 +0000)] 
Fix RPZ reference counting error on shutdown

A dns_rpz_unref_rpzs() call is missing when taking the 'goto unlock;'
path on shutdown, in order to compensate for the earlier
dns_rpz_ref_rpzs() call.

Move the dns_rpz_ref_rpzs() call after the shutdown check.

3 years agoMerge branch '3662-extend-mkeys-system-test-to-handle-islands-of-trust' into 'main'
Mark Andrews [Mon, 13 Feb 2023 23:32:05 +0000 (23:32 +0000)] 
Merge branch '3662-extend-mkeys-system-test-to-handle-islands-of-trust' into 'main'

Resolve "Extend mkeys system test to handle islands of trust"

Closes #3662

See merge request isc-projects/bind9!7049

3 years agoAdd CHANGES note for [GL #3662]
Mark Andrews [Thu, 17 Nov 2022 01:18:49 +0000 (12:18 +1100)] 
Add CHANGES note for [GL #3662]

3 years agoAdd islands of trust to mkeys test
Mark Andrews [Wed, 9 Nov 2022 16:01:42 +0000 (16:01 +0000)] 
Add islands of trust to mkeys test

This adds an island of trust that is reachable from the root
where the trust anchors are added to island.conf.

This add an island of trust that is not reachable from the root
where the trust anchors are added to private.conf.

3 years agoReport the key name that failed in retry_keyfetch
Mark Andrews [Wed, 9 Nov 2022 12:12:07 +0000 (12:12 +0000)] 
Report the key name that failed in retry_keyfetch

When there are multiple managed trust anchors we need to know the
name of the trust anchor that is failing.  Extend the error message
to include the trust anchor name.

3 years agoMerge branch '2971-cleanup-dead-functions' into 'main'
Evan Hunt [Mon, 13 Feb 2023 19:52:05 +0000 (19:52 +0000)] 
Merge branch '2971-cleanup-dead-functions' into 'main'

remove some unused functions

Closes #2971

See merge request isc-projects/bind9!7521

3 years agoremove some unused functions
Evan Hunt [Fri, 10 Feb 2023 18:18:38 +0000 (10:18 -0800)] 
remove some unused functions

removed some functions that are no longer used and unlikely to
be resurrected, and also some that were only used to support Windows
and can now be replaced with generic versions.

3 years agoMerge branch '3848-increase-wait-time-runtime-test' into 'main'
Tom Krizek [Mon, 13 Feb 2023 14:22:24 +0000 (14:22 +0000)] 
Merge branch '3848-increase-wait-time-runtime-test' into 'main'

Increase named startup wait time for runtime test

Closes #3848

See merge request isc-projects/bind9!7487

3 years agoIncrease named startup wait time for runtime test
Tom Krizek [Mon, 6 Feb 2023 13:16:44 +0000 (14:16 +0100)] 
Increase named startup wait time for runtime test

Occasionally, the allotted 10 seconds for the "running" line to appear
in log after named is started proved insufficient in CI, especially
during increased load. Give named up to 60 seconds to start up to
mitigate this issue.

3 years agoMerge branch 'mnowak/pairwise-test-auth-recursive-servers' into 'main'
Michal Nowak [Mon, 13 Feb 2023 12:24:25 +0000 (12:24 +0000)] 
Merge branch 'mnowak/pairwise-test-auth-recursive-servers' into 'main'

Test authoritative and recursive servers in pairwise

See merge request isc-projects/bind9!7397

3 years agoStart named as auth and recursive server in pairwise
Michal Nowak [Wed, 18 Jan 2023 16:41:21 +0000 (17:41 +0100)] 
Start named as auth and recursive server in pairwise

The script will start the named process configured as both an
authoritative and recursive server for each pairwise ./configure
configuration. The test is considered successful if the named process
runs until the 5-second timeout is triggered, and there is no named.lock
file present, indicating that named did not crash on shutdown.