Commit Graph
40272 Commits
Author SHA1 Message Date
Evan Hunt dd39b16a8d fix dns_qp_lookup() iterator bug
in some cases it was possible for the iterator to be positioned in the
wrong place by dns_qp_lookup(). previously, when a leaf node was found
which matched the search key at its parent branch's offset point, but
did not match after that point, the code incorrectly assumed the leaf
it had found was a successor to the searched-for name, and stepped the
iterator back to find a predecessor.  however, it was possible for the
non-matching leaf to be the predecessor, in which case stepping the
iterator back was wrong.

(for example: a branch contains "aba" and "abcd", and we are searching
for "abcde". we step down to the twig matching the letter "c" in
position 3. "abcd" is the predecessor of "abcde", so the iterator is
already correctly positioned, but because the twig was an exact match,
we would have moved it back one step to "aba".)

this previously went unnoticed due to a mistake in the qp_test unit
test, which had the wrong expected result for the test case that should
have detected the error. both the code and the test have been fixed.
2023-12-05 09:05:47 -08:00
Evan Hunt 6645ed2ba5 add an iterator argument to dns_qp_lookup()
the 'predecessor' argument to dns_qp_lookup() turns out not to
be sufficient for our needs: the predecessor node in a QP database
could have become "empty" (for the current version) because of an
update or because cache data expired, and in that case the caller
would have to iterate more than one step back to find the predecessor
node that it needs.

it may also be necessary for a caller to iterate forward, in
order to determine whether a node has any children.

for both of these reasons, we now replace the 'predecessor'
argument with an 'iter' argument. if set, this points to memory
with enough space for a dns_qpiter object.

when an exact match is found by the lookup, the iterator will be
pointing to the matching node. if not, it will be pointing to the
lexical predecessor of the nae that was searched for.

a dns_qpiter_current() method has been added for examining
the current value of the iterator without moving it in either
direction.
2023-12-05 09:05:47 -08:00
Michal Nowak c4fcdbefc5 Merge branch 'mnowak/drop-openbsd-system-test-job' into 'main'
Drop OpenBSD system test CI job

See merge request isc-projects/bind9!8535
2023-12-05 15:21:57 +00:00
Michal Nowak 27d51d6ab6 Run "make check" in system:gcc:sid:amd64
Following the discontinuation of the OpenBSD system test in CI, transfer
the execution of the system test using the "make check" method to the
Debian "sid" system test CI job.
2023-12-05 16:14:31 +01:00
Michal Nowak 2ab292c169 Drop OpenBSD system test CI job
The system tests on OpenBSD consistently exhibit lower stability
compared to our other CI platforms. Some of these challenges are
intrinsic to the system test itself and require attention. However,
there are OpenBSD issues, which seem to be more widespread on this
platform than others. In our daily CI pipelines, OpenBSD system tests
often bear the brunt of all failed CI jobs.

It's possible that our OpenBSD CI image could be optimized, but we
currently lack the domain-specific knowledge needed to make
improvements.
2023-12-05 16:14:31 +01:00
Matthijs Mekking e67bbe5c9a Merge branch '4363-lower-max-nsec3-iterations' into 'main'
Lower NSEC3 iteration limit to 50

Closes #4363

See merge request isc-projects/bind9!8515
2023-12-05 14:59:48 +00:00
Matthijs Mekking a759f7f33c Change max NSEC3 iterations in unit tests to 50
The nsec3 unit test needs to be adjusted to accept a lower maximum value
for NSEC3 iterations.
2023-12-05 14:58:58 +00:00
Matthijs Mekking 294943ba7c Add release note and CHANGES for #4363
This protocol change is definitely worth mentioning.
2023-12-05 14:58:58 +00:00
Matthijs Mekking abdaa77303 Change max NSEC3 iterations in system tests to 50
The dnssec and nsupdate system tests need to be adjusted to accept
a lower maximum value for NSEC3 iterations.
2023-12-05 14:58:58 +00:00
Matthijs Mekking ff4201e388 Lower the maximum allowed NSEC3 iterations to 50
BIND 9 will now treat the response as insecure when processing NSEC3
records with iterations larger than 50.

Earlier, we limited the number of iterations to 150 (in #2445).

RFC 9276 says: Because there has been a large growth of open (public)
DNSSEC validating resolvers that are subject to compute resource
constraints when handling requests from anonymous clients, this
document recommends that validating resolvers reduce their iteration
count limits over time. Specifically, validating resolver operators and
validating resolver software implementers are encouraged to continue
evaluating NSEC3 iteration count deployment trends and lower their
acceptable iteration limits over time.

After evaluation, we decided that the next major BIND release should
lower the maximum allowed NSEC3 iterations to 50, which should be
fine for 99,87% of the domain names.
2023-12-05 14:58:58 +00:00
Matthijs Mekking 3c08fbc79f Change NSEC3 iterations to 0 in system tests
The system tests need to be updated because non-zero iterations are no
longer accepted.

The autosign system test changes its iterations from 1 to 0 in one
test case. This requires the hash to be updated.

The checkconf system test needs to change the iterations in the good
configuration files to 0, and in the bad ones to 1 (any non-zero value
would suffice, but we test the corner case here). Also, the expected
failure message is change, so needs to be adjusted.

The nsec3 system test also needs iteration configuration adjustments.
In addition, the test script no longer needs the ITERATIONS environment
variable.

In the process of updating the system tests, I noticed an error
in the dnssec-policy "nsec3-other", where the salt length in one
configuration file is different than in the other (they need to be
the same). Furthermore, the 'rndc signing -nsec3param' test case
is operated on the zone 'nsec-change.kasp', so is moved so that the
tests on the same zone are grouped together.
2023-12-05 14:58:58 +00:00
Matthijs Mekking 75e0d394dd dnssec-policy: refuse to load non-zero iterations
According to RFC 9276, if NSEC3 must be used, then an iterations count
of 0 MUST be used to alleviate computational burdens.
2023-12-05 14:58:58 +00:00
Tom Krizek 336d99f121 Merge branch '4452-pytest-improve-assert-messages' into 'main'
Improve assert messages in pytests

Closes #4452

See merge request isc-projects/bind9!8518
2023-12-05 13:00:07 +00:00
Tom Krizek 5de2b07daa Refactor statschannel test to use isctest
Use common utility functions in favor of duplicating the code in a
test-specific file.
2023-12-05 13:26:49 +01:00
Tom Krizek cba5a1d62c Add system test utility package isctest
Create a utility package for code shared by the python tests. The
utility functions should use reasonable defaults and be split up into
modules according to their functionality.

Ensure assert rewriting is enabled for the modules to get the most
useful output from pytest.
2023-12-05 13:26:49 +01:00
Tom Krizek f0481c8600 Simplify statsport fixture in statschannel test
The ports fixture provides the required port numbers already and there's
no need to get the port number from environment.
2023-12-05 13:26:49 +01:00
Tom Krizek a57af8163a Allow assertion message rewrite in statschannel test
By default, the useful assertion message rewrite is used by pytest for
test modules only. Since another module is imported with shared
functionality, ensure it has pytest's assertion message rewriting
enabled to obtain more debug information in case it fails.
2023-12-05 13:26:49 +01:00
Tom Krizek fc295b2b5d Move helper functions in statchannel into single file
Since dnspython is now a required dependency, there's no need to keep
these two helper files separate.
2023-12-05 13:26:49 +01:00
Tom Krizek 767f4670c6 Add assert message to test doth/stress_http_quota.py
This file is executed outside of pytest with pure python, which doesn't
do any AssertionError message rewriting like pytest. Ensure the assert
messages in this file provide a useful debug message.
2023-12-05 13:26:43 +01:00
Mark Andrews 64ef6968f3 Merge branch '4462-crash-on-shutdown-when-dnssec-validation-is-running-ensure-isc_mempool_getallocated-namepoolp' into 'main'
Resolve "Crash on shutdown when DNSSEC validation is running: ENSURE(isc_mempool_getallocated(*namepoolp) == 0) failed"

Closes #4462 and #4384

See merge request isc-projects/bind9!8526
2023-12-04 22:55:50 +00:00
Mark Andrews 7ee20d7d10 Destroy the message before detaching the view
With shared name memory pools (f5af981831)
the message needs to be destroyed before the view is detached which
in turn detaches the resolver which checks that all resources have
been returned.
2023-12-04 22:00:25 +00:00
Mark Andrews f491845f5a Merge branch '4457-dig-crashes-after-sigint-if-there-are-multiple-queries' into 'main'
Resolve "dig crashes after SIGINT if there are multiple queries"

Closes #4457

See merge request isc-projects/bind9!8527
2023-12-04 21:10:00 +00:00
Mark Andrews da8a269daf Add CHANGES note for [GL #4457] 2023-12-05 07:31:19 +11:00
Mark Andrews 69f7048c89 Handle ISC_R_SHUTTINGDOWN in dighost.c:recv_done
When dighost.c:recv_done is called with ISC_R_SHUTTINGDOWN cancel
all outstanding lookups as this indicates SIGTERM was recieved.
2023-12-05 07:30:52 +11:00
Michal Nowak c21fbed5d4 Merge branch '3198-add-rr-record' into 'main'
Add support for recording named with rr

Closes #3198

See merge request isc-projects/bind9!8479
2023-12-04 18:53:07 +00:00
Michał KępieńandMichal Nowak 422286e9c2 Do not daemonize named instances with custom args
This enables the "logfileconfig" and "rpzextra" system tests to pass
when named is started under the supervision of rr (USE_RR=1).
2023-12-04 18:40:52 +01:00
Michal Nowak 920af590d1 Fix process listing string of rpzextra ns3 server 2023-12-04 18:39:28 +01:00
Michal Nowak e088e8a992 Add support for recording named runtime with rr
The traces of the named process are stored in the directory
$system_test/nsX/named-Y/.
2023-12-04 18:38:29 +01:00
Ondřej SurýandMichal Nowak 658d62a6f4 Remove support for running system tests under Valgrind
Valgrind support has been scarcely used.
2023-12-04 18:27:51 +01:00
Michal Nowak d05c2e7ff4 Merge branch 'mnowak/freebsd-14.0' into 'main'
Add FreeBSD 14.0

See merge request isc-projects/bind9!8520
2023-12-04 15:26:56 +00:00
Michal Nowak 9152fc40a8 Add FreeBSD 14.0 2023-12-04 15:42:24 +01:00
Arаm Sаrgsyаn acf55e125e Merge branch '1229-dig-no-yaml-output-when-host-is-unreachable' into 'main'
Resolve "No YAML output in dig when host is unreachable"

Closes #1229

See merge request isc-projects/bind9!8501
2023-12-04 10:38:46 +00:00
Aram Sargsyan ed879c41f2 Add a CHANGES note for [GL #1229] 2023-12-04 10:38:16 +00:00
Aram Sargsyan 4d529ee12a Emit "no servers could be reached" also for UDP setup failure
When all the servers are exhausted for UDP setup emit "no servers
could be reached" in udp_ready(). This message can also be emitted
for a recv_done() error and for TCP connection failure similarly.
2023-12-04 10:38:16 +00:00
Petr Špaček 2a14fa0a65 Merge branch '4417-stale-hyperlinks-in-the-arm' into 'main'
Fix stale hyperlinks in the ARM

Closes #4417

See merge request isc-projects/bind9!8525
2023-12-04 10:00:57 +00:00
Suzanne GoldlustandPetr Špaček 15eea792b9 Fix broken link to TLD DNSSEC stats 2023-12-04 10:00:30 +00:00
Suzanne GoldlustandPetr Špaček 1482f5b1ed Fix broken link to OMB memo 2023-12-04 10:00:30 +00:00
Tom Krizek ae349ef2e8 Merge branch '4251-remove-legacy-test-runner' into 'main'
Remove legacy system test runner

Closes #4251

See merge request isc-projects/bind9!8514
2023-12-01 14:21:34 +00:00
Tom Krizek 1e181cf61d Remove -U 4 from system tests
This option doesn't appear to be needed for any of the tests, so remove
it to keep things simple.
2023-12-01 14:03:35 +01:00
Tom Krizek 519e77d067 Add CHANGES note for [GL #4251] 2023-12-01 14:03:34 +01:00
Tom Krizek fba295600b Update system test documentation
Rewrite and reorganize the test documentation to focus on the pytest
runner, omit any mentions of the legacy runner which are no longer
relevant, and mention a few pytest tricks.
2023-12-01 14:03:33 +01:00
Tom Krizek 3e26d99c3c Remove obsolete system test lists
These were used by deleted legacy runner utility scripts.
2023-12-01 13:47:29 +01:00
Tom Krizek 910440d9b6 Remove legacy runner control scripts
These scripts have been used exclusively by the legacy test runner and
they're no longer needed.
2023-12-01 13:47:27 +01:00
Ondřej Surý 235659b95a Merge branch '4451-use-only-single-method-for-overmem-condition' into 'main'
Refactor the handling of isc_mem overmem condition

Closes #4451

See merge request isc-projects/bind9!8523
2023-11-29 13:21:09 +00:00
Ondřej Surý 022f1d8573 Add CHANGES note for [GL #4451] 2023-11-29 14:16:20 +01:00
Ondřej Surý 0b865c781a Add isc_mem_overmem unit test
The new unit isc_mem_overmem unit test sets hi and lo water marks and
then does allocations to go over:

0. x < lo_water
1. lo_water < x < hi_water
2. x > hi_water
3. lo_water < x < hi_water
4. < lo_water
2023-11-29 14:16:20 +01:00
Ondřej Surý 3383331d06 Cleanup unused stats_bucket() macro 2023-11-29 14:16:20 +01:00
Ondřej Surý 14bdd21e0a Refactor the handling of isc_mem overmem condition
Previously, there were two methods of working with the overmem
condition:

1. hi/lo water callback - when the overmem condition was reached
   for the first time, the water callback was called with HIWATER
   mark and .is_overmem boolean was set internally.  Similarly,
   when the used memory went below the lo water mark, the water
   callback would be called with LOWATER mark and .is_overmem
   was reset.  This check would be called **every** time memory
   was allocated or freed.

2. isc_mem_isovermem() - a simple getter for the internal
   .is_overmem flag

This commit refactors removes the first method and move the hi/lo water
checks to the isc_mem_isovermem() function, thus we now have only a
single method of checking overmem condition and the check for hi/lo
water is removed from the hot path for memory contexts that doesn't use
overmem checks.
2023-11-29 14:16:20 +01:00
Michal Nowak 669800342d Merge branch 'mnowak/drop-named-alt3.conf.in-leftover' into 'main'
Drop the last remnant of ns2/named-alt3.conf.in

See merge request isc-projects/bind9!8506
2023-11-28 20:15:10 +00:00
Matthijs MekkingandMichal Nowak 00fa7483b9 Renumber the ns2/named-alt*.conf.in files
Now that some configuration input files have been removed, rename
the filenames.
2023-11-28 17:03:08 +01:00