2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

36802 Commits

Author SHA1 Message Date
Aram Sargsyan
b6978ccbe3 Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.

(cherry picked from commit 94409101870b689f77452b6324968687d9f3c72f)
2022-10-17 08:52:20 +00:00
Ondřej Surý
e33fdd5c05 Merge branch 'mnowak/fix-grep-3.8-warnings-v9_18' into 'v9_18'
Fix GNU Grep 3.8 warnings [v9_18]

See merge request isc-projects/bind9!6918
2022-10-17 07:56:21 +00:00
Michal Nowak
1751a9e191
Add CI check for Grep warnings
(cherry picked from commit 759e8a66718cd1ce3dae8f1242d7151e4867b61c)
2022-10-17 09:10:29 +02:00
Michal Nowak
a7e2cc5dec
Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
    fgrep: warning: fgrep is obsolescent; using grep -F

(cherry picked from commit 212c4de043d3740dcf30c1f43c70fb89b324985d)
2022-10-17 09:10:29 +02:00
Michal Nowak
55a866355b
Remove stray backslashes
GNU Grep 3.8 reports several instances of stray backslashes in matching
patterns:

    grep: warning: stray \ before /
    grep: warning: stray \ before :

(cherry picked from commit 65e91ef5e68cd493cf54ab0ff5dffe800ded3bb0)
2022-10-17 09:10:29 +02:00
Tom Krizek
da566ca54c Merge branch 'tkrizek/remove-system-test-delzone-v9_18' into 'v9_18'
Remove system test delzone [v9_18]

See merge request isc-projects/bind9!6911
2022-10-14 15:16:34 +00:00
Tom Krizek
cfbd7431cd
Remove system test delzone
There are multiple reasons to remove this test as obsolete:

- The test may not possibly work for over 2.5 years, since
  98b3b93791777218c04a67ddaef22619162249f7 removed the rndc.py python
  tool on which this test relies.
- It isn't part of the test suite either in CI or locally unless it is
  explicitly enabled. As a result, there are many issues which prevent
  the test from being executed caused by various refactoring efforts
  accumulated over time.
- Even if the test could be executed, it has no clear failure condition.
  If the python script(s) fail, the test still passes.

(cherry picked from commit 05180154d9742954e1675b687db9bd8387664eb3)
2022-10-14 16:40:40 +02:00
Ondřej Surý
50ec8de8eb Merge branch 'artem-doth-reduce-listener-sockets-number-v9_18' into 'v9_18'
doth system test - decrease HTTP listener quota size

See merge request isc-projects/bind9!6900
2022-10-13 06:00:09 +00:00
Artem Boldariev
5656f681bd
doth system test: increase transfers-in/out limits
Sometimes doth test could intermittently fail shortly after start due
to inability to complete a zone transfer in time. As it turned out, it
could happen due to transfers-in/out limits. Initially the defaults
were fine, but over time, especially when adding Strict/Mutual TLS, we
added more than 10 zones so it became possible to hit the limits.

This commit takes care of that by bumping the limits.

(cherry picked from commit 95a551de7b91bbb10bab960860f45ed5a3e816d4)
2022-10-13 07:39:07 +02:00
Artem Boldariev
adcdbcd097
doth system test - decrease HTTP listener quota size
This commit reduces the size of HTTP listener quota from 300 (default)
to 100 so that it would make hitting any global limits in case of
running multiple tests in parallel in multiple containers unlikely.

This way the need in opening many file descriptors of different
kinds (e.g. client side connections and pipes) gets significantly
reduced while the required code paths are still verified.

(cherry picked from commit 354494cd10861ed3b5ebc568a4e26abb97a4ee12)
2022-10-13 07:39:07 +02:00
Artem Boldariev
064af66a0f Merge branch 'artem-clear-ssl-error-queue-for-dns-transports-v9-18' into 'v9_18'
[Backport to v9.18] TLS: clear error queue before doing IO or calling SSL_get_error()

See merge request isc-projects/bind9!6896
2022-10-12 14:53:22 +00:00
Artem Boldariev
15b7605e72 TLS DNS: fix certificate verification error message reporting
This commit fixes TLS DNS verification error message reporting which
we probably broke during one of the recent networking code
refactorings.

This prevent e.g. dig from producing useful error messages related to
TLS certificates verification.
2022-10-12 16:53:06 +03:00
Artem Boldariev
e229af39e7 TLS: clear error queue before doing IO or calling SSL_get_error()
Ensure that TLS error is empty before calling SSL_get_error() or doing
SSL I/O so that the result will not get affected by prior error
statuses.

In particular, the improper error handling led to intermittent unit
test failure and, thus, could be responsible for some of the system
test failures and other intermittent TLS-related issues.

See here for more details:

https://www.openssl.org/docs/man3.0/man3/SSL_get_error.html

In particular, it mentions the following:

> The current thread's error queue must be empty before the TLS/SSL
> I/O operation is attempted, or SSL_get_error() will not work
> reliably.

As we use the result of SSL_get_error() to decide on I/O operations,
we need to ensure that it works reliably by cleaning the error queue.

TLS DNS: empty error queue before attempting I/O
2022-10-12 16:39:46 +03:00
Michał Kępień
3b9ec670f6 Merge branch '3592-fix-startup-detection-after-restart-in-start.pl-v9_18' into 'v9_18'
[v9_18] Fix startup detection after restart in start.pl

See merge request isc-projects/bind9!6890
2022-10-11 10:25:31 +00:00
Michał Kępień
9bfb9184f2 Fix startup detection after restart in start.pl
The bin/tests/system/start.pl script waits until a "running" message is
logged by a given name server instance before attempting to send a
version.bind/CH/TXT query to it.  The idea behind this was to make the
script wait until named loads all the zones it is configured to serve
before telling the system test framework that a given server is ready to
use; this prevents the need to add boilerplate code that waits for a
specific zone to be loaded to each test expecting that.

The problem is that when it looks for "running" messages, the
bin/tests/system/start.pl script assumes that the existence of any such
message in the named.run file indicates that a given named instance has
already finished loading all zones.  Meanwhile, some system tests
restart all the named instances they use throughout their lifetime (some
even do that a few times), for example to run Python-based tests.  The
bin/tests/system/start.pl script handles such a scenario incorrectly: as
soon as it finds any "running" message in the named.run file it inspects
and it gets a response to a version.bind/CH/TXT query, it tells the
system test framework that a given server is ready to use, which might
not be true - it is possible that only the "version.bind" zone is loaded
at that point and the "running" message found was logged by a
previously-shutdown named instance. This triggers intermittent failures
for Python-based tests.

Fix by improving the logic that the bin/tests/system/start.pl script
uses to detect server startup: check how many "running" lines are
present in a given named.run file before attempting to start a named
instance and only proceed with version.bind/CH/TXT queries when the
number of "running" lines found in that named.run file increases after
the server is started.

(cherry picked from commit 18e20f95f62f59ae16424e20b406ea8d2d005bcc)
2022-10-11 11:56:29 +02:00
Michał Kępień
2584413c90 Do not truncate ns2 logs in the "rrsetorder" test
In the "rrsetorder" system test, the ns2 named instance is restarted
without passing the --restart option to bin/tests/system/start.pl.  This
causes the log file for that named instance to be needlessly truncated.
Prevent this from happening by restarting the affected named instance
in the same way as all the other named instances used in system tests.

(cherry picked from commit 9146b956ae8a77ecf3f34b4d928c98b3b63dcdb2)
2022-10-11 11:56:29 +02:00
Michał Kępień
bfe777613b Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.9' into 'v9_18'
Set up version and release notes for BIND 9.18.9

See merge request isc-projects/bind9!6885
2022-10-10 21:36:40 +00:00
Michał Kępień
dd8872de8f Set up release notes for BIND 9.18.9 2022-10-10 23:18:40 +02:00
Michał Kępień
fd028232f9 Update BIND version to 9.18.9-dev 2022-10-10 23:18:40 +02:00
Petr Špaček
d2b428d8d2 Merge branch '3554-improve-dnssec-policy-inline-signing-err-msg-v9_18' into 'v9_18'
Clarify new configuration incompabitility: dnssec-policy vs. inline-signing [v9_18]

See merge request isc-projects/bind9!6871
2022-10-06 08:30:42 +00:00
Petr Špaček
49db39abfe
Add Known Issue about config incompatibility
(cherry picked from commit 5589d0a49c722c13f78fccdd955c377b9c32c13e)
2022-10-06 10:28:19 +02:00
Petr Špaček
6394f5c423
Clarify error message about missing inline-signing & dnssec-policy
(cherry picked from commit 058c1744bac8317be57724ff0f235ee1e8a7438e)
2022-10-06 10:27:32 +02:00
Mark Andrews
7de12577ef Merge branch '3577-reloads-in-ixfr-system-test-happen-too-fast-v9_18' into 'v9_18'
Add sleeps to ixfr system test [v9_18]

See merge request isc-projects/bind9!6869
2022-10-05 22:28:16 +00:00
Mark Andrews
51bcf741fc Add sleeps to ixfr system test
ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.

(cherry picked from commit 491a8cfe96432d8e12666bcde42b91de031a97f2)
2022-10-06 08:36:25 +11:00
Michal Nowak
36f62900de Merge branch 'mnowak/drop-flake8-ignore-lists-v9_18' into 'v9_18'
[v9_18] Drop flake8 ignore lists

See merge request isc-projects/bind9!6867
2022-10-05 16:24:38 +00:00
Michal Nowak
8934362636
Drop flake8 ignore lists
flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.

(cherry picked from commit f5d9fa6ea4a263c26104084c3ff44a647d3147ba)
2022-10-05 18:06:38 +02:00
Petr Špaček
aa8a0f761c Merge branch '3572-fix-duplicate-link-anchor-v9_18' into 'v9_18'
Deduplicate link anchors in the ARM [v9_18]

See merge request isc-projects/bind9!6861
2022-10-05 09:59:07 +00:00
Petr Špaček
ce71fce811
Remove manually defined anchors pointing to statement definitions
This is hopefully end of duplication. This batch did not cause clashes
in Sphinx but it was pointless nonetheless as we have auto-generated
anchors for all statements.

(cherry picked from commit 137e0f4e0e14975c7fc00000da2e77b5b29f61f5)

Adapted for v9_18 branch by doing cleanup also in
notes/notes-9.18.0.rst.
2022-10-05 11:55:03 +02:00
Tom Krizek
6cd00258fa
Remove trailing whitespaces
(cherry picked from commit ea2d213f34b623d538b8f2d4d58acde080e076fb)
2022-10-05 11:44:33 +02:00
Petr Špaček
bba3440638
Deduplicate link anchors in the ARM
Some statement names like "allow-query" had manually defined link anchor
_allow-query and also implicit anchor created by
.. namedconf:statement:: syntax. This causes warnings if a ambiguous
reference is made using :any:`allow-query` syntax.

Remove (hopefully all) manually defined anchors which pointed to
identical place as the implicit anchor. This allows :any: to work.

In rare cases where manual anchor points to descriptive text separated
from statement definition the reference was disamguated by replacing
:any:`notify` with :ref:`notify` (for manual anchor)
vs. :namedconf:ref:`notify` (for statement definition).

Please note that `options` statement is a trap: It is ambiguous even
without manual anchor because rndc.conf has its own `options`. Use
:namedconf:ref:`options` vs. :rndcconf:ref:`options` to select
appropriate target.

(cherry picked from commit 9a7c2b370e7df11beefe709a47efb79ce8e11a31)
2022-10-05 11:44:33 +02:00
Mark Andrews
cf9ef990d2 Merge branch '3338-zero-system-test-add-forensics-v9_18' into 'v9_18'
Add additional forensics to zero system test [v9_18]

See merge request isc-projects/bind9!6860
2022-10-05 08:52:08 +00:00
Mark Andrews
1d508b76cd Add additional forensics to zero system test
(cherry picked from commit 285351d4b236edbb115d4ea82d44e8c4d4d5f4cb)
2022-10-05 19:30:38 +11:00
Mark Andrews
091be7c61d Merge branch '3569-dns-message-checksig-create-test-key-directory-v9_18' into 'v9_18'
Resolve "dns_message_checksig under oss_fuzz is not seeing the data files" [v9_18]

See merge request isc-projects/bind9!6858
2022-10-05 08:23:06 +00:00
Mark Andrews
f7c2c07051 Add CHANGES note for [GL #3569]
(cherry picked from commit 1849a8a5263fc1975366f34d9488abb06442d096)
2022-10-05 19:01:41 +11:00
Mark Andrews
280b863c97 Create a key directory in /tmp
Access to the source tree is not available with oss_fuzz.  Have
fuzz/dns_message_checksig build and populate a key directory for
the fuzzer to use.  This contains a key pair and a zone file which
has the public key from the key pair.  Clean it up on shutdown.

(cherry picked from commit 033057ba9d49081f609013a1fe57360825ce7109)
2022-10-05 19:01:41 +11:00
Petr Špaček
39827cfe3b Merge branch 'pspacek/tsan-ci-artifacts-fix-v9_18' into 'v9_18'
Fix TSAN artifact gathering in CI [v9_18]

See merge request isc-projects/bind9!6857
2022-10-05 07:45:12 +00:00
Petr Špaček
a1d3fb98b7
Fix TSAN artifact gathering in CI
Fixup for 2c3b2dabe9a6b3c4a10f6498a1169f39ed031eed.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243
(cherry picked from commit 9559eb3b21fec007c53c314be2ebcaf6a12782b2)
2022-10-05 09:44:20 +02:00
Mark Andrews
087faf0747 Merge branch '3544-add-dohpath-parsing-to-svbc-v9_18' into 'v9_18'
Add support for 'dohpath' to SVCB (and HTTPS) [v9_18]

See merge request isc-projects/bind9!6849
2022-10-04 05:07:10 +00:00
Mark Andrews
886df1542e Use strnstr implementation from FreeBSD if not provided by OS
(cherry picked from commit 5f07fe8cbb9d3696e94bb9c64625e23721c95c4e)
2022-10-04 15:33:33 +11:00
Mark Andrews
ec31057a0f Add release note for [GL #3544]
(cherry picked from commit 2f3441b40a0b98087c97201eb5ef5e4a3c5af0fa)
2022-10-04 15:33:32 +11:00
Mark Andrews
9e8ebbbd23 Add CHANGES note for [GL #3544]
(cherry picked from commit 335b397e15185930e3b3224eee440e4cccc2f372)
2022-10-04 15:33:00 +11:00
Mark Andrews
10d9c040e7 Add support for 'dohpath' to SVCB (and HTTPS)
dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).

(cherry picked from commit 6d561d38864d2cc21a4e9528527bceac389b173e)
2022-10-04 15:32:22 +11:00
Matthijs Mekking
c179933c09 Merge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing-v9_18' into 'v9_18'
[v9_18] Add dnssec-policy inline-signing requirement to documentation

See merge request isc-projects/bind9!6832
2022-09-28 08:38:45 +00:00
Matthijs Mekking
2abb2b638a Add inline-signing to config examples
Add 'inline-signing yes;' to configuration examples to have working
copy paste configurations.

(cherry picked from commit 18d230a5844038ad3fdd438f25f83a6580f4782e)
2022-09-28 10:37:41 +02:00
Matthijs Mekking
d1a01d88f9 Update inline-signing requirement to ARM
This change was made in !6403, but the appropriate documentation
changes were not applied to the ARM.

(cherry picked from commit 5d454a715876f8524e11acfbccfd1292c3fbedfa)
2022-09-28 10:37:41 +02:00
Matthijs Mekking
2305d8770b Add inline-signing requirement to DNSSEC Guide
This change was made in !6403, but the appropriate documentation
changes were not applied to the DNSSEC Guide.

(cherry picked from commit 09522c8d73650b477960cc63ec420c72006a5829)
2022-09-28 10:37:41 +02:00
Mark Andrews
79462fcb1d Merge branch '3562-assign-default-value-to-suffix-v9_18' into 'v9_18'
Suffix may be used before it is assigned a value [v9_18]

See merge request isc-projects/bind9!6836
2022-09-28 01:40:56 +00:00
Mark Andrews
750766a842 Suffix may be used before it is assigned a value
CID 350722 (#5 of 7): Bad use of null-like value (FORWARD_NULL)
        12. invalid_operation: Invalid operation on null-like value suffix.
    145        r.authority.append(
    146            dns.rrset.from_text(
    147                "icky.ptang.zoop.boing." + suffix,
    148                1,
    149                IN,
    150                NS,
    151                "a.bit.longer.ns.name." + suffix,
    152            )
    153        )

(cherry picked from commit 432064f63c3541b3bb40d5505a420e47efd6d30d)
2022-09-28 11:19:38 +10:00
Mark Andrews
cff7e5acdd Merge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2-v9_18' into 'v9_18'
Free 'rsa' if 'e' is NULL in opensslrsa_verify2 [v9_18]

See merge request isc-projects/bind9!6834
2022-09-28 01:06:10 +00:00
Mark Andrews
573eeea2ee Add CHANGES note for [GL #3551]
(cherry picked from commit 1e3680193aa63d855591bc8b67f5b43e3128680b)
2022-09-28 09:49:27 +10:00