Commit Graph

37972 Commits

Author SHA1 Message Date
Tom Krizek
4dcb0c67d3 Check for unset variables only after conf.sh is loaded
Make the cds/setup.sh compatible with the workaround which relies on
testing the TSAN_OPTIONS variable which may not be set.

(cherry picked from commit 76d9873ef6)
2023-06-29 13:14:33 +02:00
Tom Krizek
b94f5146a1 Fix checking for executables in shell conditions in tests
Surround the variables which are checked whether they're executable in
double quotes. Without them, empty paths won't be properly interpreted
as not executable.

(manually picked from commit 06056c44a7)
2023-06-29 13:14:26 +02:00
Tom Krizek
cfada0f62e Only use delv if available in mkeys test
Check that $DELV is an executable before using it in a test.

(cherry picked from commit 384339dbba)
2023-06-29 13:00:26 +02:00
Tom Krizek
6eeec896ef Disable delv tests under TSAN
Since delv can occasionally hang in system tests when running with TSAN
(see GL#4119), disable these tests as a workaround. Otherwise, the hung
delv process will just waste CI resources and prevent any meaningful
output from the rest of the test suite.

(cherry picked from commit fbcf37f914)
2023-06-29 13:00:24 +02:00
Mark Andrews
1eed6e28c8 Merge branch '4154-restore-the-ability-to-read-old-hmac-md5-key-pair-files-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Restore the ability to read old HMAC-MD5 key pair files."

See merge request isc-projects/bind9!8069
2023-06-29 01:38:11 +00:00
Mark Andrews
c73876fa90 Emit deprecated warning for K* file pairs
We try reading the same file using different methods so only
emit a warning if we successfully read the file.

(cherry picked from commit e3e20ed76e)
2023-06-29 10:52:48 +10:00
Mark Andrews
3db353c646 Add release note entry for [GL #4154]
(cherry picked from commit 91cb94dcbb)
2023-06-29 10:52:48 +10:00
Mark Andrews
16d6b10c5b Test legacy HMAC key files with dig
tsig-keygen is now used to generate key files for TSIG.  These have
a different format to those that were generated by dnssec-keygen.
Test that dig can still read these files.

(cherry picked from commit c91a208ef5)
2023-06-29 10:52:46 +10:00
Mark Andrews
a16e10ad8a Test support with legacy HMAC K files with nsupdate
tsig-keygen generates key files that are different to those that
where generated by dnssec-keygen.  Check that nsupdate can still
read those old format files.

(cherry picked from commit e1fb17e72c)
2023-06-29 10:41:45 +10:00
Mark Andrews
2376abc18e Restore the ability to read legacy K*+157+* files
The ability to read legacy HMAC-MD5 K* keyfile pairs using algorithm
number 157 was accidentally lost when the algorithm numbers were
consolidated into a single block, in commit
09f7e0607a.

The assumption was that these algorithm numbers were only known
internally, but they were also used in key files. But since HMAC-MD5
got renumbered from 157 to 160, legacy HMAC-MD5 key files no longer
work.

Move HMAC-MD5 back to 157 and GSSAPI back to 160.  Add exception for
GSSAPI to list_hmac_algorithms.

(cherry picked from commit 3f93d3f757)
2023-06-29 10:32:10 +10:00
Ondřej Surý
068d14a963 Merge branch '3325-strict-qname-minimisation-should-check-for-cached-nodata-for-ns-name-9.18' into 'bind-9.18'
[9.18] Use NS rather than A records for qname-minimization relaxed

See merge request isc-projects/bind9!8066
2023-06-28 11:18:41 +00:00
Mark Andrews
ae853dd2b6 Add release note for [GL #3325]
(cherry picked from commit 2a71ed47a7)
2023-06-28 12:33:18 +02:00
Mark Andrews
1e7f5eb161 Add CHANGES note for [GL #3325]
(cherry picked from commit f378e02423)
2023-06-28 12:32:50 +02:00
Mark Andrews
5739b4817a In rctx_answer return DNS_R_DELEGATION on NOFOLLOW
When DNS_FETCHOPT_NOFOLLOW is set DNS_R_DELEGATION needs to be
returned to restart the resolution process rather than converting
it to ISC_R_SUCCESS.

(cherry picked from commit ea11650376)
2023-06-28 12:32:26 +02:00
Mark Andrews
7f2eeb60ee Skip some QNAME mininisation queries if possible
If we know that the NS RRset for an intermediate label doesn't exist
on cache contents don't query using that name when looking for a
referral.

(cherry picked from commit 80bc0ee075)
2023-06-28 12:32:23 +02:00
Mark Andrews
b3a97da7a7 Use NS rather than A records for qname-minimization relaxed
Remove all references to DNS_FETCHOPT_QMIN_USE_A and adjust
the expected tests results in the qmin system test.

(cherry picked from commit dd00b3c50b)
2023-06-28 12:31:49 +02:00
Mark Andrews
0eb73bb6a3 Merge branch '4047-assertion-failure-in-dns_resolver_attach-at-resolver-c-10599' into 'bind-9.18'
Resolve "Assertion failure in dns_resolver_attach() at resolver.c:10599"

See merge request isc-projects/bind9!8045
2023-06-27 06:53:41 +00:00
Mark Andrews
0d3693f08f Remove unnecessary REQUIRE in dns_resolver_attach
There is no harm in aquiring an additional reference to the resolver
after it has started shutting down.  All the REQUIRE was doing was
introducing a point of failure when shutting down the server.
2023-06-27 05:19:56 +00:00
Evan Hunt
adf199b309 Merge branch '950-test-validation-bind-9.18' into 'bind-9.18'
[9.18] explicitly set dnssec-validation in system tests

See merge request isc-projects/bind9!8063
2023-06-27 00:18:29 +00:00
Evan Hunt
a31dd61b0f explicitly set dnssec-validation in system tests
the default value of dnssec-validation is 'auto', which causes
a server to send a key refresh query to the root zone when starting
up. this is undesirable behavior in system tests, so this commit
sets dnssec-validation to either 'yes' or 'no' in all tests where
it had not previously been set.

this change had the mostly-harmless side effect of changing the cached
trust level of unvalidated answer data from 'answer' to 'authanswer',
which caused a few test cases in which dumped cache data was examined in
the serve-stale system test to fail. those test cases have now been
updated to expect 'authanswer'.

(cherry picked from commit 0b09ee8cdc)
2023-06-26 15:03:06 -07:00
Ondřej Surý
f6ee78c61a Merge branch '4049-detect-formerr-with-an-echoed-dns-cookie-client-cookie-and-retry-without-dns-cookie-9.18' into 'bind-9.18'
[9.18] Handle FORMERR on unknown EDNS option that are echoed

See merge request isc-projects/bind9!8061
2023-06-26 17:05:44 +00:00
Michał Kępień
74ef08a7b5 Add release note for #4049
(cherry picked from commit 466530c73b)
2023-06-26 18:52:37 +02:00
Mark Andrews
20db7497b1 Add CHANGES note for [GL #4049]
(cherry picked from commit 97e1bb0e98)
2023-06-26 16:36:36 +02:00
Mark Andrews
b19bb84116 Check fallback on FORMERR to EDNS options
(cherry picked from commit 9d95cd427d)
2023-06-26 16:36:11 +02:00
Mark Andrews
d65feb0796 Add a server which returns FORMERR to all EDNS options
The server also echoes back the EDNS options and EDNS flags.

(cherry picked from commit 3328ddaf7a)
2023-06-26 16:36:11 +02:00
Mark Andrews
e7e29278a8 Handle FORMERR on unknown EDNS option that are echoed
If the resolver received a FORMERR response to a request with
an DNS COOKIE option present that echoes the option back, resend
the request without an DNS COOKIE option present.

(cherry picked from commit f3b24ba789)
2023-06-26 16:36:11 +02:00
Tom Krizek
a0d672f0c5 Merge branch 'tkrizek-system-test-fixes-9.18' into 'bind-9.18'
[9.18] Fix a couple of oversights in system tests

See merge request isc-projects/bind9!8056
2023-06-26 14:27:09 +00:00
Tom Krizek
ad5006cef4 Check for proper file size output in dnstap test
Previously, the first check silently failed, as 450 is apparently (in
the CI setup) the minimum output size for the dnstap output, rather than
470 which the test was expecting. Effectively, the check served as a 5
second sleep rather than waiting for the proper file size.

Additionally, check the expected file sizes and fail if expectations
aren't met.

(manually picked from commit 5f809e50b6)

On main, the minimum file size seems to 454 bytes, while on EL7 in our
CI setup for the 9.18 branch, it appears to be 450 instead.
2023-06-26 14:36:55 +02:00
Tom Krizek
d1caa0b4f0 Check for proper log message in kasp test
The log message is supposed to contain the zone name which was
erroneously omitted, but didn't pop up during tests, since return code
was silently ignored.

Now it actually waits for the proper log message rather than being an
equivalent of 3 second sleep (which was also sufficient to make the test
pass, thus we detected no failure).

(cherry picked from commit 1dd4c2b9e2)
2023-06-26 13:07:29 +02:00
Michal Nowak
d527fca768 Merge tag 'v9.18.16' into bind-9.18
BIND 9.18.16
2023-06-21 19:51:22 +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 Veil
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