]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoAdd a CHANGES note for [GL #4331]
Aram Sargsyan [Wed, 27 Sep 2023 11:34:30 +0000 (11:34 +0000)] 
Add a CHANGES note for [GL #4331]

(cherry picked from commit 9c545c3513a1f78dc21e83a823041da790925158)

2 years agoDon't use an uninitialized link on an error path
Aram Sargsyan [Wed, 27 Sep 2023 11:22:43 +0000 (11:22 +0000)] 
Don't use an uninitialized link on an error path

Move the block on the error path, where the link is checked, to a place
where it makes sense, to avoid accessing an unitialized link when
jumping to the 'cleanup_query' label from 4 different places. The link
is initialized only after those jumps happen.

In addition, initilize the link when creating the object, to avoid
similar errors.

(cherry picked from commit fb7bbbd1be20632db28a928f49c4082373358b64)

2 years agoMerge branch '4316-dynamic-update-refused-shortly-after-zone-was-thawed-bind-9.18...
Mark Andrews [Tue, 26 Sep 2023 04:37:26 +0000 (04:37 +0000)] 
Merge branch '4316-dynamic-update-refused-shortly-after-zone-was-thawed-bind-9.18' into 'bind-9.18'

[9.18] Resolve "dynamic update refused shortly after zone was thawed"

See merge request isc-projects/bind9!8336

2 years agoDocument that reloading happens asynchronously
Mark Andrews [Wed, 20 Sep 2023 05:49:59 +0000 (15:49 +1000)] 
Document that reloading happens asynchronously

(cherry picked from commit e33dbd0cbd48aed7d1c1eb25fa61d8173d488d5e)

2 years agoWait for the test zone to finish re-loading
Mark Andrews [Tue, 19 Sep 2023 04:06:15 +0000 (14:06 +1000)] 
Wait for the test zone to finish re-loading

'rndc thaw' initiates asynchrous loading of all the zones
similar to 'rndc load'.  Wait for the test zone's load to
complete before testing that it is updatable again.

(cherry picked from commit 5b3238aa85ab6e1e1044ae337854e4c00664c359)

2 years agoMerge branch '4327-minor-warning-about-ctype-h-function-9.18' into 'bind-9.18'
Ondřej Surý [Fri, 22 Sep 2023 15:41:39 +0000 (15:41 +0000)] 
Merge branch '4327-minor-warning-about-ctype-h-function-9.18' into 'bind-9.18'

[9.18] Add semantic patch to explicitly cast chars to unsigned for ctype.h

See merge request isc-projects/bind9!8332

2 years agoAdd CHANGES note for [GL #4327]
Ondřej Surý [Wed, 20 Sep 2023 15:42:28 +0000 (17:42 +0200)] 
Add CHANGES note for [GL #4327]

(cherry picked from commit 0e49a8422fa54020d2d7543ab02bcd2049b4afff)

2 years agoExplicitly cast chars to unsigned chars for <ctype.h> functions
Ondřej Surý [Wed, 20 Sep 2023 15:23:28 +0000 (17:23 +0200)] 
Explicitly cast chars to unsigned chars for <ctype.h> functions

Apply the semantic patch to catch all the places where we pass 'char' to
the <ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).

(cherry picked from commit 29caa6d1f0f32002245abfa838a5eb00dd7ed4e1)

2 years agoAdd semantic patch to explicitly cast chars to unsigned for ctype.h
Ondřej Surý [Wed, 20 Sep 2023 15:23:28 +0000 (17:23 +0200)] 
Add semantic patch to explicitly cast chars to unsigned for ctype.h

Add a semantic patch to catch all the places where we pass 'char' to the
<ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).  While it generally works because the way how these
functions are constructed in the libc, it's safer to do the explicit
cast.

(cherry picked from commit 5ec65ab5d082616716c94ebff94636daf1f789ac)

2 years agoMerge branch 'mnowak/add-cve-ref-role-9.18' into 'bind-9.18'
Michał Kępień [Thu, 21 Sep 2023 12:37:29 +0000 (12:37 +0000)] 
Merge branch 'mnowak/add-cve-ref-role-9.18' into 'bind-9.18'

[9.18] Add a Sphinx role for linking CVEs to the ISC Knowledgebase

See merge request isc-projects/bind9!8326

2 years agoAdd a Sphinx role for linking CVEs to the ISC Knowledgebase
Michal Nowak [Thu, 31 Aug 2023 16:55:36 +0000 (18:55 +0200)] 
Add a Sphinx role for linking CVEs to the ISC Knowledgebase

The new :cve: Sphinx role takes a CVE number as an argument and creates
a hyperlink to the relevant ISC Knowledgebase document that might have
more up-to-date or verbose information than the relevant release note.
This makes reaching ISC Knowledgebase pages directly from the release
notes easier.

Make all CVE references in the release notes use the new Sphinx role.

(cherry picked from commit 41b857e567647bd71d63f3523652fc3974ac0789)

2 years agoMerge branch 'michal/update-sphinx-and-sphinx_rtd_theme-9.18' into 'bind-9.18'
Michał Kępień [Wed, 20 Sep 2023 15:25:01 +0000 (15:25 +0000)] 
Merge branch 'michal/update-sphinx-and-sphinx_rtd_theme-9.18' into 'bind-9.18'

[9.18] Update Sphinx and sphinx_rtd_theme

See merge request isc-projects/bind9!8323

2 years agoUpdate Sphinx and sphinx_rtd_theme
Michał Kępień [Wed, 20 Sep 2023 15:18:24 +0000 (17:18 +0200)] 
Update Sphinx and sphinx_rtd_theme

Update Sphinx-related Python packages to their current versions pulled
in by "pip install sphinx-rtd-theme" run in a fresh virtual environment.

(cherry picked from commit 2f879cdec3de890d7371e185ca07b720f7c7d59b)

2 years agoMerge tag 'v9.18.19' into bind-9.18
Michał Kępień [Wed, 20 Sep 2023 14:52:16 +0000 (16:52 +0200)] 
Merge tag 'v9.18.19' into bind-9.18

2 years agoMerge branch '4312-pytest-symlink-name-collision-9.18' into 'bind-9.18'
Tom Krizek [Wed, 20 Sep 2023 14:36:27 +0000 (14:36 +0000)] 
Merge branch '4312-pytest-symlink-name-collision-9.18' into 'bind-9.18'

[9.18] Rename convenience symlink to pytest artifacts

See merge request isc-projects/bind9!8318

2 years agoRename convenience symlink to pytest artifacts
Tom Krizek [Tue, 19 Sep 2023 15:20:32 +0000 (17:20 +0200)] 
Rename convenience symlink to pytest artifacts

The previous symlink name convention was prone to name collisions If a
system test contained both a shell test and a pytest module of the same
name (e.g. dnstap test has both tests.sh and tests_dnstap.py), then
these would have the same convenience symlink, which could cause test
setup issues as well as confusion when examining test artifacts.

Update the naming convention to include the full pytest module name.
This results in a slightly more verbose names for shell tests (e.g.
dnstap_sh_dnstap instead of the previous dnstap_dnstap), but it removes
the chance of a collision.

(cherry picked from commit fd13dfb0972d775c84378e6f102ffb636279ef93)

2 years agoMerge branch '4250-remove-legacy-runner-support-for-python-tests-9.18' into 'bind...
Tom Krizek [Wed, 20 Sep 2023 13:52:38 +0000 (13:52 +0000)] 
Merge branch '4250-remove-legacy-runner-support-for-python-tests-9.18' into 'bind-9.18'

[9.18] remove support for running python system tests with legacy test runner

See merge request isc-projects/bind9!8317

2 years agoUpdate system test runner doc with pytest glue files
Tom Krizek [Tue, 15 Aug 2023 13:32:45 +0000 (15:32 +0200)] 
Update system test runner doc with pytest glue files

Document that pytest requires a glue file for each shell tests in order
to detect it.

(cherry picked from commit d050843a303fe2612ac7ac32541865b4e2358f7c)

2 years agoAdd CHANGES note for [GL #4250]
Tom Krizek [Tue, 15 Aug 2023 13:01:43 +0000 (15:01 +0200)] 
Add CHANGES note for [GL #4250]

(cherry picked from commit 363677bde7deeabd42ec0817e0f299c081b80053)

2 years agoUse integers for ports fixtures in pytest
Tom Krizek [Tue, 15 Aug 2023 11:55:56 +0000 (13:55 +0200)] 
Use integers for ports fixtures in pytest

Reorganize individual port fixtures and re-use the ports fixture to
obtain their number. Store it as integer and only cast it to string when
setting it as environment variable.

(cherry picked from commit 8deb026748a774febfd1cdbb96515e93ded20898)

2 years agoReformat conftest.py with black
Tom Krizek [Thu, 7 Sep 2023 13:22:23 +0000 (15:22 +0200)] 
Reformat conftest.py with black

(cherry picked from commit 197dac55a20fa9e22709184c3be15299184a87e1)

2 years agoRemove legacy runner support from conftest.py
Tom Krizek [Thu, 7 Sep 2023 13:21:54 +0000 (15:21 +0200)] 
Remove legacy runner support from conftest.py

Remove code fork for legacy runner, reorganize imports and move a
pylint-silencing snippet to the top of the file. The rest of the code
was just unindented.

(cherry picked from commit d16e5fd5e530f82236735c6a3f47252f8b157982)

2 years agoRemove pytest invocation from legacy runner
Tom Krizek [Tue, 15 Aug 2023 11:40:13 +0000 (13:40 +0200)] 
Remove pytest invocation from legacy runner

In order to python system tests, pytest (runner) has to be used
directly. This makes it possible to simplify the pytest runner and make
its behavior simpler and easier to extend.

The legacy runner can still be used to run shell system tests.

(cherry picked from commit 4af9bafb4eb0a0c3785119f8a577454f5ad6e068)

2 years agoMerge branch '4262-make-check-pytest-9.18' into 'bind-9.18'
Tom Krizek [Wed, 20 Sep 2023 12:38:34 +0000 (12:38 +0000)] 
Merge branch '4262-make-check-pytest-9.18' into 'bind-9.18'

[9.18] Use pytest runner for make check

See merge request isc-projects/bind9!8316

2 years agoUse 0 exit code for skipped tests in legacy runner
Tom Krizek [Wed, 20 Sep 2023 11:45:41 +0000 (13:45 +0200)] 
Use 0 exit code for skipped tests in legacy runner

Since the legacy runner is no longer used in the automake test suite,
don't use the special GNU exit code indicating a skipped tests. Instead,
use 0 to avoid considering skipped tests as failed when using simpler
mechanism (such as xargs -P) to run the tests with the legacy runner.

2 years agoci: make sure to use legacy test runner on EL7
Tom Krizek [Wed, 20 Sep 2023 08:49:44 +0000 (10:49 +0200)] 
ci: make sure to use legacy test runner on EL7

EL7 doesn't have the required dependencies for the newer pytest runner.
Since make check now invokes the pytest runner, ensure that the legacy
runner will be used instead.

2 years agoRemove make check invocation from legacy.run.sh
Tom Krizek [Fri, 8 Sep 2023 10:44:08 +0000 (12:44 +0200)] 
Remove make check invocation from legacy.run.sh

The legacy runner no longer uses make check. Ensure the legacy runner
script doesn't interact with that automake target in any way. The legacy
runner script remains available to execute the legacy runner, but there
is no out-of-the box support for running tests in parallel. Other tools
such as xargs can be utilized for that.

(cherry picked from commit 0a9ee342e9d6703137d0eda2d24b30deccfc5e8f)

2 years agoci: switch OpenBSD job to use make check
Tom Krizek [Wed, 6 Sep 2023 11:43:18 +0000 (13:43 +0200)] 
ci: switch OpenBSD job to use make check

Invoking pytest directly provides a better formatted output and more
flexibility. However, it's prudent to verify that `make check` keeps
working as expected. Use it in the OpenBSD job which isn't executed as
frequently and its output is of least concern.

(cherry picked from commit f1c631f44899b728300240ad93f13bc72e78c12c)

2 years agoModify custom-test-driver to interpret JUnit results
Tom Krizek [Tue, 5 Sep 2023 08:29:13 +0000 (10:29 +0200)] 
Modify custom-test-driver to interpret JUnit results

Pytest provides JUnit output and uses different exit codes from
Automake. Use the conversion script to interpret the JUnit test results
from python rather than relying on the status code.

(cherry picked from commit 295890a16b24f740b8bc8b7c75a4ded9802cb3ff)

2 years agoConvert JUnit XML from pytest into Automake .trs files
Tom Krizek [Tue, 5 Sep 2023 14:16:20 +0000 (16:16 +0200)] 
Convert JUnit XML from pytest into Automake .trs files

It's important to parse the JUnit result file rather than relying on the
exit code from pytest, which has a different meaning. Include a .trs test
result for each test case and set an exit code which is most appropriate
as the aggregate result (e.g. it will be set to 77 (SKIP) if there's at
least one test case that was skipped).

(cherry picked from commit b96c8e806265ba8dbe81ea50fc0d84c33c27289c)

2 years agoPrioritize long-running system tests for legacy runner
Tom Krizek [Mon, 4 Sep 2023 14:08:06 +0000 (16:08 +0200)] 
Prioritize long-running system tests for legacy runner

Synchronize the test priority with the pytest runner (which handles the
prioritization in conftest.py).

(cherry picked from commit 15fa8f1506f28fdc304f863155cf71f50ed917c1)

2 years agoUse prereq.sh for rpzrecurse system test
Tom Krizek [Mon, 4 Sep 2023 14:03:05 +0000 (16:03 +0200)] 
Use prereq.sh for rpzrecurse system test

(cherry picked from commit 0538b7e0da4acdafc9a1fa2f6e6872481ffdd2d1)

2 years agoUse prereq.sh for serve-stale system test
Tom Krizek [Mon, 4 Sep 2023 13:56:14 +0000 (15:56 +0200)] 
Use prereq.sh for serve-stale system test

(cherry picked from commit c3abedc0a2819c5be733df32981cfd2c6ae898a0)

2 years agoUse prereq.sh for chain system test
Tom Krizek [Mon, 4 Sep 2023 14:05:10 +0000 (16:05 +0200)] 
Use prereq.sh for chain system test

(cherry picked from commit 5d9a09c08698fe450fa521ce78c40f298beb2e9a)

2 years agoUse prereq.sh for digdelv, dnssec, forward system tests
Tom Krizek [Mon, 4 Sep 2023 13:38:25 +0000 (15:38 +0200)] 
Use prereq.sh for digdelv, dnssec, forward system tests

(cherry picked from commit 00b92bd06465134b8108c2c947cc8226f5a15205)

2 years agoUse prereq.sh for qmin, cookie system tests
Tom Krizek [Mon, 4 Sep 2023 13:34:05 +0000 (15:34 +0200)] 
Use prereq.sh for qmin, cookie system tests

(cherry picked from commit 78981cee775f38c23cef7ce49ba680e09527ecee)

2 years agoUse prereq.sh for reclimit system test
Tom Krizek [Mon, 4 Sep 2023 13:15:34 +0000 (15:15 +0200)] 
Use prereq.sh for reclimit system test

(cherry picked from commit 2f962f7041066c05d8de1991295bc574fa147913)

2 years agoUse prereq.sh for xfer system test
Tom Krizek [Mon, 4 Sep 2023 13:00:12 +0000 (15:00 +0200)] 
Use prereq.sh for xfer system test

(cherry picked from commit 587129b4c0537ea9159bad5b887b945d9811006c)

2 years agoUse prereq.sh for statschannel system test
Tom Krizek [Mon, 4 Sep 2023 12:32:06 +0000 (14:32 +0200)] 
Use prereq.sh for statschannel system test

(cherry picked from commit 27281955afe901d2705829edc8c327043cd689fd)

2 years agoAdd prereq.sh scripts for system tests requiring perl mod DNS
Tom Krizek [Mon, 4 Sep 2023 11:56:28 +0000 (13:56 +0200)] 
Add prereq.sh scripts for system tests requiring perl mod DNS

prereq.sh mechanism for dependency detection is preferred since it works
for both legacy and pytest runner.

(cherry picked from commit 9cc821d42f7dc1faf0f9777eaf1aee1cd9e9878b)

2 years agoUse proper perl interpreter in xfer system test
Tom Krizek [Mon, 4 Sep 2023 11:49:18 +0000 (13:49 +0200)] 
Use proper perl interpreter in xfer system test

(cherry picked from commit f0493890cc0fc18b807ec87eec06a298cafdbe06)

2 years agoRemove redundant dependency checks for system tests
Tom Krizek [Mon, 4 Sep 2023 11:41:09 +0000 (13:41 +0200)] 
Remove redundant dependency checks for system tests

Dependencies for these tests are already checked in prereq.sh - if the
dependencies are missing, these tests will be skipped. The extra
dependency check in Makefile.am is extraneous and only applied for the
legacy test runner.

(cherry picked from commit 807f67b1cd938c3877759c3998cebf21aaddf062)

2 years agoFix pytest module detection for run.sh
Tom Krizek [Thu, 31 Aug 2023 11:18:17 +0000 (13:18 +0200)] 
Fix pytest module detection for run.sh

To allow concurrent invocations of pytest, it is necessary to assign
ports properly to avoid conflicts. In order to do that, pytest needs to
know a complete list of all test modules.

When pytest is invoked from run.sh, the current working directory is the
system test directory. To properly detect other tests, the conftest.py
has to look in the bin/tests/system directory, rather than the current
working directory.

(cherry picked from commit d4502206a146b00ce1f8c1fad50a024d654b25f5)

2 years agoUse pytest runner for make check
Tom Krizek [Thu, 31 Aug 2023 11:15:24 +0000 (13:15 +0200)] 
Use pytest runner for make check

Make python & pytest required dependencies to run system tests and
invoke the pytest runner from the makefile.

(cherry picked from commit 56c108730405a42464f3c17b22ccb7b816ec8be0)

2 years agoMerge branch 'tkrizek/pytest-check-system-test-files-with-danger-9.18' into 'bind...
Tom Krizek [Tue, 19 Sep 2023 13:40:50 +0000 (13:40 +0000)] 
Merge branch 'tkrizek/pytest-check-system-test-files-with-danger-9.18' into 'bind-9.18'

[9.18] enforce system test file and name conventions with danger CI

See merge request isc-projects/bind9!8311

2 years agodanger: check system test convetions for pytest runner
Tom Krizek [Wed, 30 Aug 2023 11:51:05 +0000 (13:51 +0200)] 
danger: check system test convetions for pytest runner

When adding a new system test, it might easy to forget to add the
required files for the pytest runner or break a naming convention. Add
danger checks to cover these cases.

(cherry picked from commit d1371267c6a783ed971798202e5fb2811aa493ef)

2 years agoRename allow-query pytest glue file
Tom Krizek [Wed, 30 Aug 2023 11:37:09 +0000 (13:37 +0200)] 
Rename allow-query pytest glue file

To conform with the expected naming convention, the pytest glue file for
the `allow-query` test should use underscore as the word separator in
the python file name: allow-query/tests_sh_allow_query.py

(cherry picked from commit c026a00696de1314fa0e27afa725ce35f4016aae)

2 years agoTreat bin/tests/system/_common as non-temp directory
Tom Krizek [Mon, 18 Sep 2023 15:20:01 +0000 (17:20 +0200)] 
Treat bin/tests/system/_common as non-temp directory

The _common directory is a special case directory which contains shared
files for other system test directories. Make sure it's tracked in git
and not deleted during temporary directory cleanup.

(cherry picked from commit 9e13c3dbcb148db3cf72b758ece77d3a7ece81f7)

2 years agoRename system test directory with common files to _common
Tom Krizek [Mon, 18 Sep 2023 15:25:17 +0000 (17:25 +0200)] 
Rename system test directory with common files to _common

The old name "common" clashes with the convention of system test
directory naming. It appears as a system test directory, but it only
contains helper files.

To reduce confusion and to allow automatic detection of issues with
possibly missing test files, rename the helper directory to "_common".
The leading underscore indicates the directory is different and the its
name can no longer be confused with regular system test directories.

(cherry picked from commit 168dba163c266a46a969a87d9020f03a221bf2a5)

2 years agoMerge branch '4314-dns_ncache_current-fails-to-set-covered-correctly-bind-9.18' into...
Mark Andrews [Mon, 18 Sep 2023 06:40:27 +0000 (06:40 +0000)] 
Merge branch '4314-dns_ncache_current-fails-to-set-covered-correctly-bind-9.18' into 'bind-9.18'

[9.18] Resolve "dns_ncache_current fails to set covered correctly"

See merge request isc-projects/bind9!8307

2 years agoAdd a CHANGES note for [GL #4314]
Mark Andrews [Wed, 13 Sep 2023 01:22:30 +0000 (11:22 +1000)] 
Add a CHANGES note for [GL #4314]

(cherry picked from commit 80298ade33cfe63085fad2d4b80840e31ba348d3)

2 years agoCheck RRSIG covered type in negative cache entry
Mark Andrews [Fri, 15 Sep 2023 04:27:31 +0000 (14:27 +1000)] 
Check RRSIG covered type in negative cache entry

The covered type previously displayed as TYPE0 when it should
have reflected the records that was actually covered.

(cherry picked from commit 8ce359652a3e0c873520b319e9ee4d17e048d75c)

2 years agoCorrectly set the value of covered in dns_ncache_current
Mark Andrews [Wed, 13 Sep 2023 00:59:39 +0000 (10:59 +1000)] 
Correctly set the value of covered in dns_ncache_current

Fix the type and rdclass being passed to dns_rdata_tostruct so
that rrsig.covered is correctly set.

(cherry picked from commit 779980710c2ad6696fa8687ae19584ee65372f4e)

2 years agoMerge branch 'aram/danger-ignore-length-warn-for-fixups-9.18' into 'bind-9.18'
Arаm Sаrgsyаn [Thu, 14 Sep 2023 12:13:10 +0000 (12:13 +0000)] 
Merge branch 'aram/danger-ignore-length-warn-for-fixups-9.18' into 'bind-9.18'

[9.18] Don't warn about subject line length for the fixup commits (CI)

See merge request isc-projects/bind9!8302

2 years agoDon't warn about subject line length for the fixup commits
Aram Sargsyan [Wed, 6 Sep 2023 09:52:12 +0000 (09:52 +0000)] 
Don't warn about subject line length for the fixup commits

The fixup commits' subject line has a prefix which has its own
length, so warning about the exceeding length is not accurate.
Given that the fixup commits can not be merged, because they
cause a danger failure, it's safe to ignore the length check
for them.

(cherry picked from commit 3db2beef9ff8cdd5bfc62f8cc18bf6a75a9102f8)

2 years agoMerge branch '4299-cid-465168-null-pointer-dereference' into 'bind-9.18'
Arаm Sаrgsyаn [Thu, 14 Sep 2023 11:22:58 +0000 (11:22 +0000)] 
Merge branch '4299-cid-465168-null-pointer-dereference' into 'bind-9.18'

Resolve "CID 465168: Null pointer dereference in lib/ns/client.c"

See merge request isc-projects/bind9!8281

2 years agoRemove an unnecessary NULL-check
Aram Sargsyan [Wed, 6 Sep 2023 10:26:36 +0000 (10:26 +0000)] 
Remove an unnecessary NULL-check

In the ns__client_put_cb() callback function the 'client->manager'
pointer is guaranteed to be non-NULL, because in ns__client_request(),
before setting up the callback, the ns__client_setup() function is
called for the 'client', which makes sure that 'client->manager' is set.

Removing the NULL-check resolves the following static analyzer warning:

    /lib/ns/client.c: 1675 in ns__client_put_cb()
    1669      dns_message_puttemprdataset(client->message, &client->opt);
    1670      }
    1671      client_extendederror_reset(client);
    1672
    1673      dns_message_detach(&client->message);
    1674
    >>>     CID 465168:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "client->manager" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1675      if (client->manager != NULL) {
    1676      ns_clientmgr_detach(&client->manager);
    1677      }
    1678
    1679      /*
    1680       * Detaching the task must be done after unlinking from

2 years agoMerge branch 'tkrizek/ci-test-binaries-compilation-9.18' into 'bind-9.18'
Tom Krizek [Tue, 12 Sep 2023 08:55:42 +0000 (08:55 +0000)] 
Merge branch 'tkrizek/ci-test-binaries-compilation-9.18' into 'bind-9.18'

[9.18] ci: omit explicit command to compile test binaries

See merge request isc-projects/bind9!8295

2 years agoci: omit explicit command to compile test binaries
Tom Krizek [Fri, 8 Sep 2023 13:44:28 +0000 (15:44 +0200)] 
ci: omit explicit command to compile test binaries

The command to compile test binaries is no longer needed, as these are
now compiled as part of the default make target.

Related !8189

(cherry picked from commit 26f20b81ec8beeec82577766a9454b52f7684aaf)

2 years agoMerge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.18.20' into 'bind...
Michal Nowak [Tue, 12 Sep 2023 07:38:12 +0000 (07:38 +0000)] 
Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.18.20' into 'bind-9.18'

Set up version and release notes for BIND 9.18.20

See merge request isc-projects/bind9!8293

2 years agoSet up release notes for BIND 9.18.20
Michal Nowak [Tue, 12 Sep 2023 07:36:39 +0000 (09:36 +0200)] 
Set up release notes for BIND 9.18.20

2 years agoUpdate BIND version to 9.18.20-dev
Michal Nowak [Tue, 12 Sep 2023 07:36:39 +0000 (09:36 +0200)] 
Update BIND version to 9.18.20-dev

2 years agoUpdate BIND version for release v9.18.19
Michal Nowak [Fri, 8 Sep 2023 14:24:41 +0000 (16:24 +0200)] 
Update BIND version for release

2 years agoAdd a CHANGES marker
Michal Nowak [Fri, 8 Sep 2023 14:24:01 +0000 (16:24 +0200)] 
Add a CHANGES marker

2 years agoFix release note for [GL #4242]
Michal Nowak [Mon, 11 Sep 2023 08:16:38 +0000 (10:16 +0200)] 
Fix release note for [GL #4242]

An unintended release note has been merged in isc-private/bind9!565.
This is the correct one.

2 years agoMerge branch 'mnowak/prepare-documentation-for-bind-9.18.19' into 'security-bind...
Michal Nowak [Fri, 8 Sep 2023 14:22:57 +0000 (14:22 +0000)] 
Merge branch 'mnowak/prepare-documentation-for-bind-9.18.19' into 'security-bind-9.18'

Prepare documentation for BIND 9.18.19

See merge request isc-private/bind9!579

2 years agoTweak and reword release notes
Michal Nowak [Wed, 6 Sep 2023 18:16:01 +0000 (20:16 +0200)] 
Tweak and reword release notes

2 years agoPrepare release notes for BIND 9.18.19
Michal Nowak [Fri, 8 Sep 2023 09:54:52 +0000 (11:54 +0200)] 
Prepare release notes for BIND 9.18.19

2 years agoCheck dig's exist status
Mark Andrews [Mon, 4 Sep 2023 05:16:42 +0000 (15:16 +1000)] 
Check dig's exist status

(cherry picked from commit 701ad350f86dd1fe0a814886fd41db6b90e8c670)

2 years agoMerge branch '4242-use-after-free-fix' into 'security-bind-9.18'
Michal Nowak [Fri, 8 Sep 2023 09:51:44 +0000 (09:51 +0000)] 
Merge branch '4242-use-after-free-fix' into 'security-bind-9.18'

[9.18] [CVE-2023-4236] TLS DNS: fix 'isc__nm_uvreq_t' send request use after free error

See merge request isc-private/bind9!565

2 years agoAdd CHANGES and release note for [GL #4242]
Artem Boldariev [Mon, 7 Aug 2023 15:16:29 +0000 (18:16 +0300)] 
Add CHANGES and release note for [GL #4242]

2 years agoTLS DNS: fix 'isc__nm_uvreq_t' send request use after free error
Artem Boldariev [Mon, 7 Aug 2023 10:40:58 +0000 (13:40 +0300)] 
TLS DNS: fix 'isc__nm_uvreq_t' send request use after free error

In TLS DNS, it was possible for an 'isc__nm_uvreq_t' object to be used
twice when it was not implied, leading to use after free errors,
leading to abort()'s and/or crashes.

In particular, in the older version of the code, the following was
happening:

* 'tlsdns_send_direct()' is eventually called from
'isc__nm_async_tlsdnssend()' when sending data;

* 'tlsdns_send_direct()' could fail. If it happens early closer to the
beginning of the function, then the 'isc__nm_uvreq_t' object is passed
to 'isc__nm_failed_send_cb()' and eventually gets destroyed normally
without any negative consequences;

* However, if 'tlsdns_send_direct()' fails due to the call to
'tls_cycle()', then the send request object is re-queued to be
processed asynchronously later by a call to 'tlsdns_send_enqueue()'.

* The error processing code in 'tlsdns_send_direct()' is written
without an assumption that the send request object could be re-queued
in 'tlsdns_send_direct()' and, thus, it was passed to
'isc__nm_failed_send_cb()' for asynchronous error processing.

* As a result of asynchronous processing initiated by
`tlsdns_send_enqueue()` the 'isc__nm_uvreq_t' send request object gets
properly destroyed eventually.

* Then, as a result of asynchronous error processing initiated by the
'isc__nm_failed_send_cb()' call, the send request object is used a
second time. However, it was destroyed at the previous step.

So we have a (relatively) obvious logical mistake here. Why
'tls_cycle()' was failing is of no particular importance, as I can see
many ways for it to fail both on TLS and networking levels. In
particular, during testing with 'dnsperf', I have encountered the
following two cases:

1. 'result == ISC_R_TLSERROR' - the remote side was wrapping up,
causing errors on TLS level (e.g. handshake has not been completed
yet);

2. 'result == ISC_R_CONNECTIONRESET' - the remote side closed the
connection after we have initiated the asynchronous send request
operation and reached the point when its processing started.

One could ask: why haven't we encountered the error before? That
happened because 'send()' is, in general, a faster operation than
'read()' so we were lucky enough not to encounter this, as it took
dnsperf to make our code fail in a particular way to trigger the
problematic code path. It requires closing the connection shortly
after we have made an asynchronous 'send()' attempt and passed the
data for processing by the libuv code (or, to be precise, down our
technologies stack).

2 years agoMerge branch '4152-confidential-limit-isccc_cc_fromwire-recursion-depth-bind-9.18...
Michal Nowak [Fri, 8 Sep 2023 09:13:46 +0000 (09:13 +0000)] 
Merge branch '4152-confidential-limit-isccc_cc_fromwire-recursion-depth-bind-9.18' into 'security-bind-9.18'

[9.18] [CVE-2023-3341] Stack Exhaustion in control channel

See merge request isc-private/bind9!569

2 years agoAdd release note for [GL #4152]
Mark Andrews [Tue, 20 Jun 2023 05:38:40 +0000 (15:38 +1000)] 
Add release note for [GL #4152]

2 years agoAdd CHANGES note for [GL #4152]
Mark Andrews [Tue, 20 Jun 2023 05:27:40 +0000 (15:27 +1000)] 
Add CHANGES note for [GL #4152]

2 years agoLimit isccc_cc_fromwire recursion depth
Mark Andrews [Tue, 20 Jun 2023 05:21:36 +0000 (15:21 +1000)] 
Limit isccc_cc_fromwire recursion depth

Named and rndc do not need a lot of recursion so the depth is
set to 10.

2 years agoMerge branch '4292-uncleared-libcrypto-error-crypto-evp-evp_fetch-c-373-inner_evp_gen...
Ondřej Surý [Wed, 6 Sep 2023 15:47:08 +0000 (15:47 +0000)] 
Merge branch '4292-uncleared-libcrypto-error-crypto-evp-evp_fetch-c-373-inner_evp_generic_fetch-bind-9.18' into 'bind-9.18'

[9.18] Resolve "Uncleared libcrypto error: crypto/evp/evp_fetch.c:373 inner_evp_generic_fetch"

See merge request isc-projects/bind9!8279

2 years agoCall ERR_clear_error on EVP_MD_fetch or EVP_##alg error
Mark Andrews [Tue, 5 Sep 2023 07:53:04 +0000 (17:53 +1000)] 
Call ERR_clear_error on EVP_MD_fetch or EVP_##alg error

(cherry picked from commit 28adcf1831715735e3af4428f334c9dae18db62f)

2 years agoMerge branch '4290-raise-log-level-to-isc_log_error-on-formerr-in-xfrin-c-bind-9...
Mark Andrews [Wed, 6 Sep 2023 11:29:12 +0000 (11:29 +0000)] 
Merge branch '4290-raise-log-level-to-isc_log_error-on-formerr-in-xfrin-c-bind-9.18' into 'bind-9.18'

[9.18] Resolve "raise log level to ISC_LOG_NOTICE on FORMERR in xfrin.c"

See merge request isc-projects/bind9!8280

2 years agoAdd a CHANGES note for [GL #4290]
Mark Andrews [Fri, 1 Sep 2023 00:26:45 +0000 (10:26 +1000)] 
Add a CHANGES note for [GL #4290]

(cherry picked from commit b867244305ba3a542ddab9e6e4bc5996a014a61d)

2 years agoAdjust level of log messages when transferring in a zone
Mark Andrews [Fri, 1 Sep 2023 00:17:00 +0000 (10:17 +1000)] 
Adjust level of log messages when transferring in a zone

This raises the log level of messages treated as FORMERR to NOTICE
when transfering in a zone.  This also adds a missing log message
for TYPE0 and meta types received during a zone transfer.

(cherry picked from commit 6c3414739de8a0bb0549ca7a172314edd78597ac)

2 years agoMerge branch 'mnowak/statschannel-system-test-is-too-verbose-9.18' into 'bind-9.18'
Michal Nowak [Tue, 5 Sep 2023 17:23:48 +0000 (17:23 +0000)] 
Merge branch 'mnowak/statschannel-system-test-is-too-verbose-9.18' into 'bind-9.18'

[9.18] Disable command tracing in statschannel system test

See merge request isc-projects/bind9!8278

2 years agoDisable command tracing in statschannel system test
Michal Nowak [Tue, 5 Sep 2023 16:52:15 +0000 (18:52 +0200)] 
Disable command tracing in statschannel system test

Command tracing was added recently via
525afc666a3040330f786634c990bd595c1de83b and makes the system test too
verbose.

(cherry picked from commit f0c37d861c2cc6d2c331f4400e12fef64995e02c)

2 years agoMerge branch '4255-suspicious-messsage-id-fix' into 'bind-9.18'
Michal Nowak [Tue, 5 Sep 2023 16:45:42 +0000 (16:45 +0000)] 
Merge branch '4255-suspicious-messsage-id-fix' into 'bind-9.18'

TLS DNS: take into account partial writes by SSL_write_ex()

See merge request isc-projects/bind9!8276

2 years agoAdd CHANGES and release note for [GL #4255]
Artem Boldariev [Tue, 29 Aug 2023 19:18:27 +0000 (22:18 +0300)] 
Add CHANGES and release note for [GL #4255]

Mention that possibility of partial TLS writes was taken into account
and that fixes DNS messages corruption over long DNS over TLS streams.

2 years agoTLS DNS: take into account partial writes by SSL_write_ex()
Artem Boldariev [Wed, 23 Aug 2023 20:36:16 +0000 (23:36 +0300)] 
TLS DNS: take into account partial writes by SSL_write_ex()

This commit changes TLS DNS so that partial writes by the
SSL_write_ex() function are taken into account properly. Now, before
doing encryption, we are flushing the buffers for outgoing encrypted
data.

The problem is fairly complicated and originates from the fact that it
is somewhat hard to understand by reading the documentation if and
when partial writes are supported/enabled or not, and one can get a
false impression that they are not supported or enabled by
default (https://www.openssl.org/docs/man3.1/man3/SSL_write_ex.html). I
have added a lengthy comment about that into the code because it will
be more useful there. The documentation on this topic is vague and
hard to follow.

The main point is that when SSL_write_ex() fails with
SSL_ERROR_WANT_WRITE, the OpenSSL code tells us that we need to flush
the outgoing buffers and then call SSL_write_ex() again with exactly
the same arguments in order to continue as partial write could have
happened on the previous call to SSL_write_ex() (that is not hard to
verify by calling BIO_pending(sock->tls.app_rbio) before and after the
call to SSL_write_ex() and comparing the returned values). This aspect
was not taken into account in the code.

Now, one can wonder how that could have led to the behaviour that we
saw in the #4255 bug report. In particular, how could we lose one
message and duplicate one twice? That is where things get interesting.

One needs to keep two things in mind (that is important):

Firstly, the possibility that two (or more) subsequent SSL_write_ex()
calls will be done with exactly the same arguments is very high (the
code does not guarantee that in any way, but in practice, that happens
a lot).

Secondly, the dnsperf (the software that helped us to trigger the bug)
bombed the test server with messages that contained exactly the same
data. The only difference in the responses is message IDs, which can
be found closer to the start of a message.

So, that is what was going on in the older version of the code:

1. During one of the isc_nm_send() calls, the SSL_write_ex() call
fails with SSL_ERROR_WANT_WRITE. Partial writing has happened, though,
and we wrote a part of the message with the message
ID (e.g. 2014). Nevertheless, we have rescheduled the complete send
operation asynchronously by a call to tlsdns_send_enqueue().

2. While the asynchronous request has not been completed, we try to
send the message (e.g. with ID 2015). The next isc_nm_send() or
re-queued send happens with a call to SSL_write_ex() with EXACTLY the
same arguments as in the case of the previous call. That is, we are
acting as if we want to complete the previously failed SSL_write_ex()
attempt (according to the OpenSSL documentation:
https://www.openssl.org/docs/man3.1/man3/SSL_write_ex.html, the
"Warnings" section). This way, we already have a start of the message
containing the previous ID (2014 in our case) but complete the write
request with the rest of the data given in the current write
attempt. However, as responses differ only in message ID, we end up
sending a valid (properly structured) DNS message but with the ID of
the previous one. This way, we send a message with ID from the
previous isc_nm_send() attempt. The message with the ID from the send
request from this attempt will never be sent, as the code thinks that
it is sending it now (that is how we send the message with ID 2014
instead of 2015, as in our example, thus making the message with ID
2015 never to be sent).

3. At some point later, the asynchronous send request (the rescheduled
on the first step) completes without an error, sending a second
message with the same ID (2014).

It took exhausting SSL write buffers (so that a data encryption
attempt cannot be completed in one operation) via long DoT streams in
order to exhibit the behaviour described above. The exhaustion
happened because we have not been trying to flush the buffers often
enough (especially in the case of multiple subsequent writes).

In my opinion, the origin of the problem can be described as follows:

It happened due to making wrong guesses caused by poorly written
documentation.

2 years agoMerge branch '4038-specialised-arena-per-worker-9.18' into 'bind-9.18'
Ondřej Surý [Tue, 5 Sep 2023 14:00:16 +0000 (14:00 +0000)] 
Merge branch '4038-specialised-arena-per-worker-9.18' into 'bind-9.18'

[9.18] Make it possible to create memory contexts backed by jemalloc arenas

See merge request isc-projects/bind9!8271

2 years agoAdd CHANGES and release note for [GL #4038]
Artem Boldariev [Mon, 14 Aug 2023 13:17:54 +0000 (16:17 +0300)] 
Add CHANGES and release note for [GL #4038]

Mention that send buffer allocations/deallocations are now routed
through dedicated memory arenas.

(cherry picked from commit 60d52a49b0e52fdcae32ab027ca795366dcf9dc4)

2 years agoAllocate DNS send buffers using dedicated per-worker memory arenas
Artem Boldariev [Thu, 10 Aug 2023 20:08:25 +0000 (23:08 +0300)] 
Allocate DNS send buffers using dedicated per-worker memory arenas

This commit ensures that memory allocations related to DNS send
buffers are routed through dedicated per-worker memory arenas in order
to decrease memory usage on high load caused by TCP-based DNS
transports.

We do that by following jemalloc developers suggestions:

https://github.com/jemalloc/jemalloc/issues/2483#issuecomment-1639019699
https://github.com/jemalloc/jemalloc/issues/2483#issuecomment-1698173849
(cherry picked from commit 01cc7edcca26967c98f45b95834f752afc468922)

2 years agoAdd ability to set per jemalloc arena dirty and muzzy decay values
Artem Boldariev [Fri, 11 Aug 2023 11:25:40 +0000 (14:25 +0300)] 
Add ability to set per jemalloc arena dirty and muzzy decay values

This commit adds couple of functions to change "dirty_decay_ms" and
"muzzy_decay_ms" settings on arenas associated with memory contexts.

(cherry picked from commit 6e98b58d1554dff27cf5889ae757e79562d25786)

2 years agoMake it possible to create memory contexts backed by jemalloc arenas
Artem Boldariev [Thu, 10 Aug 2023 14:02:43 +0000 (17:02 +0300)] 
Make it possible to create memory contexts backed by jemalloc arenas

This commit extends the internal memory management middleware code in
BIND so that memory contexts backed by dedicated jemalloc arenas can
be created. A new function (isc_mem_create_arena()) is added for that.

Moreover, it extends the existing code so that specialised memory
contexts can be created easily, should we need that functionality for
other future purposes. We have achieved that by passing the flags to
the underlying jemalloc-related calls. See the above
isc_mem_create_arena(), which can serve as an example of this.

Having this opens up possibilities for creating memory contexts tuned
for specific needs.

(cherry picked from commit 8550c525881da757ac7db12990c2c1e0c72ec13c)

2 years agoMerge branch 'artem-fix-building-on-dragonflybsd-9.18' into 'bind-9.18'
Ondřej Surý [Tue, 5 Sep 2023 11:07:49 +0000 (11:07 +0000)] 
Merge branch 'artem-fix-building-on-dragonflybsd-9.18' into 'bind-9.18'

[9.18] Fix building BIND on DragonFly BSD (on both older an newer versions)

See merge request isc-projects/bind9!8272

2 years agoFix building BIND on DragonFly BSD (on both older an newer versions)
Artem Boldariev [Mon, 16 Jan 2023 16:31:08 +0000 (18:31 +0200)] 
Fix building BIND on DragonFly BSD (on both older an newer versions)

This commit ensures that BIND and supplementary tools still can be
built on newer versions of DragonFly BSD. It used to be the case, but
somewhere between versions 6.2 and 6.4 the OS developers rearranged
headers and moved some function definitions around.

Before that the fact that it worked was more like a coincidence, this
time we, at least, looked at the related man pages included with the
OS.

No in depth testing has been done on this OS as we do not really
support this platform - so it is more like a goodwill act. We can,
however, use this platform for testing purposes, too. Also, we know
that the OS users do use BIND, as it is included in its ports
directory.

Building with './configure' and './configure --without-jemalloc' have
been fixed and are known to work at the time the commit is made.

(cherry picked from commit 942569a1bb104002215286dae5fed98d783519ad)

2 years agoMerge branch '4263-deprecate-dnssec-must-be-secure-feature-9.18' into 'bind-9.18'
Ondřej Surý [Mon, 4 Sep 2023 16:54:46 +0000 (16:54 +0000)] 
Merge branch '4263-deprecate-dnssec-must-be-secure-feature-9.18' into 'bind-9.18'

Deprecate 'dnssec-must-be-secure' option

See merge request isc-projects/bind9!8268

2 years agoAdd CHANGES and release note for [GL #4263]
Ondřej Surý [Mon, 4 Sep 2023 11:11:49 +0000 (13:11 +0200)] 
Add CHANGES and release note for [GL #4263]

(cherry picked from commit 898f0ee3cf44fead2d4e9596845df65dcc23c58e)

2 years agoDeprecate 'dnssec-must-be-secure' option
Ondřej Surý [Mon, 4 Sep 2023 11:08:48 +0000 (13:08 +0200)] 
Deprecate 'dnssec-must-be-secure' option

The dnssec-must-be-secure feature was added in the early days of BIND 9
and DNSSEC and it makes sense only as a debugging feature.

Remove the feature to simplify the code.

(cherry picked from commit 9e0b348a2b6a12da65d23ddb82fa0154a30f7111)

2 years agoMerge branch 'michal/reorganize-vulnerability-docs-9.18' into 'bind-9.18'
Michał Kępień [Mon, 4 Sep 2023 10:00:36 +0000 (10:00 +0000)] 
Merge branch 'michal/reorganize-vulnerability-docs-9.18' into 'bind-9.18'

[9.18] Move security-related information to SECURITY.md

See merge request isc-projects/bind9!8266

2 years agoMove security-related information to SECURITY.md
Michał Kępień [Mon, 4 Sep 2023 09:54:57 +0000 (11:54 +0200)] 
Move security-related information to SECURITY.md

To follow current best practices, create a short SECURITY.md file in the
root of the repository that contains information about the project's
security policy and guidelines for reporting potential security issues.
Replace the relevant bits of text in other files with references to the
new SECURITY.md file, so that the relevant information only needs to be
maintained in one place.

Replace all occurrences of the generic security-officer@isc.org email
with a dedicated address for reporting BIND 9 security issues,
bind-security@isc.org.

(cherry picked from commit ca9fed91431eab6b72e8d1ffae0ed8294677dc7d)

2 years agoMerge branch 'aram/zone.c-got_transfer_quota-bugfix-9.18' into 'bind-9.18'
Arаm Sаrgsyаn [Mon, 4 Sep 2023 08:36:57 +0000 (08:36 +0000)] 
Merge branch 'aram/zone.c-got_transfer_quota-bugfix-9.18' into 'bind-9.18'

[9.18] Reset the 'result' before using it again in zone.c:got_transfer_quota()

See merge request isc-projects/bind9!8256

2 years agoUnobfuscate the code-flow logic in got_transfer_quota()
Ondřej Surý [Wed, 23 Aug 2023 14:04:44 +0000 (16:04 +0200)] 
Unobfuscate the code-flow logic in got_transfer_quota()

This refactors the code flow in got_transfer_quota() to not use the
CHECK() macro as it really obfuscates the code flow logic here.

(cherry picked from commit 00cb151f8e6a280152f8da3cf9e008fa69599e73)