Commit graph

37582 commits

Author SHA1 Message Date
Arаm Sаrgsyаn
3d341d090b Merge branch '3674-nsupdate--t-timeout-does-not-work-9.18' into 'bind-9.18'
[9.18] Resolve "nsupdate -t timeout does not work"

See merge request isc-projects/bind9!7779
2023-04-03 17:14:19 +00:00
Aram Sargsyan
a7d5ccdb1b nsupdate: set network manager default timeout values
The default values are currently set to 30 seconds, use nsupdate
default (or overriden using the -t option) timeout value instead.

(cherry picked from commit 98c8135692)
2023-04-03 16:19:18 +00:00
Aram Sargsyan
1287b0b0e8 Add a CHANGES note for [GL #3674]
(cherry picked from commit ef81775e7b)
2023-04-03 16:19:17 +00:00
Aram Sargsyan
9e42bfd1a0 nsupdate: use the configurable timeout and retry values for all queries
The 'nsupdate' tool, when sending SOA queries, uses a hard-coded value
3 UDP retries and of 5 seconds of timeout for UDP queries, and 100
seconds of timeout for TCP queries.

Use the timeout and retry values which can be configured using the
-t, -u, -r command line options, and which are already used for
sending the update query.

(cherry picked from commit 3ef2a30c75)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
d861433ad4 Update nsupdate -t option's documentation
Add some clarifications about the -t option's behavior differences
in TCP and UDP modes.

(cherry picked from commit a00540ac24)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
7beda284d2 Do not resend TCP requests
The req_response() function is using 'udpcount' variable to resend
the request 'udpcount' times on timeout even for TCP requests,
which does not make sense, as it would use the same connection.

Add a condition to use the resend logic only for UDP requests.

(cherry picked from commit edcdb881da)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
14084d8eac Perform request validation in req_response() before using the pointer
The 'request' pointer is used before it is checked. Perform the check
before using the pointer.

(cherry picked from commit 5b37359697)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
4dc2ff79d6 Synchronize dns_request_createraw() and dns_request_create() UDP timeout
The dns_request_createraw() function, unlike dns_request_create(), when
calculating the UDP timeout value, doesn't check that 'udpretries' is
not zero, and that is the more logical behavior, because the calculation
formula uses division to 'udpretries + 1', where '1' is the first try.

Change the dns_request_create() function to remove the 'udpretries != 0'
condition.

Add a 'REQUIRE(udpretries != UINT_MAX)' check to protect from a division
by zero.

Make the 'request->udpcount' field to represent the number of tries,
instead of the number of retries.

(cherry picked from commit 643abfbba7)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
b015b87fdc nsupdate: when set to 0, UDP timeout should be calculated by dns_request
The manual page of nsupdate's '-u udptimeout' option states that, quote:

> If zero, the interval is computed from the timeout interval and number
> of UDP retries.

However, nsupdate sets the UDP timeout value to UINT_MAX when it is 0,
thus, not behaving as documented.

Let dns_request_create() calculate the UDP timeout, if it was set to 0.

(cherry picked from commit 0ef11c0ccb)
2023-04-03 16:18:39 +00:00
Aram Sargsyan
9597a3aaca Add nsupdate timeout tests
* nsupdate should take 12 seconds (one try and three retries with
  3 second timeout for each), UDP mode
* nsupdate -u 4 -r 1 should take 8 seconds (one try and one retry with
  4 second timeout for each), UDP mode
* nsupdate -u 0 -t 8 -r 1 should also take 8 seconds, UDP mode
* nsupdate -u 4 -t 30 -r 1 should also take 8 seconds, as -u takes
  precedence over -t, UDP mode
* nsupdate -t 8 -v should also take 8 seconds, TCP mode

(cherry picked from commit 5ce2ed0688)
2023-04-03 16:18:39 +00:00
Petr Špaček
347222ad82 Merge branch '3981-reduce-dnssec-verify-calls-9.18' into 'bind-9.18'
[9.18] Reduce dns_dnssec_verify calls made checking for revoked trust anchor

See merge request isc-projects/bind9!7777
2023-04-03 16:17:09 +00:00
Petr Špaček
6f3d3d7eff
Add release note for [GL #3981]
(cherry picked from commit 705a9ced01)
2023-04-03 17:47:36 +02:00
Mark Andrews
ed6ba1d273
Add CHANGES for [GL #3981]
(cherry picked from commit 5de552d545)
2023-04-03 17:46:42 +02:00
Mark Andrews
39c82bf429
dns_view_untrust modifies dnskey->flags when it shouldn't
Copy the structure and declare dnskey as const.

(cherry picked from commit 21d828241b)
2023-04-03 17:46:13 +02:00
Mark Andrews
972c245065
Handle dns_rdata_fromstruct failure dns_keytable_deletekey
dns_rdata_fromstruct in dns_keytable_deletekey can potentially
fail with ISC_R_NOSPACE.  Handle the error condition.

(cherry picked from commit b5df9b8591)
2023-04-03 17:46:13 +02:00
Mark Andrews
4920fca095
Reduce the number of verifiations required
In selfsigned_dnskey only call dns_dnssec_verify if the signature's
key id matches a revoked key, the trust is pending and the key
matches a trust anchor.  Previously named was calling dns_dnssec_verify
unconditionally resulted in busy work.

(cherry picked from commit e68fecbdaa)
2023-04-03 17:46:13 +02:00
Mark Andrews
59f17be969
Add new view method dns_view_istrusted
dns_view_istrusted determines if the given key is treated as
being trusted by the view.

(cherry picked from commit 7278fff579)
2023-04-03 17:46:13 +02:00
Tom Krizek
ad6990f019 Merge branch '3915-check-dig-output-for-errors-9.18' into 'bind-9.18'
[9.18] Find errors in dig output in system tests

See merge request isc-projects/bind9!7769
2023-04-03 11:13:11 +00:00
Tom Krizek
b447032489
Find errors in dig output in system tests
Facilitate faster system test failure identification and debugging by
checking any dig outputs for errors, which are typically indicative of
CI runner network / load issues.

(cherry picked from commit 940e160c06)
2023-04-03 13:06:37 +02:00
Ondřej Surý
67737ef3cb Merge branch '3710-properly-document-DF-flag-on-outbound-UDP--9.18' into 'bind-9.18'
Clarify the documentation about DF-flag

See merge request isc-projects/bind9!7771
2023-04-03 10:32:00 +00:00
Ondřej Surý
9eddb9ecd9
Add CHANGES note for [GL #3710]
(cherry picked from commit d5921fafed)
2023-04-03 12:29:28 +02:00
Ondřej Surý
01b578f67e
Clarify the documentation about DF-flag
Remove the reference to setting the DF-flag as we don't do that right
now.  Rephrase the paragraph that the default value should not be
causing fragmentation.

(cherry picked from commit 61f276d5a4)
2023-04-03 12:29:07 +02:00
Mark Andrews
5cf99e3d23 Merge branch '3980-add-timeouts-to-unit-tests-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Add timeouts to unit tests."

See merge request isc-projects/bind9!7768
2023-04-03 01:55:17 +00:00
Mark Andrews
6cdeb5b046 Kill unit tests that run more than 1200 seconds
The CI doesn't provide useful forensics when a system test locks
up.  Fork the process and kill it with ABRT if it is still running
after 20 minutes.  Pass the exit status to the caller.

(cherry picked from commit 3d5c7cd46c)
2023-04-03 11:11:26 +10:00
Ondřej Surý
93efd7389f Merge branch '3982-remove-isc_fsaccess-API--9.18' into 'bind-9.18'
[9.18] Replace isc_fsaccess API with more secure file creation

See merge request isc-projects/bind9!7767
2023-03-31 16:01:45 +00:00
Ondřej Surý
7e0319b957
Add CHANGES note for [GL #3982]
(cherry picked from commit f853672e41)
2023-03-31 16:47:15 +02:00
Ondřej Surý
718893ece4
Replace isc_fsaccess API with more secure file creation
The isc_fsaccess API was created to hide the implementation details
between POSIX and Windows APIs.  As we are not supporting the Windows
APIs anymore, it's better to drop this API used in the DST part.

Moreover, the isc_fsaccess was setting the permissions in an insecure
manner - it operated on the filename, and not on the file descriptor
which can lead to all kind of attacks if unpriviledged user has read (or
even worse write) access to key directory.

Replace the code that operates on the private keys with code that uses
mkstemp(), fchmod() and atomic rename() at the end, so at no time the
private key files have insecure permissions.

(cherry picked from commit 263d232c79)
2023-03-31 16:47:15 +02:00
Ondřej Surý
dcea09a327
Add isc_os_umask() function to get current umask
As it's impossible to get the current umask without modifying it at the
same time, initialize the current umask at the program start and keep
the loaded value internally.  Add isc_os_umask() function to access the
starttime umask.

(cherry picked from commit aca7dd3961)
2023-03-31 16:47:15 +02:00
Matthijs Mekking
02bcff70aa Merge branch 'matthijs-checkconf-kasp-test-bug-9.18' into 'bind-9.18'
[9.18] Fix kasp system test bug

See merge request isc-projects/bind9!7764
2023-03-31 09:18:15 +00:00
Matthijs Mekking
d74557ba35 Fix kasp system test bug
This test was succeeding for the wrong reason (policy not found, rather
than bad key length).

(cherry picked from commit 106497b011)
2023-03-31 10:34:27 +02:00
Artem Boldariev
846b893a46 Merge branch '3966-backport-tlsstream-connectcb-behaviour-from-main-to-v9.18' into 'bind-9.18'
[9.18] TLS Stream: backport connect callback handling behaviour from main

See merge request isc-projects/bind9!7753
2023-03-30 16:41:08 +00:00
Artem Boldariev
d1d4f6e362 TLS Stream: backport connect callback handling behaviour from main
This commit contains the backport of the behaviour for handling TLS
connect callbacks when wrapping up.

The current behaviour have not caused any problems to us, yet, but we
are changing it to remain on the safer side.
2023-03-30 18:37:21 +03:00
Matthijs Mekking
c3cbd09027 Merge branch '3967-linkfix-dnssec-guide-9.18' into 'bind-9.18'
[9.18] linkfix in dnssec-guide/validation.rst

See merge request isc-projects/bind9!7746
2023-03-29 15:07:00 +00:00
Matthijs Mekking
f6f99d1b82 Add CHANGES for #3967
(cherry picked from commit 5a879028fe)
2023-03-29 16:14:47 +02:00
Matthijs Mekking
30e12e3a24 Remove dead link to resolver test
The doc file doc/dnssec-guide/validation.rst points to a resolver test
site that is now down. Remove the dead link.

(cherry picked from commit 8e78f8fc0f)
2023-03-29 16:14:16 +02:00
Matthijs Mekking
44ccc0b9d0 Merge branch '3965-source-never-read-master.c-v9_18' into 'bind-9.18'
[9.18] Fix scan-build issue: initialized value never read

See merge request isc-projects/bind9!7738
2023-03-29 14:11:49 +00:00
Matthijs Mekking
b719991230 Add CHANGES entry for #3965
(cherry picked from commit 357b27b04f)
2023-03-29 13:31:49 +00:00
Matthijs Mekking
9874a26686 Fix scan-build issue: initialized value never read
Value stored to 'source' during its initialization is never read.

(cherry picked from commit 4c33277446)
2023-03-29 13:31:49 +00:00
Ondřej Surý
32768d9c94 Merge branch 'ondrej/fix-isc_nm_httpconnect-to-check-for-shuttingdown--9.18' into 'bind-9.18'
[9.18]: Fix isc_nm_httpconnect to check for shuttindown condition

See merge request isc-projects/bind9!7744
2023-03-29 08:17:22 +00:00
Ondřej Surý
3e9bce0a7a
Fix isc_nm_httpconnect to check for shuttindown condition
The isc_nm_httpconnect() would succeed even if the netmgr would be
already shuttingdown.  This has been fixed and the unit test has been
updated to cope with fact that the handle would be NULL when
isc_nm_httpconnect() returns with an error.

(cherry picked from commit 665f8bb78d)
2023-03-29 08:27:05 +02:00
Michal Nowak
824378d876 Merge branch 'mnowak/drop-unit-and-system-test-jobs-9.18' into 'bind-9.18'
[9.18] Drop unit and system tests on amd64cross32

See merge request isc-projects/bind9!7740
2023-03-28 14:40:39 +00:00
Michal Nowak
d7bbc52c3a
Drop "unstable" Debian "bullseye" unit and system jobs
"Unstable" Debian "bullseye" unit and system jobs differ from unit and
system jobs on the Debian "bullseye" image by running a few more tests
enabled by the CI_ENABLE_ALL_TESTS environmental variable.  These tests
are no less stable than the rest, and thus to have distinct jobs for
them wastes resources.

Run "unstable" unit and system tests as part of stock Debian "bullseye"
jobs.

(cherry picked from commit 2b9111b435)
2023-03-28 16:36:24 +02:00
Michal Nowak
01b5a69f73
Drop unit and system tests on amd64cross32
amd64cross32 jobs run a cross-compiled 32-bit BIND 9 on the 64-bit
platform. This approach brings no build issues, and it is a good way to
catch 32-bit issues in BIND 9 code-base and ensure cross-compilation
keeps working.

Unfortunately, running unit and system tests is a problem:

- #3269 - doth-ns1 frequently failed to start
- #3316 - quota_test sometimes fails to create new thread
- #3956 - tcp-ns1 sometimes fails to allocate memory

There's little value in running unit and system tests on the
amd64cross32 platform, and it only means the effort spent by QA by
looking into what turns out to be 32-bit limitations.

(cherry picked from commit f86d4f3bd8)
2023-03-28 16:36:24 +02:00
Tom Krizek
5b13b5df74 Merge branch 'tkrizek/gh-actions-branch-name-update-9.18' into 'bind-9.18'
[9.18] Update branch&tag name conventions

See merge request isc-projects/bind9!7734
2023-03-27 15:47:41 +00:00
Tom Krizek
340166ef28
Update branch&tag naming convention in CONTRIBUTING
(cherry picked from commit 5248a3e7db)
2023-03-27 17:39:37 +02:00
Tom Krizek
763bb3afce
Update github actions to trigger on correct branches
The naming convention for maintanence branches was changed from `vX_Y`
to `bind-X.Y`.

(cherry picked from commit ee53e3c02d)
2023-03-27 17:39:35 +02:00
Tom Krizek
d82bf3b04f Merge branch '3962-doc-arm-fixes-9.18' into 'bind-9.18'
[9.18] Documentation formatting fixes in ARM

See merge request isc-projects/bind9!7732
2023-03-27 15:37:39 +00:00
Tom Krizek
86d23a1d9c
Apply suppress_grammar directive in ARM docs
With a newline before the :suppress_grammar: directive, it wasn't
actually interpreted as a directive, but rather as node content.
Therefore, the directive was ignored and the grammar was incorrectly
printed out.

(cherry picked from commit 36a5c098bd)
2023-03-27 17:08:31 +02:00
Tom Krizek
90842d1f8d
Add missing newline in documentation code example
(cherry picked from commit 1849c02606)
2023-03-27 17:08:29 +02:00
Michal Nowak
98541aaaae Merge branch 'mnowak/suppress-gitlab-clean-up-output-9.18' into 'bind-9.18'
[9.18] Suppress Git clean output in GitLab CI

See merge request isc-projects/bind9!7729
2023-03-27 13:12:03 +00:00