2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

39719 Commits

Author SHA1 Message Date
Ondřej Surý
5bd9343c4e
Remove the explicit call_rcu thread creating and destruction
The free_all_cpu_call_rcu_data() call can consume hundreds of
milliseconds on shutdown.  Don't try to be smart and let the RCU library
handle this internally.
2023-06-27 07:59:00 +02:00
Evan Hunt
bcda40db48 Merge branch '950-test-validation' into 'main'
explicitly set dnssec-validation in system tests

Closes #950

See merge request isc-projects/bind9!7999
2023-06-26 21:59:06 +00:00
Evan Hunt
0b09ee8cdc 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'.
2023-06-26 13:41:56 -07:00
Tom Krizek
73b09653d4 Merge branch 'tkrizek-system-test-fixes' into 'main'
Fix a couple of oversights in system tests

See merge request isc-projects/bind9!8051
2023-06-26 11:06:36 +00:00
Tom Krizek
5f809e50b6
Check for proper file size output in dnstap test
Previously, the first check silently failed, as 454 is apparently (in my
local 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.
2023-06-22 19:19:08 +02:00
Tom Krizek
1dd4c2b9e2
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).
2023-06-22 19:19:05 +02:00
Tom Krizek
d437b7043a Merge branch 'tkrizek-forward-test-echo-i' into 'main'
Fix echo_i typo in forward test

See merge request isc-projects/bind9!8050
2023-06-22 17:15:50 +00:00
Tom Krizek
946d3131fa
Fix echo_i typo in forward test 2023-06-22 19:12:46 +02:00
Michal Nowak
71439d0c3a BIND 9.19.14
-----BEGIN SSH SIGNATURE-----
 U1NIU0lHAAAAAQAAARcAAAAHc3NoLXJzYQAAAAMBAAEAAAEBANamVSTMToLcHCXRu1f52e
 tTJWV3T1GSVrPYXwAGe6EVC7m9CTl06FZ9ZG/ymn1S1++dk4ByVZXf6dODe2Mu0RuqGmyf
 MUEMKXVdj3cEQhgRaMjBXvIZoYAsQlbHO2BEttomq8PhrpLRizDBq4Bv2aThM0XN2QqSGS
 ozwYMcPiGUoMVNcVrC4ZQ+Cptb5C4liqAcpRqrSo8l1vcNg5b1Hk6r7NFPdx542gsGMLae
 wZrnKn3LWz3ZXTGeK2cRmBxm/bydiVSCsc9XjB+tWtIGUpQsfaXqZ7Hs6t+1f1vsnu88oJ
 oi1dRBo3YNRl49UiCukXWayQrPJa8wwxURS9W28JMAAAADZ2l0AAAAAAAAAAZzaGE1MTIA
 AAEUAAAADHJzYS1zaGEyLTUxMgAAAQAu10jzUEy+7ZqX04XsavbHCyBwIB35UXbDL4NdRR
 wxRd/9Fjid0bCKw87eWzf1xpJWjeVDHIiMFLVpMwizh63vZ2l2YqgU6hTjSqficY+KH8FQ
 xY4Vi3RlERGbe/HEy0elmXA1NL0WAlVfl/2obdS/cbOCQU8tozjUOWwHS7tKZAmAErJUyT
 vjPjwBkW1crAO6iM7DrzGe8Hy+1FFCpJzp1mAp7YHc7qD2eguRdNWe88UOb2Rq/vZz3YPJ
 6xj5LgqIr5QmzEli31GkDdqNFAdikZWvGKViYMIo4aFw/+agnn3QrnMcskUPESoY65IIT0
 FFa6kgzLQmCQqqopY98Byl
 -----END SSH SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
 U1NIU0lHAAAAAQAAARcAAAAHc3NoLXJzYQAAAAMBAAEAAAEBANamVSTMToLcHCXRu1f52e
 tTJWV3T1GSVrPYXwAGe6EVC7m9CTl06FZ9ZG/ymn1S1++dk4ByVZXf6dODe2Mu0RuqGmyf
 MUEMKXVdj3cEQhgRaMjBXvIZoYAsQlbHO2BEttomq8PhrpLRizDBq4Bv2aThM0XN2QqSGS
 ozwYMcPiGUoMVNcVrC4ZQ+Cptb5C4liqAcpRqrSo8l1vcNg5b1Hk6r7NFPdx542gsGMLae
 wZrnKn3LWz3ZXTGeK2cRmBxm/bydiVSCsc9XjB+tWtIGUpQsfaXqZ7Hs6t+1f1vsnu88oJ
 oi1dRBo3YNRl49UiCukXWayQrPJa8wwxURS9W28JMAAAADZ2l0AAAAAAAAAAZzaGE1MTIA
 AAEUAAAADHJzYS1zaGEyLTUxMgAAAQBnBEXJLIDrP/GdkUqz7Ni02bzO5/bIppEPfUefvN
 F4Nf0ltG8Vq8IHbh9FNG2mLDXONMFc5wO7ArT5YQfLBMMrh/SQ8m3saKxXJLo7/k4sAKn1
 A4W84NkXl3anAwRcZzITwBlKEl48GJcMGWFKLpfwxmOvsy1kBX1kGgnYvQmZnunIfSBYpf
 Xh4MIZz1QIlcJDBSMe6AnYTOvvN1CSrPeWBDbG5za5qu4TdIlTSA6zcqfSw8pOOzDnVMxt
 0hD38e9mkPnpAyS2OOI0eRQ3GMMF6kRY7F7elc6zVbG+PeoJOKBx79IoBe4fUq/632Husi
 OmT32VXIIEEkejnr0gxENA
 -----END SSH SIGNATURE-----

Merge tag 'v9.19.14'

BIND 9.19.14
2023-06-21 19:31:57 +02:00
Arаm Sаrgsyаn
1bdec05d69 Merge branch '4044-placeholder' into 'main'
Add a CHANGES placeholder for [GL #4044]

See merge request isc-projects/bind9!8046
2023-06-20 10:20:43 +00:00
Aram Sargsyan
33a005e23c Add a CHANGES placeholder for [GL #4044] 2023-06-20 10:13:12 +00:00
Michał Kępień
f4f1d6fddf Merge branch '2354-add-a-tool-for-reproducing-isc-spnego-bugs' into 'main'
[CVE-2020-8625] [CVE-2021-25216] Add a tool for reproducing ISC SPNEGO bugs

Closes #2354

See merge request isc-projects/bind9!7574
2023-06-19 09:06:56 +00:00
Michał Kępień
a47dc810f7
Add a tool for reproducing ISC SPNEGO bugs
Extend the "tsiggss" system test with reproducers for CVE-2020-8625 and
CVE-2021-25216.
2023-06-19 09:20:03 +02:00
Tony Finch
5f9790feca Merge branch '4126-statschannel-connection-close-keepalive' into 'main'
Improve statschannel HTTP Connection: header logic

See merge request isc-projects/bind9!8014
2023-06-15 16:03:51 +00:00
Tony Finch
e18ca83a3b Improve statschannel HTTP Connection: header protocol conformance
In HTTP/1.0 and HTTP/1.1, RFC 9112 section 9.6 says the last response
in a connection should include a `Connection: close` header, but the
statschannel server omitted it.

In an HTTP/1.0 response, the statschannel server can sometimes send a
`Connection: keep-alive` header when it is about to close the
connection. There are two ways:

If the first request on a connection is keep-alive and the second
request is not, then _both_ responses have `Connection: keep-alive`
but the connection is (correctly) closed after the second response.

If a single request contains

	Connection: close
	Connection: keep-alive

then RFC 9112 section 9.3 says the keep-alive header is ignored, but
the statschannel sends a spurious keep-alive in its response, though
it correctly closes the connection.

To fix these bugs, make it more clear that the `httpd->flags` are part
of the per-request-response state. The Connection: flags are now
described in terms of the effect they have instead of what causes them
to be set.
2023-06-15 17:03:09 +01:00
Michał Kępień
a0efcf0e58 Merge branch '4150-fix-entity-renumbering-in-parse_tsan.py' into 'main'
Fix entity renumbering in util/parse_tsan.py

Closes #4150

See merge request isc-projects/bind9!8037
2023-06-15 14:18:30 +00:00
Michał Kępień
7f0790c82f 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.
2023-06-15 16:17:14 +02:00
Ondřej Surý
f22046d61b Merge branch '4149-make-isc_result-tables-more-compact' into 'main'
Make isc_result tables smaller

Closes #4149

See merge request isc-projects/bind9!8034
2023-06-15 13:46:52 +00:00
Ondřej Surý
0a35c0da9b
Add CHANGES note for [GL #4149] 2023-06-15 15:32:24 +02:00
Ondřej Surý
a8e6c3b8f7
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.
2023-06-15 15:32:04 +02:00
Ondřej Surý
b53d1d7069
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.
2023-06-15 15:32:04 +02:00
Tom Krizek
189aadbab9 Merge branch 'tkrizek/ci-system-clang-tsan-disallow-failure' into 'main'
Mark CI failure of system:clang:tsan as an error again

See merge request isc-projects/bind9!8035
2023-06-15 11:09:48 +00:00
Tom Krizek
e556097e81
Mark CI failure of system:clang:tsan as an error again
Both the issues causing frequent failures have been resolved. The job
seems to have stabilized and there's no longer a need to mark the
failure as a mere warnings.
2023-06-15 13:09:18 +02:00
Arаm Sаrgsyаn
14d4bf9136 Merge branch '4132-catz-data-race-in-db.c' into 'main'
Fix a data race between the dns_zone and dns_catz modules

Closes #4132

See merge request isc-projects/bind9!8031
2023-06-15 09:50:15 +00:00
Aram Sargsyan
f73007afe7 Add a CHANGES note for [GL #4132] 2023-06-15 08:50:04 +00:00
Aram Sargsyan
6f1f5fc307 Fix a data race between the dns_zone and dns_catz modules
The dns_zone_catz_enable_db() and dns_zone_catz_disable_db()
functions can race with similar operations in the catz module
because there is no synchronization between the threads.

Add catz functions which use the view's catalog zones' lock
when registering/unregistering the database update notify callback,
and use those functions in the dns_zone module, instead of doing it
directly.
2023-06-15 08:49:20 +00:00
Tony Finch
68cfbd2bd1 Merge branch '4134-zonefile-erofs' into 'main'
Translate POSIX errorcode EROFS to ISC_R_NOPERM

Closes #4134

See merge request isc-projects/bind9!8017
2023-06-14 12:44:54 +00:00
Tony Finch
82401f0f0e 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]
2023-06-14 13:13:39 +01:00
Midnight Veil
dd6acc1cac 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.
2023-06-14 13:12:45 +01:00
Mark Andrews
06bbe6a2db Merge branch '4021-tsan-error-view-adb-detached-too-early' into 'main'
Resolve "TSAN error: view->adb detached too early."

Closes #4021

See merge request isc-projects/bind9!8016
2023-06-14 10:36:08 +00:00
Mark Andrews
0da3370642 Add CHANGES note for [GL #4021] 2023-06-14 19:22:00 +10:00
Mark Andrews
971f49b3ad Use RCU for view->adb access
view->adb may be referenced while the view is shutting down as the
zone uses a weak reference to the view and examines view->adb but
dns_view_detach call dns_adb_detach to clear view->adb.
2023-06-14 19:21:28 +10:00
Evan Hunt
984decc563 Merge branch 'each-tsig-refactoring' into 'main'
TSIG/TKEY refactoring

See merge request isc-projects/bind9!7828
2023-06-14 08:14:47 +00:00
Evan Hunt
885c132f4a improve code flow
the code in dns_tkey_processquery() was unnecessarily hard to follow.
2023-06-14 08:14:38 +00:00
Evan Hunt
f4084ff543 minor tkey-related fixups
- style fixes and general tidying-up in tkey.c
- remove the unused 'intoken' parameter from dns_tkey_buildgssquery()
- remove an unnecessary call to dns_tkeyctx_create() in ns_server_create()
  (the TKEY context that was created there would soon be destroyed and
  another one created when the configuration was loaded).
2023-06-14 08:14:38 +00:00
Evan Hunt
96e8b0e782 rename 'ret' to 'result'
purely to assuage my desire for consistency across modules,
result variables have been renamed to 'result' as they are
throughout most of BIND. there are no other changes.
2023-06-14 08:14:38 +00:00
Evan Hunt
6105a7d360 convert TSIG keyring storage from RBT to hash table
since it is not necessary to find partial matches when looking
up names in a TSIG keyring, we can use a hash table instead of
an RBT to store them.

the tsigkey object now stores the key name as a dns_fixedname
rather than allocating memory for it.

the `name` parameter to dns_tsigkeyring_add() has been removed;
it was unneeded since the tsigkey object already contains a copy
of the name.

the opportunistic cleanup_ring() function has been removed;
it was only slowing down lookups.
2023-06-14 08:14:38 +00:00
Evan Hunt
e64b44a5cb remove dns__tsig_algallocated()
this function was no longer needed, because the algorithm name is no
longer copied into the tsigkey object by dns_tsigkey_createfromkey();
it's always just a pointer to a statically defined name.
2023-06-14 08:14:38 +00:00
Evan Hunt
f2d5782e89 get_key_struct() can no longer fail
remove checks for NULL return values.
2023-06-14 08:14:38 +00:00
Evan Hunt
ffacf0aec6 use algorithm number instead of name to create TSIG keys
the prior practice of passing a dns_name containing the
expanded name of an algorithm to dns_tsigkey_create() and
dns_tsigkey_createfromkey() is unnecessarily cumbersome;
we can now pass the algorithm number instead.
2023-06-14 08:14:38 +00:00
Evan Hunt
a6e187a8d5 further dns_tsigkey API tweaks
- remove the 'ring' parameter from dns_tsigkey_createfromkey(),
  and use dns_tsigkeyring_add() to add key objects to a keyring instead.
- add a magic number to dns_tsigkeyring_t
- change dns_tsigkeyring_dumpanddetach() to dns_tsigkeyring_dump();
  we now call dns_tsigkeyring_detach() separately.
- remove 'maxgenerated' from dns_tsigkeyring_t since it never changes.
2023-06-14 08:14:38 +00:00
Evan Hunt
404a13b4dd clean up reference counting in dns_tsigkey
the reference counter in dns_tsigkey was being computed differently
depending on whether there was a keyring or not. this is prone to
error.
2023-06-14 08:14:38 +00:00
Evan Hunt
6fa8524bba use ISC_REFCOUNT_IMPL for dns_tsigkey and dns_tsigkeyring
use the ISC_REFCOUNT attach/detach implementation in dns/tsig.c
so that detailed tracing can be used during refactoring.

dns_tsig_keyring_t has been renamed dns_tsigkeyring_t so the type
and the attach/detach function names will match.
2023-06-14 08:14:38 +00:00
Evan Hunt
b1db1c1475 minor tsig.c cleanups
- style cleanups.
- simplify the function parameters to dns_tsigkey_create():
  + remove 'restored' and 'generated', they're only ever set to false.
  + remove 'creator' because it's only ever set to NULL.
  + remove 'inception' and 'expiry' because they're only ever set to
    (0, 0) or (now, now), and either way, this means "never expire".
  + remove 'ring' because we can just use dns_tsigkeyring_add() instead.
- rename dns_keyring_restore() to dns_tsigkeyring_restore() to match the
  rest of the functions operating on dns_tsigkeyring objects.
2023-06-14 08:14:38 +00:00
Matthijs Mekking
dc71aab358 Merge branch '4141-find-zone_keys' into 'main'
Update find_zone_keys for dynamic update

Closes #4141

See merge request isc-projects/bind9!8029
2023-06-14 08:05:55 +00:00
Matthijs Mekking
e59c6a5adc Update findzonekeys function name in log message
The "dns_dnssec_findzonekeys2" log message is a leftover from when that
was the name of the function. Rename to match the current name of the
function.
2023-06-14 09:08:56 +02:00
Matthijs Mekking
5cf91728d1 Add dynamic update prepub and doubleksk test case
Add two test cases for zones that use auto-dnssec, but not
inline-signing, and make sure that the change for find_zone_keys()
do not affect introducing a new key that is intended for signing.

See note https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/7638#note_355944
2023-06-14 09:08:56 +02:00
Matthijs Mekking
5c9a7ffbdb Add CHANGES for find_zone_keys() function update
Probably a useful point in history.
2023-06-14 09:08:56 +02:00
Matthijs Mekking
88e5bc0687 Update find_zone_keys for dynamic update
The find_zone_keys() function was not working properly for
inline-signed zones. It only worked if the DNSKEY records were also
published in the unsigned version of the zone. But this is not the
case when you use dnssec-policy, the DNSKEY records will only occur
in the signed version of the zone. Therefor, when looking for keys
to sign the zone, only the newly added keys in the dynamic update
were found (which could be zero), ignoring existing keys.

Also, if a DNSKEY was added, it would try to sign the zone with just
this new key, and this would only work if the key files for that key
were imported into the key-directory.

This is a design error, because the goal is to sign the zone with the
keys for which we actually have key files for. So instead of looking
for DNSKEY records to then search for the matching key files, call
dns_dnssec_findmatchingkeys() which just looks for the keys we have
on disk for the given zone. It will also set the correct DNSSEC
signing hints.
2023-06-14 09:08:56 +02:00
Matthijs Mekking
cda1ae69ac Add log check in multisigner system test
When we add DNSKEY records via dynamic update, this should no longer
trigger signing the zone with these keys. This currently happens when
'find_zone_keys()' looks up the keys by inspecting the DNSKEY RRset,
then attempting to read the corresponding key files.

Add checks that inspect the logs whether an attempt to read the key
files for the newly added keys was done (and failed because these files
are not available).
2023-06-14 09:08:56 +02:00