Commit Graph

38353 Commits

Author SHA1 Message Date
Tony Finch
3fef7c626a Move bind9_getaddresses() to isc_getaddresses()
No need to have a whole library for one function.
2023-02-21 13:12:26 +00:00
Mark Andrews
b2923ce356 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
2023-02-21 12:58:25 +00:00
Mark Andrews
9c17f4353b 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.
2023-02-21 12:22:27 +00:00
Arаm Sаrgsyаn
69b39899d5 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
2023-02-21 09:01:27 +00:00
Aram Sargsyan
b086374b1d Add a CHANGES note for [GL #3880] 2023-02-21 08:23:59 +00:00
Aram Sargsyan
121a095a22 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.
2023-02-21 08:23:13 +00:00
Aram Sargsyan
95f4bac002 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.
2023-02-21 08:23:13 +00:00
Evan Hunt
1efbca6856 Merge branch 'each-cleanup-gethostname' into 'main'
remove named_os_gethostname()

See merge request isc-projects/bind9!7555
2023-02-18 20:23:56 +00:00
Evan Hunt
197334464e 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.
2023-02-18 20:23:41 +00:00
Mark Andrews
345dc4d505 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
2023-02-17 22:29:28 +00:00
Mark Andrews
d22257a370 In hmac_createctx free ctx on isc_hmac_init failure 2023-02-17 21:58:56 +00:00
Michal Nowak
b131c60bf5 Merge branch 'mnowak/qa-tools-update' into 'main'
Python formatting updates

See merge request isc-projects/bind9!7551
2023-02-17 15:00:07 +00:00
Michal Nowak
8064ac6bec 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)
2023-02-17 15:31:52 +01:00
Michal Nowak
3cd2cc6254 Adapt to Python scripts to black 23.1.0 2023-02-17 15:31:52 +01:00
Tony Finch
000f885614 Merge branch 'fanf-libbind9-libisccfg' into 'main'
Move bind9/check to isccfg/check

See merge request isc-projects/bind9!7461
2023-02-17 12:50:39 +00:00
Tony Finch
dcb54af220 Move bind9/check to isccfg/check
Since it is part of the configuration machinery
2023-02-17 12:13:37 +00:00
Ondřej Surý
6ba2579c67 Merge branch 'ondrej-further-dns_validator-refactoring' into 'main'
additional refactoring of dns_validator

See merge request isc-projects/bind9!7546
2023-02-17 06:22:03 +00:00
Evan Hunt
e49350721f CHANGES for [GL #3797] 2023-02-17 07:18:25 +01:00
Evan Hunt
1ee30be7ce 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.
2023-02-17 07:18:25 +01:00
Ondřej Surý
7da99414c0 Implement proper reference counting in dns_validator
use reference counting in dns_validator to prevent use after free.
2023-02-17 07:18:25 +01:00
Evan Hunt
b4715a34a0 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.)
2023-02-17 07:18:25 +01:00
Ondřej Surý
da0f154bc7 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
2023-02-17 06:18:15 +00:00
Ondřej Surý
668d287d01 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.
2023-02-17 07:16:50 +01:00
Ondřej Surý
51e0b8994e Merge branch '3797-part9-remove-isc_task-completely' into 'main'
remove isc_task completely

Closes #3797

See merge request isc-projects/bind9!7537
2023-02-16 17:35:49 +00:00
Evan Hunt
a52b17d39b 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.
2023-02-16 18:35:32 +01:00
Ondřej Surý
b7952c6fa7 Merge branch '3797-part8-catz-delzone-refactoring' into 'main'
refactor catz and addzone/delzone to use task

See merge request isc-projects/bind9!7373
2023-02-16 17:35:09 +00:00
Evan Hunt
a9f9041fe6 refactor dns_catz to use loop callbacks
catz events are now scheduled using isc_task_async() instead
of isc_task_send().
2023-02-16 17:51:55 +01:00
Evan Hunt
9bdf982ea6 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.
2023-02-16 17:51:55 +01:00
Evan Hunt
f58e7c28cd 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.)
2023-02-16 17:51:55 +01:00
Ondřej Surý
5a028a40b6 Merge branch '3797-part7-resolver-refactoring' into 'main'
refactor dns_resolver to use loop callbacks

See merge request isc-projects/bind9!7372
2023-02-16 16:50:46 +00:00
Evan Hunt
0312789129 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.
2023-02-16 17:27:59 +01:00
Ondřej Surý
8f90424d12 Merge branch '3797-part6-refactor-callbacks' into 'main'
refactor various callbacks

See merge request isc-projects/bind9!7371
2023-02-16 16:20:26 +00:00
Evan Hunt
bba46be63d 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.)
2023-02-16 17:16:42 +01:00
Evan Hunt
83593167cd refactor dyndb sample driver to use loop callbacks
the syncptr function in the dyndb sample driver now uses
isc_async_run().
2023-02-16 17:16:42 +01:00
Evan Hunt
b061c7e27f 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.
2023-02-16 17:16:41 +01:00
Evan Hunt
773d47c95c 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().)
2023-02-16 17:16:41 +01:00
Ondřej Surý
90544bd5f9 Merge branch '3797-part5-update-processing' into 'main'
refactor update processing to use loop callbacks

See merge request isc-projects/bind9!7370
2023-02-16 16:11:53 +00:00
Evan Hunt
327b95566d refactor update processing to use loop callbacks
update processing now uses loop callbacks instead of task events.
2023-02-16 16:34:20 +01:00
Ondřej Surý
6d7fdb884c Merge branch '3797-part3-request-refactoring' into 'main'
refactor libdns modules to use loop callbacks

See merge request isc-projects/bind9!7367
2023-02-16 15:15:18 +00:00
Evan Hunt
7a78a85b35 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.)
2023-02-16 14:55:06 +01:00
Evan Hunt
31aee2ef9c 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().)
2023-02-16 14:55:06 +01:00
Evan Hunt
106da9c190 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.
2023-02-16 14:55:06 +01:00
Tony Finch
d3e2b680d0 Merge branch 'fanf-simplify-view-detach' into 'main'
Simplify locking in dns_view_detach()

See merge request isc-projects/bind9!7538
2023-02-16 13:44:28 +00:00
Tony Finch
eb6b31b6f2 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.
2023-02-16 13:44:17 +00:00
Tony Finch
97663836ea Merge branch 'fanf-avoid-fortify-source-redefinition' into 'main'
Avoid redefining _FORTIFY_SOURCE

See merge request isc-projects/bind9!7539
2023-02-16 13:43:56 +00:00
Tony Finch
b0377f798f 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
2023-02-16 13:43:40 +00:00
Michal Nowak
3203d6c549 Merge tag 'v9_19_10'
BIND 9.19.10
2023-02-16 13:38:33 +01:00
Mark Andrews
cf002b41b0 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
2023-02-16 00:16:49 +00:00
Mark Andrews
e27fc4bbc5 Cleanup OpenSSL reference on bad option
Another exit path that needs to be cleaned up.
2023-02-16 10:55:42 +11:00
Mark Andrews
4c2525c418 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.
2023-02-16 10:55:41 +11:00