Commit Graph

35840 Commits

Author SHA1 Message Date
Michał Kępień
83eaff2851 Merge branch 'michal/regenerate-man-pages-with-sphinx-4.5.0-v9_18' into 'v9_18'
[v9_18] Regenerate man pages with Sphinx 4.5.0

See merge request isc-projects/bind9!6160
2022-04-22 11:21:11 +00:00
Michał Kępień
c1ba7c685d Regenerate man pages with Sphinx 4.5.0
The Debian 11 (bullseye) Docker image, which GitLab CI uses for building
documentation, currently contains the following package versions:

  - Sphinx 4.5.0
  - sphinx-rtd-theme 1.0.0
  - docutils 0.17.1

Regenerate the man pages to match contents produced in a Sphinx
environment using the above package versions.  This is necessary to
prevent the "docs" GitLab CI job from failing.

(cherry picked from commit e80ce6cfe2)
2022-04-22 13:11:35 +02:00
Michał Kępień
ccea861632 Merge branch '3297-fix-a-pylint-2.13.7-error-v9_18' into 'v9_18'
[v9_18] Fix a PyLint 2.13.7 error

See merge request isc-projects/bind9!6151
2022-04-22 10:34:57 +00:00
Michał Kępień
fd1f39fe59 Fix a PyLint 2.13.7 error
PyLint 2.13.7 reports the following error:

    bin/tests/system/doth/conftest.py:34:28: E0601: Using variable 'stderr' before assignment (used-before-assignment)

The reason the current code has not caused problems before is that
invoking gnutls-cli with just the --logfile=/dev/null argument causes it
to always return with a non-zero exit code, either due to the option not
being supported or due to the hostname argument not being provided.  In
other words, the 'except' branch has always been taken.  PyLint is
obviously right on a syntactical level, though.

Instead of relying on a less than obvious code flow (where the 'except'
branch is always taken), rework the flagged code by employing
subprocess.run(..., check=False) instead of subprocess.check_output(),
making exception handling redundant.

While this issue was investigated, it was also noticed that
subprocess.check_output() was incorrectly used as a context manager:
Popen objects are context managers, but subprocess.check_output() and
subprocess.run() are not.  Fix by dropping the relevant 'with'
statement.

(cherry picked from commit 3f5318f094)
2022-04-22 12:14:50 +02:00
Michał Kępień
f8d17c6263 Fix "digdelv" system test requirements
Commit f64cd23e7b added a Python-based
name server (bin/tests/system/digdelv/ans8/ans.py) to the "digdelv"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "digdelv" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.

(cherry picked from commit aaa0223752)
2022-04-22 12:14:50 +02:00
Michał Kępień
1735e589d1 Require Python 3.6+ for running Python-based tests
configure.ac currently requires Python 3.4 for running Python-based
system tests.  Meanwhile, there are some features in Python 3.6+ that we
would like to use for making our Python code cleaner (e.g. f-strings).
Update the minimum Python version required for running Python-based
system tests to 3.6, noting that:

  - Python 3.4 has reached end-of-life on March 18th, 2019.
  - Python 3.5 has reached end-of-life on September 5th, 2020.

(cherry picked from commit beaaa7f4e2)
2022-04-22 12:14:50 +02:00
Michał Kępień
0f59e1e270 Merge branch '3287-prevent-memory-bloat-caused-by-a-jemalloc-quirk-v9_18' into 'v9_18'
[v9_18] Prevent memory bloat caused by a jemalloc quirk

See merge request isc-projects/bind9!6153
2022-04-21 12:42:06 +00:00
Michał Kępień
5e4855a25d Add CHANGES entry for GL #3287
(cherry picked from commit e33aef4e39)
2022-04-21 14:22:13 +02:00
Michał Kępień
2da371d005 Prevent memory bloat caused by a jemalloc quirk
Since version 5.0.0, decay-based purging is the only available dirty
page cleanup mechanism in jemalloc.  It relies on so-called tickers,
which are simple data structures used for ensuring that certain actions
are taken "once every N times".  Ticker data (state) is stored in a
thread-specific data structure called tsd in jemalloc parlance.  Ticks
are triggered when extents are allocated and deallocated.  Once every
1000 ticks, jemalloc attempts to release some of the dirty pages hanging
around (if any).  This allows memory use to be kept in check over time.

This dirty page cleanup mechanism has a quirk.  If the first
allocator-related action for a given thread is a free(), a
minimally-initialized tsd is set up which does not include ticker data.
When that thread subsequently calls *alloc(), the tsd transitions to its
nominal state, but due to a certain flag being set during minimal tsd
initialization, ticker data remains unallocated.  This prevents
decay-based dirty page purging from working, effectively enabling memory
exhaustion over time. [1]

The quirk described above has been addressed (by moving ticker state to
a different structure) in jemalloc's development branch [2], but not in
any numbered jemalloc version released to date (the latest one being
5.2.1 as of this writing).

Work around the problem by ensuring that every thread spawned by
isc_thread_create() starts with a malloc() call.  Avoid immediately
calling free() for the dummy allocation to prevent an optimizing
compiler from stripping away the malloc() + free() pair altogether.

An alternative implementation of this workaround was considered that
used a pair of isc_mem_create() + isc_mem_destroy() calls instead of
malloc() + free(), enabling the change to be fully contained within
isc__trampoline_run() (i.e. to not touch struct isc__trampoline), as the
compiler is not allowed to strip away arbitrary function calls.
However, that solution was eventually dismissed as it triggered
ThreadSanitizer reports when tools like dig, nsupdate, or rndc exited
abruptly without waiting for all worker threads to finish their work.

[1] https://github.com/jemalloc/jemalloc/issues/2251
[2] c259323ab3

(cherry picked from commit 7aa7b6474b)
2022-04-21 14:22:13 +02:00
Michał Kępień
0deec48487 Merge tag 'v9_18_2' into v9_18
BIND 9.18.2
2022-04-21 09:44:56 +02:00
Tony Finch
05c88b18da Merge branch '3275-notify-test-fix-v9_18' into 'v9_18'
Avoid timeouts in the notify system test (backport to 9.18)

See merge request isc-projects/bind9!6143
2022-04-20 17:12:36 +00:00
Tony Finch
037223211c Use wait_for_log_re in the autosign system test
Fix another occurrence of the mistake of passing a regex to
wait_for_log by using the new wait_for_log_re instead.

(cherry picked from commit f4c2909353)
2022-04-20 17:51:40 +01:00
Tony Finch
19cf15313c Avoid timeouts in the notify system test
There were two problems in the notify system test when it waited for
log messages to appear: the shellcheck refactoring introduced a call
to `wait_for_log` with a regex, but `wait_for_log` only supports fixed
strings, so it always ran for the full 45 second timeout; and the new
test to ensure that notify messages time out failed to reset the
nextpart pointer, so if the notify messages timed out before the test
ran, it would fail to see them.

This change adds a `wait_for_log_re` helper that matches a regex, and
uses it where appropriate in the notify system test, which stops the
test from waiting longer than necessary; and it resets the nextpart
pointer so that the notify timeout test works reliably.

Closes #3275

(cherry picked from commit 4a30733ae5)
2022-04-20 17:51:40 +01:00
Mark Andrews
e618bdd2df Merge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called-rdataset-v9_18' into 'v9_18'
Check that pending negative cache entries for DS can be used successfully

See merge request isc-projects/bind9!6135
2022-04-19 00:05:39 +00:00
Mark Andrews
b66e00f73a Add CHANGES entry for [GL #3279]
(cherry picked from commit 14ca6270d3)
2022-04-19 09:44:09 +10:00
Mark Andrews
40bfb70d6a Update the rdataset->trust field in ncache.c:rdataset_settrust
Both the trust recorded in the slab stucture and the trust on
rdataset need to be updated.

(cherry picked from commit d043a41499)
2022-04-19 09:44:09 +10:00
Mark Andrews
b597ea863e Check that pending negative cache entries for DS can be used successfully
Prime the cache with a negative cache DS entry then make a query for
name beneath that entry. This will cause the DS entry to be retieved
as part of the validation process.  Each RRset in the ncache entry
will be validated and the trust level for each will be updated.

(cherry picked from commit d2d9910da2)
2022-04-19 09:44:09 +10:00
Evan Hunt
230b2b8c56 Merge branch '3235-dig-exitcode-v9_18' into 'v9_18'
ensure dig sets exitcode after local UDP connection failure

See merge request isc-projects/bind9!6134
2022-04-15 18:10:08 +00:00
Evan Hunt
5739f13063 CHANGES for [GL #3235]
(cherry picked from commit d646aca282)
2022-04-15 11:08:46 -07:00
Evan Hunt
50dc4f1587 ensure dig sets exitcode after local UDP connection failure
dig previously set an exit code of 9 when a TCP connection failed
or when a UDP connection timed out, but when the server address is
localhost it's possible for a UDP query to fail with ISC_R_CONNREFUSED.
that code path didn't update the exit code, causing dig to exit with
status 0. we now set the exit code to 9 in this failure case.

(cherry picked from commit 4eee6460ff)
2022-04-15 11:08:46 -07:00
Arаm Sаrgsyаn
94d2d349d2 Merge branch '3223-catz-change-of-ownership-aka-coo-support-v9_18' into 'v9_18'
[v9_18] [3/5] Implement catalog zones change of ownership (coo) support

See merge request isc-projects/bind9!6133
2022-04-14 22:48:48 +00:00
Aram Sargsyan
546732546f Do not use REQUIRE in dns_catz_entry_detach() after other code
The REQUIRE checks should be at the top of the function before
any assignments or code.

Move the REQUIRE check to the top.

(cherry picked from commit 99d1ec6c4b)
2022-04-14 20:53:59 +00:00
Aram Sargsyan
5037aeb5d2 Replace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES
Update the enum entry in the continued effort of replacing some
DNS terminology.

(cherry picked from commit 59c486391d)
2022-04-14 20:53:53 +00:00
Aram Sargsyan
c5d523d8e9 Add CHANGES note for [GL #3223]
(cherry picked from commit 1c33dbd27d)
2022-04-14 20:53:46 +00:00
Aram Sargsyan
c37a75df5d Implement catalog zones change of ownership (coo) support
Catalog zones change of ownership is special mechanism to facilitate
controlled migration of a member zone from one catalog to another.

It is implemented using catalog zones property named "coo" and is
documented in DNS catalog zones draft version 5 document.

Implement the feature using a new hash table in the catalog zone
structure, which holds the added "coo" properties for the catalog zone
(containing the target catalog zone's name), and the key for the hash
table being the member zone's name for which the "coo" property is being
created.

Change some log messages to have consistent zone name quoting types.

Update the ARM with change of ownership documentation and usage
examples.

Add tests which check newly the added features.

(cherry picked from commit bb837db4ee)
2022-04-14 20:53:31 +00:00
Arаm Sаrgsyаn
1a9dc2fcad Merge branch '3222-catz-options-new-syntax-based-on-custom-properties-v9_18' into 'v9_18'
[v9_18] [2/5] Implement catalog zones options new syntax based on custom properties

See merge request isc-projects/bind9!6132
2022-04-14 20:27:54 +00:00
Aram Sargsyan
581d7bece0 Do not cancel processing record datasets in catalog zone after an error
When there are multiple record datasets in a database node of a catalog
zone, and BIND encounters a soft error during processing of a dataset,
it breaks from the loop and doesn't process the other datasets in the
node.

There are cases when this is not desired. For example, the catalog zones
draft version 5 states that there must be a TXT RRset named
`version.$CATZ` with exactly one RR, but it doesn't set a limitation
on possible non-TXT RRsets named `version.$CATZ` existing alongside
with the TXT one. In case when one exists, we will get a processing
error and will not continue the loop to process the TXT RRset coming
next.

Remove the "break" statement to continue processing all record datasets.

(cherry picked from commit 0b2d5490cd)
2022-04-14 19:51:45 +00:00
Aram Sargsyan
d8e1f51a04 Process the 'version' record of the catalog zone first
When processing a new or updated catalog zone, the record datasets
from the database are being processed in order. This creates a
problem because we need to know the version of the catalog zone
schema to process some of the records differently, but we do not
know the version until the 'version' record gets processed.

Find the 'version' record and process it first, only then iterate over
the database to process the rest, making sure not to process the
'version' record twice.

(cherry picked from commit 6035980bb1)
2022-04-14 19:51:37 +00:00
Aram Sargsyan
3e07e505b0 Add CHANGES note for [GL #3222]
(cherry picked from commit 321c93c05d)
2022-04-14 19:51:30 +00:00
Aram Sargsyan
f75c39811d Implement catalog zones options new syntax based on custom properties
According to DNS catalog zones draft version 5 document, catalog
zone custom properties must be placed under the "ext" label.

Make necessary changes to support the new custom properties syntax in
catalog zones with version "2" of the schema.

Change the default catalog zones schema version from "1" to "2" in
ARM to prepare for the new features and changes which come starting
from this commit in order to support the latest DNS catalog zones draft
document.

Make some restructuring in ARM and rename the term catalog zone "option"
to "custom property" to better reflect the terms used in the draft.

Change the version of 'catalog1.zone.' catalog zone in the "catz" system
test to "2", and leave the version of 'catalog2.zone.' catalog zone at
version "1" to test both versions.

Add tests to check that the new syntax works only with the new schema
version, and that the old syntax works only with the legacy schema
version catalog zones.

(cherry picked from commit cedfebc64a)
2022-04-14 19:51:22 +00:00
Arаm Sаrgsyаn
55dd09098f Merge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes-v9_18' into 'v9_18'
[v9_18] Unify dig +nssearch next query starting code for TCP and UDP protocols

See merge request isc-projects/bind9!6130
2022-04-14 11:30:43 +00:00
Aram Sargsyan
c97b23a152 Add CHANGES note for [GL #3144]
(cherry picked from commit 2a9867d512)
2022-04-14 09:40:59 +00:00
Evan Hunt
7c0ef393d8 detach unfinished query when canceling
when a query was canceled while still in the process of connecting,
tcp_connected() and udp_ready() didn't detach the query object.

(cherry picked from commit 6bf8535542)
2022-04-14 09:40:50 +00:00
Aram Sargsyan
7683d6ce69 Unify dig +nssearch next query starting code for TCP and UDP protocols
In `+nssearch` mode `dig` starts the next query of the followup lookup
using `start_udp()` or `start_tcp()` calls without waiting for the
previous query to complete.

In UDP mode that happens in the `send_done()` callback of the previous
query, but in TCP mode that happens in the `start_tcp()` call of the
previous query (recursion) which doesn't work because `start_tcp()`
attaches the `lookup->current_query` to the query it is starting, so a
recursive call will result in an assertion failure.

Make the TCP mode to start the next query in `send_done()`, just like in
the UDP mode. During that time the `lookup->current_query` is already
detached by the `tcp_connected()`/`udp_ready()` callbacks.

(cherry picked from commit b944bf4120)
2022-04-14 09:40:37 +00:00
Matthijs Mekking
da30a638a2 Merge branch '2931-cds-delete-removed-on-signing-v9_18' into 'v9_18'
[v9_18] Don't delete CDS DELETE after zone sign

See merge request isc-projects/bind9!6126
2022-04-13 13:12:04 +00:00
Matthijs Mekking
bff9a568c8 Add CDS/CDNSKEY DELETE documentation
Mention in the DNSSEC guide in the "revert to unsigned" recipe that you
can publish CDS and CDNSKEY DELETE records to remove the corresponding
DS records from the parent zone.

(cherry picked from commit f088657eb1)
2022-04-13 14:44:25 +02:00
Matthijs Mekking
c678065eaa Add CHANGE and release note for #2931
Release note worthy.

(cherry picked from commit ebbcf4c34f)
2022-04-13 14:44:18 +02:00
Matthijs Mekking
c3ab09deb5 Update dns_dnssec_syncdelete() function
Update the function that synchronizes the CDS and CDNSKEY DELETE
records. It now allows for the possibility that the CDS DELETE record
is published and the CDNSKEY DELETE record is not, and vice versa.

Also update the code in zone.c how 'dns_dnssec_syncdelete()' is called.

With KASP, we still maintain the DELETE records our self. Otherwise,
we publish the CDS and CDNSKEY DELETE record only if they are added
to the zone. We do still check if these records can be signed by a KSK.

This change will allow users to add a CDS and/or CDNSKEY DELETE record
manually, without BIND removing them on the next zone sign.

Note that this commit removes the check whether the key is a KSK, this
check is redundant because this check is also made in
'dst_key_is_signing()' when the role is set to DST_BOOL_KSK.

(cherry picked from commit 3d05c99abb)
2022-04-13 14:43:40 +02:00
Matthijs Mekking
d975d07155 Test CDS DELETE persists after zone sign
Add a test case for a dynamically added CDS DELETE record and make
sure it is not removed when signing the zone. This happens because
BIND maintains CDS and CDNSKEY publishing and it will only allow
CDS DELETE records if the zone is transitioning to insecure. This is
a state that can be identified when using KASP through 'dnssec-policy',
but not when using 'auto-dnssec'.

(cherry picked from commit f08277f9fb)
2022-04-13 14:43:34 +02:00
Michał Kępień
4a622db88d Merge branch 'michal/fix-forward-system-test-requirements-v9_18' into 'v9_18'
[v9_18] Fix "forward" system test requirements

See merge request isc-projects/bind9!6123
2022-04-12 13:32:25 +00:00
Michał Kępień
80089f52e5 Fix "forward" system test requirements
Commit 3b3495a631 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "forward" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.

(cherry picked from commit 806f457147)
2022-04-12 15:30:31 +02:00
Michał Kępień
41ddf9ce8c Merge branch 'michal/set-up-release-notes-for-bind-9.18.3' into 'v9_18'
Set up release notes for BIND 9.18.3

See merge request isc-projects/bind9!6119
2022-04-12 12:15:07 +00:00
Michał Kępień
55221e61c0 Set up release notes for BIND 9.18.3 2022-04-12 14:13:32 +02:00
Michał Kępień
4360b7532c Merge branch 'michal/update-bind-version-to-9.18.3-dev' into 'v9_18'
Update BIND version to 9.18.3-dev

See merge request isc-projects/bind9!6115
2022-04-12 11:12:20 +00:00
Michał Kępień
09ffa6cdd2 Update BIND version to 9.18.3-dev 2022-04-12 13:11:12 +02:00
Michał Kępień
3babb1557a Update BIND version to 9.18.2 v9.18.2 2022-04-11 16:00:43 +02:00
Michał Kępień
f78abdc474 Add a CHANGES marker 2022-04-11 16:00:43 +02:00
Michał Kępień
1983c3a45a Merge branch 'michal/prepare-documentation-for-bind-9.18.2' into 'v9_18_2-release'
Prepare documentation for BIND 9.18.2

See merge request isc-private/bind9!397
2022-04-11 13:59:32 +00:00
Michał Kępień
4ec20be2ae Prepare release notes for BIND 9.18.2 2022-04-11 15:56:43 +02:00
Michał Kępień
b91083494e Add release note for miscellaneous dig fixes 2022-04-11 15:56:43 +02:00