]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 hours agofix: test: Fix intermittent multisigner system test failures main
Ondřej Surý [Fri, 14 Aug 2026 10:46:05 +0000 (12:46 +0200)] 
fix: test: Fix intermittent multisigner system test failures

The multisigner system test could query an inline-signed zone
before the signed view had processed an update, intermittently
observing the previous DNSKEY, CDNSKEY, or CDS RRset. Record
the served SOA serial before each same-server update and wait
for it to advance before checking the results.

Merge branch 'ondrej/fix-the-multisigner-tests-timing' into 'main'

See merge request isc-projects/bind9!12573

5 hours agoMove get_soa_serial into isctest.query and make it retry 12573/head
Nicki Křížek [Thu, 13 Aug 2026 10:00:30 +0000 (10:00 +0000)] 
Move get_soa_serial into isctest.query and make it retry

The pre-update SOA serial capture in the multisigner test was a
one-shot query outside any retry loop, so a single transient timeout
would fail the test that the timing fix is meant to deflake.  Make
get_soa_serial a shared isctest.query helper that retries internally
(for up to 10 seconds by default) and reuse it in wait_for_serial,
which duplicated the same SOA extraction logic.

Assisted-by: Claude:claude-fable-5
5 hours agoWait for inline signing in multisigner tests
Ondřej Surý [Thu, 13 Aug 2026 06:19:37 +0000 (08:19 +0200)] 
Wait for inline signing in multisigner tests

The test skipped serial synchronization when an update was sent to the
same server that answered subsequent queries.  This allowed assertions to
observe stale inline-signed data after successful updates.

Assisted-by: Codex:gpt-5
7 hours agonew: dev: Add constant-time DNS root-name checks
Ondřej Surý [Fri, 14 Aug 2026 08:47:51 +0000 (10:47 +0200)] 
new: dev: Add constant-time DNS root-name checks

Checking whether a DNS name is the root could require walking the name
to count its labels or comparing it with the global root name. A new
dns_name_isroot() helper checks the root wire encoding directly,
distinguishes the empty name from the root, and replaces the existing
ad hoc checks.

Merge branch 'each-name-isroot' into 'main'

See merge request isc-projects/bind9!11920

8 hours agoApply the semantic patch cocci/dns_name_isroot.spatch 11920/head
Ondřej Surý [Fri, 14 Aug 2026 07:26:13 +0000 (09:26 +0200)] 
Apply the semantic patch cocci/dns_name_isroot.spatch

This replaces the dns_name_countlabels() with constant time
dns_name_isroot() and dns_name_belowroot() helpers.

8 hours agoAdd constant-time DNS name predicates
Evan Hunt [Thu, 30 Apr 2026 07:33:28 +0000 (00:33 -0700)] 
Add constant-time DNS name predicates

Determining whether a DNS name is the root or contains a non-root label
does not require walking the whole name. Add constant-time predicates
and a semantic patch for equivalent label-count and equality checks.

10 hours agofix: dev: "rndc flushtree ." failed to flush the cache
Evan Hunt [Fri, 14 Aug 2026 05:34:16 +0000 (05:34 +0000)] 
fix: dev: "rndc flushtree ." failed to flush the cache

`rndc flushtree` flushes cache data below a specified name. If the name
specified is the DNS root, it should fully empty the cache, the same
as `rndc flush`.  However, there was a bug causing the command, in that
case, to have no effect on the cache at all; this has been fixed.

Closes #6308

Merge branch '6308-rndc-flushtree-root' into 'main'

See merge request isc-projects/bind9!12579

15 hours ago"rndc flushtree ." failed to flush the cache 12579/head
Evan Hunt [Fri, 14 Aug 2026 00:17:44 +0000 (17:17 -0700)] 
"rndc flushtree ." failed to flush the cache

`rndc flushtree` flushes cache data below a specified name. If the name
specified is the DNS root, that should fully empty the cache, the same
as `rndc flush`.  However, there was a bug causing that command to have
no effect on the cache at all; this has been fixed.

20 hours agonew: dev: Add dns_name_empty() to avoid counting labels in emptiness checks
Ondřej Surý [Thu, 13 Aug 2026 19:54:20 +0000 (21:54 +0200)] 
new: dev: Add dns_name_empty() to avoid counting labels in emptiness checks

Checking whether a DNS name is empty was done with dns_name_countlabels(), which walks every label in the name just to compare the count with zero. The new dns_name_empty() helper checks the name's length directly, and a coccinelle patch converts the existing callers.

Merge branch 'ondrej/add-dns_name_empty' into 'main'

See merge request isc-projects/bind9!12558

21 hours agoApply the semantic patch to use dns_name_empty() 12558/head
Ondřej Surý [Wed, 12 Aug 2026 11:08:03 +0000 (13:08 +0200)] 
Apply the semantic patch to use dns_name_empty()

Replace the easy dns_name_countlabels == 0 and > 0 occurrences with
dns_name_empty() using the semantic patch from the previous commit.

21 hours agoAdd dns_name_empty() to skip counting all the labels in the name
Ondřej Surý [Wed, 12 Aug 2026 11:00:27 +0000 (13:00 +0200)] 
Add dns_name_empty() to skip counting all the labels in the name

Checking whether a name is empty via dns_name_countlabels() walks the
whole name just to compare the label count with zero.  An empty name
is simply one with zero length, so add dns_name_empty() that checks
the length directly, along with a coccinelle patch that converts the
existing callers.

21 hours agofix: dev: Use alignas() from stdatomics to align
Ondřej Surý [Thu, 13 Aug 2026 18:47:34 +0000 (20:47 +0200)] 
fix: dev: Use alignas() from stdatomics to align

This is a followup to !12513 that missed two fixup commits that changed
__attribute__((__aligned__(N))) to alignas()

Merge branch 'ondrej/aligned-atomics-fixup' into 'main'

See merge request isc-projects/bind9!12578

22 hours agoUse alignas() from stdatomics to align 12578/head
Ondřej Surý [Thu, 13 Aug 2026 11:55:22 +0000 (13:55 +0200)] 
Use alignas() from stdatomics to align

This is a followup to !12513 that missed two fixup commits that changed
__attribute__((__aligned__(N))) to alignas()

22 hours agochg: dev: Prevent false sharing by aligning some zone and db fields
Alessio Podda [Thu, 13 Aug 2026 17:38:59 +0000 (17:38 +0000)] 
chg: dev: Prevent false sharing by aligning some zone and db fields

The zone refcount, zone dblock, db refcount and db lock are pretty contended in setups serving few big zones, such as TLDs.

We add alignment to both in order to prevent false sharing between them.

Merge branch 'alessio/aligned-atomics-v4' into 'main'

See merge request isc-projects/bind9!12513

23 hours agoAlign qpzone lock and db refcount 12513/head
Alessio Podda [Mon, 3 Aug 2026 14:31:31 +0000 (16:31 +0200)] 
Align qpzone lock and db refcount

The qpzone refcount is the probably the most conteded refcount for
workloads with a single zone such as TLDs.

Add alignment to both the refcount and qpzone dblock to avoid false
sharing.

23 hours agoPad struct hole with rarely used fields
Alessio Podda [Mon, 3 Aug 2026 15:07:54 +0000 (17:07 +0200)] 
Pad struct hole with rarely used fields

The alignment we added to the zone reference and the zone lock
increases the size of dns_zone_t. Compensate for it by moving
some cold fields in the hole left by alignment.

23 hours agoAlign zone refcount and dblock
Alessio Podda [Mon, 19 Jan 2026 09:36:53 +0000 (10:36 +0100)] 
Align zone refcount and dblock

The zone refcount and the dblock are pretty contended in setups
serving few big zones, such as TLDs.

We add alignment to both in order to prevent false sharing between
the two.

26 hours agochg: nil: Extend CVE checklist
Petr Špaček [Thu, 13 Aug 2026 14:07:41 +0000 (14:07 +0000)] 
chg: nil: Extend CVE checklist

Merge branch 'pspacek/cve-checklist-update' into 'main'

See merge request isc-projects/bind9!12564

26 hours agoExtend CVE checklist 12564/head
Petr Špaček [Wed, 12 Aug 2026 16:05:45 +0000 (18:05 +0200)] 
Extend CVE checklist

Add also steps from In Case of Emergency document which should have been
performed before we even created the checklist.

29 hours agofix: dev: Fix various nits in the netmgr code 4695-pkcs11-replace-softhsm
Martin Basti [Thu, 13 Aug 2026 10:20:42 +0000 (10:20 +0000)] 
fix: dev: Fix various nits in the netmgr code

The MR consists of couple of small fixes and uncaught errors in the Network Manager.

Closes #6257

Merge branch 'ondrej/batch-of-netmgr-fixes' into 'main'

See merge request isc-projects/bind9!11639

30 hours agoInitialize struct sockaddr_nl sa 11639/head
Aram Sargsyan [Wed, 22 Jul 2026 15:48:42 +0000 (15:48 +0000)] 
Initialize struct sockaddr_nl sa

The structure is initialized, which can cause problems e.g. with
its nl_pid member.

To quote from an LLM report in GL#6257:

> A non-zero nl_pid is an explicit netlink port-ID request, so the
> kernel either binds the socket to an arbitrary port ID (functionally
> tolerable for a multicast-only listener, but it can squat another
> process's natural port ID) or fails with EADDRINUSE when the garbage
> value collides with an existing NETLINK_ROUTE socket in the same
> namespace.

Zero initialize the structure.

30 hours agoAdd parentheses to NM_BIG_BUF macro
Ondřej Surý [Fri, 6 Mar 2026 10:08:47 +0000 (11:08 +0100)] 
Add parentheses to NM_BIG_BUF macro

The NM_BIG_BUF macro expands without parentheses, which can cause
incorrect evaluation due to operator precedence when used in
expressions.

30 hours agoHandle initialize_tls() failure gracefully in tlslisten_acceptcb()
Ondřej Surý [Fri, 6 Mar 2026 10:08:44 +0000 (11:08 +0100)] 
Handle initialize_tls() failure gracefully in tlslisten_acceptcb()

initialize_tls() can fail due to non-memory OpenSSL errors such as
BIO_new() internal failures or SSL_set_tlsext_host_name() rejecting an
invalid hostname.  These are per-connection errors that should not
bring down the entire server.

Replace the RUNTIME_CHECK (which calls abort()) with proper error
handling: log the failure, clean up the TLS socket, and return an
error to the caller so the connection is rejected gracefully.

30 hours agoFix wrong errno value passed in route_socket()
Ondřej Surý [Fri, 6 Mar 2026 10:08:40 +0000 (11:08 +0100)] 
Fix wrong errno value passed in route_socket()

bind() returns -1 on failure and sets errno.  The code was passing the
return value `r` (which is always -1) to isc_errno_toresult() instead
of `errno`, causing incorrect error codes to be reported for netlink
bind failures.

31 hours agofix: usr: rndc-confgen `-q` (quiet) option is documented but doesn't work
Mark Andrews [Thu, 13 Aug 2026 09:16:26 +0000 (19:16 +1000)] 
fix: usr: rndc-confgen `-q` (quiet) option is documented but doesn't work

The command line parsing in rndc-confgen was broken so
`rndc-confgen -q` did not work.  This has been fixed.

Closes #6187

Merge branch '6187-fix-rndc-confgen-q' into 'main'

See merge request isc-projects/bind9!12570

37 hours agoTest that 'rndc-confgen -q' works as documented 12570/head
Mark Andrews [Thu, 13 Aug 2026 02:36:56 +0000 (12:36 +1000)] 
Test that 'rndc-confgen -q' works as documented

38 hours agorndc-confgen `-q` (quiet) option is documented but doesn't work
Mark Andrews [Thu, 13 Aug 2026 02:14:06 +0000 (12:14 +1000)] 
rndc-confgen `-q` (quiet) option is documented but doesn't work

The command line parsing in rndc-confgen was broken so 'rndc-confgen
-q' did not work.  This has been fixed.

42 hours agofix: doc: Document built in check-names exclusions
Mark Andrews [Wed, 12 Aug 2026 21:55:56 +0000 (07:55 +1000)] 
fix: doc: Document built in check-names exclusions

`check-names` rules ordinarily forbid hostnames to contain any character other than letters, digits and hyphen. There are exceptions for A and AAAA records with an Active Directory Forest prefix (`gc._msdcs`), and for RFC7208 exclusion lookup names (interior labels `_spf`, `_spf_verify` and `_spf_rate`). These exceptions were not previously documented, but now are.

Merge branch 'marka-update-check-names-documentation' into 'main'

See merge request isc-projects/bind9!12554

42 hours agoDocument built in check-name exclusions 12554/head
Mark Andrews [Wed, 12 Aug 2026 03:21:35 +0000 (13:21 +1000)] 
Document built in check-name exclusions

The Active Directory Forest prefix (gc._msdcs) A and AAAA record
and the RFC7208 exclusion lookup names (interior labels on _spf,
_spf_verify, and _spf_rate) for A records are automatically excluded
from check-names.

43 hours agofix: test: remove __init__.py from digdelv system test
Martin Basti [Wed, 12 Aug 2026 21:07:27 +0000 (21:07 +0000)] 
fix: test: remove __init__.py from digdelv system test

This was introduced as the way how to allow pytest to use tests_delv.py filename in multiple suites. However, team decision was to drop **`` `__init__.py` ``** and rather use unique filenames.

Merge branch 'stepan/no-init-py-in-digdelv' into 'main'

See merge request isc-projects/bind9!12562

43 hours agoremove __init__.py from digdelv system test 12562/head
Štěpán Balážik [Sun, 9 Aug 2026 19:08:59 +0000 (21:08 +0200)] 
remove __init__.py from digdelv system test

This was introduced as the way how to allow pytest to use
tests_delv.py filename in multiple suites.
However, team decision was to drop __init__.py
and rather use unique filenames.

43 hours agochg: dev: Remove nodep from the dns_db_find() API
Alessio Podda [Wed, 12 Aug 2026 20:31:34 +0000 (20:31 +0000)] 
chg: dev: Remove nodep from the dns_db_find() API

Previously `dns_db_find()` return four values: a result, an rdataset, the name of the rdataset and a pointer to the node containing the rdataset (`nodep`). With a few tweaks the node pointer can be made superflous, as the node can be retrieved from the rdataset name using `dns_db_findnode()`.

This MR removes the `nodep` output parameter from `dns_db_find()`, leading both an API simplification and speedups when serving NSEC signed zones.

Merge branch 'alessio/no-qctx-node-v2' into 'main'

See merge request isc-projects/bind9!12458

44 hours agoBump plugin API version 12458/head
Alessio Podda [Wed, 12 Aug 2026 08:38:11 +0000 (10:38 +0200)] 
Bump plugin API version

Changing query_ctx_t changes the plugin ABI. Bump NS_PLUGIN_VERSION
accordingly.

44 hours agoRemove node output from the database vtable
Ondřej Surý [Wed, 5 Aug 2026 14:26:13 +0000 (16:26 +0200)] 
Remove node output from the database vtable

Now that nodep is unused by all database implementations, remove it
from the signature of dns_dbmethods_t.find.

44 hours agoDo not attach nodep in sdlz_find() and builtin_find()
Ondřej Surý [Wed, 5 Aug 2026 14:26:13 +0000 (16:26 +0200)] 
Do not attach nodep in sdlz_find() and builtin_find()

As a consequence of the simplification of the dns_db_find() API,
we can avoid attaching the node in sdlz_find() and builtin_find().
The local node reference is only needed while assembling the answer
and can be released before the function returns.

44 hours agoDo not attach nodep in qpcache_find()
Ondřej Surý [Wed, 5 Aug 2026 14:26:13 +0000 (16:26 +0200)] 
Do not attach nodep in qpcache_find()

As a consequence of the simplification of the dns_db_find() API,
we can avoid attaching the node in qpcache_find(). Returned rdatasets
keep cache data alive, while callers which need to iterate a node
retrieve it by name.

44 hours agoAdd fixedname move helpers
Alessio Podda [Thu, 6 Aug 2026 14:55:35 +0000 (16:55 +0200)] 
Add fixedname move helpers

A common pattern after the cleanup is having to move fixednames to
the query context to support async restarts.

Add an helper function to handle such cases. A generic function
wouldn't be appropriate since some special handling of the wildcard
bit is needed.

44 hours agoDo not attach nodep in qpzone_find()
Alessio Podda [Fri, 17 Jul 2026 13:34:12 +0000 (15:34 +0200)] 
Do not attach nodep in qpzone_find()

As a consequence of the simplification of the dns_db_find() API,
we can avoid attaching the node in certain situations. We
only need to attach the node on zonecuts to keep alive the header
pointers.

44 hours agoDo not attach the database node to the query context
Alessio Podda [Wed, 22 Jul 2026 13:58:45 +0000 (15:58 +0200)] 
Do not attach the database node to the query context

Now that nodep is not part of the dns_db_findnode() API, we don't need
to save the node in the query context anymore. We rely instead on
saving the name found in the database.

44 hours agoRemove node output from the public lookup API
Alessio Podda [Wed, 22 Jul 2026 13:58:24 +0000 (15:58 +0200)] 
Remove node output from the public lookup API

Remove nodep from dns_db_find() and dns_db_findext(), then update
callers and tests to consume names and rdatasets directly.

44 hours agoPreserve database owner names across query processing
Alessio Podda [Wed, 22 Jul 2026 13:58:17 +0000 (15:58 +0200)] 
Preserve database owner names across query processing

Carry database owner names through query restarts, redirects,
additional processing, RPZ, and wildcard-proof generation.

44 hours agoDecouple node consumers from dns_db_find()
Alessio Podda [Wed, 22 Jul 2026 13:57:59 +0000 (15:57 +0200)] 
Decouple node consumers from dns_db_find()

The dns_db_find() had a convenience parameter to grab not only the
requested name and rdataset, but also the database node containing
the rdataset.

Now that the found name is always available, we don't need to use
the convenience parameter anymore and we can retrieve the node
directly with dns_db_findnode() if needed.

This commit replaces all uses of the nodep parameter in dns_db_find()
with explicit lookups. This will allow us later to simplify the API
and reap performance improvements.

44 hours agoReturn wildcard names instead of synthetized names in dns_db_find()
Alessio Podda [Wed, 22 Jul 2026 13:43:18 +0000 (15:43 +0200)] 
Return wildcard names instead of synthetized names in dns_db_find()

Previously dns_db_find() would return the synthetized name on a
wildcard match. This is insufficient, as sometimes query processing
requires the wildcard name instead of the synthetized name.

This commit modifies the dns_db_find() API to return the wildcard
name instead of the synthetized name, and adds helper functions to
query.c to derive the synthetized name if needed.

46 hours agochg: test: Refactor the cyclic_glue ans5 response server
Štěpán Balážik [Wed, 12 Aug 2026 18:08:45 +0000 (18:08 +0000)] 
chg: test: Refactor the cyclic_glue ans5 response server

Use the small record-builder helpers and module-style dnspython imports of the other `isctest.asyncserver` servers. Switching to `QnameQtypeHandler` also makes the declared qtypes take effect — a plain `QnameHandler` ignores them — restricting the referrals to the A queries the test actually sends.

Merge branch 'stepan/cyclic_glue-asyncserver-cleanup' into 'main'

See merge request isc-projects/bind9!12525

46 hours agoRefactor the cyclic_glue ans5 response server 12525/head
Štěpán Balážik [Sat, 18 Jul 2026 11:46:28 +0000 (13:46 +0200)] 
Refactor the cyclic_glue ans5 response server

Use the small record-builder helpers and module-style dnspython
imports of the other isctest.asyncserver servers.  Switch to
QnameQtypeHandler so the declared qtypes actually take effect --
QnameHandler ignores them -- restricting the referrals to the A
queries the test sends.

Assisted-by: Claude:claude-fable-5
47 hours agochg: test: Refactor the qpcache_rrsig_any ans3 response server
Štěpán Balážik [Wed, 12 Aug 2026 17:12:13 +0000 (17:12 +0000)] 
chg: test: Refactor the qpcache_rrsig_any ans3 response server

Rewrite the server in the declarative `isctest.asyncserver` style, so the RRSIG meta-type poisoning is expressed as handler data rather than built by hand.

Merge branch 'stepan/qpcache_rrsig_any-asyncserver-cleanup' into 'main'

See merge request isc-projects/bind9!12524

47 hours agoRefactor the qpcache_rrsig_any ans3 response server 12524/head
Štěpán Balážik [Fri, 17 Jul 2026 15:12:54 +0000 (17:12 +0200)] 
Refactor the qpcache_rrsig_any ans3 response server

Rewrite it in the declarative isctest.asyncserver style, so the RRSIG
meta-type poisoning is expressed as handler data rather than built by
hand.  The responses sent are unchanged.

Assisted-by: Claude:claude-fable-5
47 hours agofix: test: Combine rollover system tests
Evan Hunt [Wed, 12 Aug 2026 16:38:07 +0000 (16:38 +0000)] 
fix: test: Combine rollover system tests

`rollover` and the dozen or so related system tests (`rollover_algo_csk`, `rollover_algo_ksk_zsk`, etc) share most of their files in common, and can be simplified into a single directory structure.

Merge branch 'each-declutter-rollover-tests' into 'main'

See merge request isc-projects/bind9!12523

47 hours agofold in rollover_multisigner 12523/head
Evan Hunt [Fri, 7 Aug 2026 06:50:39 +0000 (23:50 -0700)] 
fold in rollover_multisigner

47 hours agofold in rollover_lifetime
Evan Hunt [Fri, 7 Aug 2026 06:38:11 +0000 (23:38 -0700)] 
fold in rollover_lifetime

47 hours agofold in dynamic2inline
Evan Hunt [Fri, 7 Aug 2026 06:17:35 +0000 (23:17 -0700)] 
fold in dynamic2inline

47 hours agofold in rollover-zsk-prepub
Evan Hunt [Fri, 7 Aug 2026 05:52:29 +0000 (22:52 -0700)] 
fold in rollover-zsk-prepub

47 hours agofold in rollover-ksk tests
Evan Hunt [Fri, 7 Aug 2026 05:36:30 +0000 (22:36 -0700)] 
fold in rollover-ksk tests

merge the "rollover_ksk_doubleksk" and "rollover_ksk_3crowd" system
tests into "rollover"

47 hours agofold more tests into rollover
Evan Hunt [Fri, 7 Aug 2026 04:33:29 +0000 (21:33 -0700)] 
fold more tests into rollover

merge the "rollover_enable_dnssec", "rollover_going_insecure",
and "rollover_straight2none" system tests into "rollover"

47 hours agofold rollover_csk_roll tests into rollover
Evan Hunt [Fri, 7 Aug 2026 04:00:29 +0000 (21:00 -0700)] 
fold rollover_csk_roll tests into rollover

merge the "rollover_csk_roll1" and "rollover_csk_roll2" system
tests into "rollover".

47 hours agofold rollover_algo_ksk_zsk into rollover
Evan Hunt [Fri, 7 Aug 2026 03:14:39 +0000 (20:14 -0700)] 
fold rollover_algo_ksk_zsk into rollover

merge the "rollover_algo_ksk_zsk" test into "rollover"

47 hours agofold rollover_algo_csk test into rollover
Evan Hunt [Fri, 7 Aug 2026 02:03:37 +0000 (19:03 -0700)] 
fold rollover_algo_csk test into rollover

"rollover" and related tests share a lot of common files. they
could be a single system test directory with modules using config
files rendered by jinja2.

this commit merges the "rollover_algo_csk" test into "rollover".

2 days agochg: test: Refactor the fwdfirst ans3 response server
Štěpán Balážik [Wed, 12 Aug 2026 16:05:27 +0000 (16:05 +0000)] 
chg: test: Refactor the fwdfirst ans3 response server

Serve the forged answer with a declarative `QnameQtypeHandler` scoped to the victim query, instead of an imperative handler that poisoned every A query.

Merge branch 'stepan/fwdfirst-asyncserver-cleanup' into 'main'

See merge request isc-projects/bind9!12527

2 days agoRefactor the fwdfirst ans3 response server 12527/head
Štěpán Balážik [Thu, 23 Jul 2026 11:02:39 +0000 (13:02 +0200)] 
Refactor the fwdfirst ans3 response server

Serve the forged answer with a declarative QnameQtypeHandler scoped to
the victim query instead of an imperative handler that poisoned every A
query.  ns.fwd.hack is reached only if the resolver wrongly follows the
poison referral, and the victim name is the query the test inspects.

Assisted-by: Claude:claude-fable-5
2 days agorem: usr: Remove the RFC 1918 reverse-lookup leakage warning
Ondřej Surý [Wed, 12 Aug 2026 14:14:47 +0000 (16:14 +0200)] 
rem: usr: Remove the RFC 1918 reverse-lookup leakage warning

When default empty zones are disabled, ``named`` would log an unthrottled
warning for every reverse (PTR) lookup of an RFC 1918 address that returned
NXDOMAIN from the Internet. This warning has been removed.

Merge branch 'ondrej/remove-warn_rfc1918' into 'main'

See merge request isc-projects/bind9!12312

2 days agoRemove the RFC 1918 reverse-leakage warning 12312/head
Ondřej Surý [Wed, 24 Jun 2026 11:24:43 +0000 (13:24 +0200)] 
Remove the RFC 1918 reverse-leakage warning

warn_rfc1918() logged a SECURITY-category warning on every cached
NXDOMAIN for a 7-label PTR/IN query whose negative SOA matched the
AS112 sinkhole. A resolver only reaches that state with the built-in
RFC 1918 reverse empty zones disabled or forwarded upstream; with
empty-zones-enable on (the default for a recursive view) those queries
are answered locally and the warning never fires.

The warning therefore only triggers on an already-misconfigured
resolver, where it is unthrottled and emitted once per query: a client
can replay or randomize matching PTR names to flood the logs. The empty
zones already prevent the leak, so the diagnostic earns little while the
log amplification is not worth keeping.

2 days agonew: dev: Add an agent skill for the isc_job/isc_async/isc_work APIs
Ondřej Surý [Wed, 12 Aug 2026 13:38:57 +0000 (15:38 +0200)] 
new: dev: Add an agent skill for the isc_job/isc_async/isc_work APIs

Documents when to use isc_job_run(), isc_async_run() or
isc_work_enqueue(), and the contract each one imposes. No functional
change.

Merge branch 'ondrej/add-isc_scheduling-skill' into 'main'

See merge request isc-projects/bind9!12405

2 days agoAdd the isc-async-scheduling agent skill 12405/head
Ondřej Surý [Tue, 14 Jul 2026 16:52:32 +0000 (18:52 +0200)] 
Add the isc-async-scheduling agent skill

Capture the three-way choice behind every deferred callback in BIND 9 —
isc_job_run() on the current loop, isc_async_run() as the only
thread-safe hand-off, isc_work_enqueue() to get blocking work off the
loop — and the contracts that keep each one safe: the unchecked
same-loop requirement of isc_job_run() and the silent run_jobs
corruption when a still-queued isc_job_t is re-armed, isc_async_run()
taking no reference on the target loop, the tombstone semantics of
isc_work_cancel(), and a work callback having neither isc_loop() nor
isc_tid() available while possibly running on the loop thread once the
worker is shutting down.

Assisted-by: claude:claude-opus-4-8
2 days agonew: dev: Add aligned memory allocation support to isc_mem
Ondřej Surý [Wed, 12 Aug 2026 13:38:00 +0000 (15:38 +0200)] 
new: dev: Add aligned memory allocation support to isc_mem

Restores the flags-based isc_mem_*x() API with ISC_MEM_ALIGN()
(removed earlier as unused) so that the upcoming false-sharing
fixes for the zone and database structures can request
cache-line-aligned memory, honored on every allocator path
including non-jemalloc builds.

Merge branch 'ondrej/re-add-aligned-allocations' into 'main'

See merge request isc-projects/bind9!12512

2 days agoRe-add the flags-based isc_mem_*x() API with ISC_MEM_ALIGN 12512/head
Ondřej Surý [Wed, 5 Aug 2026 18:39:35 +0000 (20:39 +0200)] 
Re-add the flags-based isc_mem_*x() API with ISC_MEM_ALIGN

This effectively reverts d9048b3db18 ("Remove ISC_MEM_ZERO and
isc_mem_*x() API") and 8ac679a9808 ("Remove ISC_MEM_ALIGN() memory
flag"); aligning the zone and database structures to cache lines
gives the flags a user again.  Unlike the removed version,
ISC_MEM_ALIGN() no longer degrades to a no-op without the jemalloc
API, and the memory context itself is once again allocated aligned
to the cache line size.

The non-jemalloc shim now has a single header-based implementation
instead of the malloc_usable_size()/malloc_size() variants: every
allocation carries a size_info header at a flags-derived offset
before the returned pointer, so the matching flags passed on
deallocation are enough to recover the base address and the exact
allocation size, and to INSIST that the alignment flags really do
match.  Aligned allocations always move on reallocation, which keeps
plain blocks malloc()/realloc() provenance and aligned blocks
aligned_alloc() provenance.

That split makes C23 free_sized()/free_aligned_sized() legal to use:
they are called with exact allocation sizes when the libc provides
them (new meson checks) and fall back to local free() wrappers
otherwise.  The cost is one size_info header per allocation in
non-jemalloc builds - the fallback and sanitizer configurations -
where memory accounting consequently returns to exact requested
sizes rather than malloc_usable_size().

2 days agochg: dev: Sharded client udp refcounts
Alessio Podda [Wed, 12 Aug 2026 12:49:21 +0000 (12:49 +0000)] 
chg: dev: Sharded client udp refcounts

All listening clients would try to attach to the same listening socket. By making the clients attach to the underlying sockets instead we can substantially reduce contention.

Merge branch 'alessio/sharded-udplistener-v2' into 'main'

See merge request isc-projects/bind9!12471

2 days agoRemove duplicate calls in isc__nm_udp_close 12471/head
Alessio Podda [Wed, 12 Aug 2026 08:54:17 +0000 (10:54 +0200)] 
Remove duplicate calls in isc__nm_udp_close

As an editing artifact, the calls to close the socket and stop the
timer were issued twice, this has been fixed.

2 days agoMake isc_nm_proxyudplistener into its own type
Alessio Podda [Tue, 28 Jul 2026 13:08:56 +0000 (15:08 +0200)] 
Make isc_nm_proxyudplistener into its own type

Keeping isc_nm_proxyudplistener as an instance of socket means that
proxyudp users would be slowed down by contention on high core count
machines.
It also leads to awkward code as you have an isc_nm_socket_t wrapping
a non-socket which itself wraps more isc_nm_socket_t.

With this commit, we apply the same change we did for isc_nm_udplistener
to isc_nm_proxyudplistener.

2 days agoMake isc_nm_udplistener into its own type
Alessio Podda [Fri, 10 Jul 2026 13:13:18 +0000 (15:13 +0200)] 
Make isc_nm_udplistener into its own type

The udplistener socket type wraps a group of SO_REUSEPORT udp sockets
bound to the same port and address. Since it is implemented as an
instance of isc_nmsocket_t, clients would need to attach to the
full udplistener instead of the individual sockets.
This is a great cause of contention on machines with high core count.

With this commit, we split isc_nm_udplistener out of isc_nmsocket_t,
and let clients attach to the underlying sockets, which are sharded
by thread.

2 days agochg: usr: Reject oversized and malformed DNSKEY records up front
Ondřej Surý [Wed, 12 Aug 2026 12:02:19 +0000 (14:02 +0200)] 
chg: usr: Reject oversized and malformed DNSKEY records up front

Oversized RSA key material in a DNSKEY record was only rejected
after it had been converted, allocating memory proportional to
the record size. Such records are now rejected before conversion,
as are Ed25519 and Ed448 keys with trailing bytes that were
previously silently ignored.

Closes #4537

Merge branch '4537-reject-oversized-DNSKEYs' into 'main'

See merge request isc-projects/bind9!12544

2 days agoSimplify ECDSA error handling 12544/head
Ondřej Surý [Mon, 10 Aug 2026 14:48:12 +0000 (16:48 +0200)] 
Simplify ECDSA error handling

The affected cleanup labels performed no cleanup and obscured returns.
Also plug a pre-existing leak while here: the error path taken when
deterministic-signing setup fails returned without destroying the
just-created digest context.

2 days agoMake the EdDSA exact-length contract explicit
Ondřej Surý [Mon, 10 Aug 2026 14:44:09 +0000 (16:44 +0200)] 
Make the EdDSA exact-length contract explicit

Now that raw_key_to_ossl() rejects anything but the exact key length,
passing the length by reference and writing it back on success only
obscures that contract.  Take the length by value and derive the
buffer bookkeeping from the algorithm's fixed key size.

2 days agoCheck RSA component sizes before conversion
Ondřej Surý [Mon, 10 Aug 2026 14:40:54 +0000 (16:40 +0200)] 
Check RSA component sizes before conversion

The modulus and exponent size limits were only enforced after
BN_bin2bn() had converted both components into BIGNUMs, so parsing an
attacker-supplied DNSKEY allocated memory proportional to the wire data
before any limit applied.  Bound the byte lengths first: the largest
accepted exponent (2^32 + 1) fits in five octets and a 4096-bit modulus
in 512, so oversized key material is now rejected before conversion.

This also rejects encodings that previously stayed within the bit-size
limits only because of leading zero octets, which RFC 3110 prohibits
anyway.

2 days agoRequire exact EdDSA key lengths
Ondřej Surý [Mon, 10 Aug 2026 14:39:06 +0000 (16:39 +0200)] 
Require exact EdDSA key lengths

A key blob longer than the fixed key size was accepted: the key was
imported from the expected-length prefix and the trailing bytes were
silently ignored.  For a DNSKEY this means two different RDATAs (with
two different key tags) could yield the same key, because nothing after
the import ever looks at the leftover bytes.  Treat any length mismatch
as an invalid key instead.

2 days agochg: test: Refactor the mismatchtcp ans2 response server
Štěpán Balážik [Wed, 12 Aug 2026 10:48:38 +0000 (10:48 +0000)] 
chg: test: Refactor the mismatchtcp ans2 response server

Match the Kaminsky-spoof case declaratively with a `QnameQtypeHandler` plus a protocol check, replacing the imperative match and the UDP/TCP branch.

Merge branch 'stepan/mismatchtcp-asyncserver-cleanup' into 'main'

See merge request isc-projects/bind9!12528

2 days agoRefactor the mismatchtcp ans2 response server 12528/head
Štěpán Balážik [Thu, 23 Jul 2026 20:49:16 +0000 (22:49 +0200)] 
Refactor the mismatchtcp ans2 response server

Match the Kaminsky-spoof case declaratively with a QnameQtypeHandler
and a protocol check, replacing the imperative match and the UDP/TCP
branch.  TCP queries fall through to the normal zone answer, as before.

Assisted-by: Claude:claude-fable-5
2 days agochg: test: Refactor the forward ans6 response server
Štěpán Balážik [Wed, 12 Aug 2026 10:09:02 +0000 (10:09 +0000)] 
chg: test: Refactor the forward ans6 response server

Rewrite the server in the declarative `isctest.asyncserver` style, one scoped handler per answered query instead of one branchy handler.

Includes a small `isctest.asyncserver` change — an `edns` attribute on `StaticResponseHandler` — because the two static handlers here need to advertise no EDNS declaratively rather than by overriding `get_responses()`. `forward/ans6` is its only user.

Merge branch 'stepan/forward-asyncserver-cleanup' into 'main'

See merge request isc-projects/bind9!12534

2 days agoRefactor the forward ans6 response server 12534/head
Štěpán Balážik [Thu, 23 Jul 2026 13:23:01 +0000 (15:23 +0200)] 
Refactor the forward ans6 response server

Rewrite it in the declarative isctest.asyncserver style, one scoped
handler per answered query instead of one branchy handler.  The static
answers advertise no EDNS, as before, so the resolver's DS-chase still
sees a non-EDNS forwarder.

Assisted-by: Claude:claude-fable-5
2 days agoAdd an edns attribute to StaticResponseHandler
Štěpán Balážik [Thu, 23 Jul 2026 13:22:48 +0000 (15:22 +0200)] 
Add an edns attribute to StaticResponseHandler

Let a static handler set the response's EDNS declaratively via a value
passed straight to use_edns(), instead of overriding get_responses().
The attribute is left unset by default, so EDNS stays untouched for
every existing handler.

Assisted-by: Claude:claude-fable-5
2 days agofix: usr: Fix update-policy grant external address passing
Mark Andrews [Wed, 12 Aug 2026 06:26:15 +0000 (16:26 +1000)] 
fix: usr: Fix update-policy grant external address passing

Only TCP client addresses are supposed to be passed to an `external` handler for the associated `update-policy` rule, but UDP client addresses were also being passed.  This could have caused the external handler to return a result it otherwise wouldn't. This has been fixed.

Closes #6061

Merge branch '6061-fix-grant-external-address-passing' into 'main'

See merge request isc-projects/bind9!12546

2 days agoTest passing update-policy grant external address to handler 12546/head
Mark Andrews [Mon, 10 Aug 2026 23:45:26 +0000 (09:45 +1000)] 
Test passing update-policy grant external address to handler

These addresses are only supposed to only be passed for TCP
connections.  There should be no address for UDP requests.

2 days agodns_ssu_external_match was called with an address for UDP
Mark Andrews [Mon, 10 Aug 2026 04:37:50 +0000 (14:37 +1000)] 
dns_ssu_external_match was called with an address for UDP

Addresses are only supposed to be passed to dns_ssu_external_match
when the connection comes from TCP or another mechanism which verifies
the source address.  This has been fixed.

3 days agofix: dev: Check for empty 'endpoints' list
Evan Hunt [Tue, 11 Aug 2026 07:55:48 +0000 (07:55 +0000)] 
fix: dev: Check for empty 'endpoints' list

Configuring an `http` block with `endpoints {};` previously caused
a crash in `named`. This is now rejected earlier by the configuration
check.

Closes #6330

Merge branch '6330-empty-endpoints' into 'main'

See merge request isc-projects/bind9!12548

3 days agoCheck for empty 'endpoints' list 12548/head
Evan Hunt [Tue, 11 Aug 2026 00:18:38 +0000 (17:18 -0700)] 
Check for empty 'endpoints' list

Configuring an http block with "endpoints {};" previously caused
a crash in named. This is now rejected earlier by the configuration
check.

3 days agofix: nil: Handle NUL in text files better
Mark Andrews [Tue, 11 Aug 2026 07:50:42 +0000 (17:50 +1000)] 
fix: nil: Handle NUL in text files better

NULs in text files usually indicate corruption.  Additionally embedded
NULs can cause text files to be interpreted differently to the way they
appear to be when read by humans.  NUL in text files now returns
token type isc_tokentype_unknown unless escaped or enclosed in double
quotes.

Fixes #5796

Merge branch 'marka-set-specials-zero' into 'main'

See merge request isc-projects/bind9!11669

3 days agoAdd examples of named.conf files with embedded NUL 11669/head
Mark Andrews [Thu, 19 Mar 2026 05:29:27 +0000 (16:29 +1100)] 
Add examples of named.conf files with embedded NUL

3 days agoHandle NUL in text files better
Mark Andrews [Wed, 11 Mar 2026 22:23:00 +0000 (09:23 +1100)] 
Handle NUL in text files better

NULs in text files indicate corruption.  Additionally embedded NULs
can cause text files to be interpreted differently to the way they
appear to be when read by humans.  NUL in text files now returns
token type isc_tokentype_unknown.

3 days agofix: dev: Fix crash in named-checkconf -n
Evan Hunt [Tue, 11 Aug 2026 07:01:00 +0000 (07:01 +0000)] 
fix: dev: Fix crash in named-checkconf -n

The `named-checkconf -n` option always triggered a crash due to an incorrect `REQUIRE`. This has been fixed, and a regression test added to the `checkconf` system test.

Closes #6314

Merge branch '6314-checkconf-n' into 'main'

See merge request isc-projects/bind9!12547

3 days agoFix crash in named-checkconf -n 12547/head
Evan Hunt [Tue, 11 Aug 2026 00:04:34 +0000 (17:04 -0700)] 
Fix crash in named-checkconf -n

The "named-checkconf -n" option always triggered a crash due to
an incorrect REQUIRE. This has been fixed, and a regression test
added to the checkconf system test.

3 days agofix: usr: Honor DNSSEC policy key tag ranges
Mark Andrews [Tue, 11 Aug 2026 05:09:31 +0000 (15:09 +1000)] 
fix: usr: Honor DNSSEC policy key tag ranges

When a DNSSEC policy configured a non-default tag-range, dnssec-keygen
and dnssec-ksr could accept generated keys outside that range. Both tools
now honor the configured minimum and maximum key tags.

Closes #6091

Merge branch '6091-fix-dns-kasp-key-tagmax' into 'main'

See merge request isc-projects/bind9!12539

3 days agoTest policy key tag ranges in dnssec-keygen 12539/head
Mark Andrews [Mon, 10 Aug 2026 04:15:56 +0000 (14:15 +1000)] 
Test policy key tag ranges in dnssec-keygen

Cover policy-driven key generation so a broken KASP range accessor
cannot silently disable key tag validation.

3 days agoReturn the maximum permitted KASP key tag
Mark Andrews [Mon, 10 Aug 2026 04:13:16 +0000 (14:13 +1000)] 
Return the maximum permitted KASP key tag

DNSSEC tools read the minimum tag for both bounds of a policy's key tag
range, so generated keys could be accepted outside the configured
range. Return the correct bound and assert the collision check's range
contract so invalid bounds fail instead of disabling validation.

4 days agofix: usr: A record from outside a response policy zone could stop named
Ondřej Surý [Mon, 10 Aug 2026 15:00:43 +0000 (17:00 +0200)] 
fix: usr: A record from outside a response policy zone could stop named

A response policy zone transferred from a primary can contain a record
whose name lies outside the zone. Such a record could stop named, both
when it arrived and again at every startup afterwards, because a
secondary keeps it in its own copy of the zone. Records like this are
now rejected and logged; previously one could also silently create a
policy entry for an unrelated name.

Closes #6304

Merge branch '6304-rpz-name2data-label-underflow' into 'main'

See merge request isc-projects/bind9!12522

4 days agoRename badname() and badowner() to have log_ prefix 12522/head
Ondřej Surý [Mon, 10 Aug 2026 14:05:35 +0000 (16:05 +0200)] 
Rename badname() and badowner() to have log_ prefix

The function names were little bit confusing, add a log_ prefix to make
it more clear these just log the condition and nothing more.

4 days agoTest a policy zone holding a record from outside the zone
Ondřej Surý [Thu, 6 Aug 2026 18:35:29 +0000 (20:35 +0200)] 
Test a policy zone holding a record from outside the zone

Getting an out-of-zone record into a policy zone does not need a crafted
transfer: lib/dns/master.c only drops such records for primaries, so a
secondary keeps whatever its own copy of the zone contains.  ns3 loads
one that already holds "com.", which is the state a secondary reaches
after a transfer that carried it, and is why the failure used to survive
a restart with the primary gone.

The checks read ns3's log rather than querying, so they do not depend on
when the zone expires; a secondary's expiry runs from the mtime of the
file it loaded, which for a file kept in the tree is whenever the tree
was last touched.

tests.sh fails on any "invalid rpz" complaint, which is how it catches
unexpected ones, so the message this zone exists to provoke is excluded
by name.

Assisted-by: Claude:claude-opus-5
4 days agoRequire RPZ owner names to lie within the policy zone
Ondřej Surý [Thu, 6 Aug 2026 18:35:21 +0000 (20:35 +0200)] 
Require RPZ owner names to lie within the policy zone

name2data() strips the policy zone origin off an owner name to get the
trigger name, without first checking that the origin is there to strip.
A zone transfer can carry a record from outside the zone, and a
secondary keeps such a record when it reloads its own copy of the zone,
so the owner name is not necessarily inside the policy zone.  A name
with fewer labels than the origin then underflowed an unsigned label
count and failed an assertion in dns_name_getlabelsequence().

Check that the name is a subdomain of what is being stripped, the way
dns_catz_update_process() does before splitting a catalog zone entry.
That also covers the case that did not crash: an out-of-zone name with
enough labels used to yield a trigger for some unrelated name, a policy
entry the operator never wrote.

name2ipkey() already rejected the same input, so follow it in reporting
the bad name and letting the rest of the zone load.

4 days agofix: dev: Fix -Wformat-truncation warning in totext_in_wks()
Michal Nowak [Mon, 10 Aug 2026 12:10:16 +0000 (14:10 +0200)] 
fix: dev: Fix -Wformat-truncation warning in totext_in_wks()

BIND 9 failed to build with GCC 16 at -O3: rendering a WKS record as text triggered a -Wformat-truncation error, which is fatal in developer builds. The port number is now printed with a 16-bit format specifier, so the compiler can see it always fits the output buffer.

Merge branch 'mnowak/fix-wks-format-truncation' into 'main'

See merge request isc-projects/bind9!12519

4 days agoFix -Wformat-truncation warning in totext_in_wks() 12519/head
Michal Nowak [Thu, 6 Aug 2026 08:53:55 +0000 (10:53 +0200)] 
Fix -Wformat-truncation warning in totext_in_wks()

GCC 16 at -O3 rejects the WKS port bitmap loop with:

  error: '%u' directive output may be truncated writing between 1 and
  10 bytes into a region of size 6 [-Werror=format-truncation=]

The INSIST() bounding the bitmap length keeps the printed port below
65536, but 'sr' escapes into inet_totext(), so the compiler must
assume every later call can clobber it and loses the range it needs
to prove the port fits.  Printing the port with '%hu' states the
16-bit bound in the format string instead of leaving it to be
re-derived from the bitmap length.

6 days agofix: usr: Prevent resolver crashes while processing DNS over TCP
Ondřej Surý [Sat, 8 Aug 2026 09:51:06 +0000 (11:51 +0200)] 
fix: usr: Prevent resolver crashes while processing DNS over TCP

Recursive resolvers could terminate with an assertion failure
while processing DNS responses over TCP under sustained traffic.
The failure was observed on resolvers configured globally with
forward only; the same transport path is also used by iterative
resolution.  This has been fixed.

Merge branch 'ondrej/prevent-resolver-crash-over-tcp' into 'main'

See merge request isc-projects/bind9!12536

6 days agoTest repeated StreamDNS read scheduling 12536/head
Ondřej Surý [Sat, 8 Aug 2026 08:30:51 +0000 (10:30 +0200)] 
Test repeated StreamDNS read scheduling

Exercise duplicate reads directly and stress resolver TCP responses.

Assisted-by: Codex:gpt-5