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'
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.
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.
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.
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.
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'
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.
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'
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.
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.
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.
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.
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.
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'
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.
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'
Š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.
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'
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.
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.
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.
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.
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.
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.
Š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'
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.
Š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'
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.
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'
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".
Š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'
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.
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'
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.
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.
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'
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().
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'
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.
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.
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'
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.
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.
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.
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.
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.
Š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'
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.
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.
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'
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.
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'
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.
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.
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.
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'
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.
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'
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.
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.
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'
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.
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'