2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

39719 Commits

Author SHA1 Message Date
Mark Andrews
ad747976bb 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.
2023-06-01 16:51:38 +02:00
Ondřej Surý
f760ee3f8c 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.
2023-06-01 16:51:38 +02:00
Arаm Sаrgsyаn
1b0e7e7a50 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
2023-06-01 09:21:10 +00:00
Aram Sargsyan
466a7d9b5f Add CHANGES and release notes for [GL #4074] 2023-06-01 08:14:31 +00:00
Aram Sargsyan
2ae5c4a674 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.
2023-06-01 08:13:09 +00:00
Aram Sargsyan
3bb2babcd0 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.
2023-06-01 08:13:09 +00:00
Aram Sargsyan
7ebd055c78 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.
2023-06-01 08:13:09 +00:00
Aram Sargsyan
101d829b02 Fix fetchlimit system test issues
1. Fix the numbering.
2. Fix an artifacts rewriting issue.
3. Add missing checks of 'ret' after some checks.
2023-06-01 08:13:09 +00:00
Michal Nowak
a9ec626652 Merge branch 'mnowak/alpine-3.18' into 'main'
Add Alpine Linux 3.18

See merge request isc-projects/bind9!7985
2023-05-31 10:02:52 +00:00
Michal Nowak
ddb846454d Add Alpine Linux 3.18 2023-05-31 12:01:26 +02:00
Arаm Sаrgsyаn
01605a7ed1 Merge branch 'aram/statschannel-spilled-clients-counter' into 'main'
Add ClientQuota statistics channel counter

See merge request isc-projects/bind9!7978
2023-05-31 09:52:29 +00:00
Aram Sargsyan
fa9172d996 Add a CHANGES note for [GL !7978] 2023-05-31 09:09:35 +00:00
Aram Sargsyan
08ebf39d1e Update the documentation of the resolver statistics counters
The reference manual doesn't document all the available resolver
statistics counters. Add information about the missing counters.
2023-05-31 09:08:58 +00:00
Aram Sargsyan
04648d7c2f Add ClientQuota statistics channel counter
This counter indicates the number of the resolver's spilled
queries due to reaching the clients per query quota.
2023-05-31 09:08:58 +00:00
Evan Hunt
c8b69a0289 Merge branch '4012-remove-win2k-hacks' into 'main'
remove win2k gss-tsig hacks

Closes #4012

See merge request isc-projects/bind9!7843
2023-05-31 08:29:20 +00:00
Evan Hunt
f58b9e9d2c CHANGES and release notes for [GL #4012] 2023-05-30 15:36:15 -07:00
Evan Hunt
26b4acde16 remove win2k gss-tsig hacks
Remove the code implementing nonstardard behaviors that were formerly
needed to allow GSS-TSIG to work with Windows 2000, which passed
End-of-Life in 2010.

Deprecate the "oldgsstsig" command and "-o" command line option
to nsupdate; these are now treated as synonyms for "gsstsig" and "-g"
respectively.
2023-05-30 15:36:01 -07:00
Michal Nowak
1e3bafde51 Merge branch 'mnowak/custom-userspace-rcu-library' into 'main'
Drop liburcu-related TSAN suppressions

See merge request isc-projects/bind9!7971
2023-05-30 18:27:12 +00:00
Michal Nowak
04dda8661f Change images for TSAN jobs
Fedora 38 and Debian "bullseye" images were "forked" to images used only
for TSAN CI jobs. The new images contain TSAN-aware liburcu that does
not fit well with ASAN CI jobs for which original images were also used.

Also, drop liburcu-related TSAN suppressions because they are
unnecessary with TSAN-aware liburcu.
2023-05-30 20:13:19 +02:00
Michal Nowak
1b7ed2da1a Merge branch 'mnowak/look-for-core-files-in-TOP_BUILDDIR' into 'main'
Look for core files in $TOP_BUILDDIR

See merge request isc-projects/bind9!7869
2023-05-30 17:54:48 +00:00
Michal Nowak
a13448a769 Look for core files in $TOP_BUILDDIR
The get_core_dumps.sh script couldn't find and process core files of
out-of-tree configurations because it looked for them in the source
instead of the build directory.
2023-05-30 19:41:31 +02:00
Tom Krizek
7b863f9621 Merge branch 'tkrizek-fix-pytest-base-port' into 'main'
Fix base_port calculation in pytest runner

See merge request isc-projects/bind9!7981
2023-05-30 13:36:42 +00:00
Tom Krizek
e8ea6b610b Fix base_port calculation in pytest runner
The selected base port should be in the range <port_min, port_max), the
formula was incorrect.

Credit for discovering this fault goes to Ondrej Sury.
2023-05-30 14:11:14 +02:00
Matthijs Mekking
7b35586047 Merge branch '3950-serve-stale-strikes-again' into 'main'
Fix serve-stale bug when cache has no data

Closes #3950

See merge request isc-projects/bind9!7856
2023-05-30 11:02:13 +00:00
Matthijs Mekking
23dbb6ba72 Add release note and changes for #3950
Fixing another serve-stale bug is still news.
2023-05-30 11:58:50 +02:00
Matthijs Mekking
74d30879ba Extend serve-stale logging
Print the database lookup result in serve-stale logs for debugging
potential future serve-stale issues.
2023-05-30 11:58:19 +02:00
Matthijs Mekking
bbd163acf6 Fix serve-stale bug when cache has no data
We recently fixed a bug where in some cases (when following an
expired CNAME for example), named could return SERVFAIL if the target
record is still valid (see isc-projects/bind9#3678, and
isc-projects/bind9!7096). We fixed this by considering non-stale
RRsets as well during the stale lookup.

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

Add 'answer_found' checks to the serve-stale logic to fix this issue.
2023-05-30 11:58:19 +02:00
Matthijs Mekking
c3d4fd3449 Add serve-stale test case for GL #3950
Add a test case where when priming the cache with a slow authoritative
resolver, the stale-answer-client-timeout option should not return
a delegation to the client (it should wait until an applicable answer
is found, if no entry is found in the cache).
2023-05-30 11:58:19 +02:00
Ondřej Surý
efa8cbbf68 Merge branch '3905-placeholder' into 'main'
Add CHANGES placeholder for [GL #3905]

Closes #3905

See merge request isc-projects/bind9!7976
2023-05-29 06:02:51 +00:00
Ondřej Surý
e497cb485c Add CHANGES placeholder for [GL #3905] 2023-05-29 08:00:16 +02:00
Ondřej Surý
d98cfe7f8b Merge branch '4098-remove-cruft-epoll-kqueue-configure-options' into 'main'
Remove obsolete epoll/kqueue/devpoll configure options

Closes #4098

See merge request isc-projects/bind9!7973
2023-05-29 05:57:03 +00:00
Ondřej Surý
0266760fdd Add CHANGES note for [GL #4098] 2023-05-29 07:44:24 +02:00
Ondřej Surý
051f3d612f Remove obsolete epoll/kqueue/devpoll configure options
Since we don't use networking directly but rather via libuv, these
configure options were no-op.  Remove the configure checks for epoll
(Linux), kqueue (BSDs) and /dev/poll (Solaris).
2023-05-29 07:44:24 +02:00
Mark Andrews
3bcc25abf0 Merge branch '4090-corrected-bad-insist-logic-in-isc_radix_remove' into 'main'
Resolve "Corrected bad INSIST logic in isc_radix_remove()"

Closes #4090

See merge request isc-projects/bind9!7966
2023-05-29 02:22:18 +00:00
Mark Andrews
03ebe96110 Add regression test for [GL # 4090]
These insertions are added to produce a radix tree that will trigger
the INSIST reported in [GL #4090].  Due to fixes added since BIND 9.9
an extra insert in needed to ensure node->parent is non NULL.
2023-05-29 01:40:57 +00:00
Mark Andrews
ac2e0bc3ff Move isc_mem_put to after node is checked for equality
isc_mem_put NULL's the pointer to the memory being freed.  The
equality test 'parent->r == node' was accidentally being turned
into a test against NULL.
2023-05-29 01:40:57 +00:00
Evan Hunt
5c30012a83 Merge branch '4085-httpd-shutdown-issue' into 'main'
don't set SHUTTINGDOWN until after calling the request callbacks

Closes #4085

See merge request isc-projects/bind9!7961
2023-05-27 04:12:09 +00:00
Evan Hunt
512e5e786b don't set SHUTTINGDOWN until after calling the request callbacks
if we set ISC_HTTPDMGR_SHUTTINGDOWN in the http manager before
calling the pending request callbacks, it can trigger an assertion.
2023-05-27 00:41:37 +00:00
Artem Boldariev
45b3a4a4cb Merge branch '4091-syncrhonise-access-to-the-client-tlsctx-cache' into 'main'
ZMGR: TLS contexts cache - properly synchronise access

Closes #4091

See merge request isc-projects/bind9!7967
2023-05-26 12:07:43 +00:00
Artem Boldariev
0b95cf74ff ZMGR: TLS contexts cache - properly synchronise access
This commit ensures that access to the TLS context cache within zone
manager is properly synchronised.

Previously there was a possibility for it to get unexpectedly
NULLified for a brief moment by a call to
dns_zonemgr_set_tlsctx_cache() from one thread, while being accessed
from another (e.g. from got_transfer_quota()). This behaviour could
lead to server abort()ing on configuration reload (under very rare
circumstances).

That behaviour has been fixed.
2023-05-26 14:18:03 +03:00
Tom Krizek
714d722604 Merge branch '4082-rrl-would-limit-log-line' into 'main'
Disable rrl check in slow environments

Closes #4082

See merge request isc-projects/bind9!7963
2023-05-26 10:26:41 +00:00
Tom Krizek
d8997db5d5 Disable rrl check in slow environments
The check for 'would limit' log message is triggered by sending at least
three messages within one second. However, in extremely slow conditions
(currently when running with clang+TSAN in CI), the individual queries
might take too much time to send enough of them within one second.

Since this is a pretty rare condition, let's just silently skip this
test in environments where a single query takes more than 500 ms, since
there's no way to perform the check under such conditions.

Closes #4082
2023-05-26 12:25:36 +02:00
Michal Nowak
6efe11bcec Merge branch 'mnowak/gitlab-runner-autoscaling' into 'main'
Run most Docker CI jobs in AWS with autoscaler

See merge request isc-projects/bind9!7960
2023-05-26 09:45:53 +00:00
Michal Nowak
f09cf69594 Run most Docker CI jobs in AWS with autoscaler
All but the "respdiff-long" job, for which our AWS instances do not have
enough memory, are now being spawned in the AWS by the autoscaler
executor.
2023-05-26 11:37:58 +02:00
Evan Hunt
ee5ee5a994 Merge branch '4072-tcp-dispatch-timeout' into 'main'
fix handling of TCP timeouts

Closes #4072

See merge request isc-projects/bind9!7937
2023-05-26 08:49:52 +00:00
Evan Hunt
0e800467ee fix handling of TCP timeouts
when a TCP dispatch times out, we call tcp_recv() with a result
value of ISC_R_TIMEDOUT; this cancels the oldest dispatch
entry in the dispatch's active queue, plus any additional entries
that have waited longer than their configured timeouts. if, at
that point, there were more dispatch entries still on the active
queue, it resumes reading, but until now it failed to restart
the timer.

this has been corrected: we now calculate a new timeout
based on the oldest dispatch entry still remaining.  this
requires us to initialize the start time of each dispatch entry
when it's first added to the queue.

in order to ensure that the handling of timed-out requests is
consistent, we now calculate the runtime of each dispatch
entry based on the same value for 'now'.

incidentally also fixed a compile error that turned up when
DNS_DISPATCH_TRACE was turned on.
2023-05-26 00:41:01 -07:00
Evan Hunt
2f75605698 Merge branch '4079-multiple-keyrings' into 'main'
prevent TSIG keys from being added to multiple rings

Closes #4079

See merge request isc-projects/bind9!7955
2023-05-25 22:01:33 +00:00
Evan Hunt
03a9aa95bf CHANGES for [GL #4079] 2023-05-25 11:59:37 -07:00
Evan Hunt
e436d84408 prevent TSIG keys from being added to multiple rings
it was possible to add a TSIG key to more than one TSIG
keyring at a time, and this was in fact happening with the
session key, which was generated once and then added to the
keyrings for each view as it was configured.

this has been corrected and a REQUIRE added to dns_tsigkeyring_add()
to prevent it from happening again.
2023-05-25 11:59:02 -07:00
Arаm Sаrgsyаn
80eb7c2d21 Merge branch '3765-interfacemgr-use-after-afree-on-shutdown' into 'main'
Fix an interfacemgr use-after-free error in zoneconf.c:isself()

Closes #3765

See merge request isc-projects/bind9!7962
2023-05-25 08:29:01 +00:00