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

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

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

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

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

27 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

34 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

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

38 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

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

39 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

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

40 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

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

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

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

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

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

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

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

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

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

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

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

42 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

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

43 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
44 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

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

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

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

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

44 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"

44 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"

44 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".

44 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"

44 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".

44 hours 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

45 hours 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
46 hours 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

47 hours 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.

47 hours 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

47 hours 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
47 hours 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

47 hours 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.

3 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

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

3 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
3 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
6 days agoPrevent duplicate StreamDNS read jobs
Ondřej Surý [Sat, 8 Aug 2026 05:24:26 +0000 (07:24 +0200)] 
Prevent duplicate StreamDNS read jobs

Coalesce repeated reads while an asynchronous StreamDNS job is pending.

7 days agofix: usr: Tighten EUI48 and EUI48 text parsing
Mark Andrews [Thu, 6 Aug 2026 15:40:02 +0000 (01:40 +1000)] 
fix: usr: Tighten EUI48 and EUI48 text parsing

Malformed EUI48 and EUI64 records could be accepted.  This
has been fixed.

Closes #6082

Merge branch '6082-tighten-eui48-and-eui64-parsing' into 'main'

See merge request isc-projects/bind9!12490

7 days agoCheck that bad EUI48 and EUI64 are caught 12490/head
Mark Andrews [Mon, 3 Aug 2026 04:58:22 +0000 (14:58 +1000)] 
Check that bad EUI48 and EUI64 are caught

Checks that missing leading zeros and trailing garbage is detected.

7 days agoTighten EUI48 and EUI64 text parser
Mark Andrews [Mon, 3 Aug 2026 04:42:51 +0000 (14:42 +1000)] 
Tighten EUI48 and EUI64 text parser

Check that leading zeros were present and that there wasn't
any garbage at the end of the token by generating the record
in canonical form and checking that the input matched.

7 days agofix: test: Fix named-checkzone 'CNAME and other data' tests
Mark Andrews [Thu, 6 Aug 2026 12:56:06 +0000 (22:56 +1000)] 
fix: test: Fix named-checkzone 'CNAME and other data' tests

Closes #6282

Merge branch '6282-fix-named-checkzone-cname-and-other-data-tests' into 'main'

See merge request isc-projects/bind9!12497

8 days agoCheck for expected error messages from named-checkzone 12497/head
Mark Andrews [Thu, 6 Aug 2026 02:29:28 +0000 (12:29 +1000)] 
Check for expected error messages from named-checkzone

Also fail any zone of with name bad-* that does not have
a expected error message.

8 days agoFix checkzone 'cname and other data' tests
Mark Andrews [Tue, 4 Aug 2026 05:44:20 +0000 (15:44 +1000)] 
Fix checkzone 'cname and other data' tests

* Fix path name pattern for 'cname and other data' tests.
* Fix errors in test files for AFSDB, OPENGPG and SMIMEA.
* Add test files for DSYNC, HHIT and BRID.
* Use TYPE69 for unknown type now the DSYNC (66) has been allocated.

8 days agochg: test: Deduplicate and unify named.conf.j2 in system tests
Nicki Křížek [Thu, 6 Aug 2026 11:50:25 +0000 (13:50 +0200)] 
chg: test: Deduplicate and unify named.conf.j2 in system tests

named.conf.j2 templates were unified across the system test code base.

Changes with possible functional impact:
- use a common template for root.hints which use `a.root-server.nil. IN A 10.53.0.1`: this may change the TTL of the record - I don't think the affected tests rely on it
- add missing `*-source` options: unless the tests are intentionally about testing `*-source` options, I believe it's just a copy-paste omission
- add missing `listen-on-v6 { none; }`: not specifying those is misconfiguration. tests that want IPv6 must explicitly specify which IPv6 to use
- set the `port @PORT@` if missing: not setting the port is clearly not intended, as that would default to port 53, which shouldn't be used in tests (with the exception of a couple of live internet tests)

Changes without any functional impact:
- drop `directory .` default option
- drop `recursive yes` default option
- drop `notify yes` default option
- replace space indentation with tabs
- introduce jinja2 templates for shared options and root hints and use those

Closes #5398

Merge branch '5398-named-conf-boilterplate' into 'main'

See merge request isc-projects/bind9!12474

8 days agoAdd meson lint check rejecting hand-indented template includes 12474/head
Nicki Křížek [Fri, 31 Jul 2026 13:56:39 +0000 (13:56 +0000)] 
Add meson lint check rejecting hand-indented template includes

An indented plain {% include %} pastes the included file at column zero
and a {% filter indent %} wrapper repeats the depth by hand;
{% include_indented %} replaces both. Reject them in CI so the system
test templates stay consistent.

Assisted-by: Claude:claude-fable-5
8 days agoDocument the ns template variable in the cookbook
Martin Basti [Wed, 29 Jul 2026 15:44:06 +0000 (15:44 +0000)] 
Document the ns template variable in the cookbook

The explanation of the auto-injected ns variable was dropped when the
shared plumbing templates were documented, leaving @ns.ip@ and
@ns.ip6@ undocumented while the _common/options/ partials are built
on them. Restore it to the cookbook.

Assisted-by: Claude:claude-fable-5
8 days agoAdd meson lint check enforcing tab indentation in test configs
Nicki Křížek [Tue, 28 Jul 2026 17:51:44 +0000 (17:51 +0000)] 
Add meson lint check enforcing tab indentation in test configs

Ensure the named.conf.j2 templates in system test stay consistent in the
future by adding a lint check that runs in CI.

Assisted-by: Claude:claude-fable-5
8 days agoUse tabs for indentation in system test named configs
Nicki Křížek [Tue, 28 Jul 2026 17:15:05 +0000 (17:15 +0000)] 
Use tabs for indentation in system test named configs

The system test named configs indented blocks with a mix of tabs,
spaces, and tab/space combinations. Reindent the space-indented lines
to one tab per block level to make the style uniform across all
tests.

Assisted-by: Claude:claude-fable-5
8 days agoDocument the shared _common config templates
Nicki Křížek [Thu, 23 Jul 2026 17:14:25 +0000 (17:14 +0000)] 
Document the shared _common config templates

Assisted-by: Claude:claude-fable-5
8 days agoUse the ns variable for instance addresses in config templates
Nicki Křížek [Thu, 23 Jul 2026 17:14:14 +0000 (17:14 +0000)] 
Use the ns variable for instance addresses in config templates

Statements referring to the instance's own address were switched to use
the @ns.ip@ and @ns.ip6@ variable syntax. References to other nsX
servers are kept as plain addresses.

Assisted-by: Claude:claude-fable-5
8 days agoUse the shared root hint file where local copies matched
Nicki Křížek [Thu, 23 Jul 2026 16:52:14 +0000 (16:52 +0000)] 
Use the shared root hint file where local copies matched

Use a shared root hint file and template in tests which had an identical
local copy of a root hint file.

Assisted-by: Claude:claude-fable-5
8 days agoUse the root-hint template for indented hint configs
Nicki Křížek [Tue, 28 Jul 2026 18:11:50 +0000 (20:11 +0200)] 
Use the root-hint template for indented hint configs

Replace the root hints boilerplate with a template in configs where the
config section should be indented, i.e. in view statements. While named
doesn't care about whitespace, use the ident filter to make the final
rendered config more readable.

Assisted-by: Claude:claude-fable-5
8 days agoUse the root-hint template for identical hint configs
Nicki Křížek [Tue, 28 Jul 2026 18:11:34 +0000 (20:11 +0200)] 
Use the root-hint template for identical hint configs

Replace hand-written root hint zone with the template in cases where it
exactly matches the reference.

Assisted-by: Claude:claude-fable-5
8 days agoUse partial options templates for non-standard named configs
Nicki Křížek [Thu, 23 Jul 2026 16:51:29 +0000 (16:51 +0000)] 
Use partial options templates for non-standard named configs

The divergence from the standard plumbing is relevant for these tests
and needs to stay in place. Use partial templates for the common
statements which can be templated.

Assisted-by: Claude:claude-fable-5
8 days agoUse the dual-stack options template where instances listen on IPv6
Nicki Křížek [Thu, 23 Jul 2026 16:51:20 +0000 (16:51 +0000)] 
Use the dual-stack options template where instances listen on IPv6

Options blocks whose plumbing matches the standard except for
listening on the instance's own IPv6 address get the
_common/options-dual.conf.j2 template.

Assisted-by: Claude:claude-fable-5