]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
14 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

14 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

14 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

14 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

14 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.

14 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

14 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().

14 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

14 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.

14 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.

14 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.

14 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

14 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.

14 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

14 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.

14 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

14 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>
14 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

14 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.

14 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

14 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

14 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

14 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.

14 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

14 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.

14 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

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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).

14 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

14 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().

14 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.

14 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.

14 months agoRemove convenience list macros from isc/util.h
Ondřej Surý [Fri, 28 Feb 2025 20:04:21 +0000 (21:04 +0100)] 
Remove convenience list macros from isc/util.h

The short convenience list macros were used very sparingly and
inconsistenly in the code base.  As the consistency is prefered over
the convenience, all shortened list macro were removed in favor of
their ISC_LIST API targets.

14 months agoRemove unused isc_mutexblock and isc_condition units
Ondřej Surý [Fri, 28 Feb 2025 20:01:29 +0000 (21:01 +0100)] 
Remove unused isc_mutexblock and isc_condition units

The isc_mutexblock and isc_condition units were no longer in use and
were removed.

14 months agofix: usr: Fix a bug in the statistics channel when querying zone transfers information
Arаm Sаrgsyаn [Fri, 28 Feb 2025 15:34:05 +0000 (15:34 +0000)] 
fix: usr: Fix a bug in the statistics channel when querying zone transfers information

When querying zone transfers information from the statistics channel there was a rare possibility that `named` could terminate unexpectedly if a zone transfer was in a state when transferring from all the available primary servers had failed earlier. This has been fixed.

Closes #5198

Merge branch '5198-dns_remote_curraddr-bug-fix' into 'main'

See merge request isc-projects/bind9!10182

14 months agoFix a bug in dns_zone_getprimaryaddr()
Aram Sargsyan [Thu, 27 Feb 2025 11:52:30 +0000 (11:52 +0000)] 
Fix a bug in dns_zone_getprimaryaddr()

When all the addresses were already iterated over, the
dns_remote_curraddr() function asserts. So before calling it,
dns_zone_getprimaryaddr() now checks the address list using the
dns_remote_done() function. This also means that instead of
returning 'isc_sockaddr_t' it now returns 'isc_result_t' and
writes the primary's address into the provided pointer only when
returning success.

14 months agonew: ci: Check dangling symlinks in the repository
Michal Nowak [Fri, 28 Feb 2025 11:05:46 +0000 (11:05 +0000)] 
new: ci: Check dangling symlinks in the repository

Merge branch 'mnowak/check-dangling-symlinks' into 'main'

See merge request isc-projects/bind9!10120

14 months agoLink ChangeLog to doc/arm/changelog.rst
Michal Nowak [Tue, 18 Feb 2025 10:52:41 +0000 (11:52 +0100)] 
Link ChangeLog to doc/arm/changelog.rst

Currently, the ChangeLog file is a dangling symlink pointing to the
removed CHANGES file. Fix the link by pointing to doc/arm/changelog.rst.

14 months agoCheck dangling symlinks in the repository
Michal Nowak [Tue, 18 Feb 2025 10:42:03 +0000 (11:42 +0100)] 
Check dangling symlinks in the repository

14 months agorem: dev: remove log initialization checks from named
Aydın Mercan [Fri, 28 Feb 2025 10:32:20 +0000 (10:32 +0000)] 
rem: dev: remove log initialization checks from named

Logging initialization check is now redundant as there is a default global log context created during libisc's constructor.

`isc_log` calls can safely be made at any time outside libisc's constructor.

Merge branch 'aydin/remove-log-check' into 'main'

See merge request isc-projects/bind9!10186

14 months agoremove log initialization checks from named
Aydın Mercan [Fri, 28 Feb 2025 09:43:56 +0000 (09:43 +0000)] 
remove log initialization checks from named

This check is now redundant as there is a default global log context
created during libisc's constructor.

14 months agofix: ci: Fix Clang TSAN reports
Michal Nowak [Fri, 28 Feb 2025 10:15:06 +0000 (10:15 +0000)] 
fix: ci: Fix Clang TSAN reports

Disabling dynamic tags ensures the Clang symbolizer creates a valid TSAN
report. For consistency, also add the option to gcc:tsan so they are
both on the same footing.

Closes #5149

Merge branch '5149-fix-tsan-flags' into 'main'

See merge request isc-projects/bind9!10185

14 months agoFix Clang TSAN reports
Michal Nowak [Thu, 27 Feb 2025 10:32:53 +0000 (11:32 +0100)] 
Fix Clang TSAN reports

Disabling new dynamic ELF tags ensures the Clang symbolizer creates
valid TSAN reports. For consistency, also add the option to gcc:tsan so
they are both on the same footing.

14 months agoNo need to delete the "only" keyword in generate-tsan-stress-jobs.py
Michal Nowak [Thu, 27 Feb 2025 17:51:15 +0000 (18:51 +0100)] 
No need to delete the "only" keyword in generate-tsan-stress-jobs.py

29fd7564083731373bd132ec65ffc0a9072f8efc replaced "only" with "rules" in
.gitlab-ci.yml but forgot to drop the removal from here, hence the
script was broken.

14 months agofix: nil: Complete the fix for the import_rdataset() crash
Evan Hunt [Thu, 27 Feb 2025 19:01:02 +0000 (19:01 +0000)] 
fix: nil: Complete the fix for the import_rdataset() crash

The fix in !10172 was incomplete; there were still some code paths in the resolver that could set the dns_fetchresponse `result` field to the wrong value when the rdataset type was CNAME or DNAME.

Closes #5201

Merge branch '5201-eresult-fix' into 'main'

See merge request isc-projects/bind9!10178

14 months agofix the fetchresponse result for CNAME/DNAME
Evan Hunt [Wed, 26 Feb 2025 22:56:46 +0000 (14:56 -0800)] 
fix the fetchresponse result for CNAME/DNAME

the fix in commit 1edbbc32b4 was incomplete; the wrong
event result could also be set in cache_name() and validated().

14 months agochg: dev: unify fips handling to isc_crypto and make the toggle one way
Aydın Mercan [Thu, 27 Feb 2025 15:29:07 +0000 (15:29 +0000)] 
chg: dev: unify fips handling to isc_crypto and make the toggle one way

Since algorithm fetching is handled purely in libisc, FIPS mode toggling
can be purely done in within the library instead of provider fetching in
the binary for OpenSSL >=3.0.

Disabling FIPS mode isn't a realistic requirement and isn't done
anywhere in the codebase. Make the FIPS mode toggle enable-only to
reflect the situation.

Merge branch 'aydin/fips-in-crypto' into 'main'

See merge request isc-projects/bind9!9920

14 months agounify fips handling to isc_crypto and make the toggle one way
Aydın Mercan [Mon, 16 Dec 2024 12:31:15 +0000 (15:31 +0300)] 
unify fips handling to isc_crypto and make the toggle one way

Since algorithm fetching is handled purely in libisc, FIPS mode toggling
can be purely done in within the library instead of provider fetching in
the binary for OpenSSL >=3.0.

Disabling FIPS mode isn't a realistic requirement and isn't done
anywhere in the codebase. Make the FIPS mode toggle enable-only to
reflect the situation.

14 months agonew: ci: Run shotgun tests on MRs
Nicki Křížek [Thu, 27 Feb 2025 13:30:26 +0000 (13:30 +0000)] 
new: ci: Run shotgun tests on MRs

Execute DNS Shotgun performance tests on the regular MRs and compare the changes they introduce against the MR diff base. The results are evaluated automatically - the shotgun jobs will fail if thresholds for CPU/memory/latency difference is exceeded.

Merge branch 'nicki/ci-shotgun-eval' into 'main'

See merge request isc-projects/bind9!10127

14 months agoReplace deprecated only/except with rules in .gitlab-ci.yml
Nicki Křížek [Tue, 25 Feb 2025 16:48:05 +0000 (17:48 +0100)] 
Replace deprecated only/except with rules in .gitlab-ci.yml

The keyword rules allows more flexible and complex conditions when
deciding whether to create the job and also makes it possible run tweak
variables or job properties depending on arbitraty rules. Since it's
not possible to combine only/except and rules together, replace all
uses of only/except to avoid any potential future issues.

14 months agoRun shotgun tests on MRs
Nicki Křížek [Wed, 19 Feb 2025 15:06:22 +0000 (16:06 +0100)] 
Run shotgun tests on MRs

If the shotgun tests are executed for MRs, compare it against the MR's
base rather than the previous release. Only fail the job in case the
performance drops (pass on performance improvements).

Note that start_in optimization was removed, since it isn't properly
supported with rules as of February 2025
(https://gitlab.com/gitlab-org/gitlab/-/issues/424203). Without this
optimization, container test images are likely to be re-built
unnecessarily when testing different protocols. A workaround for the
.gitlab-ci.yml exists, but the extra complexity doesn't seem justified.
The container image builds might change or be optimized in the future,
so let's just go with the build duplication for now.

14 months agofix: usr: Fix TTL issue with ANY queries processed through RPZ "passthru"
Arаm Sаrgsyаn [Thu, 27 Feb 2025 09:19:12 +0000 (09:19 +0000)] 
fix: usr: Fix TTL issue with ANY queries processed through RPZ "passthru"

Answers to an "ANY" query which were processed by the RPZ "passthru"
policy had the response-policy's `max-policy-ttl` value unexpectedly
applied. This has been fixed.

Closes #5187

Merge branch '5187-rpz-passthru-any-type-ttl-bug-fix' into 'main'

See merge request isc-projects/bind9!10176

14 months agoTest that RPZ "passthru" doesn't alter the answer's TTL with ANY queries
Aram Sargsyan [Wed, 26 Feb 2025 13:37:57 +0000 (13:37 +0000)] 
Test that RPZ "passthru" doesn't alter the answer's TTL with ANY queries

Expand the test_rpz_passthru_logging() check in the "rpzextra" system
test to check the answer's TTL values with ANY type queries.

14 months agoFix TTL issue with ANY queries processed through RPZ "passthru"
Aram Sargsyan [Wed, 26 Feb 2025 13:32:20 +0000 (13:32 +0000)] 
Fix TTL issue with ANY queries processed through RPZ "passthru"

Answers to an "ANY" query which are processed by the RPZ "passthru"
policy have the response-policy's 'max-policy-ttl' value unexpectedly
applied. Do not change the records' TTL when RPZ uses a policy which
does not alter the answer.

14 months agofix: dev: Validating ADB fetches could cause a crash in import_rdataset() 5207-dnssec-signzone-R-flag-ineffective 10179/head
Evan Hunt [Wed, 26 Feb 2025 20:34:27 +0000 (20:34 +0000)] 
fix: dev: Validating ADB fetches could cause a crash in import_rdataset()

Previously, in some cases, the resolver could return rdatasets of type CNAME or DNAME without the result code being set to `DNS_R_CNAME` or `DNS_R_DNAME`. This could trigger an assertion failure in the ADB. The resolver error has been fixed.

Closes #5201

Merge branch '5201-adb-cname-error' into 'main'

See merge request isc-projects/bind9!10172

14 months agoset eresult based on the type in ncache_adderesult()
Evan Hunt [Tue, 25 Feb 2025 22:41:41 +0000 (14:41 -0800)] 
set eresult based on the type in ncache_adderesult()

when the caching of a negative record failed because of the
presence of a positive one, ncache_adderesult() could override
this to ISC_R_SUCCESS. this could cause CNAME and DNAME responses
to be handled incorrectly.  ncache_adderesult() now sets the result
code correctly in such cases.

14 months agofix: doc: Fix command to generate KSR in DNSSEC guide
Mark Andrews [Wed, 26 Feb 2025 01:51:33 +0000 (01:51 +0000)] 
fix: doc: Fix command to generate KSR in DNSSEC guide

Merge branch 'doc-fix-dnssec-ksr-request-command' into 'main'

See merge request isc-projects/bind9!10087

14 months agoFix command to generate KSR in DNSSEC guide
Doug Freed [Tue, 11 Feb 2025 17:04:00 +0000 (17:04 +0000)] 
Fix command to generate KSR in DNSSEC guide

14 months agofix: dev: Remove 'target' from dns_adb
Evan Hunt [Wed, 26 Feb 2025 00:43:46 +0000 (00:43 +0000)] 
fix: dev: Remove 'target' from dns_adb

When a server name turns out to be a CNAME or DNAME, the ADB does not use it, but the `dns_adbname` structure still stored a copy of the target name. This is unnecessary and the code has been removed.

Merge branch 'each-remove-adb-target' into 'main'

See merge request isc-projects/bind9!10149

14 months agoremove 'target' from dns_adb
Evan Hunt [Fri, 21 Feb 2025 09:24:42 +0000 (01:24 -0800)] 
remove 'target' from dns_adb

the target name parameter to dns_adb_createfind() was always passed as
NULL, so we can safely remove it.

relatedly, the 'target' field in the dns_adbname structure was never
referenced after being set.  the 'expire_target' field was used, but
only as a way to check whether an ADB name represents a CNAME or DNAME,
and that information can be stored as a single flag.

14 months agofix: usr: Fix dual-stack-servers configuration option
Mark Andrews [Wed, 26 Feb 2025 00:22:30 +0000 (00:22 +0000)] 
fix: usr: Fix dual-stack-servers configuration option

The dual-stack-servers configuration option was not working as expected; the specified servers were not being used when they should have been, leading to resolution failures. This has been fixed.

Closes #5019

Merge branch '5019-dual-stack-servers-wasn-t-working-in-all-cases' into 'main'

See merge request isc-projects/bind9!9708

14 months agoRemoving now unneeded priming queries
Mark Andrews [Fri, 1 Nov 2024 03:45:43 +0000 (14:45 +1100)] 
Removing now unneeded priming queries

Now that fctx_try is being called when adb returns DNS_ADB_NOMOREADDRESSES
we don't need these priming queries for the dual-stack-servers test
to succeed.

14 months agoFix dual-stack-servers
Mark Andrews [Fri, 1 Nov 2024 02:54:52 +0000 (13:54 +1100)] 
Fix dual-stack-servers

Named was stopping nameserver address resolution attempts too soon
when dual stack servers are configured.  Dual stack servers are
used when there are *not* addresses for the server in a particular
address family so find->status == DNS_ADB_NOMOREADDRESSES is not a
sufficient stopping condition when dual stack servers are available.
Call fctx_try to see if the alternate servers can be used.

14 months agofix: usr: Relax private DNSKEY and RRSIG constraints
Mark Andrews [Tue, 25 Feb 2025 23:39:40 +0000 (23:39 +0000)] 
fix: usr: Relax private DNSKEY and RRSIG constraints

DNSKEY, KEY, RRSIG and SIG constraints have been relaxed to allow empty key and signature material after the algorithm identifier for PRIVATEOID and PRIVATEDNS. It is arguable whether this falls within the expected use of these types as no key material is shared and the signatures are ineffective but these are private algorithms and they can be totally insecure.

Closes #5167

Merge branch '5167-relax-private-dnskey-constraints' into 'main'

See merge request isc-projects/bind9!10083

14 months agoRelax private DNSKEY and RRSIG constraints
Mark Andrews [Thu, 6 Feb 2025 23:01:57 +0000 (10:01 +1100)] 
Relax private DNSKEY and RRSIG constraints

DNSKEY, KEY, RRSIG and SIG constraints have been relaxed to allow
empty key and signature material after the algorithm identifier for
PRIVATEOID and PRIVATEDNS. It is arguable whether this falls within
the expected use of these types as no key material is shared and
the signatures are ineffective but these are private algorithms and
they can be totally insecure.

14 months agofix: dev: Prevent a reference leak when using plugins
Evan Hunt [Tue, 25 Feb 2025 22:40:55 +0000 (22:40 +0000)] 
fix: dev: Prevent a reference leak when using plugins

The `NS_QUERY_DONE_BEGIN` and `NS_QUERY_DONE_SEND` plugin hooks could cause a reference leak if they returned `NS_HOOK_RETURN` without cleaning up the query context properly.

Closes #2094

Merge branch '2094-plugin-reference-leak' into 'main'

See merge request isc-projects/bind9!9971

14 months agowrap ns_client_error() for unit testing
Evan Hunt [Wed, 22 Jan 2025 02:29:56 +0000 (18:29 -0800)] 
wrap ns_client_error() for unit testing

When testing, the client object doesn't have a proper
netmgr handle, so ns_client_error() needs to be a no-op.

14 months agoprevent a reference leak from the ns_query_done hooks
Evan Hunt [Wed, 22 Jan 2025 01:57:00 +0000 (17:57 -0800)] 
prevent a reference leak from the ns_query_done hooks

if the NS_QUERY_DONE_BEGIN or NS_QUERY_DONE_SEND hook is
used in a plugin and returns NS_HOOK_RETURN, some of the
cleanup in ns_query_done() can be skipped over, leading
to reference leaks that can cause named to hang on shut
down.

this has been addressed by adding more housekeeping
code after the cleanup: tag in ns_query_done().

14 months agofix: usr: dnssec-signzone needs to check for a NULL key when setting offline
Mark Andrews [Tue, 25 Feb 2025 22:22:30 +0000 (22:22 +0000)] 
fix: usr: dnssec-signzone needs to check for a NULL key when setting offline

dnssec-signzone could dereference a NULL key pointer when resigning a zone.  This has been fixed.

Closes #5192

Merge branch '5192-dnssec-signzone-needs-to-check-for-a-null-key-when-setting-offline' into 'main'

See merge request isc-projects/bind9!10161

14 months agoCheck if key is NULL before dereferencing it
Mark Andrews [Tue, 25 Feb 2025 03:54:55 +0000 (14:54 +1100)] 
Check if key is NULL before dereferencing it

14 months agofix: dev: Simplify some dns_name API calls
Evan Hunt [Tue, 25 Feb 2025 21:34:31 +0000 (21:34 +0000)] 
fix: dev: Simplify some dns_name API calls

Several functions in the `dns_name` module have had parameters removed, that were rarely or never used:
- `dns_name_fromtext()` and `dns_name_concatenate()` no longer take a target buffer.
- `dns_name_towire()` no longer takes a compression offset pointer; this is now part of the compression context.
- `dns_name_towire()` with a `NULL` compression context will copy name data directly into a buffer with no processing.

Merge branch 'each-simplify-names' into 'main'

See merge request isc-projects/bind9!10152

14 months agoallow NULL compression context in dns_name_towire()
Evan Hunt [Sat, 22 Feb 2025 07:37:49 +0000 (23:37 -0800)] 
allow NULL compression context in dns_name_towire()

passing NULL as the compression context to dns_name_towire()
copies the uncompressed name data directly into the target buffer.

14 months agosimplify dns_name_fromtext() interface
Evan Hunt [Sat, 22 Feb 2025 08:11:38 +0000 (00:11 -0800)] 
simplify dns_name_fromtext() interface

previously, dns_name_fromtext() took both a target name and an
optional target buffer parameter, which could override the name's
dedicated buffer. this interface is unnecessarily complex.

we now have two functions, dns_name_fromtext() to convert text
into a dns_name that has a dedicated buffer, and dns_name_wirefromtext()
to convert text into uncompressed DNS wire format and append it to a
target buffer.

in cases where it really is necessary to have both, we can use
dns_name_fromtext() to load the dns_name, then dns_name_towire()
to append the wire format to the target buffer.

14 months agoavoid the 'target' buffer in dns_name_fromtext()
Evan Hunt [Fri, 21 Feb 2025 21:36:57 +0000 (13:36 -0800)] 
avoid the 'target' buffer in dns_name_fromtext()

dns_name_fromtext() stores the converted name in the 'name'
passed to it, and optionally also copies it in wire format to
a buffer 'target'. this makes the interface unnecessarily
complex, and could be simplified by having a different function
for each purpose. as a first step, remove uses of the target
buffer in calls to dns_name_fromtext() where it wasn't actually
needed.

14 months agoremove 'target' parameter from dns_name_concatenate()
Evan Hunt [Fri, 21 Feb 2025 08:56:47 +0000 (00:56 -0800)] 
remove 'target' parameter from dns_name_concatenate()

the target buffer passed to dns_name_concatenate() was never
used (except for one place in dig, where it wasn't actually
needed, and has already been removed in a prior commit).
we can safely remove the parameter.

14 months agoremove the 'name_coff' parameter in dns_name_towire()
Evan Hunt [Sat, 22 Feb 2025 02:14:55 +0000 (18:14 -0800)] 
remove the 'name_coff' parameter in dns_name_towire()

this parameter was added as a (minor) optimization for
cases where dns_name_towire() is run repeatedly with the
same compression context, as when rendering all of the rdatas
in an rdataset. it is currently only used in one place.

we now simplify the interface by removing the extra parameter.
the compression offset value is now part of the compression
context, and can be activated when needed by calling
dns_compress_setmultiuse(). multiuse mode is automatically
deactivated by any subsequent call to dns_compress_permitted().

14 months agoremove the namebuf and onamebuf buffers in dig
Evan Hunt [Fri, 21 Feb 2025 08:33:35 +0000 (00:33 -0800)] 
remove the namebuf and onamebuf buffers in dig

lookup->namebuf and lookup->onamebuf were not necessary and
have been removed.

14 months agofix: dev: Save time when creating a slab from another slab
Evan Hunt [Tue, 25 Feb 2025 18:37:49 +0000 (18:37 +0000)] 
fix: dev: Save time when creating a slab from another slab

The `dns_rdataslab_fromrdataset()` function creates a slab from an rdataset. If the source rdataset already uses a slab, then no processing is necessary; we can just copy the existing slab to a new location.

Closes #5188

Merge branch '5188-optimize-makeslab' into 'main'

See merge request isc-projects/bind9!10162

14 months agosave time when creating a slab from another slab
Evan Hunt [Tue, 25 Feb 2025 05:30:10 +0000 (21:30 -0800)] 
save time when creating a slab from another slab

the dns_rdataslab_fromrdataset() function creates a slab
from an rdataset. if the source rdataset already uses a slab,
then no processing is necessary; we can just copy the existing
slab to a new location.

14 months agofix: usr: Fix assertion failure when dumping recursing clients
Ondřej Surý [Tue, 25 Feb 2025 15:38:08 +0000 (15:38 +0000)] 
fix: usr: Fix assertion failure when dumping recursing clients

Previously, if a new counter was added to the hashtable
while dumping recursing clients via the `rndc recursing`
command, and `fetches-per-zone` was enabled, an assertion
failure could occur. This has been fixed.

Closes #5200

Merge branch '5200-destroy-iterator-inside-the-rwlock' into 'main'

See merge request isc-projects/bind9!10164

14 months agoDestroy the hashmap iterator inside the rwlock
Ondřej Surý [Tue, 25 Feb 2025 11:13:56 +0000 (12:13 +0100)] 
Destroy the hashmap iterator inside the rwlock

Previously, the hashmap iterator for fetches-per-zone was destroy
outside the rwlock.  This could lead to an assertion failure due to a
timing race with the internal rehashing of the hashmap table as the
rehashing process requires no iterators to be running when rehashing the
hashmap table.  This has been fixed by moving the destruction of the
iterator inside the read locked section.

14 months agochg:usr: Reduce memory used to store DNS names
Ondřej Surý [Tue, 25 Feb 2025 11:17:55 +0000 (11:17 +0000)] 
chg:usr: Reduce memory used to store DNS names

The memory used to internally store the DNS names has been reduced.

Merge branch 'ondrej/experiment-no-offsets-in-dns_name' into 'main'

See merge request isc-projects/bind9!10140

14 months agoSquash set_offsets() and dns_name_offsets() into single function
Ondřej Surý [Mon, 24 Feb 2025 13:29:55 +0000 (14:29 +0100)] 
Squash set_offsets() and dns_name_offsets() into single function

The third argument to set_offsets() was only used in
dns_name_fromregion() and not really needed.  We can remove the third
argument and then manually check whether the last label is root label.

14 months agoRemove target buffer from dns_name_downcase()
Ondřej Surý [Mon, 24 Feb 2025 13:17:22 +0000 (14:17 +0100)] 
Remove target buffer from dns_name_downcase()

There was just a single use of passing an extra buffer to
dns_name_downcase() which have been replaced by simple call to
isc_ascii_lowercase() and the 'target' argument from dns_name_downcase()
function has been removed.

14 months agoRemove MAKE_EMPTY() macro from dns_name unit
Ondřej Surý [Mon, 24 Feb 2025 12:58:13 +0000 (13:58 +0100)] 
Remove MAKE_EMPTY() macro from dns_name unit

The MAKE_EMPTY() macro was clearing up the output variable in case of
the failure.  However, this was breaking the usual design pattern that
the output variables are left in indeterminate state or we don't touch
them at all when a failure occurs.  Remove the macro and change the
dns_name_downcase() to not touch the name contents until success.

14 months agoCleanup the usage of dns_offsets_t vs unsigned char * pointers
Ondřej Surý [Fri, 21 Feb 2025 11:10:02 +0000 (12:10 +0100)] 
Cleanup the usage of dns_offsets_t vs unsigned char * pointers

There was a back-and-forth between static arrays and the pointers to the
offsets.  Since we are now only using the static arrays, we can cleanup
the usage of the pointers that would previously point either to the
static array or name->offsets if available.

14 months agoSimplify name initializers
Ondřej Surý [Fri, 21 Feb 2025 11:09:46 +0000 (12:09 +0100)] 
Simplify name initializers

We no longer need to pass labels to DNS_NAME_INITABSOLUTE
and DNS_NAME_INITNONABSOLUTE.

14 months agoSimplify dns_name_init()
Ondřej Surý [Fri, 21 Feb 2025 11:09:39 +0000 (12:09 +0100)] 
Simplify dns_name_init()

Remove the now-unused offsets parameter from dns_name_init().

14 months agoRemove offsets from the dns_name and dns_fixedname structures
Ondřej Surý [Fri, 21 Feb 2025 11:09:28 +0000 (12:09 +0100)] 
Remove offsets from the dns_name and dns_fixedname structures

The offsets were meant to speed-up the repeated dns_name operations, but
it was experimentally proven that there's actually no real-world
benefit.  Remove the offsets and labels fields from the dns_name and the
static offsets fields to save 128 bytes from the fixedname in favor of
calculating labels and offsets only when needed.

14 months agochg: nil: Remove unused symtab implementation
Alessio Podda [Tue, 25 Feb 2025 11:13:22 +0000 (11:13 +0000)] 
chg: nil: Remove unused symtab implementation

The old symtab implementation should have been removed in !9921, but it wasn't. This MR addresses that.

Merge branch 'alessio/cleanup-symtab-orphan-files' into 'main'

See merge request isc-projects/bind9!10122

14 months agoRemove unused symtab implementation
alessio [Tue, 18 Feb 2025 13:14:03 +0000 (14:14 +0100)] 
Remove unused symtab implementation

The old symtab implementation should have been removed in !9921 , but
it wasn't. This commit addresses that.

14 months agochg: usr: Drop malformed notify messages early instead of decompressing them
Alessio Podda [Tue, 25 Feb 2025 10:29:00 +0000 (10:29 +0000)] 
chg: usr: Drop malformed notify messages early instead of decompressing them

The DNS header shows if a message has multiple questions or invalid
NOTIFY sections. We can drop these messages early, right after parsing
the question. This matches RFC 9619 for multi-question messages and
Unbound's handling of NOTIFY. We still parse the question to include it in
our FORMERR response.

Add drop_msg_early() function to check for these conditions:
- Messages with more than one question, as required by RFC 9619
- NOTIFY query messages containing answer sections (like Unbound)
- NOTIFY messages containing authority sections (like Unbound)

Closes #5158, #3656

Merge branch '5158-early-formerr-on-bad-notify-or-bad-qdcount' into 'main'

See merge request isc-projects/bind9!10056

14 months agoDrop malformed notify messages early instead of decompressing them
alessio [Wed, 29 Jan 2025 09:37:33 +0000 (10:37 +0100)] 
Drop malformed notify messages early instead of decompressing them

The DNS header shows if a message has multiple questions or invalid
NOTIFY sections. We can drop these messages early, right after parsing
the question. This matches RFC 9619 for multi-question messages and
Unbound's handling of NOTIFY.
To further add further robustness, we include an additional check for
unknown opcodes, and also drop those messages early.

Add early_sanity_check() function to check for these conditions:
- Messages with more than one question, as required by RFC 9619
- NOTIFY query messages containing answer sections (like Unbound)
- NOTIFY messages containing authority sections (like Unbound)
- Unknown opcodes.

14 months agofix: test: Handle example3.db being modified in upforwd system test
Mark Andrews [Tue, 25 Feb 2025 06:16:45 +0000 (06:16 +0000)] 
fix: test:  Handle example3.db being modified in upforwd system test

The zone file for example3 (ns1/example3.db) can be modified in the
upforwd test as example3 is updated as part of the test.  Whether
the zone is written out or not by the end of the test is timing
dependent.  Rename ns1/example3.db to ns1/example3.db.in and copy it to
ns1/example3.db in setup so we don't trigger post test changes checks.

Closes #5180

Merge branch '5180-create-example3-in-setup' into 'main'

See merge request isc-projects/bind9!10160

14 months agoHandle example3.db being modified in upforwd system test
Mark Andrews [Tue, 25 Feb 2025 01:28:58 +0000 (12:28 +1100)] 
Handle example3.db being modified in upforwd system test

The zone file for example3 (ns1/example3.db) can be modified in the
upforwd test as example3 is updated as part of the test.  Whether
the zone is written out or not by the end of the test is timing
dependent.  Rename ns1/example3.db to ns1/example3.db.in and copy
it to ns1/example3.db in setup so we don't trigger post test changes
checks.