]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoAdd a catz system test check for [GL #3911]
Aram Sargsyan [Wed, 1 Mar 2023 12:47:25 +0000 (12:47 +0000)] 
Add a catz system test check for [GL #3911]

The trick is to configure a duplicate zone, which comes after the
catalog zone, where the duplicate zone is an existing member zone.

In that scenario, all the zones which come before the "faulty" zone
in the configuration file will fail to be reverted to the previous
version of the view after a reconfiguration error, and in this
particular case that will result in an assertion failure when the
catalog zone update is initiated, because it will be still tied to
the new version of the view, which was dismissed.

(cherry picked from commit 93c4f382f4a8a4d049cdcae5971412667a7bade9)

3 years agoMerge branch '3894-emit-coverage-summary-for-the-coverage-badge-v9_18' into 'v9_18'
Mark Andrews [Wed, 1 Mar 2023 00:57:07 +0000 (00:57 +0000)] 
Merge branch '3894-emit-coverage-summary-for-the-coverage-badge-v9_18' into 'v9_18'

[9.18] Resolve "Emit coverage summary for the coverage badge"

See merge request isc-projects/bind9!7628

3 years agoExtract test coverage statistics from the gcov job
Mark Andrews [Thu, 23 Feb 2023 22:39:34 +0000 (09:39 +1100)] 
Extract test coverage statistics from the gcov job

In older GitLab versions, the regular expression used for extracting
test coverage statistics from the output of GitLab CI jobs was
configured in the project's settings, using GitLab's web interface.
That changed in recent GitLab versions [1]; the previous configuration
method was removed from the web interface altogether as of GitLab 15.0.
The relevant regular expression is now supposed to be set in the
relevant job's definition in .gitlab-ci.yml.

Set the regular expression used for extracting test coverage
statistics in the definition of the "gcov" GitLab CI job.  Use the
regular expression suggested in GitLab's documentation [2].

[1] https://docs.gitlab.com/ee/update/deprecations.html#test-coverage-project-cicd-setting
[2] https://docs.gitlab.com/ee/ci/pipelines/settings.html#test-coverage-examples

(cherry picked from commit db7af9fcc1c91c3290982b555bdf1c55f6a73d66)

3 years agoMerge branch 'aram/catz-refactor-renaming-leftovers-finish-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 16:21:12 +0000 (16:21 +0000)] 
Merge branch 'aram/catz-refactor-renaming-leftovers-finish-v9_18' into 'v9_18'

[9.18] Finish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming

See merge request isc-projects/bind9!7625

3 years agoFinish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming
Aram Sargsyan [Mon, 27 Feb 2023 19:45:09 +0000 (19:45 +0000)] 
Finish catalog zone 'zone' and 'zones' to 'catz' and 'catzs' renaming

There are leftovers from the previous refactoring effort, which left
some function declarations and comments in the header file unchanged.

Finish the renaming.

(cherry picked from commit 580ef2e18f64cb1c0da86ce6fcf109d1ff9e0386)

3 years agoMerge branch '3777-fix-crash-after-failed-ixfr-from-differences-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 14:29:55 +0000 (14:29 +0000)] 
Merge branch '3777-fix-crash-after-failed-ixfr-from-differences-v9_18' into 'v9_18'

[9.18] Resolve "crash after failed ixfr-from-differences on a catalog zone"

See merge request isc-projects/bind9!7620

3 years agoAdd a CHANGES note for [GL #3777]
Aram Sargsyan [Fri, 27 Jan 2023 09:38:33 +0000 (09:38 +0000)] 
Add a CHANGES note for [GL #3777]

(cherry picked from commit 46b1c558ce706d8ffcd397da92b7fe429a74a1b1)

3 years agocatz: unregister the db update-notify callback before detaching from db
Aram Sargsyan [Fri, 27 Jan 2023 08:47:52 +0000 (08:47 +0000)] 
catz: unregister the db update-notify callback before detaching from db

When detaching from the previous version of the database, make sure
that the update-notify callback is unregistered, otherwise there is
an INSIST check which can generate an assertion failure in free_rbtdb(),
which checks that there are no outstanding update listeners in the list.

There is a similar code already in place for RPZ.

(cherry picked from commit cf79692a662b627d2230fbf7ae67f55cf729180c)

3 years agoSearching catzs->zones requires a read lock
Aram Sargsyan [Fri, 27 Jan 2023 18:04:41 +0000 (18:04 +0000)] 
Searching catzs->zones requires a read lock

Lock the catzs->lock mutex before searching in the catzs->zones
hash table.

(cherry picked from commit 0ef0c86632c838c3f342fe1c6d8cdef1b327cde6)

3 years agoProcess db callbacks in zone_loaddone() after zone_postload()
Aram Sargsyan [Thu, 26 Jan 2023 19:08:19 +0000 (19:08 +0000)] 
Process db callbacks in zone_loaddone() after zone_postload()

The zone_postload() function can fail and unregister the callbacks.

Call dns_db_endload() only after calling zone_postload() to make
sure that the registered update-notify callbacks are not called
when the zone loading has failed during zone_postload().

Also, don't ignore the return value of zone_postload().

(cherry picked from commit ed268b46f11706bde3da68bd2a4b45752350f736)

3 years agoAdd a system test for [GL #3777]
Aram Sargsyan [Fri, 27 Jan 2023 09:22:11 +0000 (09:22 +0000)] 
Add a system test for [GL #3777]

Add the 'ixfr-from-differences yes;' option to trigger a failed
zone postload operation when a zone is updated but the serial
number is not updated, then issue two successive 'rndc reload'
commands to trigger the bug, which causes an assertion failure.

(cherry picked from commit a73b67456e8ed70040fd3dd0bda1d97210bb9536)

3 years agoMerge branch '3269-increase-server-start-timeout-v9_18' into 'v9_18'
Michal Nowak [Tue, 28 Feb 2023 13:31:24 +0000 (13:31 +0000)] 
Merge branch '3269-increase-server-start-timeout-v9_18' into 'v9_18'

[9.18] Increase server start timeout for system tests

See merge request isc-projects/bind9!7619

3 years agoIncrease server start timeout for system tests
Artem Boldariev [Wed, 25 May 2022 11:49:32 +0000 (14:49 +0300)] 
Increase server start timeout for system tests

This commit increases server start timeout from 60 to 90 seconds in
order to avoid system test failures on some platforms due to inability
to initialise TLS contexts in time.

(cherry picked from commit 705f0d1ed13dfee180068d1e276af046eadbb3c3)

3 years agoMerge branch '3902-fetchlimit-system-test-failed-v9_18' into 'v9_18'
Mark Andrews [Tue, 28 Feb 2023 12:49:38 +0000 (12:49 +0000)] 
Merge branch '3902-fetchlimit-system-test-failed-v9_18' into 'v9_18'

[9.18] Resolve "'fetchlimit' system test failed"

See merge request isc-projects/bind9!7616

3 years agoFix 'checking drop statistics' test
Mark Andrews [Tue, 28 Feb 2023 03:24:20 +0000 (14:24 +1100)] 
Fix 'checking drop statistics' test

Wait for the desired log message to appear in ns3/named.stats rather
than the creation of the file.

(cherry picked from commit c7ae975ecf70fb6fc7c836f39b7f1ab4f2fe0129)

3 years agoFix 'lame server clients are dropped below the hard limit' test
Mark Andrews [Tue, 28 Feb 2023 03:10:56 +0000 (14:10 +1100)] 
Fix 'lame server clients are dropped below the hard limit' test

The test was setting a minimum count for recursive clients which
was not always being met (e.g. 91 instead of 100) producing a false
positive.  Lower the lower bound on recursive clients for this
test to 1.

(cherry picked from commit af47090d99d68f23107a65cbddea5d0231269484)

3 years agoMerge branch 'michal/add-a-dnsrps-enabled-build-to-regular-ci-pipelines-v9_18' into...
Michał Kępień [Tue, 28 Feb 2023 12:12:16 +0000 (12:12 +0000)] 
Merge branch 'michal/add-a-dnsrps-enabled-build-to-regular-ci-pipelines-v9_18' into 'v9_18'

[9.18] Add a DNSRPS-enabled build to regular CI pipelines

See merge request isc-projects/bind9!7621

3 years agoAdd a DNSRPS-enabled build to regular CI pipelines
Michał Kępień [Tue, 28 Feb 2023 11:54:02 +0000 (12:54 +0100)] 
Add a DNSRPS-enabled build to regular CI pipelines

DNSRPS-enabled builds have recently been silently broken a few times due
to that feature not being tested in regular CI pipelines.  Add the
--enable-dnsrps --enable-dnsrps-dl switches to the ./configure
invocation in one of the CI jobs run for all merge requests so that
DNSRPS-related build issues can be detected in advance.

It is important to note that this change by itself does NOT enable
actual testing of the DNSRPS feature as doing that requires a DNSRPS
provider library to be present on the test host.

(cherry picked from commit a4d6f5f6fdf2cee7a362f26566b2d33a687726b4)

3 years ago(Mostly) fix building bin/tests/system/rpz/dnsrps
Michał Kępień [Tue, 28 Feb 2023 11:54:02 +0000 (12:54 +0100)] 
(Mostly) fix building bin/tests/system/rpz/dnsrps

Building the bin/tests/system/rpz/dnsrps helper binary is currently not
possible at all as the necessary compiler and linker flag definitions
are missing from bin/tests/system/Makefile.am.  Add these as a basis for
addressing the problem.

Unfortunately, this is where the "mostly" bit mentioned in this commit's
subject line comes into play.  The dlopen() parts of DNSRPS code have
not yet been reworked to use libuv's dlopen() API (uv_dlopen() etc.)
(See commit 37b9511ce1dd9ba66a6620c5ff617016eb81188f for prior work in
this area.)  While it is certainly possible to do that, implementing
such a change without testing it in practice against a usable librpz.so
(i.e. a DNSRPS provider library) is bound to cause more trouble and
confusion than keeping the code the way it is right now.  However,
making that code buildable as-is requires linking against a C standard
library that exports the dlopen(), dlsym(), and dlclose() symbols used
by the DNSRPS dynamic loading code.  glibc 2.34+ satisfies that
requirement, but older glibc versions do not (these come with a separate
libdl shared library that would need to be linked in as well).  (Other
C standard library implementations have not been examined.)  Since the
long-term plan is to rely on libuv's dlopen() API exclusively and
detecting the shared object containing dlopen() & friends would only
pull in build system complexity for no good reason, assume for now that
the target system provides the dlopen() API in its C standard library.

This change enables the system test suite to be run for a BIND 9 build
prepared using --enable-dnsrps --enable-dnsrps-dl (on systems satisfying
the requirement explained above).  However, it is important to note that
this change by itself does NOT enable actual testing of the DNSRPS
feature as doing that requires a DNSRPS provider library to be present
on the test host.

(cherry picked from commit b396f555861f11d7d6cee2ceb0d94abb733e1101)

3 years agoMerge branch '3881-catz-offload-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 11:36:21 +0000 (11:36 +0000)] 
Merge branch '3881-catz-offload-v9_18' into 'v9_18'

[9.18] Resolve "Run the catalog zone update as an offloaded work"

See merge request isc-projects/bind9!7614

3 years agoAdd CHANGES and release notes for [GL #3881]
Aram Sargsyan [Tue, 21 Feb 2023 14:39:27 +0000 (14:39 +0000)] 
Add CHANGES and release notes for [GL #3881]

(cherry picked from commit cb1cd67bea4cd004de6510e4c65a958fdd1ebe8a)

3 years agoPause the catz dbiterator while processing the zone
Ondřej Surý [Thu, 23 Feb 2023 10:10:39 +0000 (11:10 +0100)] 
Pause the catz dbiterator while processing the zone

The dbiterator read-locks the whole zone and it stayed locked during
whole processing time when catz is being read.  Pause the iterator, so
the updates to catz zone are not being blocked while processing the catz
update.

(cherry picked from commit 4e7187601f88a15c61282db862f5025703a7a78a)

3 years agoUnlock catzs during dns__catz_update_cb()
Ondřej Surý [Mon, 27 Feb 2023 23:00:23 +0000 (23:00 +0000)] 
Unlock catzs during dns__catz_update_cb()

Instead of holding the catzs->lock the whole time we process the catz
update, only hold it for hash table lookup and then release it.  This
should unblock any other threads that might be processing updates to
catzs triggered by extra incoming transfer.

(cherry picked from commit b1cd4a066a63f221a56d9565da4907c2aad7e524)

3 years agoOffload catalog zone updates
Aram Sargsyan [Mon, 27 Feb 2023 22:53:23 +0000 (22:53 +0000)] 
Offload catalog zone updates

Offload catalog zone processing so that the network manager threads
are not interrupted by a large catalog zone update.

Introduce a new 'updaterunning' state alongside with 'updatepending',
like it is done in the RPZ module.

Note that the dns__catz_update_cb() function currently holds the
catzs->lock during the whole process, which is far from being optimal,
but the issue is going to be addressed separately.

(cherry picked from commit 0b96c9234fb157e0a06c9906263fa7c631e20a4d)

3 years agoMerge branch 'mnowak/make-openbsd-allow_failure-true-v9_18' into 'v9_18'
Michal Nowak [Tue, 28 Feb 2023 10:40:36 +0000 (10:40 +0000)] 
Merge branch 'mnowak/make-openbsd-allow_failure-true-v9_18' into 'v9_18'

[9.18] Do not fail pipeline because of failed OpenBSD system test

See merge request isc-projects/bind9!7617

3 years agoDo not fail pipeline because of failed OpenBSD system test
Michal Nowak [Mon, 27 Feb 2023 18:22:52 +0000 (19:22 +0100)] 
Do not fail pipeline because of failed OpenBSD system test

System test on OpenBSD is unstable even when test parallelism is
disabled.

(cherry picked from commit fc26da6d894978638f127dc5dd466f76710aed1f)

3 years agoRevert "Disable OpenBSD system test parallelism in CI"
Michal Nowak [Mon, 27 Feb 2023 18:21:58 +0000 (19:21 +0100)] 
Revert "Disable OpenBSD system test parallelism in CI"

This reverts commit 5f21f3203d7abcc02201d276c4e43fe52f2ce070.

(cherry picked from commit a9d3ec33b3c28ccf6feb56e85e9ddace1a3cc03a)

3 years agoMerge branch 'aram/catz-add-shutdown-signaling-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 28 Feb 2023 10:32:32 +0000 (10:32 +0000)] 
Merge branch 'aram/catz-add-shutdown-signaling-v9_18' into 'v9_18'

[9.18] Add shutdown signaling for catalog zones

See merge request isc-projects/bind9!7613

3 years agoAdd a CHANGES note for [GL !7571]
Aram Sargsyan [Tue, 21 Feb 2023 21:20:56 +0000 (21:20 +0000)] 
Add a CHANGES note for [GL !7571]

(cherry picked from commit c76cc5880380e4570c7c535f350b9459d8c50689)

3 years agoAdd shutdown signaling for catalog zones
Aram Sargsyan [Mon, 27 Feb 2023 21:29:24 +0000 (21:29 +0000)] 
Add shutdown signaling for catalog zones

This change should make sure that catalog zone update processing
doesn't happen when the catalog zone is being shut down. This
should help avoid races when offloading the catalog zone updates
in the follow-up commit.

(cherry picked from commit 246b7084d6ecb692643da464e734d719495ae63f)

3 years agoMerge branch 'aram/catz-light-refactoring-and-reference-count-tracing-v9_18' into...
Arаm Sаrgsyаn [Tue, 28 Feb 2023 09:49:51 +0000 (09:49 +0000)] 
Merge branch 'aram/catz-light-refactoring-and-reference-count-tracing-v9_18' into 'v9_18'

[9.18] Implement reference count tracing for dns_catz_zone_t and dns_catz_zones_t

See merge request isc-projects/bind9!7610

3 years agoAdd a CHANGES note for [GL !7570]
Aram Sargsyan [Tue, 21 Feb 2023 21:10:17 +0000 (21:10 +0000)] 
Add a CHANGES note for [GL !7570]

(cherry picked from commit c29299aa15c0e6677d01a7ddf2d5fbb767d79f5e)

3 years agoAdd reference count tracing for dns_catz_zone_t and dns_catz_zones_t
Aram Sargsyan [Mon, 27 Feb 2023 19:24:30 +0000 (19:24 +0000)] 
Add reference count tracing for dns_catz_zone_t and dns_catz_zones_t

Tracing can be activated by defining DNS_RPZ_TRACE in catz.h.

(cherry picked from commit 53f0c5a9ac12e2079f430887eeb8988cb2f89552)

3 years agoLight refactoring of catz.c
Aram Sargsyan [Mon, 27 Feb 2023 18:24:34 +0000 (18:24 +0000)] 
Light refactoring of catz.c

* Change 'dns_catz_new_zones()' function's prototype (the order of the
  arguments) to synchronize it with the similar function in rpz.c.
* Rename 'refs' to 'references' in preparation of ISC_REFCOUNT_*
  macros usage for reference tracking.
* Unify dns_catz_zone_t naming to catz, and dns_catz_zones_t naming to
  catzs, following the logic of similar changes in rpz.c.
* Use C compound literals for structure initialization.
* Synchronize the "new zone version came too soon" log message with the
  one in rpz.c.
* Use more of 'sizeof(*ptr)' style instead of the 'sizeof(type_t)' style
  expressions when allocating or freeing memory for 'ptr'.

(cherry picked from commit 8cb79fec9dbda31b199a5f5fdf3ae3d4c40d6a99)

3 years agoMerge branch '3900-catz-error-path-issues' into 'v9_18'
Arаm Sаrgsyаn [Mon, 27 Feb 2023 14:07:34 +0000 (14:07 +0000)] 
Merge branch '3900-catz-error-path-issues' into 'v9_18'

[9.18] Resolve "Error path cleanup issues in dns_catz_new_zones() and dns_catz_new_zone()"

See merge request isc-projects/bind9!7605

3 years agoAdd a CHANGES note for [GL #3900]
Aram Sargsyan [Mon, 27 Feb 2023 12:11:02 +0000 (12:11 +0000)] 
Add a CHANGES note for [GL #3900]

3 years agoFix a cleanup bug when isc_task_create() fails in dns_catz_new_zones()
Aram Sargsyan [Mon, 27 Feb 2023 12:06:37 +0000 (12:06 +0000)] 
Fix a cleanup bug when isc_task_create() fails in dns_catz_new_zones()

Use isc_mem_putanddetach() instead of isc_mem_put() to detach from the
memory context.

3 years agoFix a memory leak when isc_timer_create() fails in dns_catz_new_zone()
Aram Sargsyan [Mon, 27 Feb 2023 12:04:01 +0000 (12:04 +0000)] 
Fix a memory leak when isc_timer_create() fails in dns_catz_new_zone()

Destroy 'new_zone->coos' in dns_catz_new_zone() on error path.

3 years agoMerge branch '3895-memory-leak-in-isc_hmac_init-v9_18' into 'v9_18'
Mark Andrews [Sun, 26 Feb 2023 23:50:06 +0000 (23:50 +0000)] 
Merge branch '3895-memory-leak-in-isc_hmac_init-v9_18' into 'v9_18'

[9.18] Resolve "memory leak in isc_hmac_init"

See merge request isc-projects/bind9!7604

3 years agoFix memory leak in isc_hmac_init
Mark Andrews [Fri, 24 Feb 2023 01:57:39 +0000 (12:57 +1100)] 
Fix memory leak in isc_hmac_init

If EVP_DigestSignInit failed 'pkey' was not freed.

(cherry picked from commit cf5f13367965e5318487e0c31a56ba53cc2098b3)

3 years agoMerge branch 'mnowak/freebsd-12.4-v9_18' into 'v9_18'
Michal Nowak [Fri, 24 Feb 2023 13:26:34 +0000 (13:26 +0000)] 
Merge branch 'mnowak/freebsd-12.4-v9_18' into 'v9_18'

[9.18] Add FreeBSD 12.4

See merge request isc-projects/bind9!7599

3 years agoAdd FreeBSD 12.4
Michal Nowak [Tue, 6 Dec 2022 16:58:47 +0000 (17:58 +0100)] 
Add FreeBSD 12.4

(cherry picked from commit 2307661b1ad7af1e2c2ad3d3420aee1d70b5aa3f)

3 years agoMerge branch 'mnowak/alpine-3.17-v9_18' into 'v9_18'
Michal Nowak [Fri, 24 Feb 2023 12:24:13 +0000 (12:24 +0000)] 
Merge branch 'mnowak/alpine-3.17-v9_18' into 'v9_18'

[9.18] Add Alpine Linux 3.17

See merge request isc-projects/bind9!7596

3 years agoDrop date from "Regularly Tested Platforms" section
Michal Nowak [Tue, 3 Jan 2023 10:08:37 +0000 (11:08 +0100)] 
Drop date from "Regularly Tested Platforms" section

Changing the date is easy to forget and may be outdated.

(cherry picked from commit 5783280b1078797b20c674764a7ef5aaaec66e92)

3 years agoAdd Alpine Linux 3.17
Michal Nowak [Wed, 25 Jan 2023 15:55:46 +0000 (16:55 +0100)] 
Add Alpine Linux 3.17

(cherry picked from commit 345089ad2365917b941e2e74da91a0355a1979c4)

3 years agoMerge branch 'mnowak/update_TEST_PARALLEL_JOBS_for_BSD-v9_18' into 'v9_18'
Michal Nowak [Fri, 24 Feb 2023 09:18:24 +0000 (09:18 +0000)] 
Merge branch 'mnowak/update_TEST_PARALLEL_JOBS_for_BSD-v9_18' into 'v9_18'

[9.18] Disable OpenBSD system test parallelism in CI

See merge request isc-projects/bind9!7590

3 years agoDisable OpenBSD system test parallelism in CI
Michal Nowak [Wed, 22 Feb 2023 10:42:36 +0000 (11:42 +0100)] 
Disable OpenBSD system test parallelism in CI

Make OpenBSD system tests more stable by disabling parallelism in CI.

Accordingly, they will run 3-4 times longer.

(cherry picked from commit d73eba57bd03dce575f4cf4e42c80e1bced08bed)

3 years agoDo not set TEST_PARALLEL_JOBS in FreeBSD system test
Michal Nowak [Wed, 22 Feb 2023 10:38:45 +0000 (11:38 +0100)] 
Do not set TEST_PARALLEL_JOBS in FreeBSD system test

Setting TEST_PARALLEL_JOBS to 4 in FreeBSD system test jobs is a no-op
because it's already set to 4, one level above, on the global level.

(cherry picked from commit cf46addf514238e9ac0d96e66300cc3f2e6bb0c4)

3 years agoMerge branch 'ondrej-restore-sonarcloud-analysis-v9_18' into 'v9_18'
Ondřej Surý [Fri, 24 Feb 2023 08:56:39 +0000 (08:56 +0000)] 
Merge branch 'ondrej-restore-sonarcloud-analysis-v9_18' into 'v9_18'

[9.18] Add SonarCloud GitHub Action

See merge request isc-projects/bind9!7591

3 years agoAdd SonarCloud GitHub Action
Ondřej Surý [Fri, 24 Feb 2023 07:41:51 +0000 (08:41 +0100)] 
Add SonarCloud GitHub Action

Add new SonarCloud GitHub Action and configuration; something (maybe
the way the builds were submitted) has apparently changed and the
project got deleted and the analysis wasn't working.

(cherry picked from commit 4bfbb4ddf75479b13ec1a0b6ddaf2b9097779901)

3 years agoMerge branch '3622-serve-stale-rrsig-test-v9_18' into 'v9_18'
Tom Krizek [Wed, 22 Feb 2023 13:09:08 +0000 (13:09 +0000)] 
Merge branch '3622-serve-stale-rrsig-test-v9_18' into 'v9_18'

[9.18][CVE-2022-3736] Test RRSIG queries with serve-stale enabled

See merge request isc-projects/bind9!7579

3 years agoTest RRSIG queries with serve-stale enabled
Mark Andrews [Wed, 26 Oct 2022 07:39:37 +0000 (18:39 +1100)] 
Test RRSIG queries with serve-stale enabled

Make RRSIG queries where the existing tests trigger a DNS_EVENT_TRYSTALE
event.

(cherry picked from commit add40273dfd3a70a238d9ec4dc87c512d08429ee)

3 years agoMerge branch '3619-serve-stale-client-timeout-crash-test-v9_18' into 'v9_18'
Tom Krizek [Wed, 22 Feb 2023 11:56:58 +0000 (11:56 +0000)] 
Merge branch '3619-serve-stale-client-timeout-crash-test-v9_18' into 'v9_18'

[9.18][CVE-2022-3924] Add a reproducer for the serve-stale crash when recursive clients soft quota is reached

See merge request isc-projects/bind9!7576

3 years agoAdd tests for CVE-2022-3924
Aram Sargsyan [Fri, 11 Nov 2022 14:44:26 +0000 (14:44 +0000)] 
Add tests for CVE-2022-3924

Reproduce the assertion by configuring a 'named' resolver with
'recursive-clients 10;' configuration option and running 20
queries is parallel.

Also tweak the 'ans2/ans.pl' to simulate a 50ms network latency
when qname starts with "latency". This makes sure that queries
running in parallel don't get served immediately, thus allowing
the configured recursive clients quota limitation to be activated.

(cherry picked from commit 4b52b0b4a95650565cb646c5060b9af30a5e565f)

3 years agoMerge branch 'matthijs-fix-kasp-attach-detach-usage-v9_18' into 'v9_18'
Matthijs Mekking [Tue, 21 Feb 2023 16:37:55 +0000 (16:37 +0000)] 
Merge branch 'matthijs-fix-kasp-attach-detach-usage-v9_18' into 'v9_18'

[9.18] Fix dns_kasp_attach / dns_kasp_detach usage

See merge request isc-projects/bind9!7566

3 years agoFix dns_kasp_attach / dns_kasp_detach usage
Mark Andrews [Tue, 21 Feb 2023 01:15:01 +0000 (12:15 +1100)] 
Fix dns_kasp_attach / dns_kasp_detach usage

The kasp pointers in dns_zone_t should consistently be changed by
dns_kasp_attach and dns_kasp_detach so the usage is balanced.

(cherry picked from commit b41882cc75c9d820c5642c88a6cd90fec32b8397)

3 years agoMerge branch '3880-fix-rpz-assertion-failure-during-failed-reconfiguration-v9_18...
Arаm Sаrgsyаn [Tue, 21 Feb 2023 09:59:58 +0000 (09:59 +0000)] 
Merge branch '3880-fix-rpz-assertion-failure-during-failed-reconfiguration-v9_18' into 'v9_18'

[9.18] Detach rpzs and catzs from the previous view

See merge request isc-projects/bind9!7564

3 years agoAdd a CHANGES note for [GL #3880]
Aram Sargsyan [Fri, 17 Feb 2023 13:12:05 +0000 (13:12 +0000)] 
Add a CHANGES note for [GL #3880]

(cherry picked from commit b086374b1de40e5b98adc0d1f8d66bdf31249f56)

3 years agoDetach rpzs and catzs from the previous view
Aram Sargsyan [Fri, 17 Feb 2023 12:41:29 +0000 (12:41 +0000)] 
Detach rpzs and catzs from the previous view

When switching to a new view during a reconfiguration (or reverting
to the old view), detach the 'rpzs' and 'catzs' from the previuos view.

The 'catzs' case was earlier solved slightly differently, by detaching
from the new view when reverting to the old view, but we can not solve
this the same way for 'rpzs', because now in BIND 9.19 and BIND 9.18
a dns_rpz_shutdown_rpzs() call was added in view's destroy() function
before detaching the 'rpzs', so we can not leave the 'rpzs' attached to
the previous view and let it be shut down when we intend to continue
using it with the new view.

Instead, "re-fix" the issue for the 'catzs' pointer the same way as
for 'rpzs' for consistency, and also because a similar shutdown call
is likely to be implemented for 'catzs' in the near future.

(cherry picked from commit 121a095a22302472bc545476ea64f6b79bef9da6)

3 years agoAdd an "rpz" system test check for a failed reconfiguration
Aram Sargsyan [Fri, 17 Feb 2023 12:38:40 +0000 (12:38 +0000)] 
Add an "rpz" system test check for a failed reconfiguration

The faulty "DLZ" configuration triggers a reconfiguration failure
in such a place where view reverting code is covered.

(cherry picked from commit 95f4bac00236fd430131b8db8009de777d8db444)

3 years agoMerge branch 'each-cleanup-gethostname-v9_18' into 'v9_18'
Evan Hunt [Sat, 18 Feb 2023 20:52:49 +0000 (20:52 +0000)] 
Merge branch 'each-cleanup-gethostname-v9_18' into 'v9_18'

[9.18] Merge branch 'each-cleanup-gethostname' into 'main'

See merge request isc-projects/bind9!7559

3 years agoremove named_os_gethostname()
Evan Hunt [Thu, 9 Feb 2023 20:48:07 +0000 (12:48 -0800)] 
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 197334464e93c8a603864c7a3d85a3a185da7463)

3 years agoMerge branch '3879-hmac_createctx-fails-to-free-context-on-isc_hmac_init-failure...
Mark Andrews [Sat, 18 Feb 2023 00:50:26 +0000 (00:50 +0000)] 
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

3 years agoIn hmac_createctx free ctx on isc_hmac_init failure
Mark Andrews [Fri, 17 Feb 2023 00:44:45 +0000 (11:44 +1100)] 
In hmac_createctx free ctx on isc_hmac_init failure

(cherry picked from commit d22257a370c69060e17a466db7698c96e23526b5)

3 years agoMerge branch 'mnowak/qa-tools-update-v9_18' into 'v9_18'
Michal Nowak [Fri, 17 Feb 2023 15:32:17 +0000 (15:32 +0000)] 
Merge branch 'mnowak/qa-tools-update-v9_18' into 'v9_18'

[9.18] Python formatting updates

See merge request isc-projects/bind9!7553

3 years agoFix unnecessary "else" after "raise" with pylint 2.16.2
Michal Nowak [Fri, 17 Feb 2023 12:21:55 +0000 (13:21 +0100)] 
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 8064ac6becc0a5b2760d90923f41e8767bc24153)

3 years agoAdapt to Python scripts to black 23.1.0
Michal Nowak [Fri, 17 Feb 2023 12:16:13 +0000 (13:16 +0100)] 
Adapt to Python scripts to black 23.1.0

(cherry picked from commit 3cd2cc6254c5211184981d6990022673d7b3d910)

3 years agoMerge branch '3869-dig-fails-to-cleanup-openssl-references-v9_18' into 'v9_18'
Mark Andrews [Thu, 16 Feb 2023 23:43:12 +0000 (23:43 +0000)] 
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

3 years agoCleanup OpenSSL reference on bad option
Mark Andrews [Mon, 30 Jan 2023 04:26:52 +0000 (15:26 +1100)] 
Cleanup OpenSSL reference on bad option

Another exit path that needs to be cleaned up.

(cherry picked from commit e27fc4bbc54eaa2db3f3d12b871f8d7dc32298a8)

3 years agoCleanup OpenSSL reference on bad domain name
Mark Andrews [Sun, 29 Jan 2023 23:47:57 +0000 (10:47 +1100)] 
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 4c2525c4185c02d905f7017336f4847663b4ab8d)

3 years agoMerge tag 'v9_18_12' into v9_18
Michal Nowak [Thu, 16 Feb 2023 16:40:52 +0000 (17:40 +0100)] 
Merge tag 'v9_18_12' into v9_18

BIND 9.18.12

3 years agoMerge branch 'feature/main/fips-tests-v9_18' into 'v9_18'
Mark Andrews [Wed, 15 Feb 2023 21:56:45 +0000 (21:56 +0000)] 
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

3 years agoAdd CHANGES note for [GL !7417]
Mark Andrews [Wed, 15 Feb 2023 03:42:34 +0000 (14:42 +1100)] 
Add CHANGES note for [GL !7417]

(cherry picked from commit 55a6b150870de26383f9d638f760ab56ecf2c397)

3 years agoFIPS tests changes for RHEL
Petr Menšík [Thu, 2 Aug 2018 21:46:45 +0000 (23:46 +0200)] 
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 6ad794a8cdd092bbb093660164739ad2d1469fa3)

3 years agoMerge branch '3849-relax-diff-on-dig-short-output-v9_18' into 'v9_18'
Tom Krizek [Tue, 14 Feb 2023 13:26:11 +0000 (13:26 +0000)] 
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

3 years agoIgnore dig errors in +short comparisons in tests
Tom Krizek [Mon, 13 Feb 2023 12:58:47 +0000 (13:58 +0100)] 
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 bd1ef66f836c564ce44c5dacd04d73bb4f36db59)

3 years agoMerge branch '3866-fix-rpz-reference-counting-bug-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 14 Feb 2023 12:28:31 +0000 (12:28 +0000)] 
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

3 years agoAdd a CHANGES note for [GL #3866]
Aram Sargsyan [Mon, 13 Feb 2023 15:19:08 +0000 (15:19 +0000)] 
Add a CHANGES note for [GL #3866]

(cherry picked from commit a5927f115128a4487961eca0159a71cb26d84844)

3 years agoFix RPZ reference counting error on shutdown
Aram Sargsyan [Mon, 13 Feb 2023 14:47:09 +0000 (14:47 +0000)] 
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 afbe63565fa444f13359425554c871cc924d9547)

3 years agoMerge branch '3735-fix-rpz-shutdown-bugs-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 14 Feb 2023 11:19:02 +0000 (11:19 +0000)] 
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

3 years agoAdd a CHANGES note for [GL #3735]
Aram Sargsyan [Tue, 3 Jan 2023 13:27:00 +0000 (13:27 +0000)] 
Add a CHANGES note for [GL #3735]

(cherry picked from commit 2824422e783da56a548254ed656792f67e95376c)

3 years agoFix an error path bug in rpz.c:update_nodes()
Aram Sargsyan [Tue, 3 Jan 2023 13:34:58 +0000 (13:34 +0000)] 
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 ef4f15d2d1f2b97c1443c3dc0422765bdc06ef9e)

3 years agoFix a shutdown and error path bugs in rpz.c:update_nodes()
Aram Sargsyan [Tue, 3 Jan 2023 13:24:38 +0000 (13:24 +0000)] 
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 d36728e42f8d099df0dc1d6d8a318ca57f6e57d3)

3 years agoFix a shutdown bug in update_rpz_cb()
Aram Sargsyan [Tue, 3 Jan 2023 13:21:34 +0000 (13:21 +0000)] 
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 975d16230b5831532ec66769b60657c86882a244)

3 years agoMerge branch 'aram/ondrej-eliminitate-rpzs-irefs-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Tue, 14 Feb 2023 10:24:47 +0000 (10:24 +0000)] 
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

3 years agoRefactor dns_rpz unit to use single reference counting
Ondřej Surý [Wed, 5 Oct 2022 09:21:28 +0000 (11:21 +0200)] 
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 77659e739274a62573a00d029a273db6f55f7125)

3 years agoMerge branch '3662-extend-mkeys-system-test-to-handle-islands-of-trust-v9_18' into...
Mark Andrews [Tue, 14 Feb 2023 00:25:24 +0000 (00:25 +0000)] 
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

3 years agoAdd CHANGES note for [GL #3662]
Mark Andrews [Thu, 17 Nov 2022 01:18:49 +0000 (12:18 +1100)] 
Add CHANGES note for [GL #3662]

(cherry picked from commit 2928f217339c144969eb117ff87a02c69a3e54c6)

3 years agoAdd islands of trust to mkeys test
Mark Andrews [Wed, 9 Nov 2022 16:01:42 +0000 (16:01 +0000)] 
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 41bdb5b9fe10cae075cb27b417fdb4aa1c1538c4)

3 years agoReport the key name that failed in retry_keyfetch
Mark Andrews [Wed, 9 Nov 2022 12:12:07 +0000 (12:12 +0000)] 
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 fb7b7ac4959be1f8b038a6cb53a8ba823ee7f7da)

3 years agoMerge branch 'fanf-named-compilezone-stray-backtick-v9_18' into 'v9_18'
Tony Finch [Mon, 13 Feb 2023 18:26:25 +0000 (18:26 +0000)] 
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

3 years agoFix the reference to RFC 1035 in named-compilezone(1)
Tony Finch [Sun, 5 Feb 2023 20:04:02 +0000 (20:04 +0000)] 
Fix the reference to RFC 1035 in named-compilezone(1)

There was a stray backquote

(cherry picked from commit ef1170b3fcbddf8ddcef895180fe9576c1bf9d8c)

3 years agoMerge branch '3848-increase-wait-time-runtime-test-v9_18' into 'v9_18'
Tom Krizek [Mon, 13 Feb 2023 15:33:54 +0000 (15:33 +0000)] 
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

3 years agoIncrease named startup wait time for runtime test
Tom Krizek [Mon, 6 Feb 2023 13:16:44 +0000 (14:16 +0100)] 
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 b8bb4233e879c8a9eb8c545a3a7a17fabfb645db)

3 years agoMerge branch 'mnowak/pairwise-test-auth-recursive-servers-v9_18' into 'v9_18'
Michal Nowak [Mon, 13 Feb 2023 15:00:05 +0000 (15:00 +0000)] 
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

3 years agoStart named as auth and recursive server in pairwise
Michal Nowak [Wed, 18 Jan 2023 16:41:21 +0000 (17:41 +0100)] 
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 a708c2f93d672a331d7abf3588a05582163362fe)

3 years agoMerge branch '3190-offload-rpz-updates-2nd-round-v9_18' into 'v9_18'
Arаm Sаrgsyаn [Mon, 13 Feb 2023 12:31:24 +0000 (12:31 +0000)] 
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

3 years agoAdd CHANGES and release note for [GL #3190]
Ondřej Surý [Tue, 8 Mar 2022 17:36:08 +0000 (18:36 +0100)] 
Add CHANGES and release note for [GL #3190]

(cherry picked from commit 23a4559b3496e392e1106de3fe263baa5b01aa74)

3 years agoRun the RPZ update as offloaded work
Ondřej Surý [Mon, 7 Mar 2022 12:55:03 +0000 (13:55 +0100)] 
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 f106d0ed2b8f3b3fa78b831879c1533a0d3ec171)

3 years agoRefactor the dns_rpz_add/delete to use local rpz copy
Ondřej Surý [Tue, 8 Mar 2022 16:13:26 +0000 (17:13 +0100)] 
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 b6e885c97ff5e80d9108fb53eed28cf11aadbb86)