Commit Graph
36227 Commits
Author SHA1 Message Date
Michal Nowak c9aca34b1e Merge tag 'v9_19_1'
BIND 9.19.1
2022-05-19 10:55:42 +02:00
Evan Hunt 0e0d39bfdb Merge branch 'each-resolver-hash-tables' into 'main'
Use self-resizing hash tables for resolver

See merge request isc-projects/bind9!6271
2022-05-19 07:49:11 +00:00
Evan Hunt be841577f1 CHANGES for [GL !6271] 2022-05-19 00:48:06 -07:00
Evan HuntandOndřej Surý 6936db2f59 Always use the number of CPUS for resolver->ntasks
Since the fctx hash table is now self-resizing, and resolver tasks are
selected to match the thread that created the fetch context, there
shouldn't be any significant advantage to having multiple tasks per CPU;
a single task per thread should be sufficient.

Additionally, the fetch context is always pinned to the calling netmgr
thread to minimize the contention just to coalesced fetches - if two
threads starts the same fetch, it will be pinned to the first one to get
the bucket.
2022-05-19 09:27:33 +02:00
Evan HuntandOndřej Surý 857f3bede3 Use automatically-resizing hash table for resolver buckets
Replace the statically-sized hash table used for the resolver
fetch contexts with an isc_ht_t.
2022-05-19 09:27:28 +02:00
Evan HuntandOndřej Surý 1595304312 Use automatically-resizing hash table for fetches-per-zone
Replace the statically-sized hash table used for fcount_incr()
and fcount_decr() with an isc_ht_t.
2022-05-19 09:27:23 +02:00
Evan Hunt 5731a3d7f0 Merge branch '3350-rndc-dnssec-checkds-doc' into 'main'
specify time format in the documentation for 'rdnc dnssec -checkds'

Closes #3350

See merge request isc-projects/bind9!6302
2022-05-18 22:28:39 +00:00
Evan Hunt 83f9466d61 specify time format in the documentation for 'rdnc dnssec -checkds'
also clarified the writing in the surrounding paragraph.
2022-05-18 15:24:54 -07:00
Michal Nowak da7d0a7ea3 Merge branch 'mnowak/fix-typo-in-ednscompliance-test' into 'main'
Fix typo in ednscompliance test

See merge request isc-projects/bind9!6323
2022-05-18 17:15:04 +00:00
Michal Nowak 9de2c06a21 Fix typo in ednscompliance test
Caused by ba0313e649, an incomplete fix of
spelling errors.
2022-05-18 19:13:30 +02:00
Ondřej Surý 6842733018 Merge branch '3366-configure-fails-to-find-uv-h-on-bsd' into 'main'
Use libuv CFLAGS and LIBS when checking for features

Closes #3366

See merge request isc-projects/bind9!6326
2022-05-18 17:04:31 +00:00
Ondřej Surý f063ee276e Use libuv CFLAGS and LIBS when checking for features
When autoconf was checking for libuv features, the LIBUV_CFLAGS was not
added to CFLAGS and LIBUV_LIBS to LIBS which resulted in false
negatives.

Use AX_SAVE_FLAGS and AX_RESTORE_FLAGS to temporarily add LIBUV_CFLAGS
and LIBUV_LIBS to their respective variables.
2022-05-18 14:10:58 +02:00
Mark Andrews 2cfef0f72d Merge branch '3356-wrong-path-for-geoip-directory' into 'main'
Resolve "wrong path for geoip-directory"

Closes #3356

See merge request isc-projects/bind9!6316
2022-05-17 18:56:17 +00:00
Mark Andrews 686d691fa9 Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb]) 2022-05-17 18:37:00 +00:00
Tony Finch 6795a346b4 Merge branch '3361-dnssec-settime-unset' into 'main'
Teach dnssec-settime to read unset times that it writes

Closes #3361

See merge request isc-projects/bind9!6317
2022-05-17 15:33:29 +00:00
Tony Finch 4c96efac5c Teach dnssec-settime to read unset times that it writes
When there is no time in a key file, `dnssec-settime` will print
"UNSET", but to unset a time the user must specify "none" or "never".
This change allows "unset" or "UNSET" as well as "none" or "never".
The "UNSET" output remains the same to avoid compatibility problems
with wrapper scripts.

I have also re-synchronized the "Timing Options" sections of the man
pages.
2022-05-17 16:28:40 +02:00
Ondřej Surý 9903a1defb Merge branch 'ondrej-cleanup-dns_message_gettemp' into 'main'
Cleanup dns_message_gettemp*() functions - they cannot fail

See merge request isc-projects/bind9!6311
2022-05-17 11:12:06 +00:00
Ondřej Surý 33ba0057a7 Cleanup dns_message_gettemp*() functions - they cannot fail
The dns_message_gettempname(), dns_message_gettemprdata(),
dns_message_gettemprdataset(), and dns_message_gettemprdatalist() always
succeeds because the memory allocation cannot fail now.  Change the API
to return void and cleanup all the use of aforementioned functions.
2022-05-17 12:39:25 +02:00
Matthijs Mekking edbb52c95c Merge branch '3352-kasp-test-broken-on-freebsd' into 'main'
Fix "kasp test broken on freebsd"

Closes #3352

See merge request isc-projects/bind9!6310
2022-05-16 16:15:01 +00:00
Matthijs Mekking fe601c5915 Replace stat with PERL stat in kasp system test
7249bad7 introduced the -c option to stat(1) command, but BSD systems
do not know about it. Replace the stat(1) command with a PERL script
that achieves the same.

Why PERL? For consistency purposes, there are more places in the
system test where we use the same method.
2022-05-16 17:20:46 +02:00
Evan Hunt dbf867d960 Merge branch '3327-fetches-per-server-quota' into 'main'
fix the fetches-per-server quota calculation

Closes #3327

See merge request isc-projects/bind9!6268
2022-05-14 07:42:04 +00:00
Evan Hunt 3f478a3bed Add CHANGES note for [GL #3327] 2022-05-13 21:47:32 -07:00
Evan Hunt 8834c44683 Add lower bound checks to fetchlimit test
Check that the recursing client count is above a reasonable
minimum, as well as below a maximum, so that we can detect
bugs that cause recursion to fail too early or too often.
2022-05-13 21:47:32 -07:00
Evan Hunt 0201eab655 Cleanup: always count ns_statscounter_recursclients
The ns_statscounter_recursclients counter was previously only
incremented or decremented if client->recursionquota was non-NULL.
This was harmless, because that value should always be non-NULL if
recursion is enabled, but it made the code slightly confusing.
2022-05-13 21:47:27 -07:00
Evan Hunt 81deb24deb Disable EDNS for the fetchlimit test server
The fetchlimit test depends on a resolver continuing to try UDP
and timing out while the client waits for resolution to succeed.
but since commit bb990030 (flag day 2020), a fetch will always
switch to TCP after two timeouts, unless EDNS was disabled for
the query.

This commit adds "edns no;" to server statements in the fetchlimit
resolver, to restore the behavior expected by the test.
2022-05-13 21:47:27 -07:00
Evan Hunt 694bc50273 Fix the fetches-per-server quota calculation
Since commit bad5a523c2, when the fetches-per-server quota
was increased or decreased, instead of the value being set to
the newly calculated quota, it was set to the *minimum* of
the new quota or 1 - which effectively meant it was always set to 1.
it should instead have been the maximum, to prevent the value from
ever dropping to zero.
2022-05-13 21:47:27 -07:00
Evan Hunt e73728d2cb Merge branch '3351-checkconf-overflow' into 'main'
prevent a possible buffer overflow in configuration check

Closes #3351

See merge request isc-projects/bind9!6303
2022-05-14 03:28:48 +00:00
Evan Hunt 921043b541 prevent a possible buffer overflow in configuration check
corrected code that could have allowed a buffer overfow while
parsing named.conf.
2022-05-13 19:59:58 -07:00
Evan Hunt 891c50af48 Merge branch 'each-view-cleanup' into 'main'
clean up view and related object shutdown processes

See merge request isc-projects/bind9!6278
2022-05-13 21:23:40 +00:00
Evan Hunt 578297936c CHANGES 2022-05-13 13:39:55 -07:00
Evan Hunt 3b13edc5bd attach the resolver to the ADB
the ADB depends on the resolver, but previously only accessed it
via the view. as view->resolver may now be detached before the ADB
finishes, a shutdown race was possible. attaching to the resolver
directly prevents this.
2022-05-13 13:39:55 -07:00
Evan Hunt d7ffd897ef remove requestmgr whenshutdown events
the request manager has no direct dependency on the
view, so there's no need for a weak reference. remove the
dns_requestmgr_whenshutdown() mechanism since it is no longer
used.
2022-05-13 13:39:52 -07:00
Evan Hunt 51cd295c4b remove resolver whenshutdown events
weakly attaching and detaching when creating and destroying the
resolver obviates the need to have a callback event to do the weak
detach. remove the dns_resolver_whenshutdown() mechanism, as it is
now unused.
2022-05-13 13:36:10 -07:00
Evan Hunt a2d491279a remove ADB whenshutdown events
weakly attaching and detaching the view when creating or destroying
the ADB obviates the need for a whenshutdown callback event to do
the detaching.  remove the dns_adb_whenshutdown() mechanism, since
it is no longer needed.
2022-05-13 13:36:10 -07:00
Evan Hunt 3027f59f6f move ADB and resolver stats out of the view object
for better object separation, ADB and resolver statistics counters
are now stored in the ADB and resolver objects themsevles, rather than
in the associated view.
2022-05-13 13:36:10 -07:00
Evan Hunt e5e2d7814e remove view->attributes field
it's not necessary to use view attributes to determine whether
the ADB, resolver and requestmgr need to be shut down; checking
whether they're NULL is sufficient.
2022-05-13 13:36:10 -07:00
Evan Hunt 435e29c3e0 the validator can attach to the view normally
dns_view_weakattach() and _weakdetach() are used by objects that
are created by the view and need it to persist until they are
destroyed, but don't need to prevent it from being shut down. the
validator can use normal view references instead of weak references.
2022-05-13 13:36:10 -07:00
Evan Hunt e8ab719bc2 fixed a possible reference leak in dns_resolver_create()
If an error occurred while creating the resolver, the mctx could
remain attached.
2022-05-13 13:36:10 -07:00
Evan Hunt fe1fa8dc88 minor view refactoring
- eliminate dns_view_flushanddetach(), which was only called from
  one place; instead, we now call a function dns_view_flushonshutdown()
  which sets the view up to flush zones when it is detached normally
  with dns_view_detach().
- cleaned up code in dns_view_create().
2022-05-13 13:36:10 -07:00
Evan Hunt f7fa139fe7 maybe_cancel_validators() is always called locked
there's no longer any need for a parameter to specify whether the
function is called while holding the bucket lock, because all
unlocked uses have been removed.
2022-05-13 13:36:10 -07:00
Matthijs Mekking e6baff35ac Merge branch '3302-keymgr-updates-key-files-each-run' into 'main'
Fix "keymgr updates key files each run"

Closes #3302

See merge request isc-projects/bind9!6250
2022-05-13 12:50:16 +00:00
Matthijs Mekking 0f89f0b134 Add changes and release notes for #3302
Add a comment to make danger happy.
2022-05-13 13:31:17 +02:00
Matthijs Mekking 1da91b3ab4 Check if key metadata is modified before writing
Add a new parameter to the dst_key structure, mark a key modified if
dst_key_(un)set[bool,num,state,time] is called. Only write out key
files during a keymgr run if the metadata has changed.
2022-05-13 13:31:17 +02:00
Matthijs Mekking 7249bad706 Add kasp test for #3302
Add a test case that triggers a keymgr run that will not trigger any
metadata changes. Ensure that the last status change of the key files
is unmodified.
2022-05-13 13:28:38 +02:00
Ondřej Surý 688d81242a Merge branch 'ondrej-fix-trampoline-locking' into 'main'
Lock the trampoline when attaching

See merge request isc-projects/bind9!6257
2022-05-13 10:16:16 +00:00
Ondřej Surý 933162ae14 Lock the trampoline when attaching
When attaching to the trampoline, the isc__trampoline_max was access
unlocked.  This would not manifest under normal circumstances because we
initialize 65 trampolines by default and that's enough for most
commodity hardware, but there are ARM machines with 128+ cores where
this would be reported by ThreadSanitizer.

Add locking around the code in isc__trampoline_attach().  This also
requires the lock to leak on exit (along with memory that we already)
because a new thread might be attaching to the trampoline while we are
running the library destructor at the same time.
2022-05-13 10:07:20 +02:00
Ondřej Surý 01f3c51894 Merge branch 'ondrej-remove-isc_task-on-shutdown' into 'main'
Remove isc_task_onshutdown()

See merge request isc-projects/bind9!6275
2022-05-13 08:04:49 +00:00
Ondřej Surý a6cd5e2550 Add CHANGES note for [GL !6275] 2022-05-12 14:55:49 +02:00
Ondřej Surý 0582478c96 Remove isc_task_destroy() and isc_task_shutdown()
After removing the isc_task_onshutdown(), the isc_task_shutdown() and
isc_task_destroy() became obsolete.

Remove calls to isc_task_shutdown() and replace the calls to
isc_task_destroy() with isc_task_detach().

Simplify the internal logic to destroy the task when the last reference
is removed.
2022-05-12 14:55:49 +02:00
Ondřej Surý 2235edabcf Remove isc_task_onshutdown()
The isc_task_onshutdown() was used to post event that should be run when
the task is being shutdown.  This could happen explicitly in the
isc_test_shutdown() call or implicitly when we detach the last reference
to the task and there are no more events posted on the task.

This whole task onshutdown mechanism just makes things more complicated,
and it's easier to post the "shutdown" events when we are shutting down
explicitly and the existing code already always knows when it should
shutdown the task that's being used to execute the onshutdown events.

Replace the isc_task_onshutdown() calls with explicit calls to execute
the shutdown tasks.
2022-05-12 13:45:34 +02:00