Commit graph

37474 commits

Author SHA1 Message Date
Mark Andrews
cdbebb0a69
Now logs UV versions when starting up
Named now logs both compile time and run time UV versions when
starting up.  This is useful information to have when debugging
network issues involving named.

(cherry picked from commit 5fd2cd8018)
2023-03-03 09:31:54 +01:00
Arаm Sаrgsyаn
c70914d788 Merge branch '3907-data-race-in-rbtdb-v9_18' into 'v9_18'
[9.18] Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1365 in newversion"

See merge request isc-projects/bind9!7640
2023-03-02 20:22:15 +00:00
Aram Sargsyan
9c48b6619a Check if catz is active in dns__catz_update_cb()
A reconfiguration can deactivate the catalog zone, while the
offloaded update process was preparing to run.

(cherry picked from commit 6980e3b354)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
2e348627a1 Check if catz is active in dns__catz_timer_cb()
A reconfiguration can deactivate the catalog zone, while the
update process was deferred using a timer.

(cherry picked from commit 67c77aba38)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
fb15a6d6f6 Use catzs->lock in dns_catz_prereconfig()
There can be an update running in another thread, so use a lock,
like it's done in dns_catz_postreconfig().

(cherry picked from commit 3973724d67)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
b230fbb591 Add a CHANGES note for [GL #3907]
(cherry picked from commit cb0d6393a7)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
d6001423af catz: protect db_registered and db callback (un)registration with a lock
Doing this to avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions.

(cherry picked from commit a87859f1fa)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
574682b8c7 catz: use two pairs of dns_db_t and dns_dbversion_t in a catalog zone
As it is done in the RPZ module, use 'db' and 'dbversion' for the
database we are going to update to, and 'updb' and 'updbversion' for
the database we are working on.

Doing this should avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions.

(cherry picked from commit d2ecff3c4a)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
363061a1fc Update the CHANGES note for [GL #3777]
Remove the part which is no longer true after reverting the commit
in question.

The CHANGES entry was never part of a released BIND 9 version.

(cherry picked from commit e1627e1289)
2023-03-02 18:57:16 +00:00
Aram Sargsyan
6834ea968e Revert "Process db callbacks in zone_loaddone() after zone_postload()"
This reverts commit a719647023.

The commit introduced a data race, because dns_db_endload() is called
after unfreezing the zone.

(not cherry picked from commit 593dea871a)
2023-03-02 18:55:06 +00:00
Arаm Sаrgsyаn
8ccdf53fa9 Merge branch 'aram/catz-add-lock-for-dns_catz_zone_t-v9_18' into 'v9_18'
[9.18] Add a lock for dns_catz_zone_t

See merge request isc-projects/bind9!7636
2023-03-01 17:56:33 +00:00
Aram Sargsyan
9fdce9948e Add a lock for dns_catz_zone_t
Use a lock for the catalog zones during dns__catz_zones_merge() to
avoid races between 'catz' and 'parentcatz'.

(cherry picked from commit 2ae3bc6e1d)
2023-03-01 17:05:15 +00:00
Arаm Sаrgsyаn
48981ccc84 Merge branch '3911-reconfig-zone-view-revert-bugfix-v9_18' into 'v9_18'
[9.18] Fix view's zones reverting bug during reconfiguration

See merge request isc-projects/bind9!7634
2023-03-01 16:45:43 +00:00
Aram Sargsyan
4a5156f132 Add CHANGES and release notes for [GL #3911]
(cherry picked from commit e1036253db)
2023-03-01 15:41:10 +00:00
Aram Sargsyan
78f1d256a3 Fix view's zones reverting bug during reconfiguration
During reconfiguration, the configure_view() function reverts the
configured zones to the previous view in case if there is an error.

It uses the 'zones_configured' boolean variable to decide whether
it is required to revert the zones, i.e. the error happened after
all the zones were successfully configured.

The problem is that it does not account for the case when an error
happens during the configuration of one of the zones (not the first),
in which case there are zones that are already configured for the
new view (and they need to be reverted), and there are zones that
are not (starting from the failed one).

Since 'zones_configured' remains 'false', the configured zones are
not reverted.

Replace the 'zones_configured' variable with a pointer to the latest
successfully configured zone configuration element, and when reverting,
revert up to and including that zone.

(cherry picked from commit 84c235a4b0)
2023-03-01 15:40:33 +00:00
Aram Sargsyan
789ce76dd1 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 93c4f382f4)
2023-03-01 15:39:39 +00:00
Mark Andrews
2f808b76e5 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
2023-03-01 00:57:07 +00:00
Mark Andrews
51f25b52e4 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 db7af9fcc1)
2023-03-01 10:50:02 +11:00
Arаm Sаrgsyаn
6060c33161 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
2023-02-28 16:21:12 +00:00
Aram Sargsyan
6b7d2df6b8 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 580ef2e18f)
2023-02-28 14:52:35 +00:00
Arаm Sаrgsyаn
1b8cd6a59d 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
2023-02-28 14:29:55 +00:00
Aram Sargsyan
09667330d4 Add a CHANGES note for [GL #3777]
(cherry picked from commit 46b1c558ce)
2023-02-28 13:47:18 +00:00
Aram Sargsyan
e9acfbd43a 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 cf79692a66)
2023-02-28 13:47:18 +00:00
Aram Sargsyan
00569f62b3 Searching catzs->zones requires a read lock
Lock the catzs->lock mutex before searching in the catzs->zones
hash table.

(cherry picked from commit 0ef0c86632)
2023-02-28 13:47:18 +00:00
Aram Sargsyan
a719647023 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 ed268b46f1)
2023-02-28 13:47:18 +00:00
Aram Sargsyan
7e4d450c1e 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 a73b67456e)
2023-02-28 13:47:18 +00:00
Michal Nowak
ed598a8c7a 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
2023-02-28 13:31:24 +00:00
Artem Boldariev
c392b57e50
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 705f0d1ed1)
2023-02-28 14:26:13 +01:00
Mark Andrews
5b1fbe0c1f 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
2023-02-28 12:49:38 +00:00
Mark Andrews
aa8bcc0a5a 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 c7ae975ecf)
2023-02-28 12:26:45 +00:00
Mark Andrews
1c0ef5fabe 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 af47090d99)
2023-02-28 12:26:45 +00:00
Michał Kępień
902cd753c1 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
2023-02-28 12:12:16 +00:00
Michał Kępień
7dfd4ec61b 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 a4d6f5f6fd)
2023-02-28 12:57:41 +01:00
Michał Kępień
8fcf05a724 (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 37b9511ce1 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 b396f55586)
2023-02-28 12:57:41 +01:00
Arаm Sаrgsyаn
c0a72cf6fd 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
2023-02-28 11:36:21 +00:00
Aram Sargsyan
bc885fb489 Add CHANGES and release notes for [GL #3881]
(cherry picked from commit cb1cd67bea)
2023-02-28 11:11:17 +00:00
Ondřej Surý
8b059b211f 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 4e7187601f)
2023-02-28 11:11:17 +00:00
Ondřej Surý
d13e7472ea 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 b1cd4a066a)
2023-02-28 11:11:17 +00:00
Aram Sargsyan
16dc8c3977 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 0b96c9234f)
2023-02-28 11:11:17 +00:00
Michal Nowak
cb588a7b75 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
2023-02-28 10:40:36 +00:00
Michal Nowak
a2ccda7872
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 fc26da6d89)
2023-02-28 11:34:39 +01:00
Michal Nowak
157f098248
Revert "Disable OpenBSD system test parallelism in CI"
This reverts commit 5f21f3203d.

(cherry picked from commit a9d3ec33b3)
2023-02-28 11:34:38 +01:00
Arаm Sаrgsyаn
a24a62924e 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
2023-02-28 10:32:32 +00:00
Aram Sargsyan
5ecc4bedbe Add a CHANGES note for [GL !7571]
(cherry picked from commit c76cc58803)
2023-02-28 09:50:42 +00:00
Aram Sargsyan
ed942f5536 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 246b7084d6)
2023-02-28 09:50:42 +00:00
Arаm Sаrgsyаn
ceba260fb8 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
2023-02-28 09:49:51 +00:00
Aram Sargsyan
396265c8fa Add a CHANGES note for [GL !7570]
(cherry picked from commit c29299aa15)
2023-02-27 20:43:48 +00:00
Aram Sargsyan
f8663976ff 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 53f0c5a9ac)
2023-02-27 20:43:48 +00:00
Aram Sargsyan
43d99eb8b8 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 8cb79fec9d)
2023-02-27 20:43:48 +00:00
Arаm Sаrgsyаn
ca9bbd43c6 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
2023-02-27 14:07:34 +00:00