Commit Graph

36823 Commits

Author SHA1 Message Date
Petr Špaček
4f4556941c Build gcc:oraclelinux9:amd64 CI jobs with --disable-developer
Purpose of this is to guard against tests which rely on querytrace or
other optional features enabled by --enable-developer switch.

(cherry picked from commit d6db5c5335)
2022-10-18 15:14:54 +02:00
Ondřej Surý
bc1acfdccb Merge branch 'ondrej-add-ISC_LIST,LINK_INITIALIZER-v9_18' into 'v9_18'
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers [v9.18]

See merge request isc-projects/bind9!6934
2022-10-18 12:56:42 +00:00
Ondřej Surý
6525ebc777 Replace (void *)-1 with ISC_LINK_TOMBSTONE
Instead of having "arbitrary" (void *)-1 to define non-linked, add a
ISC_LINK_TOMBSTONE(type) macro that replaces the "magic" value with a
define.

(cherry picked from commit 5e20c2ccfb)
2022-10-18 14:30:43 +02:00
Ondřej Surý
8efe60d423 Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do

    *foo = (foo_t){ .list = ISC_LIST_INITIALIZER };

Instead of:

    *foo = (foo_t){ 0 };
    ISC_LIST_INIT(foo->list);

(cherry picked from commit cb3c36b8bf)
2022-10-18 14:30:43 +02:00
Arаm Sаrgsyаn
c6270cefb2 Merge branch '3584-ns_statscounter_recursclients-bug-v9_18' into 'v9_18'
[v9_18] Fix ns_statscounter_recursclients counting bug

See merge request isc-projects/bind9!6876
2022-10-18 10:36:55 +00:00
Aram Sargsyan
d83642b3ac Add a release note for [GL #3584] 2022-10-18 08:54:20 +00:00
Aram Sargsyan
5b1ef41897 Add a CHANGES note for [GL #3584] 2022-10-18 08:54:11 +00:00
Aram Sargsyan
82991451b4 Fix ns_statscounter_recursclients counting bug
The incrementing and decrementing of 'ns_statscounter_recursclients'
were not properly balanced: for example, it would be incremented for
a prefetch query but not decremented if the query failed.

This commit ensures that the recursion quota and the recursive clients
counter are always in sync with each other.
2022-10-18 08:54:04 +00:00
Petr Špaček
954ce9fcff Merge branch 'pspacek/doc-nsupdate-server-gsstsig-v9_18' into 'v9_18'
Document that nsupdate ignores server command in GSS-TSIG mode [v9_18]

See merge request isc-projects/bind9!6925
2022-10-18 08:17:15 +00:00
Petr Špaček
dbb7856038 Document that nsupdate ignores server command in GSS-TSIG mode
This behavior is present since introduction of GSS-TSIG support,
commit 289ae548d5.

(cherry picked from commit c8a38d70f0)
2022-10-18 10:13:30 +02:00
Tony Finch
684b5e536d Merge branch 'fanf-deduplicate-file-line-v9_18' into 'v9_18'
De-duplicate __FILE__, __LINE__ plus some error reporting cleanup (backport to v9_18)

See merge request isc-projects/bind9!6922
2022-10-17 17:27:04 +00:00
Tony Finch
6adb0c32ea CHANGES for [GL !6914]
[cleanup]	Less ceremonial UNEXPECTED_ERROR() and FATAL_ERROR()
		reporting macros. [GL !6914]

(cherry picked from commit 2ffb582d2c)
2022-10-17 16:08:28 +01:00
Tony Finch
b48c73d802 Remove redundant #include <isc/strerr.h>
Most uses are now internal to <isc/util.h>
2022-10-17 16:08:28 +01:00
Tony Finch
96b6bae5bc Include the function name when reporting unexpected errors
I.e. print the name of the function in BIND that called the system
function that returned an error. Since it was useful for pthreads
code, it seems worthwhile doing so everywhere.

(cherry picked from commit 26ed03a61e)
2022-10-17 16:00:27 +01:00
Tony Finch
8dfc078ea3 De-duplicate some calls to strerror_r()
Specifically, when reporting an unexpected or fatal error.

(cherry picked from commit a34a2784b1)
2022-10-17 16:00:27 +01:00
Tony Finch
f273fdfc12 De-duplicate __FILE__, __LINE__
Mostly generated automatically with the following semantic patch,
except where coccinelle was confused by #ifdef in lib/isc/net.c

@@ expression list args; @@
- UNEXPECTED_ERROR(__FILE__, __LINE__, args)
+ UNEXPECTED_ERROR(args)
@@ expression list args; @@
- FATAL_ERROR(__FILE__, __LINE__, args)
+ FATAL_ERROR(args)

(cherry picked from commit ec50c58f52)
2022-10-17 16:00:26 +01:00
Arаm Sаrgsyаn
79a7fb6cb5 Merge branch 'aram/cfg_print_duration-uninitialized-length-v9_18' into 'v9_18'
[v9_18] Fix a logical bug in cfg_print_duration()

See merge request isc-projects/bind9!6920
2022-10-17 09:56:59 +00:00
Aram Sargsyan
24aa154b67 Handle large numbers when parsing/printing a duration
The isccfg_duration_fromtext() function is truncating large numbers
to 32 bits instead of capping or rejecting them, i.e. 64424509445,
which is 0xf00000005, gets parsed as 32-bit value 5 (0x00000005).

Fail parsing a duration if any of its components is bigger than
32 bits. Using those kind of big numbers has no practical use case
for a duration.

The isccfg_duration_toseconds() function can overflow the 32 bit
seconds variable when calculating the duration from its component
parts.

To avoid that, use 64-bit calculation and return UINT32_MAX if the
calculated value is bigger than UINT32_MAX. Again, a number this big
has no practical use case anyway.

The buffer for the generated duration string is limited to 64 bytes,
which, in theory, is smaller than the longest possible generated
duration string.

Use 80 bytes instead, calculated by the '7 x (10 + 1) + 3' formula,
where '7' is the count of the duration's parts (year, month, etc.), '10'
is their maximum length when printed as a decimal number, '1' is their
indicator character (Y, M, etc.), and 3 is two more indicators (P and T)
and the terminating NUL character.

(cherry picked from commit fddaebb285)
2022-10-17 08:54:10 +00:00
Aram Sargsyan
9a318fbc1e Add a CHANGES note for [GL !6880]
(cherry picked from commit 190aab84d7)
2022-10-17 08:53:49 +00:00
Aram Sargsyan
e3fa77f577 Fix an off-by-one error in cfg_print_duration()
The cfg_print_duration() checks added previously in the 'duration_test'
unit test uncovered a bug in cfg_print_duration().

When calculating the current 'str' pointer of the generated text in the
buffer 'buf', it erroneously adds 1 byte to compensate for that part's
indicator character. For example, to add 12 minutes, it needs to add
2 + 1 = 3 characters, where 2 is the length of "12", and 1 is the length
of "M" (for minute). The mistake was that the length of the indicator
is already included in 'durationlen[i]', so there is no need to
calculate it again.

In the result of this mistake the current pointer can advance further
than needed and end up after the zero-byte instead of right on it, which
essentially cuts off any further generated text. For example, for a
5 minutes and 30 seconds duration, instead of having this:

    'P', 'T', '5', 'M', '3', '0', 'S', '\0'

The function generates this:

    'P', 'T', '5', 'M', '\0', '3', '0', 'S', '\0'

Fix the bug by adding to 'str' just 'durationlen[i]' instead of
'durationlen[i] + 1'.

(cherry picked from commit dc55f1ebb9)
2022-10-17 08:52:33 +00:00
Aram Sargsyan
98481e0a0a Test cfg_print_duration() in duration_test.c
Currently the 'duration_test' unit test checks only the
cfg_obj_asduration() function.

Extend the test so it checks also the reverse operation using the
cfg_print_duration() function, which is used in named-checkconf.

(cherry picked from commit 39290bb7cd)
2022-10-17 08:52:26 +00:00
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 9440910187)
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 759e8a6671)
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 212c4de043)
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 65e91ef5e6)
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
  98b3b93791 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 05180154d9)
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 95a551de7b)
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 354494cd10)
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 18e20f95f6)
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 9146b956ae)
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 5589d0a49c)
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 058c1744ba)
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 491a8cfe96)
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 f5d9fa6ea4)
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 137e0f4e0e)

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 ea2d213f34)
2022-10-05 11:44:33 +02:00