]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 weeks agoMake isc_radix_insert, dns_iptable_addprefix/merge return void
Ondřej Surý [Sun, 22 Mar 2026 10:06:37 +0000 (11:06 +0100)] 
Make isc_radix_insert, dns_iptable_addprefix/merge return void

isc_radix_insert can no longer fail: node allocation uses
isc_mem_get which aborts on OOM, and prefix copying was eliminated
by inlining. Propagate the void return through dns_iptable_addprefix,
dns_iptable_merge, dns_acl_any, dns_acl_none, and all their callers.

2 weeks agoClean up radix tree code style
Ondřej Surý [Sun, 22 Mar 2026 00:18:47 +0000 (01:18 +0100)] 
Clean up radix tree code style

Improve the radix tree code:

- Rename node children from .l/.r to .left/.right
- Rename static functions to drop reserved leading underscores
- Rename legacy macro variables (Xrn, Xsp, Xstack) to
  readable names (cur, sp, stack)
- Narrow variable scopes to point of first use
- Use size_t for loop iterators, uint8_t for byte values
- Replace do/while(0) with plain blocks in macros
- Clean up unit test with helpers and meaningful data values

2 weeks agoRemove AF_UNSPEC and has_prefix from radix tree
Ondřej Surý [Sat, 21 Mar 2026 16:26:30 +0000 (17:26 +0100)] 
Remove AF_UNSPEC and has_prefix from radix tree

Instead of treating AF_UNSPEC as a special "any" prefix that sets
both IPv4 and IPv6 data slots, insert two separate entries (one
per address family). Both land on the same 0/0 node via the
existing dual-family data[] mechanism.

This eliminates AF_UNSPEC handling from isc_radix_insert (4 branch
blocks removed), removes the has_prefix bool from isc_radix_node_t
(using family==0 for glue nodes instead), and simplifies the
NETADDR_TO_PREFIX_T macro.

2 weeks agoInline prefix into radix tree node
Ondřej Surý [Sat, 21 Mar 2026 16:19:40 +0000 (17:19 +0100)] 
Inline prefix into radix tree node

Embed isc_prefix_t directly in isc_radix_node_t instead of heap-
allocating it separately. This eliminates per-node isc_mem_get/put
and isc_mem_attach/detach calls, removes a pointer dereference on
every search comparison, and simplifies the code by removing the
_new_prefix, _ref_prefix, and _deref_prefix helpers entirely.

Remove isc_mem_t from isc_prefix_t since it is now a plain value
type with no memory management. Remove per-node isc_mem_t since
nodes use the tree's memory context. Reorder struct fields to
eliminate padding holes.

2 weeks agoRemove prefix refcounting from radix tree
Ondřej Surý [Sat, 21 Mar 2026 16:12:15 +0000 (17:12 +0100)] 
Remove prefix refcounting from radix tree

Radix tree prefixes were reference-counted to allow sharing between
nodes, with refcount==0 used as a sentinel for stack-allocated
prefixes. Since the radix tree is only modified during config
parsing (single-threaded) and read-only during query processing,
the sharing optimization is unnecessary. Always copy prefixes
instead, eliminating the refcount field and the sentinel hack.

2 weeks agonew: test: Add build-time check for unregistered rdata files
Michal Nowak [Tue, 30 Jun 2026 17:20:11 +0000 (19:20 +0200)] 
new: test: Add build-time check for unregistered rdata files

Fail at meson configure if an rdata source file in lib/dns/rdata is not
registered in dns_header_depfiles, so edits no longer silently skip
header regeneration (as happened with brid, dsync, hhit, and wallet).

Assisted-by: Claude:claude-opus-4-8
Merge branch 'mnowak/check-rdata-registration' into 'main'

See merge request isc-projects/bind9!12219

2 weeks agoCheck for unregistered rdata files in CI
Michal Nowak [Tue, 9 Jun 2026 16:11:51 +0000 (16:11 +0000)] 
Check for unregistered rdata files in CI

Verify in the misc CI job that every rdata source file under
lib/dns/rdata is an input of the generated lib/dns/code.h, i.e.
registered in dns_header_depfiles.  An unregistered file is still
compiled into BIND 9 (gen.c scans the directories directly), but
editing it does not trigger regeneration of code.h.

Assisted-by: Claude:claude-opus-4-8
2 weeks agofix: dev: Assorted Meson fixes
Michal Nowak [Tue, 30 Jun 2026 17:01:50 +0000 (19:01 +0200)] 
fix: dev: Assorted Meson fixes

Merge branch 'mnowak/meson-ci-fixes' into 'main'

See merge request isc-projects/bind9!12167

2 weeks agoFix typo in build_vars comment
Michal Nowak [Tue, 2 Jun 2026 09:37:09 +0000 (09:37 +0000)] 
Fix typo in build_vars comment

Assisted-by: Claude:claude-opus-4-8
2 weeks agoQuote paths in the meson helper scripts
Michal Nowak [Tue, 2 Jun 2026 09:37:07 +0000 (09:37 +0000)] 
Quote paths in the meson helper scripts

Quote variable expansions, guard MESON_BUILD_ROOT, and enable
nullglob so paths with spaces and empty globs are handled.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoRaise nm timeout in the sanitizer defaults check
Michal Nowak [Tue, 2 Jun 2026 09:37:03 +0000 (09:37 +0000)] 
Raise nm timeout in the sanitizer defaults check

A 1 second timeout could abort the check on loaded runners.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoBase the readline check on the configured flags
Michal Nowak [Tue, 2 Jun 2026 09:37:02 +0000 (09:37 +0000)] 
Base the readline check on the configured flags

WITH_LIBEDIT/WITHOUT_LIBEDIT are always-set globals, so the check
always asserted libedit was absent. Inspect EXTRA_CONFIGURE instead.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoDrop duplicate dnstap-read.rst entry
Michal Nowak [Tue, 2 Jun 2026 09:36:57 +0000 (09:36 +0000)] 
Drop duplicate dnstap-read.rst entry

It was added both unconditionally and gated on HAVE_DNSTAP; keep
only the gated entry.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoInstall the synthrecord man page
Michal Nowak [Tue, 2 Jun 2026 09:36:55 +0000 (09:36 +0000)] 
Install the synthrecord man page

It was missing from man_srcset, unlike the other plugin man pages.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoTrack new generic rdata files for header generation
Michal Nowak [Tue, 2 Jun 2026 09:36:50 +0000 (09:36 +0000)] 
Track new generic rdata files for header generation

brid, dsync, hhit and wallet were missing from the header
dependency list, so edits to them did not regenerate headers.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoAvoid leaking FLAKY into every unit test
Michal Nowak [Tue, 2 Jun 2026 09:36:43 +0000 (09:36 +0000)] 
Avoid leaking FLAKY into every unit test

meson stores the test env by reference, so mutating the shared
test_env leaked FLAKY and TIMEOUT into all later tests. Build a
fresh environment for flaky tests instead.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoFix named.conf and named.pid path substitutions
Michal Nowak [Tue, 2 Jun 2026 09:36:36 +0000 (09:36 +0000)] 
Fix named.conf and named.pid path substitutions

Both substitutions wrongly expanded to named.key.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoCheck the host system for dtrace on macOS
Michal Nowak [Tue, 2 Jun 2026 09:36:31 +0000 (09:36 +0000)] 
Check the host system for dtrace on macOS

The macOS dtrace check used build_machine, breaking cross builds;
use host_machine like every other Darwin check.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoLook up urcu-common without the lib prefix
Michal Nowak [Tue, 2 Jun 2026 09:36:27 +0000 (09:36 +0000)] 
Look up urcu-common without the lib prefix

cc.find_library() expects the bare library name, so liburcu-common
was never found on liburcu < 0.13.0.

Assisted-by: Claude:claude-opus-4-8
2 weeks agoSet HAVE_ARM_YIELD instead of HAVE_SPARC_PAUSE on arm
Michal Nowak [Tue, 2 Jun 2026 09:36:23 +0000 (09:36 +0000)] 
Set HAVE_ARM_YIELD instead of HAVE_SPARC_PAUSE on arm

pause.h keys the arm yield instruction off HAVE_ARM_YIELD, so 32-bit
arm never got the fast path.

Assisted-by: Claude:claude-opus-4-8
2 weeks agofix: dev: Fold receive_secure_serial into zone maintainance
Alessio Podda [Tue, 30 Jun 2026 13:36:46 +0000 (13:36 +0000)] 
fix: dev: Fold receive_secure_serial into zone maintainance

Having two separate zone maintainance async jobs increases the risk of
race conditions. This commit folds the inline-signing resigning job
into the zone maintainance of the secure zone, ensuring only one async
job acts on a zone.

Closes #5816

Merge branch '5816-resign-single-source-of-truth' into 'main'

See merge request isc-projects/bind9!12005

2 weeks agoSplit inline sync state into a separate struct
Alessio Podda [Thu, 4 Jun 2026 12:05:08 +0000 (14:05 +0200)] 
Split inline sync state into a separate struct

The inline sync state is only needed when there is a raw-to-secure sync
in progress, and should be handled "atomically".

This commit creates a separate structure that holds all the inline sync
state to streamline the creation and cleanup.

2 weeks agoRename inline sync related methods
Alessio Podda [Thu, 4 Jun 2026 09:55:15 +0000 (11:55 +0200)] 
Rename inline sync related methods

The inline sync related methods and structs retained the old
receive_secure_ prefix. Since there is no async tasks involved anymore
we change the naming scheme to a more descriptive one.

2 weeks agoFix rss_state leak in receive_secure_serial_cancel
Alessio Podda [Thu, 21 May 2026 11:05:55 +0000 (13:05 +0200)] 
Fix rss_state leak in receive_secure_serial_cancel

Previously receive_secure_serial_cancel() could leak .rss_state on
inline secure bootstrap or zone shutdown, if a pre-existing DNSSEC
signing pass was paused. This has been fixed.

2 weeks agoSerialize zone maintenance requests
Alessio Podda [Sun, 24 May 2026 12:03:38 +0000 (14:03 +0200)] 
Serialize zone maintenance requests

Some rndc-driven maintenance operations interact with raw-to-secure
synchronization in the same way as setting NSEC3PARAM did. They are
scheduled via async tasks, which can interleave with raw-to-secure sync
and cause crashes.

To solve this, treat them the same as NSEC3PARAM changes, and extend
the pending NSEC3PARAM change queue to a generic maintenance queue that
rndc can post commands to.

These commands are dispatched by the zone_maintenance() callback, which
delays them if a raw-to-secure sync is in progress.

2 weeks agoFix setnsec3param DNSSEC maintenance ordering
Alessio Podda [Sun, 24 May 2026 11:57:24 +0000 (13:57 +0200)] 
Fix setnsec3param DNSSEC maintenance ordering

Before this commit, NSEC3PARAM changes were scheduled through an async
callback. This leads to a similar problem of interleaving with an
existing raw-to-secure sync, which is unsound since only one writer
version can be active at a time.

The zone already has a queue of "pending" NSEC3PARAM changes, so the
use of async tasks is also redundant. With this commit, we schedule
NSEC3PARAM changes using the pre-existing queues plus a timer.

2 weeks agoMove inline sync into zone maintenance
Alessio Podda [Sun, 24 May 2026 11:57:13 +0000 (13:57 +0200)] 
Move inline sync into zone maintenance

Before this commit, synchronization between raw and secure zones ran as
async tasks split into quanta. As a consequence, it could interleave
with some zone maintenance operations.

However, synchronization between raw and secure zones needs to keep the
version open across the full operation. There can be only one writer
version open at a time, which makes any model where synchronization and
maintenance interleave unsound.

To fix that, this commit models raw-to-secure synchronization as an
explicit state machine and moves the synchronization operations inside
the zone_maintenance() callback.

This way, zone maintenance operations can be intercepted so they do not
run on a partially synced secure zone. Pending zone maintenance or sync
operations can also be flushed when a full database reload has happened
on the raw side.

2 weeks agoAdd NSEC3-to-NSEC rollover regression test
Alessio Podda [Mon, 18 May 2026 22:03:32 +0000 (00:03 +0200)] 
Add NSEC3-to-NSEC rollover regression test

Before this commit, the NSEC3-to-NSEC transition was only tested by
test_nsec_case[nsec3-to-rsasha1-ds.kasp], which is gated by
RSASHA1_SUPPORTED.

Add another test that does not depend on RSASHA1_SUPPORTED, so this
coverage also runs when RSASHA1 signing is unavailable, such as with
newer OpenSSL configurations.

2 weeks agoRefactor zone timer time handling
Alessio Podda [Thu, 18 Jun 2026 14:49:04 +0000 (16:49 +0200)] 
Refactor zone timer time handling

2 weeks agofix: usr: validate query and response time nanosecs when parsing dnstap
Aydın Mercan [Tue, 30 Jun 2026 09:40:20 +0000 (12:40 +0300)] 
fix: usr: validate query and response time nanosecs when parsing dnstap

An assertion is triggered inside `isc_time_set` when dnstap-read calls
`dns_dt_parse` on dnstap files with query/response time nanosecond
fields greater than a second.

Avoid the assertion by validating the nanosecond fields to be subsecond
when parsing.

Closes #6123

Merge branch '6123-dnstap-parse-invalid-nsec-assert-md' into 'main'

See merge request isc-projects/bind9!12224

2 weeks agovalidate query and response time nanosecs when parsing dnstap
Aydın Mercan [Wed, 10 Jun 2026 14:40:00 +0000 (17:40 +0300)] 
validate query and response time nanosecs when parsing dnstap

An assertion is triggered inside `isc_time_set` when dnstap-read calls
`dns_dt_parse` on dnstap files with query/response time nanosecond
fields greater than a second.

Avoid the assertion by validating the nanosecond fields to be subsecond
when parsing.

2 weeks agoadd unit test for invalid dnstap entries
Aydın Mercan [Thu, 18 Jun 2026 06:45:00 +0000 (09:45 +0300)] 
add unit test for invalid dnstap entries

Test `dns_dt_parse` against:
- query nanosecond field over a second
- response nanosecond field over a second
- invalid message type field

2 weeks agofix: dev: Remove dead code warnings found by scan-build
Matthijs Mekking [Mon, 29 Jun 2026 10:32:46 +0000 (10:32 +0000)] 
fix: dev: Remove dead code warnings found by scan-build

Small cleanup, fixing the dead code issues found by scan-build.

Patch submitted by Tim Rühsen.

Closes #6165

Merge branch '6165-dead-code-warnings-found-by-scan-build' into 'main'

See merge request isc-projects/bind9!12293

2 weeks agoSmall update to patch
Matthijs Mekking [Mon, 22 Jun 2026 13:31:20 +0000 (15:31 +0200)] 
Small update to patch

../lib/dns/rdataslab.c
../lib/dns/rdataslab.c:168:3: error: expression result unused; should this cast be to 'void'? [-Werror,-Wunused-value]
  168 |                 (void *)newslab(rdataset, mctx, region, 0, buflen);
      |

2 weeks agoRemove dead code warnings found by scan-build
Matthijs Mekking [Mon, 22 Jun 2026 12:45:54 +0000 (14:45 +0200)] 
Remove dead code warnings found by scan-build

Small cleanup, fixing the dead code issues found by scan-build.

Patch submitted by Tim Rühsen.

3 weeks agofix: usr: Tighten referral DS acceptance
Mark Andrews [Thu, 25 Jun 2026 06:04:32 +0000 (16:04 +1000)] 
fix: usr: Tighten  referral DS acceptance

Named was accepting DS records for sibling zones when it shouldn't
have.  This has been fixed.

Closes #5870

Merge branch '5870-tighten-referral-ds-acceptance' into 'main'

See merge request isc-projects/bind9!11837

3 weeks agoAdd dnssec_py/tests_sibling_ds: reject DS for sibling zones in referrals
Nicki Křížek [Mon, 13 Apr 2026 12:55:54 +0000 (12:55 +0000)] 
Add dnssec_py/tests_sibling_ds: reject DS for sibling zones in referrals

Add a system test that verifies the resolver rejects DS records whose
owner name does not match the delegation (NS) name in a referral
response.

A custom authoritative server (ans4) serves the parent zone sibling-ds.
from zone file with delegations for child and sibling subzones.  Its
DomainHandler injects a DS record for sibling.sibling-ds into referrals
for child.sibling-ds.  The resolver must detect the mismatch, log "DS
doesn't match referral (NS)", and return SERVFAIL.

Assisted-by: Claude:claude-opus-4-8
3 weeks agoDon't include ORIGIN for AsyncDnsServer zones
Nicki Křížek [Mon, 13 Apr 2026 13:29:51 +0000 (15:29 +0200)] 
Don't include ORIGIN for AsyncDnsServer zones

The zone template can't use $ORIGIN with AsyncDnsServer because
AsyncDnsServer._load_zone_file_with_origin() rejects it for non-root
zones.

3 weeks agoTighten referral DS acceptance
Mark Andrews [Mon, 13 Apr 2026 06:49:37 +0000 (16:49 +1000)] 
Tighten referral DS acceptance

Named was accepting DS records for sibling zones when it shouldn't
have.  Only DS rrsets that match the delegation name should have
been accepted.

Remove ds_name from struct respctx as it is no longer useful.

3 weeks agofix: usr: Check that an NSEC signer is at or above the name to be validated
Evan Hunt [Wed, 24 Jun 2026 21:04:20 +0000 (21:04 +0000)] 
fix: usr: Check that an NSEC signer is at or above the name to be validated

Add a check that an NSEC record being used as a proof of nonexistence
for a given name is not signed by a name lower in the DNS hierarchy than
the one in question.

Closes #5876

Merge branch '5876-nsec-signer-above-name' into 'main'

See merge request isc-projects/bind9!12272

3 weeks agoReproducer for #5876 child apex self-loop NSEC
Alessio Podda [Wed, 3 Jun 2026 14:58:25 +0000 (16:58 +0200)] 
Reproducer for #5876 child apex self-loop NSEC

Added to "nsec_synthesis" system test.

Co-Authored-By: Evan Hunt <each@isc.org>
3 weeks agoCheck that an NSEC signer is at or above the name to be validated
Evan Hunt [Sat, 23 May 2026 04:04:03 +0000 (21:04 -0700)] 
Check that an NSEC signer is at or above the name to be validated

Add a check that an NSEC record being used as a proof of nonexistence
for a given name is not signed by a name lower in the DNS hierarchy than
the one in question.

Fixes: isc-projects/bind9#5876
3 weeks agofix: test: Fix RRL test random failure
Colin Vidal [Wed, 24 Jun 2026 20:31:27 +0000 (22:31 +0200)] 
fix: test: Fix RRL test random failure

RRL test were randomly failing because `ns2` hint files uses

```
. NS ns1.
ns1. A 10.53.0.1
```

Whereas `ns1` root zone didn't contains `ns1.` as NS (but only `ns.`).
This is a problem with the following scenario:

- A query starts before priming;
- It gets the root hints as zonecut (with `. NS ns1.`, and no glues, this
  is how parent-centric currently works);
- Priming starts and complete (so now rootdb contains the answer/glues
  from `ns1` root file);
- Then the query go to ADB to resolve `ns1.`.

Resolution of `ns1.` fails since it doesn't exists from the rootdb
anymore. This is a configuration issue (the resolver behavior is correct
and expected) whch is now fixed.

Closes #6032

Merge branch '6032-fix-rrl' into 'main'

See merge request isc-projects/bind9!12322

3 weeks agoFix RRL random failure
Colin Vidal [Wed, 24 Jun 2026 16:52:41 +0000 (18:52 +0200)] 
Fix RRL random failure

RRL test were randomly failing because `ns2` hint files uses

```
. NS ns1.
ns1. A 10.53.0.1
```

Whereas `ns1` root zone didn't contains `ns1.` as NS (but only `ns.`).
This is a problem with the following scenario:

- A query starts before priming;
- It gets the root hints as zonecut (with `. NS ns1.`, and no glues, this
  is how parent-centric currently works);
- Priming starts and complete (so now rootdb contains the answer/glues
  from `ns1` root file);
- Then the query go to ADB to resolve `ns1.`.

Resolution of `ns1.` fails since it doesn't exists from the rootdb
anymore. This is a configuration issue (the resolver behavior is correct
and expected) whch is now fixed.

3 weeks agonew: ci: Add Alpine Linux 3.24
Michal Nowak [Wed, 24 Jun 2026 15:45:14 +0000 (17:45 +0200)] 
new: ci: Add Alpine Linux 3.24

Merge branch 'mnowak/alpine-3.24' into 'main'

See merge request isc-projects/bind9!12229

3 weeks agoFix a false positive compiler warning/error on Alpine 3.24
Michal Nowak [Thu, 11 Jun 2026 11:39:14 +0000 (11:39 +0000)] 
Fix a false positive compiler warning/error on Alpine 3.24

On Alpine Linux 3.24, GCC 15 with fortify-headers produces a compiler
warning when building bin/nsupdate/nsupdate.c:

    In function 'fgets',
        inlined from 'get_next_command' at ../bin/nsupdate/nsupdate.c:2414:13:
    /usr/include/fortify/stdio.h:48:16: error: 'cmdlinebuf' may be used uninitialized [-Werror=maybe-uninitialized]
       48 |         return __orig_fgets(__s, __n, __f);
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/fortify/stdio.h:42:1: note: in a call to '*fgets' declared with attribute 'access (read_write, 1, 2)' here
       42 | _FORTIFY_FN(fgets) char *fgets(char * _FORTIFY_POS0 __s, int __n, FILE *__f)
          | ^~~~~~~~~~~
    ../bin/nsupdate/nsupdate.c:2405:14: note: 'cmdlinebuf' declared here
     2405 |         char cmdlinebuf[MAXCMD];
          |              ^~~~~~~~~~

This is a false positive, because fgets() only writes into the buffer;
the fortify-headers wrapper annotates the buffer argument with
'access (read_write, ...)', which makes GCC treat passing an
uninitialized buffer as a read of uninitialized memory.

Initialize the 'cmdlinebuf' buffer anyway to avoid the build error.

Assisted-by: Claude:claude-fable-5
3 weeks agoAdd Alpine Linux 3.24
Michal Nowak [Thu, 11 Jun 2026 09:35:15 +0000 (11:35 +0200)] 
Add Alpine Linux 3.24

3 weeks agofix: test: Retry pipequeries on a transient EADDRINUSE in the pipelined test
Michal Nowak [Wed, 24 Jun 2026 15:16:14 +0000 (17:16 +0200)] 
fix: test: Retry pipequeries on a transient EADDRINUSE in the pipelined test

On FreeBSD, the TCP connect() call can transiently fail with
EADDRINUSE under parallel CI load.  The netmgr already retries such
connects (see #3451), but it retries on the same socket, which is
already bound to the same ephemeral source port, so when the
four-tuple is genuinely busy (e.g. in TIME_WAIT) every retry fails
the same way.  pipequeries then exits with "request event result:
address in use", leaving raw.1 empty and failing the first check.

All eight requests share a single TCP dispatch, so the failed connect
means no query ever reached ns4 and its cache is still cold.  It is
therefore safe to run pipequeries again: a fresh process binds a new
ephemeral port, and the out-of-order check keeps its meaning.  Retry
for up to ten attempts, but only on this specific transient error.

Assisted-by: Claude Code:claude-fable-5
Merge branch 'mnowak/pipelined-retry-transient-eaddrinuse' into 'main'

See merge request isc-projects/bind9!12228

3 weeks agoRetry pipequeries on a transient EADDRINUSE in the pipelined test
Michal Nowak [Thu, 11 Jun 2026 08:32:13 +0000 (08:32 +0000)] 
Retry pipequeries on a transient EADDRINUSE in the pipelined test

On FreeBSD, the TCP connect() call can transiently fail with
EADDRINUSE under parallel CI load.  The netmgr already retries such
connects (see #3451), but it retries on the same socket, which is
already bound to the same ephemeral source port, so when the
four-tuple is genuinely busy (e.g. in TIME_WAIT) every retry fails
the same way.  pipequeries then exits with "request event result:
address in use", leaving raw.1 empty and failing the first check.

All eight requests share a single TCP dispatch, so the failed connect
means no query ever reached ns4 and its cache is still cold.  It is
therefore safe to run pipequeries again: a fresh process binds a new
ephemeral port, and the out-of-order check keeps its meaning.  Retry
for up to ten attempts, but only on this specific transient error.

Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-opus-4-8
3 weeks agonew: dev: Print OS platform in "named -V"
Michal Nowak [Wed, 24 Jun 2026 15:06:30 +0000 (17:06 +0200)] 
new: dev: Print OS platform in "named -V"

The "running on" line emitted by `named -V` (as well as the startup
log and `rndc status`, which share the same source) now appends the
PRETTY_NAME value from /etc/os-release in parentheses after the uname
output, e.g.:

    running on Linux x86_64 6.19.14-... (Fedora Linux 42 (Workstation Edition))

This helps disambiguate environments where the kernel string is not a
reliable indicator of the userspace, such as RHEL clones and
containers whose kernel does not match the host OS.

When /etc/os-release is absent, /usr/lib/os-release is tried as a
fallback per the systemd os-release(5) specification. When neither is
available or no PRETTY_NAME is found, the output is unchanged.

Assisted-by: Claude:claude-opus-4-7
Closes #5334

Merge branch '5334-add-os-platform-to-named-V' into 'main'

See merge request isc-projects/bind9!12055

3 weeks agoPrint OS platform in "named -V"
Michal Nowak [Tue, 19 May 2026 16:09:36 +0000 (16:09 +0000)] 
Print OS platform in "named -V"

The "running on" line emitted by `named -V` (as well as the startup
log and `rndc status`, which share the same source) now appends the
PRETTY_NAME value from /etc/os-release in parentheses after the uname
output, e.g.:

    running on Linux x86_64 6.19.14-... (Fedora Linux 42 (Workstation Edition))

This helps disambiguate environments where the kernel string is not a
reliable indicator of the userspace, such as RHEL clones and
containers whose kernel does not match the host OS.

When /etc/os-release is absent, /usr/lib/os-release is tried as a
fallback per the systemd os-release(5) specification. When neither is
available or no PRETTY_NAME is found, the output is unchanged.

Assisted-by: Claude:claude-opus-4-7
3 weeks agonew: test: Add extra expired RRSIGs test to dnssec_py
Ondřej Surý [Wed, 24 Jun 2026 14:32:15 +0000 (16:32 +0200)] 
new: test: Add extra expired RRSIGs test to dnssec_py

Related #5760

Merge branch 'nicki/pytest-add-extra-expired-rrsigs-test' into 'main'

See merge request isc-projects/bind9!11808

3 weeks agoAdd extra expired RRSIGs test to dnssec_py
Nicki Křížek [Fri, 3 Apr 2026 13:57:01 +0000 (15:57 +0200)] 
Add extra expired RRSIGs test to dnssec_py

The test verifies that a validating resolver enforces the
max-validations-per-fetch limit when encountering a record with multiple
expired RRSIGs followed by a valid one. One of the records is signed
three times: twice with expired timestamps (to produce two expired
RRSIGs for a.rrsigs-extra-expired/A) and once with valid timestamps,
after which the expired RRSIGs are injected back into the signed zone
file. max-validations-per-fetch is set to 2 via the template variable so
that the third (valid) RRSIG is never reached, causing SERVFAIL.

Assisted-by: Claude:claude-opus-4-8
3 weeks agofix: test: Report all unregistered unit test files at once
Michal Nowak [Wed, 24 Jun 2026 11:57:42 +0000 (13:57 +0200)] 
fix: test: Report all unregistered unit test files at once

Collect every unregistered unit test file before exiting instead of
failing on the first one, so a single configure run lists them all.

Assisted-by: Claude:claude-opus-4-8
Merge branch 'mnowak/report-all-unregistered-unit-tests' into 'main'

See merge request isc-projects/bind9!12220

3 weeks agoReport all unregistered unit test files at once
Michal Nowak [Tue, 9 Jun 2026 16:11:51 +0000 (16:11 +0000)] 
Report all unregistered unit test files at once

Collect every unregistered unit test file before exiting instead of
failing on the first one, so a single configure run lists them all.

Assisted-by: Claude:claude-opus-4-8
3 weeks agofix: usr: Stop reusing outgoing TCP connections the peer has already closed
Ondřej Surý [Wed, 24 Jun 2026 11:52:58 +0000 (13:52 +0200)] 
fix: usr: Stop reusing outgoing TCP connections the peer has already closed

``named`` could hand a new query an idle forwarder/upstream TCP or TLS
connection that the peer had already closed, causing the query to fail
(and CLOSE-WAIT sockets to pile up). Idle reused connections are now
watched, so a close is noticed and the connection is dropped instead of
reused. A new ``tcp-reuse-timeout`` option controls how long an idle
outgoing connection is kept open for reuse (default 5 seconds).

Closes #6171

Merge branch '6171-tcp-reuse-idle-read' into 'main'

See merge request isc-projects/bind9!12289

3 weeks agoAdd the tcp-reuse-timeout option
Ondřej Surý [Sun, 21 Jun 2026 18:20:35 +0000 (20:20 +0200)] 
Add the tcp-reuse-timeout option

The idle timeout that bounds how long a reused outgoing TCP/TLS
connection is held open for reuse was only tunable through the 'named -T
tcpidletimeout' developer hook added earlier on this branch. Make it a
proper configuration option, tcp-reuse-timeout (options block, in units
of 100 milliseconds like the other tcp-*-timeout options), and drop the
-T hook.

3 weeks agoKeep idle reused outgoing TCP connections under read
Ondřej Surý [Sun, 21 Jun 2026 07:24:14 +0000 (09:24 +0200)] 
Keep idle reused outgoing TCP connections under read

A reused TCP/TLS dispatch with no outstanding responses was left in the
reuse pool with no read pending, so a peer closing the idle connection
went unnoticed: the socket lingered in CLOSE-WAIT and the dead dispatch
was later handed to a new query, which failed and the fetch timed out.
Keep a read pending on an idle connected dispatch, bounded by an idle
timeout, so the close is seen promptly and the connection is dropped
from the pool instead of reused.

The idle read may only be (re)armed while the dispatch is still
connected; arming it on a dispatch that is already shutting down
re-reads a dying handle and double-schedules a netmgr job.

On shutdown, close the connection as soon as the dispatch reaches its
terminal state instead of waiting for the last reference to drop, so an
unexpected read (or a peer-side close) cannot leave the socket in
CLOSE-WAIT while a reference still lingers.

3 weeks agorem: ci: Drop Danger check related to pre-release testing
Michał Kępień [Wed, 24 Jun 2026 11:33:57 +0000 (13:33 +0200)] 
rem: ci: Drop Danger check related to pre-release testing

With the advent of the new development model involving security-*
branches and autorebasing, the value added by the pre-release testing
mechanism dropped drastically.  The only remaining benefit of
pre-release testing is flagging in-progress security fixes targeting
open source branches that conflict with the corresponding bind-9.x-sub
branches.  However, such conflicts are a rare occurrence and can be
handled after merging anyway.

Remove the Danger check related to pre-release testing.

Merge branch 'michal/drop-danger-check-related-to-pre-release-testing' into 'main'

See merge request isc-projects/bind9!12313

3 weeks agoDrop Danger check related to pre-release testing
Michał Kępień [Wed, 24 Jun 2026 11:25:27 +0000 (13:25 +0200)] 
Drop Danger check related to pre-release testing

With the advent of the new development model involving security-*
branches and autorebasing, the value added by the pre-release testing
mechanism dropped drastically.  The only remaining benefit of
pre-release testing is flagging in-progress security fixes targeting
open source branches that conflict with the corresponding bind-9.x-sub
branches.  However, such conflicts are a rare occurrence and can be
handled after merging anyway.

Remove the Danger check related to pre-release testing.

3 weeks agofix: ci: Use resource-group for RPM-related CI jobs
Andoni Duarte [Wed, 24 Jun 2026 10:33:10 +0000 (10:33 +0000)] 
fix: ci: Use resource-group for RPM-related CI jobs

RPM build jobs work by pushing a commits to main in a repository. Each
repository is identified by the `SERVICE variable and, since race
conditions may happen, the jobs are run serially via GitLab's
resource_group mechanism.

Merge branch 'andoni/use-resource-group-for-rpms-copr-ci-job' into 'main'

See merge request isc-projects/bind9!12295

3 weeks agoUse resource groups for RPM build CI jobs
Andoni Duarte Pintado [Mon, 22 Jun 2026 14:30:37 +0000 (16:30 +0200)] 
Use resource groups for RPM build CI jobs

RPM build jobs push commits to Git repositories.  If multiple such jobs
are triggered simultaneously, some of these pushes may fail due to the
same Git branch getting updated by one job while another one attempts to
do the same thing in parallel.  Use GitLab's resource group mechanism to
prevent such races: group jobs by the Git repository they push to, which
is indicated by the $SERVICE variable set for each job.

3 weeks agofix: usr: Truncated reply to a TSIG query no longer stalls the resolver alessio/qpzone-find-cleanup-baseline
Ondřej Surý [Wed, 24 Jun 2026 10:18:30 +0000 (12:18 +0200)] 
fix: usr: Truncated reply to a TSIG query no longer stalls the resolver

When an upstream server returned a truncated reply to a query that BIND had
signed with TSIG, the resolver could keep waiting for a follow-up UDP packet
that never arrived, so the query stalled until it hit resolver-query-timeout
and the client received no answer. BIND now treats any reply it cannot
authenticate as an immediate failure and returns SERVFAIL right away as a
defense in depth.

Closes #6028

Merge branch '6028-tsig-truncated-tsig-response' into 'main'

See merge request isc-projects/bind9!12080

3 weeks agoFail the fetch when a response fails the TSIG signature check
Ondřej Surý [Mon, 22 Jun 2026 11:29:58 +0000 (13:29 +0200)] 
Fail the fetch when a response fails the TSIG signature check

A response that failed the signature check with a missing or unexpected
TSIG used to set nextitem, so the resolver kept reading the dispatch for
another response.  When the response was truncated with the TSIG cut off
the end of the wire, no further response ever arrived and the fetch
stalled until resolver-query-timeout.

Treat an unauthenticated response like every other signature-check
failure and finish the fetch immediately.  A response carrying a missing
or bogus TSIG now yields SERVFAIL instead of being skipped in favour of
a later one; the cookie system test that fed a spoofed TSIG response is
updated to expect that.  The unauthenticated data is still never
returned.

3 weeks agofix: dev: Avoid writing through a const pointer in render_xsl()
Michal Nowak [Wed, 24 Jun 2026 09:30:59 +0000 (11:30 +0200)] 
fix: dev: Avoid writing through a const pointer in render_xsl()

render_xsl() served the static XSL stylesheet by casting away the const
qualifier of xslmsg and handing the pointer to isc_buffer_reinit():

    p = UNCONST(xslmsg);
    isc_buffer_reinit(b, p, strlen(xslmsg));

isc_buffer_reinit() copies any pre-existing buffer content into the new
base with memmove(), so the call would write into xslmsg, which is a
'const char[]' living in read-only memory.  This is safe today only
because the supplied bodybuffer is always freshly initialized with
length 0, so the memmove() never runs -- a fragile, action-at-a-distance
invariant that GCC's -fanalyzer flags as a write to a const object
(-Wanalyzer-write-to-const).

Use isc_buffer_constinit(), the primitive intended for pointing a buffer
at constant data: it goes through isc_buffer_init() and never writes to
the base.  This drops the UNCONST cast, keeps xslmsg in read-only
memory, and silences the analyzer warning.

Assisted-by: Claude:claude-opus-4-8
Merge branch 'mnowak/render-xsl-const-buffer' into 'main'

See merge request isc-projects/bind9!12168

3 weeks agoAvoid writing through a const pointer in render_xsl()
Michal Nowak [Tue, 2 Jun 2026 17:27:16 +0000 (17:27 +0000)] 
Avoid writing through a const pointer in render_xsl()

render_xsl() cast away the const of the static xslmsg stylesheet and
passed it to isc_buffer_reinit(), which memmove()s into the base when
the buffer is non-empty -- a write to read-only memory that -fanalyzer
flags (-Wanalyzer-write-to-const).  It only stayed safe because the
body buffer is always empty here.

Use isc_buffer_constinit(), which never writes to the base, and assert
the empty-buffer contract with REQUIRE(isc_buffer_length(b) == 0).

Assisted-by: Claude:claude-opus-4-8
3 weeks agochg: ci: Miscellaneous autorebasing tweaks
Michał Kępień [Wed, 24 Jun 2026 08:07:41 +0000 (10:07 +0200)] 
chg: ci: Miscellaneous autorebasing tweaks

  - Remove the "autorebase-merge-request" CI job
  - Fix formatting of autorebase failure notifications
  - Send Zulip notifications for autorebase failures

Merge branch 'michal/autorebase-ci-tweaks' into 'main'

See merge request isc-projects/bind9!12288

3 weeks agoSend Zulip notifications for autorebase failures
Michał Kępień [Wed, 24 Jun 2026 08:04:06 +0000 (10:04 +0200)] 
Send Zulip notifications for autorebase failures

Use the GitLab-to-Zulip username map available in the BIND 9 QA
repository to determine the Zulip username of the developer who happened
to author a breaking base branch change, so that a Zulip notification
can be triggered for that developer.

3 weeks agoFix formatting of autorebase failure notifications
Michał Kępień [Wed, 24 Jun 2026 08:04:06 +0000 (10:04 +0200)] 
Fix formatting of autorebase failure notifications

Using a plain "echo" command does not turn "\n" into newline
characters, breaking the formatting of the Zulip notifications sent upon
autorebase failures.  Fix by using "echo -e" instead, which enables
interpreting backslash sequences in the provided input.

3 weeks agoRemove the "autorebase-merge-request" CI job
Michał Kępień [Wed, 24 Jun 2026 08:04:06 +0000 (10:04 +0200)] 
Remove the "autorebase-merge-request" CI job

The "autorebase-merge-request" CI job is not useful in practice as the
Danger check whose complaints it was supposed to address does not look
for commit hashes in the original merge request's target branch, but
rather in the original merge request itself - and those commit hashes
remain stable over time.  Furthermore, after a backport gets merged, any
cherry-pick references its commits might contain will be maintained by
other autorebasing jobs.  Given the above, remove the
"autorebase-merge-request" CI job as it serves no useful purpose.

3 weeks agofix: dev: Don't serve a stale CNAME or record when fresh data of the other exists
Ondřej Surý [Wed, 24 Jun 2026 04:53:34 +0000 (06:53 +0200)] 
fix: dev: Don't serve a stale CNAME or record when fresh data of the other exists

When a cached name held both a CNAME and records of another type — one stale,
the other still fresh — named with serve-stale could return the expired set
instead of the fresh one, in either direction. It now prefers whichever is fresh.

Merge branch 'ondrej/fix-serve_stale-cname-and-type' into 'main'

See merge request isc-projects/bind9!12282

3 weeks agoDon't stop qpcache_find on a stale header while fresh data remains
Ondřej Surý [Thu, 18 Jun 2026 21:26:12 +0000 (23:26 +0200)] 
Don't stop qpcache_find on a stale header while fresh data remains

With serve-stale enabled, stale rdataset headers are kept at a node so
they can be served as a last resort. The find loop, however, accepted a
stale CNAME or stale record of the requested type as a final answer and
broke out of the iteration early, returning stale data even when a fresh
header for the same name appeared later in the scan. Treat STALE(found)
like a missing answer so the loop keeps looking and only falls back to
the stale header when no fresh answer is found.

3 weeks agofix: usr: Fix a bug in DNS UPDATE processing with inline-signing enabled
Arаm Sаrgsyаn [Mon, 22 Jun 2026 20:56:07 +0000 (20:56 +0000)] 
fix: usr: Fix a bug in DNS UPDATE processing with inline-signing enabled

In rare cases the :iscman:`named` process could terminate unexpectedly
when processing authorized DNS UPDATE messages in quick procession
which are updating a zone with inline-signing enabled. This has been
fixed.

Closes #5816

Merge branch '5816-inline-signing-concurrent-update-fix' into 'main'

See merge request isc-projects/bind9!11982

3 weeks agoFix memory leak bug during zone shutdown
Aram Sargsyan [Thu, 7 May 2026 23:24:22 +0000 (23:24 +0000)] 
Fix memory leak bug during zone shutdown

The dns_update_signaturesinc() updates zone signatures in chunks,
keeping its current state in 'zone->rss_state'. When a zone shuts
down, the signature update process is canceled, and all the data
in the state is not freed.

Create a new dns_update_state_clear() function which can be called
from dns_zone_free() to free the memory.

3 weeks agoHandle zone shutting down case in receive_secure_serial()
Aram Sargsyan [Thu, 7 May 2026 13:31:13 +0000 (13:31 +0000)] 
Handle zone shutting down case in receive_secure_serial()

When the zone is shutting down jump straight to cleanup, otherwise
an assertion failure is possible, e.g. because zone->loop can be
already NULL.

3 weeks agoRemove the unused link from 'struct rss'
Aram Sargsyan [Fri, 3 Apr 2026 15:57:26 +0000 (15:57 +0000)] 
Remove the unused link from 'struct rss'

The link is declared but never used. Remove it.

3 weeks agoFix a bug in "receive secure serial" processing
Aram Sargsyan [Fri, 3 Apr 2026 15:55:55 +0000 (15:55 +0000)] 
Fix a bug in "receive secure serial" processing

When a DNS UPDATE messages is received, the zone_send_secureserial()
function can schedule a new receive_secure_serial() call with a new
'rss' object before a previous one had a chance to be fully processed.
This can cause an assertion failure in receive_secure_serial() with a
new 'rss' object (when the old one was rescheduled because it got
DNS_R_CONTINUE from dns_update_signaturesinc()). In other words:

1. receive_secure_serial() called with rss, sets zone->rss = rss,
   reschedules because of DNS_R_CONTINUE
2. receive_secure_serial() called with rss_new, INSIST fails because
   zone->rss != rss_new), i.e. this was called before the old 'rss'
   was fully processed

Change the code logic by introducing a new 'rss_next' field and making
sure the old 'rss' is complete before starting processing the new
one.

3 weeks agoRemove redundant INSIST
Aram Sargsyan [Fri, 3 Apr 2026 15:16:10 +0000 (15:16 +0000)] 
Remove redundant INSIST

The check is already performed in the INSIST above.

3 weeks agoAdd a new check in "inline" system test
Aram Sargsyan [Thu, 7 May 2026 11:44:44 +0000 (11:44 +0000)] 
Add a new check in "inline" system test

This new check floods the server with DNS UPDATE messages for an
'inline-signing yes; sig-signing-signatures 1;' zone to see if
it manages to process the updates correctly.

3 weeks agochg: dev: Fix double initialization in copy_tuple()
Matthijs Mekking [Mon, 22 Jun 2026 14:53:07 +0000 (14:53 +0000)] 
chg: dev: Fix double initialization in copy_tuple()

Small cleanup. Found with ninja -C build-dir/ scan-build.

Patch submitted by Tim Rühsen.

Closes #6163

Merge branch '6163-double-initialization-copy-tuple' into 'main'

See merge request isc-projects/bind9!12292

3 weeks agoFix double initialization in copy_tuple()
Matthijs Mekking [Mon, 22 Jun 2026 12:33:25 +0000 (14:33 +0200)] 
Fix double initialization in copy_tuple()

Small cleanup. Found with ninja -C build-dir/ scan-build.

Patch submitted by Tim Rühsen.

3 weeks agochg: dev: Reference count and flatten the cache slabheader storage
Ondřej Surý [Mon, 22 Jun 2026 13:05:10 +0000 (15:05 +0200)] 
chg: dev: Reference count and flatten the cache slabheader storage

Internal refactoring of the cache database (qpcache) with no functional
change. The slab headers that hold cached rdatasets are now reference
counted and own their memory context and node reference directly, so a
header can outlive the cleaning of its node and be reclaimed
independently of it. Building on that, the per-type slabtop container is
folded into the slab header itself, removing a level of indirection and
one allocation per cached type.

Merge branch 'ondrej/slabheader-reference-counting' into 'main'

See merge request isc-projects/bind9!12285

3 weeks agoKeep in-flight cache headers safe from LRU eviction during add
Ondřej Surý [Sat, 20 Jun 2026 07:33:55 +0000 (09:33 +0200)] 
Keep in-flight cache headers safe from LRU eviction during add

When the cache is over its size limit, qpcache_miss() runs LRU eviction
while add() is still in progress.  Eviction removes a header together
with its RRSIG/covered 'related' partner, so it could free a header the
add still needs -- the new header, the partner it was just paired with,
or the one about to be displaced for max-types-per-name.  With 'related'
now a counted reference, that became a use-after-free reachable under
sustained load.

Run the eviction last, after the new header is linked, bound and any
over-limit header removed, and skip the new header and its partner in
the eviction loop (the partner is marked visited so the SIEVE hand still
advances).  Per-header removal is factored into header_delete(),
expire_header() and flush_node().

3 weeks agoRemove the ANCIENT slabheader attribute and statistics counter
Ondřej Surý [Fri, 19 Jun 2026 13:43:42 +0000 (15:43 +0200)] 
Remove the ANCIENT slabheader attribute and statistics counter

Cache headers are now unlinked from their node as soon as they expire,
so a slabheader is never left in the "ancient, awaiting cleanup" state
that DNS_SLABHEADERATTR_ANCIENT tracked.  Drop the attribute, rename
mark_ancient() to header_delete() to reflect that it now removes the
header rather than flagging it (keying idempotency on list membership),
and remove the ancient RRset statistics counter that recorded the state,
which is now always zero; the rdataset statistics array shrinks to
match.

The rdataset-level 'ancient' flag and 'rndc dumpdb -expired' are
unaffected: expiry is derived from the entry's TTL when the rdataset is
bound, not from the slabheader attribute.

3 weeks agoFactor the header/RRSIG extraction out of the find paths
Ondřej Surý [Fri, 19 Jun 2026 09:09:00 +0000 (11:09 +0200)] 
Factor the header/RRSIG extraction out of the find paths

qpcache_find, qpcache_findrdataset, and find_headers each repeated the
same logic to pick a header and its RRSIG out of a slabheader and its
'related' link.  Pull it into store_headers(), and rename check_header()
to invalid_header() since it returns true when the header should be
skipped.

3 weeks agoSquash dns_slabtop into dns_slabheader
Ondřej Surý [Fri, 19 Jun 2026 07:39:20 +0000 (09:39 +0200)] 
Squash dns_slabtop into dns_slabheader

With headers removed eagerly in mark_ancient there is at most one header
per type at a node, so the separate per-type dns_slabtop container no
longer earns its keep.  Fold its fields onto the header -- the link into
the node's list, the RRSIG/covered related pairing, and the SIEVE-LRU
state -- and link headers directly into the node, dropping a level of
indirection and an allocation per cached type.

3 weeks agoRemove cache headers and empty slabtops eagerly in mark_ancient
Ondřej Surý [Thu, 18 Jun 2026 16:39:08 +0000 (18:39 +0200)] 
Remove cache headers and empty slabtops eagerly in mark_ancient

Now that a bound rdataset keeps references to both the slabheader and
the node, an ancient header (and the slabtop it leaves empty) can be
removed from the cache immediately in mark_ancient, instead of being
parked on a per-node dirty list and reclaimed only once the node becomes
unreferenced.  This drops the dirty list and the clean_cache_* machinery
entirely.

Because the cache structure can now change under a node that still has
external references, the all-rdatasets iterator no longer walks the live
slabtop list: allrdatasets() binds every matching rdataset up front and
the iterator works from that snapshot, cloning out each entry.

3 weeks agoFree the slabheader proofs in its destructor
Ondřej Surý [Thu, 18 Jun 2026 15:15:32 +0000 (17:15 +0200)] 
Free the slabheader proofs in its destructor

Now that the slabheader carries its own memory context, free its
noqname/closest proofs from slabheader_destroy rather than reaching
through the owning node's deletedata method.  That was the method's last
caller, so remove dns_db_deletedata entirely; the cache bookkeeping it
performed (rrset statistics and the dirty list) becomes a plain helper
called wherever a header leaves the cache.

3 weeks agoStore the bound node and slabheader reference on the rdataset
Ondřej Surý [Thu, 18 Jun 2026 14:51:28 +0000 (16:51 +0200)] 
Store the bound node and slabheader reference on the rdataset

The bound rdataset now keeps its own node reference instead of reaching
it through the slabheader, and each slabheader carries its own memory
context so it can free itself once its reference count reaches zero.
The noqname/closest proof rdatasets are views into a slabheader's proof
slabs, so they now hold a reference to that slabheader too, keeping the
proof slab (and the cloned owner name): alive for as long as the proof
rdataset is.  Keeping the node on the rdataset means node access stays
valid for the life of the rdataset, independent of the slabheader's own
node pointer.

3 weeks agoMake the dns_slabheaders in the cache reference counted
Ondřej Surý [Thu, 18 Jun 2026 07:59:51 +0000 (09:59 +0200)] 
Make the dns_slabheaders in the cache reference counted

Instead of only reference counting the enclosing qpcnode, add the
reference counting directly to the slabheaders.  This will allow us to
simplify the data model, as the slabheaders reference is now incremented
when we bind the rdataset and decremented when we disassociate the
rdataset.  This will allow us to remove the slabheader from the slabtop
directly instead of waiting for qpcnode to become completely
unreferenced.

3 weeks agoSplit the slabheader and slabheader_proof structures in rdataset
Ondřej Surý [Thu, 18 Jun 2026 09:39:05 +0000 (11:39 +0200)] 
Split the slabheader and slabheader_proof structures in rdataset

Follow the method split with a data split: give the proof
pseudo-rdataset its own member in the dns_rdataset union, carrying its
own node, instead of overloading the slab member.  The proof methods
now read proof.raw/proof.node independently of the real
slab.raw/slab.noqname/slab.closest, so the two share no state and the
proof path is fully self-contained.

3 weeks agoSplit the slabheader and slabheader_proof methods
Ondřej Surý [Thu, 18 Jun 2026 09:23:37 +0000 (11:23 +0200)] 
Split the slabheader and slabheader_proof methods

The noqname/closest proof pseudo-rdatasets share the slab data layout
but have a different lifecycle: they reference a bare proof slab owned
by the parent header and are torn down via dns_slabheader_freeproof(),
not the rdataset's own teardown.  Give them a dedicated
dns_rdataslab_proof_rdatasetmethods table with their own
disassociate/clone so the proof path can diverge from the real
bound-rdataset path -- a prerequisite for reference counting the real
headers without it ever reaching the proof slabs.

3 weeks agoDon't stop qpcache_find on a stale header while fresh data remains
Ondřej Surý [Thu, 18 Jun 2026 21:26:12 +0000 (23:26 +0200)] 
Don't stop qpcache_find on a stale header while fresh data remains

With serve-stale enabled, stale rdataset headers are kept at a node so
they can be served as a last resort. The find loop, however, accepted a
stale CNAME or stale record of the requested type as a final answer and
broke out of the iteration early, returning stale data even when a fresh
header for the same name appeared later in the scan. Treat STALE(found)
like a missing answer so the loop keeps looking and only falls back to
the stale header when no fresh answer is found.

3 weeks agofix: usr: ignore 0-byte reads in the TCP read callback
Aydın Mercan [Mon, 22 Jun 2026 07:05:02 +0000 (10:05 +0300)] 
fix: usr: ignore 0-byte reads in the TCP read callback

Callbacks for libuv stream reads do not signal zero-length reads as a
failure signal but rather as EAGAIN/EWOULDBLOCK. This can trigger an
assertion when a zero-length read is pushed onto a PROXYv2 endpoint that
has not yet processed the headers as it expects a non-NULL region of
positive length.

Closes #6140

Merge branch '6140-proxyv2-assertion-on-zero-byte-read' into 'main'

See merge request isc-projects/bind9!12261

3 weeks agoignore 0-byte reads in the TCP read callback
Aydın Mercan [Thu, 11 Jun 2026 13:38:27 +0000 (16:38 +0300)] 
ignore 0-byte reads in the TCP read callback

Callbacks for libuv stream reads do not signal zero-length reads as a
failure signal but rather as EAGAIN/EWOULDBLOCK. This can trigger an
assertion when a zero-length read is pushed onto a PROXYv2 endpoint that
has not yet processed the headers as it expects a non-NULL region of
positive length.

4 weeks agochg: ci: Raise respdiff third-party and recent-named disagreement thresholds
Nicki Křížek [Fri, 19 Jun 2026 11:50:58 +0000 (13:50 +0200)] 
chg: ci: Raise respdiff third-party and recent-named disagreement thresholds

The third-party comparison is right at the 0.4 % threshold, making it
fail quite often. The current range of observed values ranges from
0.3-0.5 %. Raise the threshold to 0.5 %.

The recent-named comparison produces values ranging from 0.05 to 0.12 %,
but appears to be more sensitive to time of the day when the test runs.
Raise the threshold to 0.15 %.

Both results are stable within the specified ranges across the last
three releases in both main and bind-9.20 series.

Merge branch 'nicki/respdiff-threshold-bump' into 'main'

See merge request isc-projects/bind9!12286

4 weeks agoRaise respdiff third-party and recent-named disagreement thresholds
Nicki Křížek [Fri, 19 Jun 2026 11:09:42 +0000 (11:09 +0000)] 
Raise respdiff third-party and recent-named disagreement thresholds

The third-party comparison is right at the 0.4 % threshold, making it
fail quite often. The current range of observed values ranges from
0.3-0.5 %. Raise the threshold to 0.5 %.

The recent-named comparison produces values ranging from 0.05 to 0.12 %,
but appears to be more sensitive to time of the day when the test runs.
Raise the threshold to 0.15 %.

Both results are stable within the specified ranges across the last
three releases in both main and bind-9.20 series.

4 weeks agofix: usr: CDS/CDNSKEY records were not removed when re-configuring the server
Matthijs Mekking [Fri, 19 Jun 2026 09:07:10 +0000 (09:07 +0000)] 
fix: usr: CDS/CDNSKEY records were not removed when re-configuring the server

When on an ``rndc reconfig`` the DNSSEC policy changes such that it changes the expected ``CDNSKEY`` and/or ``CDS`` records in the zone, the RRset should
be updated accordingly. This did not happen when removing digests from the configuration, or setting `cdnskey no;`. This has been fixed.

Closes #6166

Merge branch '6166-reconfig-delete-cds' into 'main'

See merge request isc-projects/bind9!12265

4 weeks agoDon't rely on smart signing in cds system test
Matthijs Mekking [Thu, 18 Jun 2026 08:42:10 +0000 (10:42 +0200)] 
Don't rely on smart signing in cds system test

With dnssec-signzone smart-signing (-S), the CDS and CDSNKEY are
derived from the key timing metadata and the configuration options (-G).

The test has specific test cases that smart signing (with the fix)
interferes with. Therefor, disable smart-signing in the cds system test.

4 weeks agoRemove CDs/CDNSKEY records on reconfig
Matthijs Mekking [Wed, 17 Jun 2026 15:34:42 +0000 (17:34 +0200)] 
Remove CDs/CDNSKEY records on reconfig

When adding to dnssec-policy:

    cdnskey no;
    cds-digest-types { };

and then reconfig the server, named must remove existing CDS and CDNSKEY
records. Note this already worked when adding CDS digest, or setting
'cdnskey yes;', but not when digests were removed from the list, or
when setting 'cdnskey no;'.