Commit Graph
37833 Commits
Author SHA1 Message Date
Tom Krizek 3cbdb48ff0 WIP digdelv local repro script 2023-06-21 14:37:45 +02:00
Tom Krizek 2d553dc53c WIP run digdelv only without xdist 2023-06-21 12:48:31 +02:00
Tom Krizek 76845584e8 WIP digdelv xtrace 2023-06-20 14:24:30 +02:00
Tom Krizek c6e182f232 WIP Timeout digdelv test after 600 seconds 2023-06-20 14:23:54 +02:00
Tom Krizek aba8c60462 DROP Use staging images 2023-06-20 14:23:46 +02:00
Arаm Sаrgsyаn 4b97081fca Merge branch '4044-nslookup-reports-timeout-if-input-lookup-is-delayed' into 'bind-9.18'
[9.18] Update the event loop's time after executing a task

See merge request isc-projects/bind9!7891
2023-06-20 11:06:35 +00:00
Aram Sargsyan 7f70809d91 Add a CHANGES note for [GL #4044] 2023-06-20 10:22:46 +00:00
Aram Sargsyan 0c751ce72e Update the event loop's time after executing a task
Tasks can block for a long time, especially when used by tools in
interactive mode. Update the event loop's time to avoid unexpected
errors when processing later events during the same callback.
For example, newly started timers can fire too early, because the
current time was stale. See the note about uv_update_time() in the
https://docs.libuv.org/en/v1.x/timer.html#c.uv_timer_start page.
2023-06-20 10:21:54 +00:00
Aram Sargsyan 7f5beb751d Add nslookup test with a delayed input
The added test checks the stdin input mode of nslookup with an
added delay to confirm that [GL #4044] is fixed.
2023-06-20 10:21:54 +00:00
Michał Kępień e1a9db5fa6 Merge branch '2354-add-a-tool-for-reproducing-isc-spnego-bugs-9.18' into 'bind-9.18'
[9.18] [CVE-2020-8625] [CVE-2021-25216] Add a tool for reproducing ISC SPNEGO bugs

See merge request isc-projects/bind9!8042
2023-06-19 09:08:20 +00:00
Michał Kępień f046e415bf Add a tool for reproducing ISC SPNEGO bugs
Extend the "tsiggss" system test with reproducers for CVE-2020-8625 and
CVE-2021-25216.

(cherry picked from commit a47dc810f7)
2023-06-19 10:34:56 +02:00
Ondřej Surý b855432686 Merge branch '4149-make-isc_result-tables-more-compact-9.18' into 'bind-9.18'
[9.18] Make isc_result tables smaller

See merge request isc-projects/bind9!8038
2023-06-15 14:28:47 +00:00
Ondřej Surý a1413c2faf Add CHANGES note for [GL #4149]
(cherry picked from commit 0a35c0da9b)
2023-06-15 16:27:17 +02:00
Ondřej Surý be0f38553e 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.

(cherry picked from commit a8e6c3b8f7)
2023-06-15 16:27:17 +02:00
Ondřej Surý a29de517fa 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.

(cherry picked from commit b53d1d7069)
2023-06-15 16:27:17 +02:00
Michał Kępień 01fc746996 Merge branch '4150-fix-entity-renumbering-in-parse_tsan.py-9.18' into 'bind-9.18'
[9.18] Fix entity renumbering in util/parse_tsan.py

See merge request isc-projects/bind9!8039
2023-06-15 14:22:20 +00:00
Michał Kępień 9b764ab0e9 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.

(cherry picked from commit 7f0790c82f)
2023-06-15 16:18:49 +02:00
Tony Finch 9813e6d006 Merge branch '4134-zonefile-erofs-bind-9.18' into 'bind-9.18'
Translate POSIX errorcode EROFS to ISC_R_NOPERM

See merge request isc-projects/bind9!8033
2023-06-14 13:20:18 +00:00
Tony Finch dde068c2a0 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]

(cherry picked from commit 82401f0f0e)
2023-06-14 13:49:27 +01:00
Midnight VeilandTony Finch 5172f4c32a 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.

(cherry picked from commit dd6acc1cac)
2023-06-14 13:48:25 +01:00
Arаm Sаrgsyаn 025110b07a Merge branch '4136-catz-db-update-notify-bug-9.18' into 'bind-9.18'
[9.18] Fix catz db update callback registration logic error

See merge request isc-projects/bind9!8030
2023-06-14 09:25:44 +00:00
Aram Sargsyan 2ab73c3a94 Add a CHANGES note for [GL #4136]
(cherry picked from commit 23f609ba59)
2023-06-14 09:24:41 +00:00
Aram Sargsyan 6154eab679 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.

(cherry picked from commit 998765fea5)
2023-06-14 09:24:41 +00:00
Tom Krizek eee589f5ee Merge branch 'tkrizek/remove-trailing-whitespace-9.18' into 'bind-9.18'
[9.18] Remove trailing whitespace from all text files

See merge request isc-projects/bind9!8013
2023-06-14 08:53:05 +00:00
Tom Krizek 6f4afe238c Add utility script to detect trailing whitespace
Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.

(cherry picked from commit 034a32a4f3)
2023-06-14 09:52:58 +02:00
Tom Krizek 0820bedbd8 Ignore trailing whitespace removal commit in git blame 2023-06-14 09:52:58 +02:00
Tom Krizek 644a0b80c8 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]*$//'
2023-06-13 16:13:16 +02:00
Tom Krizek e0c4f5b60f Merge branch '4117-serve-stale-check-9.18' into 'bind-9.18'
[9.18] Avoid false positive in serve-stale system test check

See merge request isc-projects/bind9!8027
2023-06-13 12:54:26 +00:00
Tom Krizek c911aef622 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.

(cherry picked from commit dd7bcd2855)
2023-06-13 14:16:00 +02:00
Michal Nowak 6f23eef2d5 Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.18.17' into 'bind-9.18'
Set up version and release notes for BIND 9.18.17

See merge request isc-projects/bind9!8022
2023-06-12 15:14:45 +00:00
Michal Nowak 1184301d24 Set up release notes for BIND 9.18.17 2023-06-12 16:33:46 +02:00
Michal Nowak af92f44561 Update BIND version to 9.18.17-dev 2023-06-12 16:32:22 +02:00
Arаm Sаrgsyаn 36d019ffce Merge branch '4105-QryDropped-stats-counter-documentation-update-9.18' into 'bind-9.18'
[9.18] QryDropped stats counter documentation update

See merge request isc-projects/bind9!8011
2023-06-07 15:13:17 +00:00
Aram Sargsyan dd2973996f QryDropped stats counter documentation update
Document which dropped queries are calculated by the QryDropped
statistics counter.

(cherry picked from commit 27c30fe8a4)
2023-06-07 14:01:46 +00:00
Arаm Sаrgsyаn 5206a06e11 Merge branch '4074-fix-stale-answer-client-timeout-with-clients-per-query-9.18' into 'bind-9.18'
[9.18] Fix a clients-per-query miscalculation bug

See merge request isc-projects/bind9!7997
2023-06-06 12:47:28 +00:00
Aram Sargsyan 545a3fe089 Add CHANGES and release notes for [GL #4074]
(cherry picked from commit 466a7d9b5f)
2023-06-06 12:46:18 +00:00
Aram Sargsyan d91edda639 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.

(cherry picked from commit 2ae5c4a674)
2023-06-06 12:45:00 +00:00
Aram Sargsyan f82aaedbdc 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.

(cherry picked from commit 3bb2babcd0)
2023-06-06 12:45:00 +00:00
Aram Sargsyan 71a27a2848 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.

(cherry picked from commit 7ebd055c78)
2023-06-06 12:45:00 +00:00
Aram Sargsyan 17e09d8a10 Fix fetchlimit system test issues
1. Fix the numbering.
2. Fix an artifacts rewriting issue.
3. Add missing checks of 'ret' after some checks.
4. Fix extracting the quota value from the ADB dump.

(cherry picked from commit 101d829b02)
2023-06-06 12:45:00 +00:00
Ondřej Surý 449124c56d Merge branch '4038-resize-send-buffers-to-avoid-excessive-memory-allocation-9.18' into 'bind-9.18'
[9.18] Use appropriately sized send buffers for DNS messages over TCP

See merge request isc-projects/bind9!8005
2023-06-06 12:21:56 +00:00
Artem BoldarievandOndřej Surý 2c145b1862 Update CHANGES and release note [GL #4038]
Mention that memory usage was reduced by allocating properly sized
send buffers for stream-based transports.

(cherry picked from commit 8672d54847)
2023-06-06 14:04:01 +02:00
Artem BoldarievandOndřej Surý 285e75b3b0 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.

(cherry picked from commit d8a5feb556)
2023-06-06 14:04:01 +02:00
Arаm Sаrgsyаn e72c92c497 Merge branch '4106-lock-order-inversion-in-resolver.c' into 'bind-9.18'
[9.18] Fix a lock-order-inversion bug in resolver.c

See merge request isc-projects/bind9!8000
2023-06-06 11:56:01 +00:00
Aram Sargsyan db45cab546 Fix a lock-order-inversion bug in resolver.c
There is a lock-order-inversion (potential deadlock) in resolver.c,
because in dns_resolver_shutdown() a resolver bucket lock is locked
while the resolver lock itself is already locked, while in
fctx_sendevents() the resolver lock is locked while a bucket lock
is locked before calling that function in fctx__done_detach().

The resolver lock/unlock in dns_resolver_shutdown() was added back in
the 317e36d47e commit to make sure that
the function is finished before the resolver object is destroyed.

Since res->exiting is atomic, it should be possible to remove the
resolver locking in dns_resolver_shutdown() and add it to the
send_shutdown_events() function which requires it.

Also, since 'res->exiting' is now set while unlocked, the 'INSIST'
in spillattimer_countdown() is wrong, and is removed.
2023-06-06 11:02:24 +00:00
Arаm Sаrgsyаn ff3d25a47f Merge branch 'aram/statschannel-spilled-clients-counter-9.18' into 'bind-9.18'
[9.18] Add ClientQuota statistics channel counter

See merge request isc-projects/bind9!7993
2023-05-31 14:51:08 +00:00
Aram Sargsyan 9a3e00478f Add a CHANGES note for [GL !7978]
(cherry picked from commit fa9172d996)
2023-05-31 11:07:08 +00:00
Aram Sargsyan b6eec9ee51 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.

(cherry picked from commit 08ebf39d1e)
2023-05-31 11:07:08 +00:00
Aram Sargsyan cd47429365 Add ClientQuota statistics channel counter
This counter indicates the number of the resolver's spilled
queries due to reaching the clients per query quota.

(cherry picked from commit 04648d7c2f)
2023-05-31 11:07:08 +00:00
Michal Nowak 56ae462f21 Merge branch 'mnowak/alpine-3.18-9.18' into 'bind-9.18'
[9.18] Add Alpine Linux 3.18

See merge request isc-projects/bind9!7994
2023-05-31 10:16:09 +00:00