Commit Graph

37398 Commits

Author SHA1 Message Date
Evan Hunt
61692942b8 remove named_os_gethostname()
this function was just a front-end for gethostname(). it was
needed when we supported windows, which has a different function
for looking up the hostname; it's not needed any longer.

(cherry picked from commit 197334464e)
2023-02-18 12:27:19 -08:00
Mark Andrews
833a932928 Merge branch '3879-hmac_createctx-fails-to-free-context-on-isc_hmac_init-failure-v9_18' into 'v9_18'
[9.18] Resolve "hmac_createctx fails to free context on isc_hmac_init failure"

See merge request isc-projects/bind9!7556
2023-02-18 00:50:26 +00:00
Mark Andrews
0d56344a8e In hmac_createctx free ctx on isc_hmac_init failure
(cherry picked from commit d22257a370)
2023-02-18 10:26:55 +11:00
Michal Nowak
2536012463 Merge branch 'mnowak/qa-tools-update-v9_18' into 'v9_18'
[9.18] Python formatting updates

See merge request isc-projects/bind9!7553
2023-02-17 15:32:17 +00:00
Michal Nowak
da49342f26 Fix unnecessary "else" after "raise" with pylint 2.16.2
bin/tests/system/get_algorithms.py:225:4: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)

(cherry picked from commit 8064ac6bec)
2023-02-17 16:03:30 +01:00
Michal Nowak
d89f1056df Adapt to Python scripts to black 23.1.0
(cherry picked from commit 3cd2cc6254)
2023-02-17 16:03:30 +01:00
Mark Andrews
af3c4ae900 Merge branch '3869-dig-fails-to-cleanup-openssl-references-v9_18' into 'v9_18'
[9.18] Resolve "Dig fails to cleanup OpenSSL references"

See merge request isc-projects/bind9!7542
2023-02-16 23:43:12 +00:00
Mark Andrews
cf5e81ed7b Cleanup OpenSSL reference on bad option
Another exit path that needs to be cleaned up.

(cherry picked from commit e27fc4bbc5)
2023-02-16 22:31:52 +00:00
Mark Andrews
4dfc183fbd Cleanup OpenSSL reference on bad domain name
Free/detach tsigkey and sig0key when exiting and then call
dst_lib_destroy if we have previously called dst_lib_init.  This will,
in theory, allow OPENSSL_cleanup to free all memory.

(cherry picked from commit 4c2525c418)
2023-02-16 22:31:52 +00:00
Michal Nowak
e48b6dfc61 Merge tag 'v9_18_12' into v9_18
BIND 9.18.12
2023-02-16 17:40:52 +01:00
Mark Andrews
3090062aec Merge branch 'feature/main/fips-tests-v9_18' into 'v9_18'
[9.18] FIPS tests changes for RHEL

See merge request isc-projects/bind9!7540
2023-02-15 21:56:45 +00:00
Mark Andrews
f42a203376 Add CHANGES note for [GL !7417]
(cherry picked from commit 55a6b15087)
2023-02-16 08:35:12 +11:00
Petr Menšík
0915738c46 FIPS tests changes for RHEL
Include MD5 feature detection in featuretest tool and use it in some
places. When RHEL distribution or Fedora ELN is in FIPS mode, then MD5
algorithm is unavailable completely and even hmac-md5 algorithm usage
will always fail. Work that around by checking MD5 works and if not,
skipping its usage.

Those changes were dragged as downstream patch bind-9.11-fips-tests.patch
in Fedora and RHEL.

(cherry picked from commit 6ad794a8cd)
2023-02-16 08:34:47 +11:00
Tom Krizek
d0920a91dc Merge branch '3849-relax-diff-on-dig-short-output-v9_18' into 'v9_18'
[9.18] Ignore dig errors in +short comparisons in tests

See merge request isc-projects/bind9!7532
2023-02-14 13:26:11 +00:00
Tom Krizek
df2a962284 Ignore dig errors in +short comparisons in tests
Tests using diff to compare outputs of dig +short shall ignore lines
starting with ";". In dig +short output, such lines should only be
present for errors such as network issues. Since we utilize dig's
default timeout/retry mechanisms, these transitory issues should be
ignored and only the final output should be considered during the diff
comparison.

(cherry picked from commit bd1ef66f83)
2023-02-14 13:41:06 +01:00
Arаm Sаrgsyаn
ebd49dc674 Merge branch '3866-fix-rpz-reference-counting-bug-v9_18' into 'v9_18'
[9.18] Fix RPZ reference counting error on shutdown

See merge request isc-projects/bind9!7531
2023-02-14 12:28:31 +00:00
Aram Sargsyan
e2f19d1a4b Add a CHANGES note for [GL #3866]
(cherry picked from commit a5927f1151)
2023-02-14 11:21:49 +00:00
Aram Sargsyan
aafe857e48 Fix RPZ reference counting error on shutdown
A dns_rpz_unref_rpzs() call is missing when taking the 'goto unlock;'
path on shutdown, in order to compensate for the earlier
dns_rpz_ref_rpzs() call.

Move the dns_rpz_ref_rpzs() call after the shutdown check.

(cherry picked from commit afbe63565f)
2023-02-14 11:21:40 +00:00
Arаm Sаrgsyаn
d68ef418f8 Merge branch '3735-fix-rpz-shutdown-bugs-v9_18' into 'v9_18'
[9.18] Fix shutdown and error path bugs in the rpz unit

See merge request isc-projects/bind9!7519
2023-02-14 11:19:02 +00:00
Aram Sargsyan
b236577ccf Add a CHANGES note for [GL #3735]
(cherry picked from commit 2824422e78)
2023-02-14 10:26:37 +00:00
Aram Sargsyan
c3a4e14243 Fix an error path bug in rpz.c:update_nodes()
When dns_db_createiterator() fails, 'updbit' should not be destroyed
for obvious reasons, i.e. it is NULL.

(cherry picked from commit ef4f15d2d1)
2023-02-14 10:26:37 +00:00
Aram Sargsyan
c72b19b5e8 Fix a shutdown and error path bugs in rpz.c:update_nodes()
When shutting down, or when dns_dbiterator_current() fails, 'node'
shouldn't be detached, because it is NULL at that point.

(cherry picked from commit d36728e42f)
2023-02-14 10:26:37 +00:00
Aram Sargsyan
cc4cb67149 Fix a shutdown bug in update_rpz_cb()
When shutting down, the cleanup path should not try to destroy
'newnodes', because it is NULL at that point.

Introduce another label for the "shuttingdown" scenario.

(cherry picked from commit 975d16230b)
2023-02-14 10:26:37 +00:00
Arаm Sаrgsyаn
c8206cab0b Merge branch 'aram/ondrej-eliminitate-rpzs-irefs-v9_18' into 'v9_18'
[9.18] Refactor dns_rpz unit to use single reference counting

See merge request isc-projects/bind9!7516
2023-02-14 10:24:47 +00:00
Ondřej Surý
5baf3ac3b6 Refactor dns_rpz unit to use single reference counting
The dns_rpz_zones structure was using .refs and .irefs for strong and
weak reference counting.  Rewrite the unit to use just a single
reference counting + shutdown sequence (dns_rpz_destroy_rpzs) that must
be called by the creator of the dns_rpz_zones_t object.  Remove the
reference counting from the dns_rpz_zone structure as it is not needed
because the zone objects are fully embedded into the dns_rpz_zones
structure and dns_rpz_zones_t object must never be destroyed before all
dns_rpz_zone_t objects.

The dns_rps_zones_t reference counting uses the new ISC_REFCOUNT_TRACE
capability - enable by defining DNS_RPZ_TRACE in the dns/rpz.h header.

Additionally, add magic numbers to the dns_rpz_zone and dns_rpz_zones
structures.

(cherry picked from commit 77659e7392)
2023-02-14 09:58:16 +00:00
Mark Andrews
8d01ece927 Merge branch '3662-extend-mkeys-system-test-to-handle-islands-of-trust-v9_18' into 'v9_18'
[9.18] Resolve "Extend mkeys system test to handle islands of trust"

See merge request isc-projects/bind9!7529
2023-02-14 00:25:24 +00:00
Mark Andrews
5817b3817a Add CHANGES note for [GL #3662]
(cherry picked from commit 2928f21733)
2023-02-14 10:44:39 +11:00
Mark Andrews
90aa1ba971 Add islands of trust to mkeys test
This adds an island of trust that is reachable from the root
where the trust anchors are added to island.conf.

This add an island of trust that is not reachable from the root
where the trust anchors are added to private.conf.

(cherry picked from commit 41bdb5b9fe)
2023-02-14 10:44:39 +11:00
Mark Andrews
4a7c78b290 Report the key name that failed in retry_keyfetch
When there are multiple managed trust anchors we need to know the
name of the trust anchor that is failing.  Extend the error message
to include the trust anchor name.

(cherry picked from commit fb7b7ac495)
2023-02-14 10:44:39 +11:00
Tony Finch
a0405b3511 Merge branch 'fanf-named-compilezone-stray-backtick-v9_18' into 'v9_18'
[9.18] Fix the reference to RFC 1035 in named-compilezone(1)

See merge request isc-projects/bind9!7527
2023-02-13 18:26:25 +00:00
Tony Finch
6c19848836 Fix the reference to RFC 1035 in named-compilezone(1)
There was a stray backquote

(cherry picked from commit ef1170b3fc)
2023-02-13 16:33:38 +00:00
Tom Krizek
4596017ae6 Merge branch '3848-increase-wait-time-runtime-test-v9_18' into 'v9_18'
[9.18] Increase named startup wait time for runtime test

See merge request isc-projects/bind9!7524
2023-02-13 15:33:54 +00:00
Tom Krizek
b4d01b0175 Increase named startup wait time for runtime test
Occasionally, the allotted 10 seconds for the "running" line to appear
in log after named is started proved insufficient in CI, especially
during increased load. Give named up to 60 seconds to start up to
mitigate this issue.

(cherry picked from commit b8bb4233e8)
2023-02-13 16:08:56 +01:00
Michal Nowak
3dc6296e2e Merge branch 'mnowak/pairwise-test-auth-recursive-servers-v9_18' into 'v9_18'
[9.18] Start named as auth and recursive server in pairwise

See merge request isc-projects/bind9!7523
2023-02-13 15:00:05 +00:00
Michal Nowak
e6f5b69784 Start named as auth and recursive server in pairwise
The script will start the named process configured as both an
authoritative and recursive server for each pairwise ./configure
configuration. The test is considered successful if the named process
runs until the 5-second timeout is triggered, and there is no named.lock
file present, indicating that named did not crash on shutdown.

(cherry picked from commit a708c2f93d)
2023-02-13 13:40:47 +01:00
Arаm Sаrgsyаn
28b33b72e3 Merge branch '3190-offload-rpz-updates-2nd-round-v9_18' into 'v9_18'
[9.18] Run the RPZ update as offloaded work (2-nd round)

See merge request isc-projects/bind9!7512
2023-02-13 12:31:24 +00:00
Ondřej Surý
c9028b4976 Add CHANGES and release note for [GL #3190]
(cherry picked from commit 23a4559b34)
2023-02-13 11:41:52 +00:00
Ondřej Surý
6873cc1c79 Run the RPZ update as offloaded work
Previously, the RPZ updates ran quantized on the main nm_worker loops.
As the quantum was set to 1024, this might lead to service
interruptions when large RPZ update was processed.

Change the RPZ update process to run as the offloaded work.  The update
and cleanup loops were refactored to do as little locking of the
maintenance lock as possible for the shortest periods of time and the db
iterator is being paused for every iteration, so we don't hold the rbtdb
tree lock for prolonged periods of time.

(cherry picked from commit f106d0ed2b)
2023-02-13 11:41:52 +00:00
Ondřej Surý
bb6029db64 Refactor the dns_rpz_add/delete to use local rpz copy
Previously dns_rpz_add() were passed dns_rpz_zones_t and index to .zones
array.  Because we actually attach to dns_rpz_zone_t, we should be using
the local pointer instead of passing the index and "finding" the
dns_rpz_zone_t again.

Additionally, dns_rpz_add() and dns_rpz_delete() were used only inside
rpz.c, so make them static.

(cherry picked from commit b6e885c97f)
2023-02-13 11:41:52 +00:00
Ondřej Surý
74bd205177 General cleanup of dns_rpz implementation
Do a general cleanup of lib/dns/rpz.c style:

 * Removed deprecated and unused functions
 * Unified dns_rpz_zone_t naming to rpz
 * Unified dns_rpz_zones_t naming to rpzs
 * Add and use rpz_attach() and rpz_attach_rpzs() functions
 * Shuffled variables to be more local (cppcheck cleanup)

(cherry picked from commit 840179a247)
2023-02-13 11:41:52 +00:00
Ondřej Surý
d726d3eeaf Merge branch 'pspacek/make-manin-on-dist-v9_18' into 'v9_18'
[9.18] Remove pregenerated manpages from the repo

See merge request isc-projects/bind9!7517
2023-02-10 11:36:43 +00:00
Ondřej Surý
aa996e48b5 Test the pre-generated man pages in GitLab CI
Add an extra job for a build from tarball, but without sphinx-build and
enable RUN_MAKE_INSTALL to check that man pages were generated and
installed.

Disable the RUN_MAKE_INSTALL on the systems without sphinx-build (sid).

(cherry picked from commit 8f2e1e15cc)
2023-02-10 12:05:52 +01:00
Petr Špaček
596c6f4cf7 Remove pregenerated manpages from the repo
We don't need them in the repo, it's sufficient if we pregenerate them
while preparing the tarball.  That way we don't have overhead while
modifying them but they are still available for installations without
Sphinx.

I assume that this will make rebases and cherry-picks across branches
easier, with less trial and error churn required in the CI.

It's implemented in the way that we build the manpages only when we
either have pregenerated pages available at the configure time or
sphinx-build is installed and working.

(cherry picked from commit 9110465194)
2023-02-10 12:03:56 +01:00
Michał Kępień
44c3f4e249 Merge branch '3840-avoid-libuv-with-broken-recvmmsg-v9_18' into 'v9_18'
[9.18] Avoid libuv 1.35 and 1.36 that have broken recvmmsg implementation

See merge request isc-projects/bind9!7482
2023-02-09 21:38:47 +00:00
Ondřej Surý
ac7d195859 Add CHANGES and release note for [GL #3840]
(cherry picked from commit 6fa48c963e)
2023-02-09 22:10:46 +01:00
Ondřej Surý
8d103f7bbc Enforce version drift limits for libuv
libuv support for receiving multiple UDP messages in a single system
call (recvmmsg()) has been tweaked several times between libuv versions
1.35.0 and 1.40.0.  Mixing and matching libuv versions within that span
may lead to assertion failures and is therefore considered harmful, so
try to limit potential damage be preventing users from mixing libuv
versions with distinct sets of recvmmsg()-related flags.

(cherry picked from commit 735d09bffe)
2023-02-09 22:10:46 +01:00
Ondřej Surý
3368e5f231 Avoid libuv 1.35 and 1.36 that have broken recvmmsg implementation
The implementation of UDP recvmmsg in libuv 1.35 and 1.36 is
incomplete and could cause assertion failure under certain
circumstances.

Modify the configure and runtime checks to report a fatal error when
trying to compile or run with the affected versions.

(cherry picked from commit 251f411fc3)
2023-02-09 22:10:46 +01:00
Evan Hunt
f560541efe Merge branch 'each-remove-bind9-refvar-v9_18' into 'v9_18'
[9.18] Merge branch 'each-remove-bind9-refvar' into 'main'

See merge request isc-projects/bind9!7513
2023-02-09 18:34:13 +00:00
Evan Hunt
342286ecdb remove isc_bind9 variable
isc_bind9 was a global bool used to indicate whether the library
was being used internally by BIND or by an external caller. external
use is no longer supported, but the variable was retained for use
by dyndb, which needed it only when being built without libtool.
building without libtool is *also* no longer supported, so the variable
can go away.

(cherry picked from commit 935879ed11)
2023-02-09 10:07:39 -08:00
Mark Andrews
e67adfb479 Merge branch '3857-notify-source-port-test-is-not-reliable-v9_18' into 'v9_18'
[9.18] Resolve "Notify source port test is not reliable"

See merge request isc-projects/bind9!7510
2023-02-09 09:36:47 +00:00