Commit Graph

40785 Commits

Author SHA1 Message Date
Michal Nowak
e7b5cf7f79 Rewrite sortlist system test to pytest 2024-02-22 18:02:25 +01:00
Michal Nowak
4a203dcb93 Support "source" parameter in isctest.query.(tcp|udp) 2024-02-22 14:32:04 +01:00
Artem Boldariev
ce33f8e941 Merge branch 'artem-transferslowly-transferstuck-via-timers' into 'main'
Do not block workers when using -T transferslowly/transferstuck

Closes #4566

See merge request isc-projects/bind9!8751
2024-02-21 23:36:31 +00:00
Artem Boldariev
f8812d4184 Do not lock workers when using -T transferslowly/transferstuck
This commit ensures that worker threads are not sleeping (by using
select()) when '-T transferslowly/transferstuck' test options are
used. This commit converts synchronous implementation of the code into
an asynchronous one based on timers.
2024-02-22 00:09:04 +02:00
Artem Boldariev
6406c39edc Merge branch '4572-do-not-crash-resolver-when-tlsctx-creation-failed' into 'main'
DoT: do not crash resolver on TLS context creation failure

Closes #4572

See merge request isc-projects/bind9!8727
2024-02-21 20:41:26 +00:00
Artem Boldariev
6ce6567564 Update CHANGES [GL #4572]
Mention that BIND should not abort anymore when trying to connect to a
remote server via TLS when using an incorrect 'tls' configuration.
2024-02-21 21:42:27 +02:00
Artem Boldariev
17632ad22a Add a system test for #4572
This commit adds a test which exactly reproduces the situation give by
the bug reporter.
2024-02-21 21:05:21 +02:00
Artem Boldariev
4cbe1eb368 DoT: do not crash resolver on TLS context creation failure
The resolver's code was not ready to failures when trying to establish
a connection via TCP-based transports (e.g. when creating TLS contexts
before establishing a TLS connection).

This commit fixes that.
2024-02-21 21:05:21 +02:00
Arаm Sаrgsyаn
2616519a95 Merge branch '4588-cid-486508-control-flow-issue' into 'main'
Clean up fetch_answered

Closes #4588

See merge request isc-projects/bind9!8753
2024-02-21 10:51:32 +00:00
Aram Sargsyan
9e38d0e3af Clean up fetch_answered
After the changes in [GL #4447] the 'fetch_answered' variable is
always false now. Delete the unnecessary code.
2024-02-20 10:46:40 +00:00
Tom Krizek
366b93f835 Merge branch 'tkrizek/pytest-log' into 'main'
Simplify pytest logging

See merge request isc-projects/bind9!8742
2024-02-16 15:00:32 +00:00
Tom Krizek
8058140b67 Don't include temp testdir on each log line
This was mostly an artifact to tell which log lines belong to which test
from the time when the test output could be all mingled together. Now
this info is reduntant, because the pytest logger already includes both
the system test name, and the specific test.
2024-02-16 14:56:00 +01:00
Tom Krizek
c60975f108 Add utility logging functions to isctest.log
Unify the different loggers (conftest, module, test) into a single
interface. Remove the need to select the proper logger by automatically
selecting the most-specific logger currently available.

This also removes the need to use the logger/mlogger fixtures manually
and pass these around. This was especially annoying and unwieldy when
splitting the test cases into functions, because logger had to always be
passed around. Instead, it is now possible to use the
isctest.log.(debug,info,warning,error) functions.
2024-02-16 14:56:00 +01:00
Tom Krizek
52f9e6f557 Move watchlog module into isctest.log package
Preparation for further logging improvements - keep the watchlog
contents in a separate module inside isctest.log. Export the names in
the log package so the imports don't change for the users of these
classes.
2024-02-16 14:56:00 +01:00
Tom Krizek
f8fa528cdd Remove accidentally duplicated RNDCExecutor code
This code has probably been accidentally added during some rebase. The
actual RNDCExecutor and related classes are in isctest/rndc.py. Remove
the duplicated and unused code from isctest/log.py, as it doesn't belong
there.
2024-02-16 14:55:55 +01:00
Arаm Sаrgsyаn
7f924a12f4 Merge branch '4447-disallow-stale-answer-client-timeout-non-zero' into 'main'
Disallow stale-answer-client-timeout non-zero values

Closes #4447

See merge request isc-projects/bind9!8699
2024-02-16 09:35:13 +00:00
Aram Sargsyan
03b68b8c38 Address scan-build warnings
The warnings (see below) seem to be false-positives. Address them
by adding runtime checks.

    resolver.c:1627:10: warning: Access to field 'tid' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     1627 |         REQUIRE(fctx->tid == isc_tid());
          |                 ^~~~~~~~~
    ../../lib/isc/include/isc/util.h:332:34: note: expanded from macro 'REQUIRE'
      332 | #define REQUIRE(e)   ISC_REQUIRE(e)
          |                                  ^
    ../../lib/isc/include/isc/assertions.h:45:11: note: expanded from macro 'ISC_REQUIRE'
       45 |         ((void)((cond) ||                                                  \
          |                  ^~~~
    resolver.c:10335:6: warning: Access to field 'depth' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     10335 |         if (fctx->depth > depth) {
           |             ^~~~~~~~~~~
    2 warnings generated.
2024-02-16 08:42:48 +00:00
Aram Sargsyan
152c6e2274 Add CHANGES and release notes for [GL #4447] 2024-02-16 08:42:47 +00:00
Aram Sargsyan
bd7463914f Disallow stale-answer-client-timeout non-zero values
Remove all the code and tests which support non-zero
stale-answer-client-timeout values, and adjust the
documentation.
2024-02-16 08:41:52 +00:00
Evan Hunt
a2dc8ebcc0 Merge branch 'each-rbtdb-dbiterator-fixes' into 'main'
fix several bugs in the RBTDB dbiterator implementation

See merge request isc-projects/bind9!8741
2024-02-15 18:52:47 +00:00
Evan Hunt
32241022b5 CHANGES for [GL !8741] 2024-02-15 10:15:50 -08:00
Evan Hunt
e40fd4ed06 fix several bugs in the RBTDB dbiterator implementation
- the DNS_DB_NSEC3ONLY and DNS_DB_NONSEC3 flags are mutually
  exclusive; it never made sense to set both at the same time.
  to enforce this, it is now a fatal error to do so.  the
  dbiterator implementation has been cleaned up to remove
  code that treated the two as independent: if nonsec3 is
  true, we can be certain nsec3only is false, and vice versa.
- previously, iterating a database backwards omitted
  NSEC3 records even if DNS_DB_NONSEC3 had not been set. this
  has been corrected.
- when an iterator reaches the origin node of the NSEC3 tree, we
  need to skip over it and go to the next node in the sequence.
  the NSEC3 origin node is there for housekeeping purposes and
  never contains data.
- the dbiterator_test unit test has been expanded, several
  incorrect expectations have been fixed. (for example, the
  expected number of iterations has been reduced by one; we were
  previously counting the NSEC3 origin node and we should not
  have been doing so.)
2024-02-15 10:15:50 -08:00
Evan Hunt
88c56e25a1 Merge branch 'each-zone-xfrin-race' into 'main'
prevent a possible race in setting up zone->xfr

See merge request isc-projects/bind9!8716
2024-02-14 21:50:25 +00:00
Evan Hunt
7d59a0ed81 prevent a possible race in setting up zone->xfr
the call to dns_xfrin_create() wrote to zone->xfr with
the zone unlocked.
2024-02-14 18:53:17 +00:00
Evan Hunt
c05cf6d80e Merge branch 'each-fix-missing-comparison' into 'main'
test for SIGTYPE correctly

See merge request isc-projects/bind9!8733
2024-02-14 18:36:45 +00:00
Evan Hunt
3e683a9ed5 test for SIGTYPE correctly
a comparison was incorrectly removed during a previous merge.
2024-02-14 09:32:20 -08:00
Michał Kępień
cc65a14d0e Merge branch 'michal/post-release-tweaks' into 'main'
Miscellaneous post-release tweaks

See merge request isc-projects/bind9!8738
2024-02-14 16:17:02 +00:00
Michał Kępień
dedc5b9afb Swap CHANGES entries 6343 and 6344
Fix a CHANGES entries numbering issue that was inadvertently introduced
when change 6344 was backported.  This makes the affected CHANGES
numbers consistent across all branches and releases again.
2024-02-14 14:49:49 +01:00
Michał Kępień
01ac86f90b Retroactively add release note for CVE-2023-50868
A release note for CVE-2023-50868 was not included in BIND 9.19.21, even
though that vulnerability was already addressed in that release (by the
fix for CVE-2023-50387).  Retroactively add a relevant release note for
BIND 9.19.21.
2024-02-14 14:49:49 +01:00
Michał Kępień
2fd20bbaf5 Mention CVE-2023-50868 in CHANGES entry 6322
Since CVE-2023-50868 does not have a dedicated fix in BIND 9, mention
its CVE identifier in the CHANGES entry for CVE-2023-50387 (KeyTrap),
which accompanied the code change that addresses both of these
vulnerabilities.
2024-02-14 14:49:49 +01:00
Michał Kępień
8610799317 Merge tag 'v9.19.21'
BIND 9.19.21
2024-02-14 13:24:56 +01:00
Michal Nowak
917851ac5c Merge branch 'mnowak/accommodate-black-24.2.0' into 'main'
Accommodate black 24.2.0

See merge request isc-projects/bind9!8729
2024-02-14 11:31:34 +00:00
Michal Nowak
70163a8b3f Accommodate black 24.2.0 2024-02-14 10:49:21 +01:00
Evan Hunt
9279a1038b Merge branch 'each-cleanup-dns_rbt' into 'main'
clean up dns_rbt

See merge request isc-projects/bind9!8715
2024-02-14 09:45:58 +00:00
Evan Hunt
ac9bd03a0d clean up dns_rbt
- create_node() in rbt.c cannot fail
- the dns_rbt_*name() functions, which are wrappers around
  dns_rbt_[add|find|delete]node(), were never used except in tests.

this change isn't really necessary since RBT is likely to go away
eventually anyway. but keeping the API as simple as possible while it
persists is a good thing, and may reduce confusion while QPDB is being
developed from RBTDB code.
2024-02-14 01:36:44 -08:00
Evan Hunt
7d1e622b5f Merge branch 'each-move-DNS_RBT_NSEC_-to-db.h' into 'main'
move DNS_RBT_NSEC_* to db.h

See merge request isc-projects/bind9!8714
2024-02-14 09:27:21 +00:00
Evan Hunt
78d173b548 move DNS_RBT_NSEC_* to db.h
these values pertain to whether a node is in the main, nsec, or nsec3
tree of an RBTDB. they need to be moved to a more generic location so
they can also be used by QPDB.

(this is in db.h rather than db_p.h because rbt.c needs access to it.
technically, that's a layer violation, but it's a long-existing one;
refactoring to get rid of it would be a large hassle, and eventually
we expect to remove rbt.c anyway.)
2024-02-14 01:13:44 -08:00
Matthijs Mekking
808281cf43 Merge branch 'each-separate-generic-DB-helpers' into 'main'
separate generic DB helpers into db_p.h

See merge request isc-projects/bind9!8713
2024-02-14 08:46:05 +00:00
Matthijs Mekking
af5679960e Add coccinelle rule to favor DNS_SIGTYPE
This should error if DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, type) is
used.
2024-02-14 09:00:27 +01:00
Evan Hunt
27c862d953 separate generic DB helpers into db_p.h
when the QPDB is implemented, we will need to have both qpdb_p.h and
rbtdb_p.h. in order to prevent name collisions or code duplication,
this commit adds a generic private header file, db_p.h, containing
structures and macros that will be used by both databases.

some functions and structs have been renamed to more specifically refer
to the RBT database, in order to avoid namespace collision with similar
things that will be needed by the QPDB later.
2024-02-14 09:00:27 +01:00
Evan Hunt
a22fec506a Merge branch 'each-refactor-wildcard-matching' into 'main'
Refactor wildcard matching

See merge request isc-projects/bind9!8712
2024-02-13 22:48:39 +00:00
Evan Hunt
d1acc987e9 refactor wildcard matching
refactor the wildcard matching code to make it a bit easier to
understand, in hopes that it will reduce the difficulty of converting
from RBTDB to QPDB later.

there are also some minor optimizations: previously, after stepping
backward to find the predecessor, we stepped back foward *from* the
predecessor to find the successor.  we now reset the rbtnode chain to
its original starting point before stepping forward; this eliminates
some unnecessary processing. and, if neither predecessor nor successor
is found, we return early rather than carrying on with an unnecessary
effort to match labels.
2024-02-13 22:14:17 +00:00
Mark Andrews
dbf29b7b5b Merge branch '4571-findnsec3proofs-failed-to-disassociate-all-rdatasets-returned-by-dns_ncache_current' into 'main'
Resolve "findnsec3proofs failed to disassociate all rdatasets returned by dns_ncache_current"

Closes #4571

See merge request isc-projects/bind9!8725
2024-02-13 13:06:32 +00:00
Mark Andrews
3b7cddfb1b Add CHANGES note for [GL #4571] 2024-02-13 11:42:56 +00:00
Mark Andrews
dc94f42209 Dissassociate rdatasets returned from dns_ncache_current
lib/dns/validator.c:findnsec3proofs failed to disassociate the
temporary rdataset returned by dns_ncache_current on all paths.
2024-02-13 11:42:56 +00:00
Mark Andrews
a9ceecdd9d Merge branch '4569-cid-486326-memory-corruptions-overrun' into 'main'
Resolve "** CID 486326:  Memory - corruptions  (OVERRUN)"

Closes #4569

See merge request isc-projects/bind9!8723
2024-02-13 00:07:42 +00:00
Mark Andrews
371defc357 Address CID 486326: Memory - corruptions (OVERRUN)
Coverity detected that address->type.sa was too small when copying
a struct sockaddr_sin6, use the alterative union element
address->type.sin6 instead.
2024-02-13 09:21:49 +11:00
Mark Andrews
c2b7cb2cef Merge branch '4570-cid-486327-control-flow-issues-unreachable' into 'main'
Resolve "CID 486327:  Control flow issues  (UNREACHABLE)"

Closes #4570

See merge request isc-projects/bind9!8724
2024-02-12 21:59:12 +00:00
Mark Andrews
dd57db2274 Remove duplicate unreachable code block
This was accidentially left in during the developement of !8299.
2024-02-12 15:18:46 +11:00
Ondřej Surý
dea228d198 Merge branch '4568-fix-isc_ht-case-insensitive-matching' into 'main'
Fix case insensitive matching in isc_ht hash table implementation

Closes #4568

See merge request isc-projects/bind9!8718
2024-02-11 08:55:52 +00:00