]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
14 months agoHandle queries indefinitely on each TCP connection
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Handle queries indefinitely on each TCP connection

Instead of closing every incoming TCP connection after handling a single
query, continue receiving queries on each TCP connection until the
client disconnects itself.  When coupled with response dropping, this
enables silently receiving all incoming data, simulating an unresponsive
server.

14 months agoEnable receiving chunked TCP DNS messages
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Enable receiving chunked TCP DNS messages

A TCP DNS client may send its queries in chunks, causing
StreamReader.read() to return less data than previously declared by the
client as the DNS message length; even the two-octet DNS message length
itself may be split up into two single-octet transmissions.  Sending
data in chunks is valid client behavior that should not be treated as an
error.  Add a new helper method for reading TCP data in a loop, properly
distinguishing between chunked queries and client disconnections.  Use
the new method for reading all TCP data from clients.

14 months agoExtend TCP logging
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Extend TCP logging

Emit more log messages from TCP connection handling code and extend
existing ones to improve debuggability of servers using asyncserver.py.

14 months agoHandle connection resets during reading
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Handle connection resets during reading

A TCP peer may reset the connection at any point, but asyncserver.py
currently only handles connection resets when it is sending data to the
client.  Handle connection resets during reading in the same way.

14 months agoRefactor AsyncDnsServer._handle_tcp()
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Refactor AsyncDnsServer._handle_tcp()

Split up AsyncDnsServer._handle_tcp() into a set of smaller methods to
improve code readability.

14 months agoGracefully handle TCP client disconnections
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Gracefully handle TCP client disconnections

Prevent premature client disconnections during reading from triggering
unhandled exceptions in TCP connection handling code.

14 months agoSimplify peer address formatting
Michał Kępień [Tue, 18 Mar 2025 15:28:18 +0000 (16:28 +0100)] 
Simplify peer address formatting

Add a helper class, Peer, which holds the <host, port> tuple of a
connection endpoint and gets pretty-printed when formatted as a string.
This enables passing instances of this new class directly to logging
functions, eliminating the need for the AsyncDnsServer._format_peer()
helper method.

14 months agochg: ci: Allow re-run of the shotgun jobs to reduce false positives
Nicki Křížek [Tue, 18 Mar 2025 09:29:10 +0000 (09:29 +0000)] 
chg: ci: Allow re-run of the shotgun jobs to reduce false positives

The false positive rate is about 10-20 % when evaluating shotgun results
from a single run. Attempt to reduce the false positive rate by allowing
a re-run of failed jobs.

Merge branch 'nicki/ci-shotgun-reduce-false-positives' into 'main'

See merge request isc-projects/bind9!10271

14 months agoAllow re-run of the shotgun jobs to reduce false positive
Nicki Křížek [Wed, 12 Mar 2025 16:24:05 +0000 (17:24 +0100)] 
Allow re-run of the shotgun jobs to reduce false positive

The false positive rate is about 10-20 % when evaluating shotgun results
from a single run. Attempt to reduce the false positive rate by allowing
a re-run of failed jobs.

While there is a slight risk that barely noticable decreases in
performance might slip by more easily in MRs, they'd still likely pop up
during nightly or pre-release testing.

Also increase the tolerance threshold for DoH latency comparisons, as
those tests often experience increased jitter in the tail end latencies.

14 months agoAdjust the load factor for shotgun:tcp test
Nicki Křížek [Wed, 12 Mar 2025 16:03:50 +0000 (17:03 +0100)] 
Adjust the load factor for shotgun:tcp test

With the slightly decreased load for the TCP test, the results appear to
be a little bit more stable.

14 months agochg: test: Use isctest.asyncserver in the "qmin" test
Michał Kępień [Tue, 18 Mar 2025 05:55:17 +0000 (05:55 +0000)] 
chg: test: Use isctest.asyncserver in the "qmin" test

Replace custom DNS servers used in the "qmin" system test with new code
based on the isctest.asyncserver module.  The revised code employs zone
files and a limited amount of custom logic, which massively improves
test readability and maintainability, extends logging, and fixes
non-compliant replies sent by some of the custom servers in response to
certain queries (e.g. AA=0 in authoritative empty non-terminal
responses, non-glue address records in ADDITIONAL section).

Merge branch 'michal/qmin-asyncserver' into 'main'

See merge request isc-projects/bind9!10195

14 months agoBroaden vulture exclude glob for ans.py servers
Michał Kępień [Tue, 18 Mar 2025 05:19:01 +0000 (06:19 +0100)] 
Broaden vulture exclude glob for ans.py servers

The vulture tool seems to be unable to follow how the parent classes
defined in bin/tests/system/qmin/qmin_ans.py use mandatory properties
specified by child classes in bin/tests/system/qmin/ans*/ans.py.  Make
the tool ignore not just ans.py servers, but also *_ans.py utility
modules above the ansX/ subdirectories to prevent false positives about
unused code from causing CI pipeline failures.

14 months agoIgnore .hypothesis files created by system tests
Michał Kępień [Tue, 18 Mar 2025 05:19:01 +0000 (06:19 +0100)] 
Ignore .hypothesis files created by system tests

Some versions of the Hypothesis Python library - notably the one
included in stock OS repositories for Ubuntu 20.04 Focal Fossa - cause a
.hypothesis file to be created in a Python script's working directory
when the hypothesis module is present in its import chain.  Ignore such
files by adding them to the list of expected test artifacts to prevent
pytest teardown checks from failing due to these files appearing in the
file system after running system tests.

14 months agoFix PYTHONPATH set for ans.py servers by start.pl
Michał Kępień [Tue, 18 Mar 2025 05:19:01 +0000 (06:19 +0100)] 
Fix PYTHONPATH set for ans.py servers by start.pl

Commit 6c010a5644324947c8c13b5600cd8d988ae7684f caused the PYTHONPATH
environment variable to be set for ans.py servers started using
start.pl.  However, no system test has actually used the new
isctest.asyncserver module since that change was applied, so it has not
been noticed until now that including the source directory in PYTHONPATH
is only sufficient for in-tree builds.  Include the build directory
instead of the source directory in the PYTHONPATH environment variable
set for ans.py servers started by start.pl so that they work correctly
for both in-tree and out-of-tree builds.

14 months agoUse isctest.asyncserver in the "qmin" test
Michał Kępień [Tue, 18 Mar 2025 05:19:01 +0000 (06:19 +0100)] 
Use isctest.asyncserver in the "qmin" test

Replace custom DNS servers used in the "qmin" system test with new code
based on the isctest.asyncserver module.  The revised code employs zone
files and a limited amount of custom logic, which massively improves
test readability and maintainability, extends logging, and fixes
non-compliant replies sent by some of the custom servers in response to
certain queries (e.g. AA=0 in authoritative empty non-terminal
responses, non-glue address records in ADDITIONAL section).

14 months agorem: dev: Cleanup BIND 8 compatibility code
Ondřej Surý [Tue, 18 Mar 2025 00:12:31 +0000 (00:12 +0000)] 
rem: dev: Cleanup BIND 8 compatibility code

There was some code in dns_resolver unit meant to keep compatibility with BIND 8 breaking the DNS protocol.  These should not be needed anymore.

Merge branch 'ondrej/resolver-bind-8-cleanup' into 'main'

See merge request isc-projects/bind9!10270

14 months agoRemove a kludge to process non-authoritative CNAME response
Ondřej Surý [Mon, 17 Mar 2025 15:31:14 +0000 (16:31 +0100)] 
Remove a kludge to process non-authoritative CNAME response

A BIND 8 server could return a non-authoritative answer when a CNAME is
followed.  This is no longer handled as a valid answer.

14 months agoRemove the kludges for records in the bad sections
Ondřej Surý [Mon, 17 Mar 2025 14:27:38 +0000 (15:27 +0100)] 
Remove the kludges for records in the bad sections

There were kludges to help process responses from authoritative servers
giving RRs in wrong sections (mentioning BIND 8).  These should just go
away and such responses should not be processed.

14 months agoSmall cleanup in dns_adb unit
Ondřej Surý [Mon, 17 Mar 2025 14:23:00 +0000 (15:23 +0100)] 
Small cleanup in dns_adb unit

14 months agochg: ci: Disable linkcheck on dl.acm.org
Michal Nowak [Mon, 17 Mar 2025 17:07:40 +0000 (17:07 +0000)] 
chg: ci: Disable linkcheck on dl.acm.org

The check fails with the following error for some time:

    403 Client Error: Forbidden for url: https://dl.acm.org/doi/10.1145/1315245.1315298

Merge branch 'mnowak/linkcheck-disable-dl-acm-org' into 'main'

See merge request isc-projects/bind9!10272

14 months agoDisable linkcheck on dl.acm.org
Michal Nowak [Mon, 17 Mar 2025 16:39:36 +0000 (17:39 +0100)] 
Disable linkcheck on dl.acm.org

The check fails with the following error for some time:

    403 Client Error: Forbidden for url: https://dl.acm.org/doi/10.1145/1315245.1315298

14 months agonew: dev: Implement -T cookiealwaysvalid
Arаm Sаrgsyаn [Mon, 17 Mar 2025 11:36:57 +0000 (11:36 +0000)] 
new: dev: Implement -T cookiealwaysvalid

When `-T cookiealwaysvalid` is passed to `named`, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

Merge branch 'aram/new-named-minus-T-option-of-cookiealwaysvalid' into 'main'

See merge request isc-projects/bind9!10232

14 months agoTest -T cookiealwaysvalid
Aram Sargsyan [Tue, 11 Mar 2025 14:29:22 +0000 (14:29 +0000)] 
Test -T cookiealwaysvalid

Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

14 months agoImplement -T cookiealwaysvalid
Aram Sargsyan [Tue, 11 Mar 2025 14:03:56 +0000 (14:03 +0000)] 
Implement -T cookiealwaysvalid

When -T cookiealwaysvalid is passed to named, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

14 months agofix: dev: Add missing locks when returning addresses
Mark Andrews [Sat, 15 Mar 2025 06:04:34 +0000 (06:04 +0000)] 
fix: dev: Add missing locks when returning addresses

Add missing locks in dns_zone_getxfrsource4 et al.  Addresses CID 468706, 468708, 468741, 468742, 468785, and 468778.

Cleanup dns_zone_setxfrsource4 et al to now return void.

Remove double copies with dns_zone_getprimaryaddr and dns_zone_getsourceaddr.

Closes #4933

Merge branch '4933-add-missing-locks-when-returning-addresses' into 'main'

See merge request isc-projects/bind9!9485

14 months agoAdd missing locks when returning addresses
Mark Andrews [Thu, 12 Sep 2024 02:54:25 +0000 (12:54 +1000)] 
Add missing locks when returning addresses

Add missing locks in dns_zone_getxfrsource4 et al. Addresses CID
468706, 468708, 468741, 468742, 468785 and 468778.

Cleanup dns_zone_setxfrsource4 et al to now return void.

Remove double copies with dns_zone_getprimaryaddr and dns_zone_getsourceaddr.

14 months agofix: nil: Add new convenience functions to classify rdata types
Evan Hunt [Sat, 15 Mar 2025 01:26:35 +0000 (01:26 +0000)] 
fix: nil: Add new convenience functions to classify rdata types

- `dns_rdatatype_ismulti()` returns true if a given type can have
  multiple answers: ANY, RRSIG, or SIG.
- `dns_rdatatype_issig()` returns true for a signature: RRSIG or SIG.
- `dns_rdatatype_isaddr()` returns true for an address: A or AAAA.
- `dns_rdatatype_isalias()` returns true for an alias: CNAME or DNAME.

Code has been modified to use these functions where applicable.

These and all similar functions (e.g., `dns_rdatatype_ismeta()`, `dns_rdatatype_issingleton()`, etc) are now `static inline` functions defined in `rdata.h`.

Merge branch 'each-rdatatype-functions' into 'main'

See merge request isc-projects/bind9!10216

14 months agouse new dns_rdatatype classification functions
Evan Hunt [Tue, 4 Mar 2025 23:51:49 +0000 (15:51 -0800)] 
use new dns_rdatatype classification functions

modify code to use dns_rdatatype_ismulti(), dns_rdatatype_issig(),
dns_rdatatype_isaddr(), and dns_rdatatype_isalias() where applicable.

14 months agoconvert rdatatype classification routines to inline
Evan Hunt [Wed, 5 Mar 2025 00:21:50 +0000 (16:21 -0800)] 
convert rdatatype classification routines to inline

turn the dns_rdatatype_is*() functions into static inline
functions in rdata.h.

14 months agoadd new functions to classify rdata types
Evan Hunt [Tue, 4 Mar 2025 23:51:49 +0000 (15:51 -0800)] 
add new functions to classify rdata types

- dns_rdatatype_ismulti() returns true if a given type can have
  multiple answers: ANY, RRSIG, or SIG.
- dns_rdatatype_issig() returns true for a signature: RRSIG or SIG.
- dns_rdatatype_isaddr() returns true for an address: A or AAAA.
- dns_rdatatype_isalias() returns true for an alias: CNAME or DNAME.

14 months agofix: dev: step() could ignore rollbacks
Evan Hunt [Fri, 14 Mar 2025 23:19:36 +0000 (23:19 +0000)] 
fix: dev: step() could ignore rollbacks

The `step()` function (used for stepping to the prececessor or successor of a database node) could overlook a node if there was an rdataset that was marked IGNORE because it had been rolled back, covering an active rdataset under it.

Closes #5170

Merge branch '5170-step-ignores-rollback' into 'main'

See merge request isc-projects/bind9!10103

14 months agoadd a unit test with an empty node
Evan Hunt [Wed, 5 Mar 2025 23:46:17 +0000 (15:46 -0800)] 
add a unit test with an empty node

the db_test unit test now looks up an empty nonterminal node
to exercise the behavior of the step() function in qpzone.

14 months agoadd a unit test to check database rollback
Evan Hunt [Wed, 5 Mar 2025 04:21:04 +0000 (20:21 -0800)] 
add a unit test to check database rollback

check that a database rollback works and the correct
(original) data is found on lookup.

14 months agoqpzone.c:step() could ignore rollbacks
Evan Hunt [Sat, 15 Feb 2025 05:42:34 +0000 (21:42 -0800)] 
qpzone.c:step() could ignore rollbacks

the step() function (used for stepping to the prececessor or
successor of a database node) could overlook a node because
there was an rdataset marked IGNORE because it had been rolled
back, covering an active rdataset under it.

14 months agofix: dev: Fix handling of revoked keys
Evan Hunt [Fri, 14 Mar 2025 22:26:36 +0000 (22:26 +0000)] 
fix: dev: Fix handling of revoked keys

When a key is revoked, its key ID changes due to the inclusion of the "revoked" flag. A collision between this changed key ID
and an unrelated public-only key could cause a crash in `dnssec-signzone`.

Closes #5231

Merge branch '5231-fix-keyid-collision' into 'main'

See merge request isc-projects/bind9!10233

14 months agofix handling of revoked keys
Evan Hunt [Tue, 11 Mar 2025 20:36:00 +0000 (13:36 -0700)] 
fix handling of revoked keys

when a key is revoked its key ID changes, due to the inclusion
of the "revoke" flag. a collision between this changed key ID and
that of an unrelated public-only key could cause a crash in
dnssec-signzone.

14 months agofix: test: Tune many types tests in reclimit test
Mark Andrews [Fri, 14 Mar 2025 05:28:01 +0000 (05:28 +0000)] 
fix:  test:  Tune many types tests in reclimit test

The `I:checking that lifting the limit will allow everything to get
cached (20)` test was failing due to the TTL of the records being
too short for the elapsed time of the test.  Raise the TTL to fix
this and adjust other tests as needed.

Closes #5206

Merge branch '5206-tune-last-sub-test-of-reclimit' into 'main'

See merge request isc-projects/bind9!10177

14 months agoTune many types tests in reclimit test
Mark Andrews [Wed, 26 Feb 2025 21:36:54 +0000 (08:36 +1100)] 
Tune many types tests in reclimit test

The 'I:checking that lifting the limit will allow everything to get
cached (20)' test was failing due to the TTL of the records being
too short for the elapsed time of the test.  Raise the TTL to fix
this and adjust other tests as needed.

14 months agofix: usr: QNAME minimization could leak the query type
Mark Andrews [Fri, 14 Mar 2025 02:02:52 +0000 (02:02 +0000)] 
fix: usr: QNAME minimization could leak the query type

When performing QNAME minimization, `named` now sends an NS query for the original query name, before sending the final query. This prevents the parent zone from learning the original query type, in the event that the query name is a delegation point.

For example, when looking up an address record for `example.com`, NS queries are now sent to the servers for both `com` and `example.com`, before the address query is sent to the servers for `example.com`.  Previously, an address query would have been sent to the servers for `com`.

Closes #4805

Merge branch '4805-missing-qname-ns-query-when-using-qname-minimisation' into 'main'

See merge request isc-projects/bind9!9155

14 months agoDon't leak the original QTYPE to parent zone
Mark Andrews [Thu, 18 Jul 2024 03:27:23 +0000 (13:27 +1000)] 
Don't leak the original QTYPE to parent zone

When performing QNAME minimization, named now sends an NS
query for the original QNAME, to prevent the parent zone from
receiving the QTYPE.

For example, when looking up example.com/A, we now send NS queries
for both com and example.com before sending the A query to the
servers for example.com.  Previously, an A query for example.com
would have been sent to the servers for com.

Several system tests needed to be adjusted for the new query pattern:

- Some queries in the serve-stale test were sent to the wrong server.
- The synthfromdnssec test could fail due to timing issues; this
  has been addressed by adding a 1-second delay.
- The cookie test could fail due to the a change in the count of
  TSIG records received in the "check that missing COOKIE with a
  valid TSIG signed response does not trigger TCP fallback" test case.
- The GL #4652 regression test case in the chain system test depends
  on a particular query order, which no longer occurs when QNAME
  minimization is active. We now disable qname-minimization
  for that test.

14 months agoFix handling of ISC_R_TIMEOUT in resume_qmin()
Mark Andrews [Thu, 15 Aug 2024 13:34:59 +0000 (23:34 +1000)] 
Fix handling of ISC_R_TIMEOUT in resume_qmin()

If a timeout occurs when sending a QMIN query, QNAME
minimization should be disabled. This now causes a hard
failure in strict mode, or a fallback to non-minimized queries
in relaxed mode.

14 months agoExempt QNAME minimization queries from fetches-per-zone
Mark Andrews [Fri, 6 Sep 2024 04:41:26 +0000 (14:41 +1000)] 
Exempt QNAME minimization queries from fetches-per-zone

The calling fetch has already called fcount_incr() for this zone;
calling it again for a QMIN query results in double counting.

When resuming after a QMIN query is answered, however, we do now
ensure before continuing that the fetches-per-zone limit has not
been exceeded.

14 months agonew: usr: dig can now display the received BADVERS message during negotiation
Mark Andrews [Fri, 14 Mar 2025 00:45:20 +0000 (00:45 +0000)] 
new: usr: dig can now display the received BADVERS message during negotiation

Dig +showbadvers now displays the received BADVERS message and
continues the EDNS version negotiation.  Previously to see the
BADVERS message +noednsneg had to be specified which terminated the
EDNS negotiation.  Additionally the specified EDNS value (+edns=value)
is now used when making all the initial queries with +trace. i.e EDNS
version negotiation will be performed with each server when performing
the trace.

Closes #5234

Merge branch '5234-have-dig-display-the-badvers-message' into 'main'

See merge request isc-projects/bind9!10234

14 months agocheck that dig +showbadvers works
Mark Andrews [Wed, 12 Mar 2025 00:16:10 +0000 (11:16 +1100)] 
check that dig +showbadvers works

14 months agoAdd "+showbadvers" to dig and reset EDNS version
Mark Andrews [Tue, 11 Mar 2025 23:02:05 +0000 (10:02 +1100)] 
Add "+showbadvers" to dig and reset EDNS version

Add "+showbadvers" to display the BADVERS response similarly
to "+showbadcookie".  Additionally reset the EDNS version to
the requested version in "dig +trace" so that EDNS version
negotiation can be tested at all levels of the trace rather
that just when requesting the root nameservers.

14 months agofix: usr: Ensure max-clients-per-query is at least clients-per-query
Matthijs Mekking [Thu, 13 Mar 2025 13:02:48 +0000 (13:02 +0000)] 
fix: usr: Ensure max-clients-per-query is at least clients-per-query

If the `max-clients-per-query` option is set to a lower value than `clients-per-query`, the value is adjusted to match `clients-per-query`.

Closes #5224

Merge branch '5224-raise-max-clients-per-query-to-be-at-least' into 'main'

See merge request isc-projects/bind9!10241

14 months agoRaise max-clients-per-query to be at least
Matthijs Mekking [Thu, 13 Mar 2025 08:28:37 +0000 (09:28 +0100)] 
Raise max-clients-per-query to be at least

In the case where 'clients-per-query' is larger than
'max-clients-per-query', raise 'max-clients-per-query' so that
'clients-per-query' equals 'max-clients-per-query' and log a warning
that this is what happened.

14 months agoTest new max-clients-per-query log warning
Matthijs Mekking [Thu, 13 Mar 2025 08:27:41 +0000 (09:27 +0100)] 
Test new max-clients-per-query log warning

Make sure the new warning is logged.

14 months agoUpdate max-clients-per-query documentation
Matthijs Mekking [Wed, 12 Mar 2025 15:48:54 +0000 (16:48 +0100)] 
Update max-clients-per-query documentation

The new intended behavior is that 'max-clients-per-query' value is
raised to equal 'clients-per-query' if it is lower.

14 months agonew: usr: Add support for EDE 20 (Not Authoritative)
Colin Vidal [Thu, 13 Mar 2025 11:56:37 +0000 (11:56 +0000)] 
new: usr: Add support for EDE 20 (Not Authoritative)

Support was added for EDE codes 20 (Not Authoritative) when client requests recursion (RD) but the server has recursion disabled.

RFC 8914 mention EDE 20 should also be returned if the client doesn't have the RD bit set (and recursion is needed) but it doesn't apply for
BIND as BIND would try to resolve from the "deepest" referral in AUTHORITY section. For example, if the client asks for "www.isc.org/A" but the server only knows the root domain, it will return NOERROR but no answer for "www.isc.og/A", just the list of other servers to ask.

See #1836

Merge branch '1836-not-authoritative' into 'main'

See merge request isc-projects/bind9!10228

14 months agoadd system test covering EDE 20
Colin Vidal [Wed, 12 Mar 2025 09:29:10 +0000 (10:29 +0100)] 
add system test covering EDE 20

Add system test to cover extended DNS error 20 (Not authoritative).

14 months agoadd support for EDE 20 (Not Authoritative)
Colin Vidal [Wed, 12 Mar 2025 09:28:27 +0000 (10:28 +0100)] 
add support for EDE 20 (Not Authoritative)

Extended DNS Error message EDE 20 (Not Authoritative) is now sent when
client request recursion (RD) but the server has recursion disabled.

RFC 8914 mention EDE 20 should also be returned if the client doesn't
have the RD bit set (and recursion is needed) but it doesn't apply for
BIND as BIND would try to resolve from the "deepest" referral in
AUTHORITY section. For example, if the client asks for "www.isc.org/A"
but the server only knows the root domain, it will returns NOERROR but
no answer for "www.isc.og/A", just the list of other servers to ask.

14 months agonew: usr: Add support for EDE 7 and EDE 8
Colin Vidal [Thu, 13 Mar 2025 10:13:36 +0000 (10:13 +0000)] 
new: usr: Add support for EDE 7 and EDE 8

Support was added for EDE codes 7 (Signature Expired) and 8 (Signature Not Yet Valid) which might occur during DNSSEC validation.

See #2715

Merge branch '2715-expired-future-keys' into 'main'

See merge request isc-projects/bind9!10225

14 months agoadd system tests covering EDE 7 and 8
Colin Vidal [Wed, 12 Mar 2025 09:53:33 +0000 (10:53 +0100)] 
add system tests covering EDE 7 and 8

Add DNSSEC system tests to cover extended DNS error 7 (Signature
Expired) and 8 (Signature Not Yet Valid).

14 months agoadd support for EDE 7 and 8
Colin Vidal [Wed, 12 Mar 2025 09:53:11 +0000 (10:53 +0100)] 
add support for EDE 7 and 8

Extended DNS Error messages EDE 7 (expired key) and EDE 8 (validity
period of the key not yet started) are now sent in case of such DNSSEC
validation failures.

Refactor the existing validator extended error APIs in order to make it
easy to have a consisdent extra info (with domain/type) in the various
use case (i.e. when the EDE depends on validator state,
validate_extendederror or when the EDE doesn't depend of any state but
can be called directly in a specific flow).

14 months agofix: test: Take into account key collisions in ksr system test
Matthijs Mekking [Thu, 13 Mar 2025 08:19:05 +0000 (08:19 +0000)] 
fix: test: Take into account key collisions in ksr system test

Closes #5229

Merge branch '5229-ksr-system-test-can-fail-on-key-collision' into 'main'

See merge request isc-projects/bind9!10238

14 months agoksr: Take into account key collisions
Matthijs Mekking [Wed, 12 Mar 2025 15:14:52 +0000 (16:14 +0100)] 
ksr: Take into account key collisions

When generating new key pairs, one test checks if existing keys that
match the time bundle are selected, rather than extra keys being
generated. Part of the test is to check the verbose output, counting
the number of "Selecting" and "Generating" occurences. But if there
is a key collision, the ksr tool will output that the key already
exists and includes the substring "already exists, or might collide
with another key upon revokation.  Generating a new key".

So substract by one the generated counter if there is a "collide"
occurrence.

14 months agofix: dev: Fix CID 544147: Code maintainability issues (UNUSED_VALUE)
Matthijs Mekking [Thu, 13 Mar 2025 08:18:35 +0000 (08:18 +0000)] 
fix: dev: Fix CID 544147: Code maintainability issues (UNUSED_VALUE)

Assigning value "NULL" to "newstr", but that stored value is overwritten
before it can be used.

Setting "newstr" to NULL does not have any effect, so the line can
safely be removed.

Closes #5227

Merge branch '5227-cid-544147' into 'main'

See merge request isc-projects/bind9!10239

14 months agoFix CID 544147
Matthijs Mekking [Wed, 12 Mar 2025 15:39:36 +0000 (16:39 +0100)] 
Fix CID 544147

Assigning value "NULL" to "newstr", but that stored value is overwritten
before it can be used.

Setting "newstr" to NULL does not have any effect, so the line can
safely be removed.

14 months agochg: doc: Set up version for BIND 9.21.7
Andoni Duarte [Wed, 12 Mar 2025 13:07:00 +0000 (13:07 +0000)] 
chg: doc: Set up version for BIND 9.21.7

Merge branch 'andoni/set-up-version-for-bind-9.21.7' into 'main'

See merge request isc-projects/bind9!10237

14 months agoUpdate BIND version to 9.21.7-dev
Andoni Duarte Pintado [Wed, 12 Mar 2025 11:09:35 +0000 (12:09 +0100)] 
Update BIND version to 9.21.7-dev

15 months agoUpdate BIND version for release v9.21.6
Andoni Duarte Pintado [Tue, 11 Mar 2025 10:37:59 +0000 (11:37 +0100)] 
Update BIND version for release

15 months agonew: doc: Prepare documentation for BIND 9.21.6
Andoni Duarte [Tue, 11 Mar 2025 10:10:19 +0000 (10:10 +0000)] 
new: doc: Prepare documentation for BIND 9.21.6

Merge branch 'andoni/prepare-documentation-for-bind-9.21.6' into 'v9.21.6-release'

See merge request isc-private/bind9!784

15 months agoTweak and reword relase notes
Andoni Duarte Pintado [Fri, 7 Mar 2025 18:46:20 +0000 (19:46 +0100)] 
Tweak and reword relase notes

15 months agoPrepare release notes for BIND 9.21.6
Andoni Duarte Pintado [Thu, 6 Mar 2025 16:32:19 +0000 (17:32 +0100)] 
Prepare release notes for BIND 9.21.6

15 months agoGenerate changelog for BIND 9.21.6
Andoni Duarte Pintado [Thu, 6 Mar 2025 16:31:24 +0000 (17:31 +0100)] 
Generate changelog for BIND 9.21.6

15 months agofix: dev: Revert "Delete dead nodes when committing a new version"
Ondřej Surý [Wed, 5 Mar 2025 17:25:20 +0000 (17:25 +0000)] 
fix: dev: Revert "Delete dead nodes when committing a new version"

This reverts commit 67255da4b376f65138b299dcd5eb6a3b7f9735a9, reversing
changes made to 74c9ff384e695d1b27fa365d1fee84576f869d4c.

Closes #5169

Merge branch '5169-revert-qpzone-delete-dead-nodes' into 'main'

See merge request isc-projects/bind9!10224

15 months agoRevert "fix: dev: Delete dead nodes when committing a new version"
Ondřej Surý [Wed, 5 Mar 2025 16:36:53 +0000 (17:36 +0100)] 
Revert "fix: dev: Delete dead nodes when committing a new version"

This reverts commit 67255da4b376f65138b299dcd5eb6a3b7f9735a9, reversing
changes made to 74c9ff384e695d1b27fa365d1fee84576f869d4c.

15 months agofix: dev: Fix a bug in get_request_transport_type()
Arаm Sаrgsyаn [Wed, 5 Mar 2025 13:17:28 +0000 (13:17 +0000)] 
fix: dev: Fix a bug in get_request_transport_type()

When `dns_remote_done()` is true, calling `dns_remote_curraddr()` asserts.
Add a `dns_remote_curraddr()` check before calling `dns_remote_curraddr()`.

Closes #5215

Merge branch '5215-assert-in-dns_remote_curraddr-fix' into 'main'

See merge request isc-projects/bind9!10222

15 months agoFix a bug in get_request_transport_type()
Aram Sargsyan [Wed, 5 Mar 2025 09:58:32 +0000 (09:58 +0000)] 
Fix a bug in get_request_transport_type()

When dns_remote_done() is true, calling dns_remote_curraddr() asserts.
Add a dns_remote_curraddr() check before calling dns_remote_curraddr().

15 months agochg: dev: Cleanup parts of the isc_mem API
Ondřej Surý [Wed, 5 Mar 2025 11:20:21 +0000 (11:20 +0000)] 
chg: dev: Cleanup parts of the isc_mem API

This MR changes custom attach/detach implementation with refcount macros, replaces isc_mem_destroy() with isc_mem_detach(), and does various small cleanups.

Merge branch 'ondrej/cleanup-isc_mem-api' into 'main'

See merge request isc-projects/bind9!9456

15 months agoAdd the call function tracking to isc_mem API
Ondřej Surý [Mon, 9 Sep 2024 11:59:43 +0000 (13:59 +0200)] 
Add the call function tracking to isc_mem API

As we already track __func__, __FILE__, __LINE__ triplet in most places,
add the function tracking to the isc_mem tracking API.

15 months agoReplace attach/detach in isc_mem with refcount implementation
Ondřej Surý [Mon, 9 Sep 2024 10:14:05 +0000 (12:14 +0200)] 
Replace attach/detach in isc_mem with refcount implementation

The isc_mem API is one of the most commonly used APIs that didn't
used ISC_REFCOUNT_DECL and ISC_REFCOUNT_IMPL macros.  Replace the
implementation of isc_mem_attach(), isc_mem_detach() and
isc_mem_destroy() with the respective macros.

This also removes the legacy isc_mem_destroy() functionality that would
check whether all references had been detached from the memory context
as it doesn't work reliably when using the call_rcu() API.  Instead of
doing this individually, call isc_mem_checkdestroyed(stderr) from the
isc_mem_destroy() macro to keep the extra check that all contexts were
freed when the program is exiting.

15 months agoReplace isc_mem_destroy() with isc_mem_detach()
Ondřej Surý [Mon, 9 Sep 2024 11:38:31 +0000 (13:38 +0200)] 
Replace isc_mem_destroy() with isc_mem_detach()

Remove legacy isc_mem_destroy() and just use isc_mem_detach() as
isc_mem_destroy() doesn't play well with call_rcu API.

15 months agochg: ci: Move FreeBSD jobs to AWS autoscalers
Michal Nowak [Wed, 5 Mar 2025 09:25:52 +0000 (09:25 +0000)] 
chg: ci: Move FreeBSD jobs to AWS autoscalers

Merge branch 'mnowak/freebsd-aws-autoscaling' into 'main'

See merge request isc-projects/bind9!10214

15 months agoMove FreeBSD jobs to AWS autoscalers
Michal Nowak [Mon, 17 Feb 2025 14:31:56 +0000 (15:31 +0100)] 
Move FreeBSD jobs to AWS autoscalers

From technical reasons --with-readline=libedit is not being tested on
FreeBSD anymore as it's hard to have anchors both unified and specific.

15 months agonew: dev: Add digest methods for SIG and RRSIG
Mark Andrews [Wed, 5 Mar 2025 09:18:32 +0000 (09:18 +0000)] 
new: dev: Add digest methods for SIG and RRSIG

ZONEMD digests RRSIG records and potentially digests SIG record. Add digests
methods for both record types.

Closes #5219

Merge branch '5219-add-digest-methods-for-sig-and-rrsig' into 'main'

See merge request isc-projects/bind9!10217

15 months agoImplement digest_sig and digest_rrsig for ZONEMD
Mark Andrews [Wed, 23 Jun 2021 09:51:51 +0000 (19:51 +1000)] 
Implement digest_sig and digest_rrsig for ZONEMD

ZONEMD needs to be able to digest SIG and RRSIG records.  The signer
field can be compressed in SIG so we need to call dns_name_digest().
While for RRSIG the records the signer field is not compressed the
canonical form has the signer field downcased (RFC 4034, 6.2).  This
also implies that compare_rrsig needs to downcase the signer field
during comparison.

15 months agofix: dev: Fix the foundname vs dcname madness in qpcache_findzonecut()
Ondřej Surý [Wed, 5 Mar 2025 06:49:59 +0000 (06:49 +0000)] 
fix: dev: Fix the foundname vs dcname madness in qpcache_findzonecut()

The qpcache_findzonecut() accepts two "foundnames": 'foundname' and
'dcname' could be NULL.  Originally, when 'dcname' would be NULL, the
'dcname' would be set to 'foundname' which basically means that we were
copying the .ndata over itself for no apparent reason.

Merge branch 'ondrej/refactor-qpcache_findzonecut' into 'main'

See merge request isc-projects/bind9!10049

15 months agoFix the foundname vs dcname madness in qpcache_findzonecut()
Ondřej Surý [Sun, 2 Feb 2025 14:50:15 +0000 (15:50 +0100)] 
Fix the foundname vs dcname madness in qpcache_findzonecut()

The qpcache_findzonecut() accepts two "foundnames": 'foundname' and
'dcname' could be NULL.  Originally, when 'dcname' would be NULL, the
'dcname' would be set to 'foundname'.  Then code like this was present:

    result = find_deepest_zonecut(&search, node, nodep, foundname,
                                  rdataset,
                                  sigrdataset DNS__DB_FLARG_PASS);
    dns_name_copy(foundname, dcname);

Which basically means that we are copying the .ndata over itself for no
apparent reason.  Cleanup the dcname vs foundname usage.

Co-authored-by: Evan Hunt <each@isc.org>
Co-authored-by: Ondřej Surý <ondrej@isc.org>
15 months agochg: nil: Cleanup dns_opcode_t
Alessio Podda [Tue, 4 Mar 2025 18:30:48 +0000 (18:30 +0000)] 
chg: nil: Cleanup dns_opcode_t

Refactor to cleanup the `dns_opcode_t` enum.

Merge branch 'alessio/cleanup-dns_opcode_t' into 'main'

See merge request isc-projects/bind9!10165

15 months agoCleanup dns_opcode_t
alessio [Tue, 25 Feb 2025 09:40:10 +0000 (10:40 +0100)] 
Cleanup dns_opcode_t

Make dns_opcode_t refer directly to the underlying enum, and use
attributes to ensure the underlying enum is the same size as uint16_t.

15 months agofix: dev: Sync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job
Ondřej Surý [Tue, 4 Mar 2025 14:49:42 +0000 (14:49 +0000)] 
fix: dev: Sync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job

Merge branch 'ondrej/sync-tsan-options-in-gitlab-ci' into 'main'

See merge request isc-projects/bind9!10209

15 months agoSync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job
Ondřej Surý [Mon, 3 Mar 2025 22:05:15 +0000 (23:05 +0100)] 
Sync the TSAN CC, CFLAGS and LDFLAGS in the respdiff:tsan job

15 months agofix: dev: Call isc__iterated_hash_initialize in isc__work_cb
Mark Andrews [Tue, 4 Mar 2025 13:33:43 +0000 (13:33 +0000)] 
fix: dev: Call isc__iterated_hash_initialize in isc__work_cb

isc_iterated_hash didn't work in offloaded threads as the per thread
initialisation has not been done.  This has been fixed.

Closes #5214

Merge branch '5214-call-isc__iterated_hash_initialize-in-isc__work_cb' into 'main'

See merge request isc-projects/bind9!10206

15 months agoCall isc__iterated_hash_initialize
Mark Andrews [Fri, 20 Sep 2024 05:27:59 +0000 (15:27 +1000)] 
Call isc__iterated_hash_initialize

The iterated hash implementation needs to be initialised
on the worker thread.  Also clean it up after we are done.

15 months agofix: dev: When recording an rr trace, use libtool
Evan Hunt [Tue, 4 Mar 2025 09:16:02 +0000 (09:16 +0000)] 
fix: dev: When recording an rr trace, use libtool

When a system test is run with the `USE_RR` environment variable set to 1, an `rr` trace is now correctly generated for each instance of `named`.

Closes #5079

Merge branch '5079-fix-rr' into 'main'

See merge request isc-projects/bind9!10197

15 months agowhen recording an rr trace, use libtool
Evan Hunt [Sun, 2 Mar 2025 05:03:51 +0000 (21:03 -0800)] 
when recording an rr trace, use libtool

when running a system test with the USE_RR environment
variable set to 1, an rr trace is generated for named.
because rr wasn't run using libtool --mode=execute, the
trace would actually be generated for the wrapper script
generated by libtool, not for the actual named binary.

15 months agorem: dev: Remove check for the mandatory IPv6 support
Ondřej Surý [Mon, 3 Mar 2025 19:41:00 +0000 (19:41 +0000)] 
rem: dev: Remove check for the mandatory IPv6 support

IPv6 Advanced Socket API (:rfc:`3542`) is a hard requirement, remove the
autoconf check to speed up the ./configure run a little bit.

Merge branch 'ondrej/remove-check-for-mandatory-IPv6' into 'main'

See merge request isc-projects/bind9!10201

15 months agoRemove check for the mandatory IPv6 support
Ondřej Surý [Mon, 3 Mar 2025 11:01:10 +0000 (12:01 +0100)] 
Remove check for the mandatory IPv6 support

IPv6 Advanced Socket API (:rfc:`3542`) is a hard requirement, remove the
autoconf check to speed up the ./configure run a little bit.

15 months agofix: dev: Post [CVE-2024-12705] Performance Drop Fixes, Part 2
Artem Boldariev [Mon, 3 Mar 2025 10:10:33 +0000 (10:10 +0000)] 
fix: dev: Post [CVE-2024-12705] Performance Drop Fixes, Part 2

This merge request addresses several key performance bottlenecks in the DoH (DNS over HTTPS) implementation by introducing significant optimizations and improvements.

### Key Improvements

1. **Simplification and Optimisation of `http_do_bio()` Function**:
   - The code flow in the `http_do_bio()` function has been significantly simplified.
2. **Flushing HTTP Write Buffer on Outgoing DNS Messages**:
   - The buffer is flushed and a send operation is performed when there is an outgoing DNS message.
3. **Bumping Active Streams Processing Limit**:
   - The total number of active streams has been increased to 60% of the total streams limit.

These changes collectively enhance the performance and reliability of the DoH implementation, making it more efficient and robust for handling high-load scenarios, particularly noticeable in long runs (>= 1h) of `stress:long:rpz:doh+udp:linux:*` tests. It improves perf. for tests for BIND 9.18, but it likely will have a positive but less pronounced effect on newer versions as well.

In essence, the merge request fixes three bottlenecks stacked upon each other.

*It is a logical continuation of the merge requests !10109.* !10109, unfortunately, did not completely [address the performance drop in 9.18](https://gitlab.isc.org/isc-projects/bind9/-/pipelines/221545) for longer runs of the stress test. This merge request [addresses that](https://gitlab.isc.org/isc-projects/bind9/-/pipelines/223661).

**P.S.**

The origin of the fixes is, in fact, the branch in !10193. So this MR is a ... *forward port* of them.

Merge branch 'artem-doh-performance-drop-post-fix' into 'main'

See merge request isc-projects/bind9!10192

15 months agoDoH: Bump the active streams processing limit
Artem Boldariev [Tue, 25 Feb 2025 17:58:24 +0000 (19:58 +0200)] 
DoH: Bump the active streams processing limit

This commit bumps the total number of active streams (= the opened
streams for which a request is received, but response is not ready) to
60% of the total streams limit.

The previous limit turned out to be too tight as revealed by
longer (≥1h) runs of "stress:long:rpz:doh+udp:linux:*" tests.

15 months agoDoH: remove obsolete INSIST() check
Artem Boldariev [Wed, 26 Feb 2025 12:43:34 +0000 (14:43 +0200)] 
DoH: remove obsolete INSIST() check

The check, while not active by default, is not valid since the commit
8b8f4d500d9c1d41d95d34a79c8935823978114c.

See 'if (total == 0) { ...' below branch to understand why.

15 months agoDoH: Flush HTTP write buffer on an outgoing DNS message
Artem Boldariev [Tue, 25 Feb 2025 07:52:19 +0000 (09:52 +0200)] 
DoH: Flush HTTP write buffer on an outgoing DNS message

Previously, the code would try to avoid sending any data regardless of
what it is unless:

a) The flush limit is reached;
b) There are no sends in flight.

This strategy is used to avoid too numerous send requests with little
amount of data. However, it has been proven to be too aggressive and,
in fact, harms performance in some cases (e.g., on longer (≥1h) runs
of "stress:long:rpz:doh+udp:linux:*").

Now, additionally to the listed cases, we also:

c) Flush the buffer and perform a send operation when there is an
outgoing DNS message passed to the code (which is indicated by the
presence of a send callback).

That helps improve performance for "stress:long:rpz:doh+udp:linux:*"
tests.

15 months agoDoH: Limit the number of delayed IO processing requests
Artem Boldariev [Mon, 24 Feb 2025 16:32:23 +0000 (18:32 +0200)] 
DoH: Limit the number of delayed IO processing requests

Previously, a function for continuing IO processing on the next UV
tick was introduced (http_do_bio_async()). The intention behind this
function was to ensure that http_do_bio() is eventually called at
least once in the future. However, the current implementation allows
queueing multiple such delayed requests needlessly. There is currently
no need for these excessive requests as http_do_bio() can requeue them
if needed. At the same time, each such request can lead to a memory
allocation, particularly in BIND 9.18.

This commit ensures that the number of enqueued delayed IO processing
requests never exceeds one in order to avoid potentially bombarding IO
threads with the delayed requests needlessly.

15 months agoDoH: Simplify http_do_bio()
Artem Boldariev [Thu, 20 Feb 2025 20:08:01 +0000 (22:08 +0200)] 
DoH: Simplify http_do_bio()

This commit significantly simplifies the code flow in the
http_do_bio() function, which is responsible for processing incoming
and outgoing HTTP/2 data. It seems that the way it was structured
before was indirectly caused by the presence of the missing callback
calls bug, fixed in 8b8f4d500d9c1d41d95d34a79c8935823978114c.

The change introduced by this commit is known to remove a bottleneck
and allows reproducible and measurable performance improvement for
long runs (>= 1h) of "stress:long:rpz:doh+udp:linux:*" tests.

Additionally, it fixes a similar issue with potentially missing send
callback calls processing and hardens the code against use-after-free
errors related to the session object (they can potentially occur).

15 months agorem: dev: Cleanup isc/util.h header and friends
Ondřej Surý [Sat, 1 Mar 2025 06:35:58 +0000 (06:35 +0000)] 
rem: dev: Cleanup isc/util.h header and friends

Cleanup short list macros from <isc/util.h>, remove two unused headers, move locking macros to respective headers and use only the C11 static assertion.

Merge branch 'ondrej/cleanup-short-macros' into 'main'

See merge request isc-projects/bind9!10196

15 months agoRemove STATIC_ASSERT variants in favor of the C11 variant
Ondřej Surý [Fri, 28 Feb 2025 20:51:18 +0000 (21:51 +0100)] 
Remove STATIC_ASSERT variants in favor of the C11 variant

Previously, a gcc < 4.6 shim for _Static_assert() was included.  Such an
old compiler is not supported now anyway, so the macro variant has been
removed in favor of a single definition using _Static_assert().

15 months agoMove locking macros into individual headers
Ondřej Surý [Fri, 28 Feb 2025 20:49:48 +0000 (21:49 +0100)] 
Move locking macros into individual headers

Previously, the LOCK()/UNLOCK() and friends macros were defined in the
isc/util.h header.  Those macros were moved to their respective headers
as those would have to be included anyway if that particular lock was in
use.

15 months agoRemove superflous header includes from isc/util.h header
Ondřej Surý [Fri, 28 Feb 2025 20:40:50 +0000 (21:40 +0100)] 
Remove superflous header includes from isc/util.h header

Formerly, isc/util.h would pull a few extra headers (isc/list.h,
isc/attributes.h, isc/result.h and errno.h).  These includes were
removed in favor of including them directly when used.