Commit Graph

38256 Commits

Author SHA1 Message Date
Ondřej Surý
d9fc95f842 Fix assertion failure when using -X and lock-file in configuration
When 'lock-file <lockfile1>' was used in configuration at the same time
as using `-X <lockfile2>` in `named` invocation, there was an invalid
logic that would lead to a double isc_mem_strdup() call on the
<lockfile2> value.

Skip the second allocation if `lock-file` is being used in
configuration, so the <lockfile2> is used only single time.

(cherry picked from commit 4f68def5e9)
2023-10-26 13:59:46 +02:00
Tom Krizek
bf330dc3cc Merge branch 'tkrizek/shfmt-9.18' into 'bind-9.18'
[9.18] Enforce shell script codestyle with shfmt

See merge request isc-projects/bind9!8429
2023-10-26 11:59:05 +00:00
Tom Krizek
914654efeb Ignore shell script formatting in git blame
(cherry picked from commit c8fb0b48e0)
2023-10-26 13:07:44 +02:00
Tom Krizek
5bd67594b1 Add editorconfig file for shell style
(cherry picked from commit bebdfa13be)
2023-10-26 13:06:55 +02:00
Tom Krizek
a17230fefb Run shfmt in CI
Ensure our shell script format stays consistent in the future.

(cherry picked from commit b6505ff573)
2023-10-26 13:06:53 +02:00
Tom Krizek
b8b9b4ac2c Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)

(manually replayed commit 4cb8b13987)
2023-10-26 13:05:00 +02:00
Mark Andrews
fd2e6f90a4 Merge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed-bind-9.18' into 'bind-9.18'
[9.18] Resolve "lock file is deleted on exit even if lock acquisition failed"

See merge request isc-projects/bind9!8424
2023-10-26 07:47:14 +00:00
Mark Andrews
81b5a94ad8 Add release note for [GL #4387]
(cherry picked from commit c1b8279ebb)
2023-10-26 18:05:26 +11:00
Mark Andrews
46870c74e6 Add CHANGES note for [GL #4387]
(cherry picked from commit a8613372c9)
2023-10-26 18:05:25 +11:00
Mark Andrews
74ab7e4660 Check that the lock file was not removed too early
When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

(cherry picked from commit 811c9ee7d1)
2023-10-26 18:05:07 +11:00
Mark Andrews
534cadba3a Only remove the lock file if we managed to lock it
The lock file was being removed when we hadn't successfully locked
it which defeated the purpose of the lockfile.  Adjust cleanup_lockfile
such that it only unlinks the lockfile if we have successfully locked
the lockfile and it is still active (lockfile != NULL).

(cherry picked from commit b9c789b8b3)
2023-10-26 18:05:07 +11:00
Arаm Sаrgsyаn
d18be57900 Merge branch '4381-assert-in-dns__catz_update_cb-on-shutdown-9.18' into 'bind-9.18'
[9.18] Resolve "Assertion failure in dns__catz_update_cb() on shutdown"

See merge request isc-projects/bind9!8413
2023-10-23 11:08:16 +00:00
Aram Sargsyan
4f29e514df Add a CHANGES note for [GL #4381]
(cherry picked from commit 598107f1c2)
2023-10-23 10:53:40 +00:00
Aram Sargsyan
2141bde46b Fix shutdown races in catzs
The dns__catz_update_cb() does not expect that 'catzs->zones'
can become NULL during shutdown.

Add similar checks in the dns__catz_update_cb() and dns_catz_zone_get()
functions to protect from such a case. Also add an INSIST in the
dns_catz_zone_add() function to explicitly state that such a case
is not expected there, because that function is called only during a
reconfiguration.

(cherry picked from commit 4eb4fa288c)
2023-10-23 10:53:40 +00:00
Michal Nowak
59294c4320 Merge branch 'mnowak/drop-ubuntu-bionic' into 'bind-9.18'
Drop Ubuntu 18.04 "bionic"

See merge request isc-projects/bind9!8365
2023-10-23 09:52:13 +00:00
Michal Nowak
6d100c4a32 Drop Ubuntu 18.04 "bionic"
Ubuntu 18.04 LTS (Bionic Beaver) is EOL.

Move gcc:bionic:amd64-specific CFLAGS and EXTRA_CONFIGURE to
gcc:jammy:amd64.
2023-10-23 11:47:01 +02:00
Michal Nowak
a9a2700672 Merge branch '4152-reproducer-stack-exhaustion-9.18' into 'bind-9.18'
[9.18] Add test for CVE-2023-3341

See merge request isc-projects/bind9!8411
2023-10-20 14:56:57 +00:00
Michal Nowak
114551659e Add test for CVE-2023-3341
(cherry picked from commit 7d1834b250)
2023-10-20 16:27:31 +02:00
Mark Andrews
d25813a08a Merge branch '4260-adjust-udp-refresh-timeouts-bind-9.18' into 'bind-9.18'
[9.18] Adjust UDP zone maintenance timeouts

See merge request isc-projects/bind9!8405
2023-10-20 00:45:26 +00:00
Mark Andrews
593647bde5 add CHANGES for [GL #4260]
(cherry picked from commit 1a9791b4d8)
2023-10-20 00:16:01 +00:00
Mark Andrews
306ee4cb28 Adjust UDP timeouts used in zone maintenance
Drop timeout before resending a UDP request from 15 seconds to 5
seconds and add 1 second to the total time to allow for the reply
to the third request to arrive.  This will speed up the time it
takes for named to recover from a lost packet when refreshing a
zone and for it to determine that a primary is down.

(cherry picked from commit 29f399797d)
2023-10-20 00:16:01 +00:00
Mark Andrews
f82844aee1 Merge branch '4378-uv_sleep-wrapper-misses-parentheses-causing-unit-test-hang-bind-9.18' into 'bind-9.18'
[9.18] Resolve "uv_sleep wrapper misses parentheses, causing unit test hang"

See merge request isc-projects/bind9!8404
2023-10-20 00:05:31 +00:00
Mark Andrews
ebfbad29c1 Add parentheses around macro arguement 'msec'
The is needed to ensure that the multiplication is correctly done.
This was reported by Jinmei Tatuya.
2023-10-20 10:30:48 +11:00
Michal Nowak
b0f3a440f1 Merge branch 'mnowak/llvm-17-9.18' into 'bind-9.18'
[9.18] Update clang to version 17

See merge request isc-projects/bind9!8398
2023-10-18 07:42:36 +00:00
Michal Nowak
7c6632e174 Update the source code formatting using clang-format-17 2023-10-18 09:02:57 +02:00
Michal Nowak
1cf082baa6 Update clang to version 17
(cherry picked from commit 625a4ffc7a)
2023-10-18 09:02:18 +02:00
Mark Andrews
5c35ca97b9 Merge branch '4368-callback-prototype-mismatch' into 'bind-9.18'
Resolve "tcp_noresponse check fails with LLVM 17"

See merge request isc-projects/bind9!8394
2023-10-17 22:06:16 +00:00
Mark Andrews
a25ab7ec25 Fix callback to match prototype
noop_accept_cb triggers an undefined behaviour failure with LLVM 17.
The return type mismatched the prototype.  Also return ISC_R_SUCCESS
instead of 0.
2023-10-17 17:47:24 +11:00
Mark Andrews
bde42c4293 Merge branch '4365-update-dangerfile-py-to-know-about-cve-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Update dangerfile.py to know about `:cve:`"

See merge request isc-projects/bind9!8391
2023-10-17 02:51:34 +00:00
Mark Andrews
da6077b7f7 Update dangerfile.py to know about ':cve:'
(cherry picked from commit dbc2167325)
2023-10-17 13:19:12 +11:00
Matthijs Mekking
837082fbfb Merge branch 'matthijs-kasp-system-test-nit-fixes-v9_18' into 'bind-9.18'
Two minor fixes in the kasp system test

See merge request isc-projects/bind9!8390
2023-10-16 11:19:33 +00:00
Matthijs Mekking
e3f65d465c Two minor fixes in the kasp system test
The 'dynamic-signed-inline-signing.kasp' zone was set up with
the environment variable 'ksktimes', but that should be 'csktimes'
which is set one line above. Since the values are currently the same
the behavior is identical, but of course it should use the correct
variable.

The 'step4.enable-dnssec.autosign' zone was set up twice. This is
unnecessary.

(cherry picked from commit 21d04f556d)
2023-10-16 12:34:52 +02:00
Matthijs Mekking
bae7534a24 Merge branch '4350-resign-triggered-on-raw-dnssec-zone-9.18' into 'bind-9.18'
[9.18]  Don't schedule resign for raw version of an inline-signing zone

See merge request isc-projects/bind9!8388
2023-10-16 09:10:34 +00:00
Matthijs Mekking
641da0ff0f Add changes and release note for #4350
(cherry picked from commit a8306b541b)
2023-10-16 10:34:43 +02:00
Matthijs Mekking
ac1b70ad00 Don't resign raw version of the zone
Update the function 'set_resigntime()' so that raw versions of
inline-signing zones are not scheduled to be resigned.

Also update the check in the same function for zone is dynamic, there
exists a function 'dns_zone_isdynamic()' that does a similar thing
and is more complete.

Also in 'zone_postload()' check whether the zone is not the raw
version of an inline-signing zone, preventing calculating the next
resign time.

(cherry picked from commit 741ce2d07a)
2023-10-16 10:34:17 +02:00
Matthijs Mekking
e9989c541b Add test case for GL #4350
Add a test scenario for a dynamic zone that uses inline-signing which
accidentally has signed the raw version of the zone.

This should not trigger resign scheduling on the raw version of the
zone.

(cherry picked from commit c90b622648)
2023-10-16 10:33:25 +02:00
Arаm Sаrgsyаn
ecebd9187c Merge branch '4360-fix-undefined-behaviours-detected-by-llvm-17-9.18' into 'bind-9.18'
[9.18] Resolve "Undefined behaviours detected by LLVM 17 (noop_accept_cb, dns__nta_shutdown_cb)"

See merge request isc-projects/bind9!8383
2023-10-13 12:10:47 +00:00
Aram Sargsyan
59741ddea9 Fix undefined behaviour occurrences
The undefined behaviour was detected by LLVM 17. Fix the affected
functions definitions to match the expected function type.

(cherry picked from commit 20fdab8667)
2023-10-13 11:25:53 +00:00
Ondřej Surý
f0b21a2218 Merge branch 'ondrej/dont-undef-TRACE-define-9.18' into 'bind-9.18'
[9.18] Don't undef <unit>_TRACE, instead add comment how to enable it

See merge request isc-projects/bind9!8382
2023-10-13 11:09:08 +00:00
Ondřej Surý
905f8c5899 Don't undef <unit>_TRACE, instead add comment how to enable it
In units that support detailed reference tracing via ISC_REFCOUNT
macros, we were doing:

    /* Define to 1 for detailed reference tracing */
    #undef <unit>_TRACE

This would prevent using -D<unit>_TRACE=1 in the CFLAGS.

Convert the above mentioned snippet with just a comment how to enable
the detailed reference tracing:

    /* Add -D<unit>_TRACE=1 to CFLAGS for detailed reference tracing */

(cherry picked from commit 6afa961534)
2023-10-13 11:46:41 +02:00
Petr Špaček
b12e5bc84d Merge branch 'pspacek/doc-and-build-tweaks-9.18' into 'bind-9.18'
[9.18] Describe BIND threat model

See merge request isc-projects/bind9!8379
2023-10-13 07:54:26 +00:00
Petr Špaček
43f39a266a Describe BIND threat model
Basically all local data is considered trusted, and proper ACLs and
limits need to be explicitly configured. We are also free to let
protocol non-compliant servers burn in flames.

(cherry picked from commit fc907baa7f)
2023-10-13 09:26:57 +02:00
Michał Kępień
ee3ac71622 Merge branch 'michal/install-pdf-dependencies-on-demand-in-gitlab-ci' into 'bind-9.18'
Install PDF dependencies on demand in GitLab CI

See merge request isc-projects/bind9!8351
2023-10-12 13:09:15 +00:00
Michał Kępień
29cba33d44 Install PDF dependencies on demand in GitLab CI
Building the PDF version of the BIND 9 ARM requires TeX Live to be
present on the build host.  A TeX Live installation takes up several
gigabytes of disk space.  This significantly increases the size of the
Debian Docker images that include that toolchain, even though only two
GitLab CI jobs actually use it.

Instead of including TeX Live in the Docker image itself, install the
former on demand in a new GitLab CI job that only tests building the PDF
version of the BIND 9 ARM.  Do the same for qpdf, a tool used for
checking the PDF output produced by TeX Live.  This enables the size of
the "base" Docker image (which a lot of GitLab CI jobs need to pull) to
remain within reasonable limits.  As downloading and installing TeX Live
takes a significant amount of time, only run the new job in scheduled
pipelines and for tags.  Adjust job dependencies so that the "release"
job continues to work.
2023-10-12 14:27:35 +02:00
Michał Kępień
02df1a681e Merge branch 'michal/move-linux-stress-tests-to-autoscaled-instances-9.18' into 'bind-9.18'
[9.18] Move Linux "stress" tests to autoscaled instances

See merge request isc-projects/bind9!8362
2023-10-06 11:12:06 +00:00
Michał Kępień
1f9d59f726 Move Linux "stress" tests to autoscaled instances
The autoscaling GitLab CI runners currently used for most GitLab CI jobs
spin up AWS EC2 instances that are at least as powerful as the dedicated
instances used for running "stress" tests.  Move all Linux-based
"stress" tests to autoscaling GitLab CI runners to enable deprovisioning
Linux AWS instances reserved for running "stress" tests.  Leave FreeBSD
"stress" tests intact as there is currently no support for autoscaling
BSD instances.

(cherry picked from commit 12ea994680)
2023-10-06 13:10:09 +02:00
Michal Nowak
0de0cc0206 Merge branch 'mnowak/monitor-stuck-system-tests-9.18' into 'bind-9.18'
[9.18] Report hung system tests

See merge request isc-projects/bind9!8360
2023-10-06 07:20:44 +00:00
Michal Nowak
28bae02a96 Report hung system tests
At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.

(cherry picked from commit 35792b1700)
2023-10-05 19:44:41 +02:00
Petr Špaček
3ebcca683f Merge branch 'pspacek/cross-version-tests-junit-9.18' into 'bind-9.18'
[9.18] Generate and capture JUnit XML output from cross-version-config-tests

See merge request isc-projects/bind9!8358
2023-10-04 12:52:10 +00:00
Petr Špaček
fccfc99b44 Generate and capture JUnit XML output from cross-version-config-tests
(cherry picked from commit f2a3eb00b9)
2023-10-04 14:51:31 +02:00