]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 months agoremove find_deepest_zonecut() from qpcache
Evan Hunt [Sat, 21 Mar 2026 04:45:29 +0000 (21:45 -0700)] 
remove find_deepest_zonecut() from qpcache

because the cache no longer stores delegation (parent-side) NS rrsets,
and authoritative (child-side) NS rrsets don't affect recursion,
it no longer makes sense for qpcache_find() to look for NS rrsets
and return DNS_R_DELEGATION. that code has been removed.

the cache still does search for covering DNAME records. the
check_zonecut() function has been renamed to check_dname() for clarity.

related changes:
- one test case has been removed from the mirror system test, because it
  tested the behavior of a cached delegation.
- query_checkrrl() and rpz_rrset_find() have been updated so they no
  longer expect cache responses to have DNS_R_DELEGATION response codes.

2 months agosystem test for rndc dumpdb -cache and reload
Colin Vidal [Tue, 24 Mar 2026 13:37:00 +0000 (14:37 +0100)] 
system test for rndc dumpdb -cache and reload

Add system test which check the behavior of `rndc dumpdb -cache` as well
as the preservation of the delegation cache on server reload.

2 months agoDump delegation database in 'rndc dumpdb'
Colin Vidal [Mon, 30 Mar 2026 09:22:32 +0000 (11:22 +0200)] 
Dump delegation database in 'rndc dumpdb'

When dumping the cache, include the contents of the delegation
database. Add a new 'rndc dumpdb -deleg' option, which dumps
the delegation database exclusively.

While the delegation database dumping format mimic the zone file format,
the API does not use the `dns_master_style_t` configuration (i.e. to
specify how many spaces/tab are used between each RR fields), because
the generic API handling this relies on databse using `dns_rdataset_t`
as internal storage format. This can be improved later.

2 months agoprevent early termination of rpzrecurse test
Evan Hunt [Thu, 19 Mar 2026 20:08:25 +0000 (13:08 -0700)] 
prevent early termination of rpzrecurse test

add "|| ret=1" after calls to dig, so that dig failures won't
stop the test due to "set -e".

2 months agoAdd invariant check for delegset in rctx_nextserver()
Ondřej Surý [Sat, 14 Mar 2026 09:10:34 +0000 (10:10 +0100)] 
Add invariant check for delegset in rctx_nextserver()

The get_nameservers path in rctx_nextserver() is only reachable from
rctx_referral(), which already detaches fctx->delegset.  Assert that
it is NULL rather than redundantly detaching it, since
dns_view_bestzonecut() requires *delegsetp == NULL.

2 months agoGuard against NULL delegset in query_delegation_recurse()
Ondřej Surý [Sat, 14 Mar 2026 07:20:43 +0000 (08:20 +0100)] 
Guard against NULL delegset in query_delegation_recurse()

If both dns_view_bestzonecut() and dns_deleg_fromrdataset() fail,
delegset stays NULL.  Passing it to ns_query_recurse() would crash
on the REQUIRE(DNS_DELEGSET_VALID(delegset)) in createfetch().

Return ISC_R_NOTFOUND instead, which lets the caller handle the
failure gracefully.

2 months agoClean up frdataset in resume_dslookup() on shutdown
Ondřej Surý [Sat, 14 Mar 2026 07:20:05 +0000 (08:20 +0100)] 
Clean up frdataset in resume_dslookup() on shutdown

When resume_dslookup() receives ISC_R_SHUTTINGDOWN or ISC_R_CANCELED,
frdataset (fctx->nsrrset) was not disassociated.  While fctx__destroy()
eventually cleans it up, leaving it associated keeps the underlying DB
node referenced longer than necessary.

2 months agoFix fetchlimit test failure
Evan Hunt [Tue, 3 Mar 2026 06:29:20 +0000 (22:29 -0800)] 
Fix fetchlimit test failure

When a referral lookup is triggered by a QMIN query, it should be
exempt from the fetches-per-zone limit just as the QMIN query itself
is.

Also restart the test server between the fetches-per-server and
fetches-per-zone tests so that leftover statistics from the former
do not pollute the latter.

Another fix is because zone spills and general query drops are no longer
in a strict >= relation (on a parent-centric resolver), so check that
both counters are non-zero instead.

2 months agoFix chain system test for parent-centric resolver
Evan Hunt [Tue, 3 Mar 2026 02:12:33 +0000 (18:12 -0800)] 
Fix chain system test for parent-centric resolver

The resolver now uses glue addresses from the parent side of a
zonecut without triggering an additional address lookup.  Update the
test involving a nameserver target name below a DNAME so that the
delegation does not use glue.

2 months agoDo not cache NS from referral in negative responses
Colin Vidal [Fri, 27 Feb 2026 16:07:31 +0000 (17:07 +0100)] 
Do not cache NS from referral in negative responses

Stop storing the NS referral into the main cache when processing a
negative response.  These records are already cached in the delegation
database and are not needed elsewhere.

Update dnssec tests that relied on parent-side NS RRsets being
returned in recursive query responses.

2 months agoCleans up `mark_related()`
Colin Vidal [Mon, 30 Mar 2026 09:49:29 +0000 (11:49 +0200)] 
Cleans up `mark_related()`

Cleans up mark_related(): since the FCTX_ATTR_GLUING flag is never set
anymore, the code that handled it has been removed.

2 months agoFix cacheclean system test for parent-centric resolver
Colin Vidal [Thu, 19 Feb 2026 15:56:10 +0000 (16:56 +0100)] 
Fix cacheclean system test for parent-centric resolver

The ADB flushtree test was failing because the test zone
(flushtest.example.) uses an in-domain nameserver with parent glue,
so the ADB cache was never populated.

Add a new zone with an out-of-domain nameserver to force an ADB
lookup and ensure the flushtree test exercises the intended code
path.

2 months agoWire delegdb flushing flows
Colin Vidal [Mon, 30 Mar 2026 09:36:10 +0000 (11:36 +0200)] 
Wire delegdb flushing flows

The 'rndc flush' and 'rndc flushname/flushtree' commands are now wired
to the delegation database, along with the main cache.

2 months agoUse delegdb for lookup in query_delegation_recurse()
Colin Vidal [Wed, 18 Feb 2026 15:05:19 +0000 (16:05 +0100)] 
Use delegdb for lookup in query_delegation_recurse()

When `query.c` finds a zonecut in the main cache (e.g. from stale NS
records), it must still use the correct delegation for recursion. Look
up the delegation DB via `dns_view_bestzonecut()` first; fall back to
`dns_deleg_fromrdataset()` only if no delegation is found.

This might also be done inside `query_lookup()` instead, with the `qctx`
holding a delegset property, but that approach needs further work to
avoid breakage and it is not clear so far if there would be other use
case of it. Current approach is simpler for now.

2 months agoSimplify resolver delegation expiry test
Colin Vidal [Wed, 18 Feb 2026 15:04:04 +0000 (16:04 +0100)] 
Simplify resolver delegation expiry test

Remove the dynamic NS update loop from the delegation expiry test.
With the delegation DB, it is sufficient to wait for the delegation
to expire (after 5 seconds) and verify that names below the removed
zone return NXDOMAIN.

2 months agoFix tests for parent-centric resolver behavior
Evan Hunt [Wed, 11 Feb 2026 21:56:59 +0000 (13:56 -0800)] 
Fix tests for parent-centric resolver behavior

In 'additional', pre-cache the A RRset for ns1.rt.example so the
additional-data handling in the cache can be tested; previously this
was cached as part of resolution, but now must be queried explicitly.

In 'cookie', pre-cache an NS to prevent a QMIN query from distorting
log results and causing a test failure.

In 'resolver', increase the expected query count in the timeout test.

2 months agoFix qmin test with parent-centric resolver
Colin Vidal [Wed, 11 Feb 2026 13:47:51 +0000 (14:47 +0100)] 
Fix qmin test with parent-centric resolver

Remove expected queries for ns2 addresses (and ns.b.stale.) from the
qmin system test.  The parent-centric resolver no longer attempts to
get the child-side NS of the delegation, so these queries do not
occur.

2 months agoupdate camp system test max-query-count
Colin Vidal [Tue, 10 Feb 2026 15:08:36 +0000 (16:08 +0100)] 
update camp system test max-query-count

As named is now parent-centric, the global query count can be lower (in
particular for queries which has a long delegation chain), as the
resolver doesn't proactively resolve an NS name when a glue is provided
by the parent-side of a zonecut.

Update camp system test to lower the max-query-count of ns9, to ensure
the max-query-count limit enforcement is still working.

2 months agoResolver is parent-centric
Colin Vidal [Mon, 30 Mar 2026 09:45:15 +0000 (11:45 +0200)] 
Resolver is parent-centric

The resolver now uses glue addresses from `dns_deleg_t` objects stored
in the delegation database.  The main cache is still used for ADB A/AAAA
lookups when no glue is available for a nameserver name.

The resolver's `fctx_getaddresses()` is refactored to, for each
delegation of the delegation set, try to get the address-based finds,
then nameserver name lookups. (Later, the logic to handle DELEG
`include-delegparm=` will be hooked there too.)

2 months agoAdd dns_adb_createaddrinfosfind() for address-based lookups
Colin Vidal [Sat, 28 Mar 2026 09:02:22 +0000 (10:02 +0100)] 
Add dns_adb_createaddrinfosfind() for address-based lookups

Add a new ADB API function that creates a find from a list of addresses
rather than by looking up nameserver names.  This enables the resolver
to handle address-based delegations (NS-based with glues or DELEG with
addresses) and name-based delegations uniformly (i.e. the list of finds
from ADB is handled the same way no matter the type of the delegation).

2 months agoAdd system test for minimal-responses behaviour
Colin Vidal [Mon, 23 Feb 2026 13:27:44 +0000 (14:27 +0100)] 
Add system test for minimal-responses behaviour

Add the 'minimalresponses' system test in order to cover the multiple
combinations of server 'minimal-responses' configurations and contexts
(resolver, auth only, etc.) when filling the ANSWER, AUTHORITY and
ADDITIONAL sections.

2 months agoMake the RD flag optional in isctest.query()
Evan Hunt [Tue, 24 Feb 2026 00:27:52 +0000 (16:27 -0800)] 
Make the RD flag optional in isctest.query()

Add an 'rd' parameter (default True) to isctest.query.create() so
that non-recursive queries can be sent with rd=False.

2 months agoRemove dns_db_findzonecut()
Evan Hunt [Fri, 20 Feb 2026 23:17:03 +0000 (15:17 -0800)] 
Remove dns_db_findzonecut()

This function is no longer used and has been removed, along with its
implementation in qpcache.

2 months agoDon't use dns_db_findzonecut() in query_addbestns()
Evan Hunt [Fri, 20 Feb 2026 22:55:42 +0000 (14:55 -0800)] 
Don't use dns_db_findzonecut() in query_addbestns()

Previously, when answering from the cache, and when minimal-responses
was not set, we added the best known zone cut to the authority section
of the response message, using dns_db_findzonecut() to look it up in
the DNS cache.  Since the DNS cache will no longer be used to store
parent-side NS RRsets, it will now be possible for an ancestor node
to be used as the zone cut, leading to the wrong NS record being
included.

There are various ways we could correct this:

1. Use dns_deleg_lookup() instead of dns_db_findzonecut() to find the
   zone cut. But currently, the deleg database stores only the server
   addresses for the delegation, not the full NS RRset; this would need
   to be changed.
2. Look up <name>/NS whenever we cache a referral; that way we'll get
   the child-side NS RRset and cache that, and we can retrieve it when
   building the response.

But the solution chosen here is simply not to look up the NS record
when answering from the cache, effectively making "minimal-responses
yes;" mandatory for queries answered from the cache.

System tests have been updated as needed, so they no longer expect
NS RRsets in the authority section of recursive responses.

2 months agoUse delegation DB for bestzonecut lookups
Colin Vidal [Mon, 30 Mar 2026 09:31:47 +0000 (11:31 +0200)] 
Use delegation DB for bestzonecut lookups

Function `dns_view_bestzonecut()` now uses the delegation DB instead of
the main cache when looking up at the cache.

As a result, replace `dns_rdataset_t` (representing an NS RRset) with
`dns_delegset_t` in `dns_view_bestzonecut()` and
`dns_resolver_createfetch()` APIs. The resolver and query processing now
use the delegation DB instead of the cache for zonecut lookups.

In the case of the delegation lives in the local database, the locally
found `rdataset` is internally converted into a `dns_delegset_t` object.
From caller POV, it doesn't change anything: a delegation set is a
read-only object which can be used as long as needed and must be
detached one it's done with it.

2 months agofix delv in resolver mode colin/exp-bisect-revert-parent-centric
Colin Vidal [Sat, 28 Mar 2026 12:59:26 +0000 (13:59 +0100)] 
fix delv in resolver mode

Create an instance of the delegation database in the view created by
delv in resolver mode. As the default `named` configuration is not in
use, also specifically configure the `max-delegation-servers` setting
using the same default value than `named`.

2 months agoPopulate the delegation DB from referrals answers
Colin Vidal [Thu, 22 Jan 2026 10:07:01 +0000 (11:07 +0100)] 
Populate the delegation DB from referrals answers

The resolver now caches NS records and their A/AAAA glues from referral
answers into the delegation database.

A new `cache_delegns()` function extracts NS names and associated glue
addresses from the authority/additional sections of a referral answer
and use those informations to build a delegation set, which is then
inserted into the delegation database.

The created delegation set contains a delegation per NS RR. If the NS RR
has matching A/AAAA RR, the delegation only store the addresses and not
the name. (Note this is technically possible to group all NS RR which
doesn't have glues into a single delegation, and the implementation can
be changed in that way in the future).

Each view has its own instance of the delegation database (they are
never shared between views), but a server restart/reload preserve the
delegation database state.

2 months agoIntroduce a delegation database
Colin Vidal [Tue, 20 Jan 2026 13:58:53 +0000 (14:58 +0100)] 
Introduce a delegation database

Add `dns_delegdb_t`, a qpmulti-based database enabling to lookup a
delegation set (`dns_delegset_t`) from a zonecut name (`dns_name_t`). A
delegation set object essentially contains an expiration time and a list
of delegation (`dns_deleg_t`). Finally, a delegation can be either:

- A list of IP addresses (`isc_netaddrlist_t`), for NS-based delegation
  providing glues or DELEG-based delegation using `server-ipv4=` or
  `server-ipv6=`;
- Or a list of nameserver names, for NS-based delegation without glues,
  or DELEG-based delegation using `server-name=`;
- Or a list of nameserver names, for DELEG-based delegation using
  `include-delegparam=`.

The delegation database API provides lookup by closest zonecut,
delegation and delegation set builders as well as insertion of those
newly built delegation set, dumping to a `FILE *`, conversion from an NS
rdataset to a delegation set, deletion of a specific zonecut or all the
sub-tree of a given zonecut.

A memory context is internally used inside the delegation database and
can be constraint to a maximum size. Once it gets close to its maximum
size and a new delegation set is inserted into the database, a
reclamation flow is run internally removing the least recently used
entries.

The delegation set and delegation objects are, once they been inserted
into the database, read-only object. Thus, the caller can use them
without concurrency or locking concerns, and must detached them once its
done with it.

2 months agoAdd ISC_LIST support for isc_netaddr_t
Colin Vidal [Tue, 20 Jan 2026 14:05:58 +0000 (15:05 +0100)] 
Add ISC_LIST support for isc_netaddr_t

Add an `isc_netaddrlink_t` type wrapping an `isc_netaddr_t` and an
`ISC_LINK`. This enable to build list of `isc_netaddr_t` without
increasing the memory footprint of existing usages of `isc_netaddr_t`
(which doesn't require to be linked).

2 months agochg: dev: Revert NTA flush on expire
Arаm Sаrgsyаn [Mon, 30 Mar 2026 18:27:59 +0000 (18:27 +0000)] 
chg: dev: Revert NTA flush on expire

Flushing the name when NTA expires causes problems for the ongoing
resolving process. Do not flush the name from the cache. Instead,
the resolver should do the flushing (this is planned to be implemented
later).

Merge branch 'aram/revert-nta-flush-on-expire' into 'main'

See merge request isc-projects/bind9!11765

2 months agoRevert NTA flush on expire
Aram Sargsyan [Mon, 30 Mar 2026 12:11:46 +0000 (12:11 +0000)] 
Revert NTA flush on expire

Flushing the name when NTA expires causes problems for the ongoing
resolving process. Do not flush the name from the cache. Instead,
the resolver should do the flushing (this is planned to be merged
next).

2 months agofix: usr: Count temporal problems with DNSSEC validation as attempts
Ondřej Surý [Mon, 30 Mar 2026 10:32:23 +0000 (12:32 +0200)] 
fix: usr: Count temporal problems with DNSSEC validation as attempts

After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

Closes #5760

Merge branch '5760-count-DNSSEC-temporal-errors-as-validation-attempts' into 'main'

See merge request isc-projects/bind9!11589

2 months agoCount temporal problems with DNSSEC validation as attempts
Ondřej Surý [Mon, 23 Feb 2026 18:42:49 +0000 (19:42 +0100)] 
Count temporal problems with DNSSEC validation as attempts

After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

2 months agofix: usr: Fix update-policy per-type max quota bypass via crafted UPDATE messages
Ondřej Surý [Sat, 28 Mar 2026 09:44:21 +0000 (10:44 +0100)] 
fix: usr: Fix update-policy per-type max quota bypass via crafted UPDATE messages

An authenticated DDNS client could bypass update-policy per-type record limits
(e.g. TXT(3)) by including padding records in the UPDATE message that are
silently skipped during processing. Each skipped record shifted an internal
counter, causing subsequent records to be checked against the wrong quota —
potentially reading an unlimited (0) entry instead of the configured maximum.

This allowed a client with valid TSIG credentials to add an arbitrary number of
records beyond the configured limit across repeated UPDATE messages up to the
`max-records-per-type` limit.

Closes #5799

Merge branch '5799-fix-counter-desync-in-SSU' into 'main'

See merge request isc-projects/bind9!11708

2 months agoFix update-policy per-type max quota bypass via counter desynchronization
Ondřej Surý [Wed, 18 Mar 2026 09:33:06 +0000 (10:33 +0100)] 
Fix update-policy per-type max quota bypass via counter desynchronization

The prescan and main update loops in DNS UPDATE processing both used the
same counter to index the maxbytype[] quota array.  The prescan loop
always incremented the counter, but the main loop had 14 continue paths
that skipped the increment.  This allowed an authenticated DDNS client to
craft an UPDATE message with padding records (e.g. CNAME+A pairs that
trigger CNAME-conflict skips) to shift the counter and read wrong quota
entries, bypassing per-type record limits entirely.

Fix by incrementing the counter unconditionally at the start of each
iteration in the main loop.

2 months agofix: usr: Fix the processing of empty catalog zone ACLs
Arаm Sаrgsyаn [Fri, 27 Mar 2026 12:37:33 +0000 (12:37 +0000)] 
fix: usr: Fix the processing of empty catalog zone ACLs

The :iscman:`named` process could terminate unexpectedly when
processing a catalog zone ACL in an APL resource record that
was completely empty. This has been fixed.

Closes #5801

Merge branch '5801-catz-empty-apl-rr-bug-fix' into 'main'

See merge request isc-projects/bind9!11740

2 months agoTest the ability to walk the iterators multiple times
Mark Andrews [Wed, 25 Mar 2026 05:15:42 +0000 (16:15 +1100)] 
Test the ability to walk the iterators multiple times

It should be possible to walk APL, HIP, HTTPS and SVBC record
elements multiple times.  We now test this.

2 months agoAllow the dns_rdata_in_apl structure to be walked twice
Mark Andrews [Wed, 25 Mar 2026 05:13:16 +0000 (16:13 +1100)] 
Allow the dns_rdata_in_apl structure to be walked twice

The offset value should be set prior to calculating the length.

2 months agoTest walking apl list entries
Mark Andrews [Wed, 25 Mar 2026 04:58:53 +0000 (15:58 +1100)] 
Test walking apl list entries

2 months agoTest an empty APL record as catalog zone ACL
Aram Sargsyan [Mon, 23 Mar 2026 15:17:47 +0000 (15:17 +0000)] 
Test an empty APL record as catalog zone ACL

Test that named can process an empty APL record as a valid catalog
zone ACL.

2 months agoAllow empty APL records
Aram Sargsyan [Mon, 23 Mar 2026 15:15:18 +0000 (15:15 +0000)] 
Allow empty APL records

Allow empty APL records because RFC 3123 (Section 4) says "zero or
more items". This fixes processing of a catalog zone ACL (which is
based on APL records) when the zone contains an empty APL record or
when a zone update arrives which creates an empty APL record.

2 months agochg: dev: Add low contention stats counter
Alessio Podda [Thu, 26 Mar 2026 10:53:29 +0000 (10:53 +0000)] 
chg: dev: Add low contention stats counter

In the current statistics counter implementation, the statistics are
backed by an array of counters, which are updated via atomic operations.
This leads to contention, especially on high core count
machines.

This commit introduces a new isc_statsmulti_t counter that keeps a
separate array per thread. These counters are then aggregated only when
statistics are queried, shifting work off the critical path.

These changes lead to a ~2% improvement in perflab.

Merge branch 'alessio/statsmulti-v2' into 'main'

See merge request isc-projects/bind9!11036

2 months agoMove ns_highwater_recursclients to highwater stats
Alessio Podda [Wed, 25 Mar 2026 12:12:41 +0000 (13:12 +0100)] 
Move ns_highwater_recursclients to highwater stats

Since it is impossible to increase an isc_statsmulti counter and
retrieve the new counter atomically, and we need the output of
recursclients in order to compute ns_highwater_recursive, we change the
recursclients counter to an isc_stats one.

2 months agoConvert isc_statsmulti to use ISC_REFCOUNT_IMPL
Alessio Podda [Wed, 25 Mar 2026 09:22:32 +0000 (10:22 +0100)] 
Convert isc_statsmulti to use ISC_REFCOUNT_IMPL

Instead of using hand-rolled attach and detach function, this commit
declares the same functions through the ISC_REFCOUNT_IMPL macro.

2 months agoAdd low contention stats counter
Alessio Podda [Fri, 5 Sep 2025 13:39:48 +0000 (15:39 +0200)] 
Add low contention stats counter

In the current statistics counter implementation, the statistics are
backed by an array of counters, which are updated via atomic operations.
This leads to contention, especially on high core count
machines.

This commit introduces a new isc_statsmulti_t counter that keeps a
separate array per thread. These counters are then aggregated only when
statistics are queried, shifting work off the critical path.

These changes lead to a ~2% improvement in perflab.

2 months agonew: usr: Add switch to disable cookie checking in delv
Mark Andrews [Thu, 26 Mar 2026 00:57:04 +0000 (11:57 +1100)] 
new: usr:  Add switch to disable cookie checking in delv

This adds the switch +[no]cookie to delv to control the sending of
DNS COOKIE options when sending requests.  The default is to send
DNS COOKIE options.

Closes #5825

Merge branch '5825-switch-to-disable-cookie-checking-in-delv' into 'main'

See merge request isc-projects/bind9!11733

2 months agoTest that delv +cookie and delv +nocookie work
Mark Andrews [Mon, 23 Mar 2026 07:06:16 +0000 (18:06 +1100)] 
Test that delv +cookie and delv +nocookie work

2 months agoDocument delv's +[no]cookie option
Mark Andrews [Mon, 23 Mar 2026 05:53:19 +0000 (16:53 +1100)] 
Document delv's +[no]cookie option

2 months agoAdd switch to disable cookie checking in delv
Mark Andrews [Mon, 23 Mar 2026 05:43:32 +0000 (16:43 +1100)] 
Add switch to disable cookie checking in delv

This adds the switch +[no]cookie to delv to control the sending of
DNS COOKIE options when sending requests.  The default is to send
DNS COOKIE options.

2 months agofix: ci: Fixes and tweaks for release-related jobs
Michał Kępień [Wed, 25 Mar 2026 17:13:18 +0000 (18:13 +0100)] 
fix: ci: Fixes and tweaks for release-related jobs

Merge branch 'michal/release-job-tweaks' into 'main'

See merge request isc-projects/bind9!11720

2 months agoFix distros token deletion in CI
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Fix distros token deletion in CI

Clone the BIND 9 QA repository before invoking a script in it.

2 months agoPrevent unscheduled release publication
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Prevent unscheduled release publication

The "publish" job has no dependencies on other jobs, so nothing prevents
it from being accidentally started before the scheduled publication
date.  Although publication still requires confirmation via an SSH
connection to a dedicated, locked-down runner, performing that action
prematurely may have drastic consequences.  Therefore, it is worth
implementing additional safeguards.

Add an extra check to the "publish" job to ensure it can only be run on
the scheduled publication day.  In exceptional circumstances, this check
can be overridden by setting the FORCE_PUBLICATION CI variable to any
non-empty value.

2 months agoTighten dependencies for tag-related jobs
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Tighten dependencies for tag-related jobs

The "merge-tag" and "update-stable-tag" jobs currently use the
"manual_release_job_qa" YAML anchor, which makes them depend on the
"staging" job.  Meanwhile, both of these jobs require the tag they were
created for to be public for them to work.  While this is harmless, as
these jobs will simply fail if they are run too early, it still makes
sense for them to depend on the "publish" job instead, if only to reduce
confusion in the pipeline view.  Adjust the "needs" key for the
"merge-tag" and "update-stable-tag" jobs accordingly.

2 months agoExtend artifact lifetime for Cloudsmith build jobs
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Extend artifact lifetime for Cloudsmith build jobs

The commit.txt file produced by each Cloudsmith build job is required to
run the corresponding publication job.  Therefore, the artifact lifetime
for the former must be long enough to prevent the file from expiring
before the publication job is run.  Set the lifetime of the artifacts
created by Cloudsmith build jobs to one month to ensure that the
publication jobs can access them.

2 months agoFix building EVN & -S Cloudsmith packages
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Fix building EVN & -S Cloudsmith packages

Setting "artifacts: false" for the dependency on the "publish-private"
job prevents the url-*.txt files produced by that job from being pulled
from GitLab when the jobs that build EVN & -S Cloudsmith packages are
run, effectively breaking the latter.  Fix by making these jobs depend
on the artifacts of the "publish-private" job.

2 months agochg: test: Rename "nsec3-delegation" to "nsec3_delegation"
Michał Kępień [Wed, 25 Mar 2026 15:52:06 +0000 (16:52 +0100)] 
chg: test: Rename "nsec3-delegation" to "nsec3_delegation"

The "nsec3-delegation" test was added in a release branch, before commit
67aca1f8c6f19de11f238a402604697be4ff64dc introduced the current system
test naming convention.  Rename the test to comply with that convention.

Merge branch 'michal/rename-nsec3-delegation-test' into 'main'

See merge request isc-projects/bind9!11753

2 months agoRename "nsec3-delegation" to "nsec3_delegation"
Michał Kępień [Wed, 25 Mar 2026 14:36:17 +0000 (15:36 +0100)] 
Rename "nsec3-delegation" to "nsec3_delegation"

The "nsec3-delegation" test was added in a release branch, before commit
67aca1f8c6f19de11f238a402604697be4ff64dc introduced the current system
test naming convention.  Rename the test to comply with that convention.

2 months agoMerge tag 'v9.21.20' colin/bind-9.21.20
Michał Kępień [Wed, 25 Mar 2026 14:23:41 +0000 (14:23 +0000)] 
Merge tag 'v9.21.20'

2 months agonew: dev: optionally use libngtcp2 in development builds
Aydın Mercan [Wed, 25 Mar 2026 12:37:37 +0000 (15:37 +0300)] 
new: dev: optionally use libngtcp2 in development builds

Unlike new transports with a new dependency DNS-over-QUIC support will
be added incrementally due to the non-trivial amound of plumbing
required by libngtcp2. This will require non-functional QUIC code in the
main branch that won't be exposed for non-development builds.

Therefore, libngtcp2 is linked as an optional dependency only on
explicitly enabled development builds and cannot be required. This will
be changed with a `doq` meson build option once the server-side
functionality is complete for consumption.

Merge branch 'aydin/ngtcp2-dev-only' into 'main'

See merge request isc-projects/bind9!11557

2 months agooptionally use libngtcp2 only in development builds
Aydın Mercan [Tue, 17 Feb 2026 12:43:16 +0000 (15:43 +0300)] 
optionally use libngtcp2 only in development builds

Unlike new transports with a new dependency DNS-over-QUIC support will
be added incrementally due to the non-trivial amound of plumbing
required by libngtcp2. This will require non-functional QUIC code in the
main branch that won't be exposed for non-development builds.

Therefore, libngtcp2 is linked as an optional dependency only on
explicitly enabled development builds and cannot be required. This will
be changed with a `doq` meson build option once the server-side
functionality is complete for consumption.

2 months agofix: ci: Set User-Agent for Sphinx to fix gitlab.gnome.org
Michal Nowak [Wed, 25 Mar 2026 10:26:02 +0000 (11:26 +0100)] 
fix: ci: Set User-Agent for Sphinx to fix gitlab.gnome.org

The linkcheck started to fail because of a new check on gitlab.gnome.org
that now forbids Sphinx User-Agent, returnin 406 HTTP status.

    (       chapter10: line  115) broken    https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home - 406 Client Error: Not Acceptable for url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home

Merge branch 'mnowak/linkcheck-set-user-agent' into 'main'

See merge request isc-projects/bind9!11747

2 months agopkcs11-provider project has new home
Michal Nowak [Wed, 25 Mar 2026 09:47:42 +0000 (10:47 +0100)] 
pkcs11-provider project has new home

2 months agoSet User-Agent for Sphinx to fix gitlab.gnome.org
Michal Nowak [Wed, 25 Mar 2026 09:39:15 +0000 (10:39 +0100)] 
Set User-Agent for Sphinx to fix gitlab.gnome.org

The linkcheck started to fail because of a new check on gitlab.gnome.org
that now forbids Sphinx User-Agent, returnin 406 HTTP status.

    (       chapter10: line  115) broken    https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home - 406 Client Error: Not Acceptable for url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home

2 months agofix: dev: Remove legacy NS processing limit check
Colin Vidal [Wed, 25 Mar 2026 07:34:34 +0000 (08:34 +0100)] 
fix: dev: Remove legacy NS processing limit check

Commit `604d8f0b967563b0ba9dcd4f09559fdd9e21dfbe` introduced during 9.19
development cycle a check to ensure the resolver never attempts to
lookup more than 20 NS names. This limit was introduced by
`3a44097fd6c6c260765b628cd1d2c9cb7efb0b2a` as part of the CVE-2022-2795.

However, this test relies on the fact that, at the time, the NS names
were processed in a specific order in the nameserver.

This is not true anymore, as the NS are in a random order. Moreover,
commit `3c33e7d9370006b1599e3d99c0d5fa6a6dad7979` introduced the
randomization of the selection of the NS names to lookup, which make the
test potentially unreliable, as it now doesn't mean anything to check
the nameserver does not query `ns21.fake.redirect.com.`, as it could be
the first one, or in any position form the randomized list.

Another test has been added in commit
`c67b52684f11652b07afaa75a917f6f0355dbca6` which test both the
randomization of the NS name to be looked up, as well as the upper bound
limit of NS  name lookup to be done.

For all those reasons, this specific legacy check is now removed.

Merge branch 'colin/remove-incompatble-nslimit-check' into 'main'

See merge request isc-projects/bind9!11745

2 months agoremove legacy NS processing limit check
Colin Vidal [Tue, 24 Mar 2026 20:22:14 +0000 (21:22 +0100)] 
remove legacy NS processing limit check

Commit `604d8f0b967563b0ba9dcd4f09559fdd9e21dfbe` introduced during 9.19
development cycle a check to ensure the resolver never attempts to
lookup more than 20 NS names. This limit was introduced by
`3a44097fd6c6c260765b628cd1d2c9cb7efb0b2a` as part of the CVE-2022-2795.

However, this test relies on the fact that, at the time, the NS names
were processed in a specific order in the nameserver, as this snip from
the log (from a build on `604d8f0` branch) running the test illustrates:

```
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: success, length == 19956, addr = 0x7fdaa0a7c102
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: got valid DNS message header, /QR 1, id 14328
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: search for response in bucket 7213: success
24-Mar-2026 21:19:46.354 received packet from 10.53.0.3#5300
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  14328
;; flags: qr aa; QUESTION: 1, ANSWER: 0, AUTHORITY: 999, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
; COOKIE: baf16b0241efc700
;; QUESTION SECTION:
;large-referral.example.net. IN A

;; AUTHORITY SECTION:
;large-referral.example.net. 300 IN NS ns1.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns2.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns3.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns4.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns5.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns6.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns7.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns8.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns9.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns10.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns11.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns12.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns13.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns14.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns15.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns16.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns17.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns18.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns19.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns20.fake.redirect.com.
```

This is not true anymore, as the NS are in a random order. Moreover,
commit `3c33e7d9370006b1599e3d99c0d5fa6a6dad7979` introduced the
randomization of the selection of the NS names to lookup, which make the
test potentially unreliable, as it now doesn't mean anything to check
the nameserver does not query `ns21.fake.redirect.com.`, as it could be
the first one, or in any position form the randomized list.

Another test has been added in commit
`c67b52684f11652b07afaa75a917f6f0355dbca6` which test both the
randomization of the NS name to be looked up, as well as the upper bound
limit of NS  name lookup to be done.

For all those reasons, this specific legacy check is now removed.

2 months agorem: usr: Remove -C option from dnssec-keygen and dnssec-keyfromlabel
Evan Hunt [Tue, 24 Mar 2026 20:24:58 +0000 (20:24 +0000)] 
rem: usr: Remove -C option from dnssec-keygen and dnssec-keyfromlabel

The -C option, introduced in BIND 9.7, caused a backward-compatible
key to be generated, using private key format version 1.2, omitting the
creation date and other timing metadata. This made it possible to
generate keys that could be loaded by older versions of BIND.

Those older versions having reached end of life many years ago, the
option can now be removed, along with the `dnssec-settime -f` option,
which caused old-style keys to be upgraded.

Merge branch 'each-remove-keygen-compat' into 'main'

See merge request isc-projects/bind9!11446

2 months agoremove -C option from dnssec-keygen and dnssec-keyfromlabel
Evan Hunt [Sat, 10 Jan 2026 07:37:49 +0000 (23:37 -0800)] 
remove -C option from dnssec-keygen and dnssec-keyfromlabel

The -C option, introduced in BIND 9.7, caused a backward-compatible
key to be generated, using private key format version 1.2, omitting the
creation date and other timing metadata. This made it possible to
generate keys that could be loaded by older versions of BIND.

Those older versions having reached end of life many years ago, the
option can now be removed, along with the "dnssec-settime -f" option,
which caused old-style keys to be upgraded.

2 months agofix: dev: rpz_rrset_find() now recurses on ISC_R_NOTFOUND
Evan Hunt [Tue, 24 Mar 2026 00:14:10 +0000 (00:14 +0000)] 
fix: dev: rpz_rrset_find() now recurses on ISC_R_NOTFOUND

Previously, `rpz_rrset_find()` behaved differently depending on whether
a cache lookup returned `DNS_R_DELEGATION` or `ISC_R_NOTFOUND`.  The former
indicates the presence of a cached NS rrset, and the latter indicates
that the cache is cold or that all NS rrsets above the query name have
expired. Both results indicate that the caller should recurse, but
`rpz_rrset_find()` only recursed in the case of `DNS_R_DELEGATION`. This
has been fixed and the test updated to match.

Merge branch 'each-rpz-recursion' into 'main'

See merge request isc-projects/bind9!11741

2 months agorpz_rrset_find() now recurses on ISC_R_NOTFOUND
Evan Hunt [Sun, 22 Mar 2026 03:28:24 +0000 (20:28 -0700)] 
rpz_rrset_find() now recurses on ISC_R_NOTFOUND

previously, rpz_rrset_find() behaved differently depending on whether
a cache lookup returned DNS_R_DELEGATION or ISC_R_NOTFOUND.  the former
indicates the presence of a cached NS rrset, and the latter indicates
that the cache is cold or that all NS rrsets above the query name have
expired. both results indicate that the caller should recurse, but
rpz_rrset_find() only recursed in the case of DNS_R_DELEGATION.

the nsip-wait-recurse and nsdname-wait-recurse test cases in the
rpzrecurse system test were dependent on this misbehavior. the test
server was configured with a lame delegation, so that recursion always
failed, but once the lame delegation was expired due to a zero TTL, the
cache returned ISC_R_NOTFOUND, which caused the recursion not to be
attempted. the test seemed to be observing a delay before recursion
succeeded, but it was actually observing a delay before recursion was
skipped. fixing this bug caused the test to fail.

the test server has now been reconfigured so that recursion succeeds
after a delay, instead of failing. now we're able to test that
we're waiting for the successful completion of recursion.

2 months agosec: usr: Fix crash when reconfiguring zone update policy during active updates
Ondřej Surý [Mon, 23 Mar 2026 11:10:49 +0000 (12:10 +0100)] 
sec: usr: Fix crash when reconfiguring zone update policy during active updates

Fixed a crash that could occur when running rndc reconfig to change a zone's update policy (e.g., from allow-update to update-policy) while DNS UPDATE requests were being processed for that zone.

ISC would like to thank Vitaly Simonovich for bringing this issue to our attention.

Fixes #5817

Merge branch '5817-fix-crash-via-SSU-table-desynchronization' into 'main'

See merge request isc-projects/bind9!11707

2 months agoAdd regression test for TOCTOU race in DNS UPDATE SSU handling
Ondřej Surý [Wed, 18 Mar 2026 03:09:50 +0000 (04:09 +0100)] 
Add regression test for TOCTOU race in DNS UPDATE SSU handling

Race rndc reconfig (toggling between allow-update and update-policy)
against a stream of DNS UPDATEs for 5 seconds and verify that named
does not crash.

Before the fix, the race between send_update() and update_action()
reading the SSU table independently could trigger an assertion
failure (INSIST) when the zone's update policy changed between the
two reads.

2 months agoFix TOCTOU race in DNS UPDATE SSU table handling
Ondřej Surý [Wed, 18 Mar 2026 02:55:51 +0000 (03:55 +0100)] 
Fix TOCTOU race in DNS UPDATE SSU table handling

Pass the SSU table through the update event struct from
send_update() to update_action() instead of reading it from the
zone twice.  If rndc reconfig changed the zone's update policy
between the two reads (e.g., from allow-update to update-policy),
send_update() would skip the maxbytype allocation but
update_action() would see a non-NULL ssutable, triggering
INSIST(ssutable == NULL || maxbytype != NULL) and crashing named.

The ssutable reference is now taken once in send_update() and
transferred to update_action() via the event struct, ensuring
both functions see the same value.

2 months agonew: dev: Add MOVE_OWNERSHIP() macro for transferring pointer ownership
Ondřej Surý [Mon, 23 Mar 2026 10:06:48 +0000 (11:06 +0100)] 
new: dev: Add MOVE_OWNERSHIP() macro for transferring pointer ownership

A helper macro that returns the current value of a pointer and sets
it to NULL in one expression, useful for transferring ownership in
designated initializers.

Merge branch 'ondrej/TAKE_OWNERSHIP-macro' into 'main'

See merge request isc-projects/bind9!11724

2 months agoReplace SAVE/RESTORE/INITANDSAVE macros with MOVE_OWNERSHIP()
Ondřej Surý [Sat, 21 Mar 2026 14:35:34 +0000 (15:35 +0100)] 
Replace SAVE/RESTORE/INITANDSAVE macros with MOVE_OWNERSHIP()

Replace the local SAVE(), RESTORE(), and INITANDSAVE() macros in
query.c with the project-wide MOVE_OWNERSHIP() macro.  The new
form is clearer about the intent: ownership of a pointer is being
transferred from source to destination, with the source set to NULL.

SAVE and RESTORE were identical macros with different names used to
indicate the direction of transfer, but this distinction was purely
cosmetic.  INITANDSAVE additionally set the destination to NULL
first, which is unnecessary because the preceding memcpy already
initialized all fields from the source struct.

2 months agoMove ISC_NONSTRING from util.h to attributes.h
Ondřej Surý [Fri, 20 Mar 2026 13:03:05 +0000 (14:03 +0100)] 
Move ISC_NONSTRING from util.h to attributes.h

ISC_NONSTRING is a compiler attribute macro and belongs alongside
the other attribute definitions in attributes.h, not in util.h.

2 months agoAdd MOVE_OWNERSHIP() macro for transferring pointer ownership
Ondřej Surý [Fri, 20 Mar 2026 01:15:17 +0000 (02:15 +0100)] 
Add MOVE_OWNERSHIP() macro for transferring pointer ownership

A helper macro that returns the current value of a pointer and sets
it to NULL in one expression, useful for transferring ownership in
designated initializers.

2 months agofix: doc: Fix dnssec-signzone usage output
Matthijs Mekking [Mon, 23 Mar 2026 09:36:23 +0000 (09:36 +0000)] 
fix: doc: Fix dnssec-signzone usage output

The usage still said the default NSEC3 iterations is 10, but this
has been 0 for a while.

Merge branch 'matthijs-dnssec-signzone-help-nsec3iter' into 'main'

See merge request isc-projects/bind9!11727

2 months agoFix dnssec-signzone usage output
Matthijs Mekking [Fri, 20 Mar 2026 11:10:07 +0000 (12:10 +0100)] 
Fix dnssec-signzone usage output

The usage still said the default NSEC3 iterations is 10, but this
has been 0 for a while.

2 months agochg: dev: Fix cache flush ordering on NTA expiry
Ondřej Surý [Fri, 20 Mar 2026 16:18:04 +0000 (17:18 +0100)] 
chg: dev: Fix cache flush ordering on NTA expiry

dns_view_flushnode() was called in the delete_expired() async
callback, which runs after the query that detected the NTA expiry.
This created a race: the query would proceed with stale cached data
from the NTA period before the flush had a chance to run, resulting
in transient SERVFAIL with EDE 22 (No Reachable Authority).

Move dns_view_flushnode() into dns_ntatable_covered() so the cache
is flushed synchronously when the expiry is detected, before the
query continues.

Also simplify the expiry comparison in delete_expired() to a direct
pointer comparison (nta == pval) instead of comparing expiry
timestamps.

Merge branch 'ondrej/refactor-nta-using-RCU-delete-order-fix' into 'main'

See merge request isc-projects/bind9!11729

2 months agoFix cache flush ordering on NTA expiry
Ondřej Surý [Fri, 20 Mar 2026 13:29:57 +0000 (14:29 +0100)] 
Fix cache flush ordering on NTA expiry

dns_view_flushnode() was called in the delete_expired() async
callback, which runs after the query that detected the NTA expiry.
This created a race: the query would proceed with stale cached data
from the NTA period before the flush had a chance to run, resulting
in transient SERVFAIL with EDE 22 (No Reachable Authority).

Move dns_view_flushnode() into dns_ntatable_covered() so the cache
is flushed synchronously when the expiry is detected, before the
query continues.

Also simplify the expiry comparison in delete_expired() to a direct
pointer comparison (nta == pval) instead of comparing expiry
timestamps.

2 months agofix: dev: Fix data race in server round-trip time tracking
Ondřej Surý [Fri, 20 Mar 2026 01:06:29 +0000 (02:06 +0100)] 
fix: dev: Fix data race in server round-trip time tracking

The SRTT (Smoothed Round-Trip Time) update for remote servers was not
atomic — concurrent callers could each read the same value and one
update would be silently lost. Additionally, the aging decay applied
once per second could run multiple times if several threads entered the
function simultaneously.

Use compare-and-swap loops for the SRTT update and for the aging
timestamp to ensure no updates are lost.

Merge branch 'ondrej/fix-non-atomic-srtt-aging' into 'main'

See merge request isc-projects/bind9!11718

2 months agoFix non-atomic read-modify-write on entry->srtt in adjustsrtt()
Ondřej Surý [Thu, 19 Mar 2026 03:17:45 +0000 (04:17 +0100)] 
Fix non-atomic read-modify-write on entry->srtt in adjustsrtt()

The SRTT update loaded the old value, computed a new one, and stored it
back as separate operations.  Two concurrent callers could each read the
same old value and one update would be silently lost.

Use a CAS loop for the read-modify-write on entry->srtt.  For the aging
path, also CAS on entry->lastage to prevent multiple threads from aging
the same entry in the same second.

2 months agofix: dev: Fix data race on fctx->vresult in validated()
Ondřej Surý [Thu, 19 Mar 2026 23:56:24 +0000 (00:56 +0100)] 
fix: dev: Fix data race on fctx->vresult in validated()

Move the write to fctx->vresult after LOCK(&fctx->lock).  The field was
being set before acquiring the lock, but dns_resolver_logfetch() reads
it under the same lock from another thread.

Merge branch 'ondrej/fix-data-race-on-fctx-result-in-validated' into 'main'

See merge request isc-projects/bind9!11717

2 months agoFix data race on fctx->vresult in validated()
Ondřej Surý [Thu, 19 Mar 2026 02:42:08 +0000 (03:42 +0100)] 
Fix data race on fctx->vresult in validated()

Move the write to fctx->vresult after LOCK(&fctx->lock).  The field was
being set before acquiring the lock, but dns_resolver_logfetch() reads
it under the same lock from another thread.

2 months agofix: dev: Fix data race in glue cache RCU pointer publication
Ondřej Surý [Thu, 19 Mar 2026 18:04:09 +0000 (19:04 +0100)] 
fix: dev: Fix data race in glue cache RCU pointer publication

The liburcu rcu_cmpxchg_pointer() uses relaxed ordering on the CAS
failure path. When two threads race to publish a new pointer and one
loses the CAS, the returned pointer has no acquire semantics - reading
fields through it is a data race on weakly-ordered architectures.

Override rcu_cmpxchg_pointer() and rcu_xchg_pointer() to use
acquire/release ordering via standard __atomic builtins, which also
makes the operations natively visible to ThreadSanitizer.

Closes #5182

Merge branch '5182-fix-false-tsan-report-in-addglue' into 'main'

See merge request isc-projects/bind9!11719

2 months agoFix data race in RCU pointer exchange operations
Ondřej Surý [Thu, 19 Mar 2026 06:30:24 +0000 (07:30 +0100)] 
Fix data race in RCU pointer exchange operations

The liburcu rcu_cmpxchg_pointer() uses CMM_RELAXED ordering on the CAS
failure path.  When a thread loses the CAS and gets another thread's
pointer back, reading fields through that pointer is a data race on
weakly-ordered architectures (ARM, POWER) because the failing load has
no acquire semantics.

Override rcu_cmpxchg_pointer() and rcu_xchg_pointer() to use standard
__atomic builtins with __ATOMIC_ACQ_REL (success) and __ATOMIC_ACQUIRE
(failure) ordering.  This fixes the race on all architectures and is
natively visible to ThreadSanitizer.

2 months agochg: dev: Refactor NTA to use RCU instead of rwlock
Ondřej Surý [Thu, 19 Mar 2026 00:45:12 +0000 (01:45 +0100)] 
chg: dev: Refactor NTA to use RCU instead of rwlock

Replace the ntatable rwlock with RCU read-side critical sections.

Merge branch 'ondrej/refactor-nta-using-RCU' into 'main'

See merge request isc-projects/bind9!11689

2 months agoFix data race on nta->expiry
Ondřej Surý [Tue, 17 Mar 2026 03:08:54 +0000 (04:08 +0100)] 
Fix data race on nta->expiry

Use CMM_LOAD_SHARED/CMM_STORE_SHARED for nta->expiry, which is
written from the NTA's owning loop but read from any loop (validator,
rndc status, rndc nta -dump).

Also dispatch delete_expired to the NTA's owning loop rather than
the caller's loop.

2 months agoRefactor NTA to use RCU instead of rwlock
Ondřej Surý [Sun, 15 Mar 2026 13:42:06 +0000 (14:42 +0100)] 
Refactor NTA to use RCU instead of rwlock

Replace the ntatable rwlock with RCU read-side critical sections.
The QP multi trie already provides its own concurrency control for
reads and writes, making the rwlock redundant. NTA fields like
expiry are only accessed from the NTA's own event loop thread, so
no additional synchronization is needed.

The table shutdown is now deferred via call_rcu to ensure all
read-side critical sections have completed before iterating and
shutting down individual NTAs.

2 months agofix: usr: Fix NTA (Negative Trust Anchor) expiration issue
Ondřej Surý [Wed, 18 Mar 2026 23:56:31 +0000 (00:56 +0100)] 
fix: usr: Fix NTA (Negative Trust Anchor) expiration issue

When a configured NTA for a name expired, any possibly cached
data for the name (with "insecure" DNSSEC validation result)
was not flushed from the resolver's cache. This has been fixed.

Closes #5747

Merge branch '5747-nta-expiry-cache-flush-bug-fix' into 'main'

See merge request isc-projects/bind9!11597

2 months agoCheck that cached data is flushed when NTA expires
Aram Sargsyan [Tue, 24 Feb 2026 17:24:38 +0000 (17:24 +0000)] 
Check that cached data is flushed when NTA expires

2 months agoFlush the node when NTA expires
Aram Sargsyan [Tue, 24 Feb 2026 17:22:52 +0000 (17:22 +0000)] 
Flush the node when NTA expires

When NTA expires the name's node should be flushed from the view's
cache as it's done when the NTA is manually removed using a rndc
command.

2 months agofix: dev: Take dns_dtenv_t reference before an async function call
Arаm Sаrgsyаn [Wed, 18 Mar 2026 17:04:31 +0000 (17:04 +0000)] 
fix: dev: Take dns_dtenv_t reference before an async function call

A 'dns_dtenv_t' pointer is passed to an async function without taking
a reference first, which can potentially cause a use-after-free error.
Take a reference, then detach in the async function.

Closes #5820

Merge branch '5820-dns_dtenv-reference-bug-fix' into 'main'

See merge request isc-projects/bind9!11705

2 months agoTake 'env' reference before async calling perform_reopen()
Aram Sargsyan [Tue, 17 Mar 2026 11:23:22 +0000 (11:23 +0000)] 
Take 'env' reference before async calling perform_reopen()

The 'env' pointer is passed to an async function without taking
a reference first, which can potentially cause a use-after-free
error. Take a reference, then detach in the async function.

2 months agoConvert dns_dtenv_t reference counting to standard macors
Aram Sargsyan [Tue, 17 Mar 2026 11:22:04 +0000 (11:22 +0000)] 
Convert dns_dtenv_t reference counting to standard macors

Use standard reference counting macros for dns_dtenv_t instead of
custom attach/detach functions.

2 months agochg: dev: Use underscore for system test names
Nicki Křížek [Wed, 18 Mar 2026 14:10:30 +0000 (15:10 +0100)] 
chg: dev: Use underscore for system test names

Change the convention for system test directory names to always use an
underscore rather than a hyphen. Names using underscore are valid python
package names and can be used with standard `import` facilities in
python, which allows easier code reuse.

Merge branch 'nicki/system-test-dir-underscore-names' into 'main'

See merge request isc-projects/bind9!11710

2 months agoRename all system test to use underscore
Nicki Křížek [Tue, 17 Mar 2026 16:18:48 +0000 (17:18 +0100)] 
Rename all system test to use underscore

All system tests previously using a hyphen have been renamed to use
underscore instead. A couple of symlinks were corrected and one path in
`nsec3-answer` adjusted accordingly.

2 months agoUse underscore for system test names
Nicki Křížek [Tue, 17 Mar 2026 16:08:15 +0000 (17:08 +0100)] 
Use underscore for system test names

Change the convention for system test directory names to always use an
underscore rather than a hyphen. Names using underscore are valid python
package names and can be used with standard `import` facilities in
python, which allows easier code reuse.

The temporary directories for test execution and their convenience
symlinks have been switched to using hyphens rather than underscores to
keep the pytest collection, filtering and .gitignore working as
expected.

2 months agofix: dev: Fix isc_buffer_init capacity mismatch in DoH data chunk callback
Ondřej Surý [Wed, 18 Mar 2026 10:39:16 +0000 (11:39 +0100)] 
fix: dev: Fix isc_buffer_init capacity mismatch in DoH data chunk callback

isc_buffer_init() is given MAX_DNS_MESSAGE_SIZE (65535) as capacity but
only h2->content_length bytes are allocated.  This makes the buffer
believe it has more space than actually allocated.  A secondary bounds
check (new_bufsize <= h2->content_length) prevents actual overflow, but
the buffer invariant is violated.

Pass h2->content_length as the capacity to match the allocation.

Merge branch 'ondrej/fix-isc_buffer_init-capacity-mismatch-in-DoH' into 'main'

See merge request isc-projects/bind9!11662

2 months agoFix isc_buffer_init capacity mismatch in DoH data chunk callback
Ondřej Surý [Wed, 11 Mar 2026 12:17:45 +0000 (13:17 +0100)] 
Fix isc_buffer_init capacity mismatch in DoH data chunk callback

isc_buffer_init() is given MAX_DNS_MESSAGE_SIZE (65535) as capacity but
only h2->content_length bytes are allocated.  This makes the buffer
believe it has more space than actually allocated.  A secondary bounds
check (new_bufsize <= h2->content_length) prevents actual overflow, but
the buffer invariant is violated.

Pass h2->content_length as the capacity to match the allocation.