]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 weeks agoAdd a test with an active truncated key
Evan Hunt [Sun, 3 May 2026 07:41:58 +0000 (00:41 -0700)] 
Add a test with an active truncated key

Check that an invalid truncated key is handled correctly.

6 weeks ago[9.20] fix: usr: Prevent crafted queries from degrading RRL performance
Ondřej Surý [Tue, 5 May 2026 05:07:28 +0000 (07:07 +0200)] 
[9.20] fix: usr: Prevent crafted queries from degrading RRL performance

With response rate limiting enabled, an attacker sending queries from many
spoofed source addresses could steer entries into the same slot of the
internal rate-limit table and slow down query processing on the affected
server. The table now uses a per-process keyed hash so the placement of
entries cannot be predicted or influenced from the network.

Closes #5906

Backport of MR !11950

Merge branch 'backport-5906-rrl-hash-collision-dos-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11952

6 weeks agoUse a keyed hash for the RRL bucket table
Ondřej Surý [Wed, 29 Apr 2026 16:20:03 +0000 (18:20 +0200)] 
Use a keyed hash for the RRL bucket table

The previous hash_key() was a deterministic, unkeyed (<<1) + add over the
key words.  An off-path attacker could invert it offline and submit
queries whose source /24, qname hash, and qtype map to a single bucket;
under chaining this turns every lookup into an O(N) walk under
rrl->lock and starves legitimate query processing on the very feature
deployed to mitigate DoS.

Replace it with isc_hash32(), which is HalfSipHash-2-4 keyed by a
per-process random seed, so collision sets cannot be precomputed.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit a6b7ce29c4cfab2ab1d46f48f21f531d5ffde942)

7 weeks ago[9.20] fix: ci: Use "git push --force-with-lease" for autorebases
Michał Kępień [Thu, 30 Apr 2026 20:38:25 +0000 (22:38 +0200)] 
[9.20] fix: ci: Use "git push --force-with-lease" for autorebases

If a merge request is merged to an autorebased branch while it is
getting rebased, the "git push -f" command at the end of the autorebase
job will cause the contents of that merge request to be silently deleted
from Git history even though the merge request will still be (correctly)
shown as "merged" by GitLab.

Use "git push --force-with-lease" instead to prevent force-pushing the
rebased version of the branch if it is pushed to after its pre-rebase
version is fetched by the autorebase job.  Report such an event
accordingly.  For simplicity, no retries are attempted as the problem is
expected to be resolved by the next autorebase and the chances of this
scenario happening in practice are already low to begin with.

Backport of MR !11939

Merge branch 'backport-michal/use-git-push-force-with-lease-for-autorebases-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11940

7 weeks agoUse "git push --force-with-lease" for autorebases
Michał Kępień [Thu, 30 Apr 2026 20:19:59 +0000 (22:19 +0200)] 
Use "git push --force-with-lease" for autorebases

If a merge request is merged to an autorebased branch while it is
getting rebased, the "git push -f" command at the end of the autorebase
job will cause the contents of that merge request to be silently deleted
from Git history even though the merge request will still be (correctly)
shown as "merged" by GitLab.

Use "git push --force-with-lease" instead to prevent force-pushing the
rebased version of the branch if it is pushed to after its pre-rebase
version is fetched by the autorebase job.  Report such an event
accordingly.  For simplicity, no retries are attempted as the problem is
expected to be resolved by the next autorebase and the chances of this
scenario happening in practice are already low to begin with.

(cherry picked from commit f5a7671107e0c51f2a30b0d15aa24298694cb77a)

7 weeks ago[9.20] new: ci: Set up automatic rebasing for security-* branches
Michał Kępień [Thu, 30 Apr 2026 11:27:56 +0000 (13:27 +0200)] 
[9.20] new: ci: Set up automatic rebasing for security-* branches

Introduce a set of private branches containing only security fixes that
are automatically rebased onto the corresponding open source branches
whenever new changes are merged.  Each rebase triggers a basic build,
failing the CI job if the build breaks.

When a security-* branch is rebased, create a CI pipeline for its new
revision and rebase its corresponding bind-9.x-sub branch (if it exists)
on top of it, creating a rebase chain.

Report any failures in the process via Mattermost.

These changes enable treating security fixes similarly to other code
changes, without deferring merges all the way until release prep.

Backport of MR !11930

Merge branch 'backport-michal/autorebase-chain-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11931

7 weeks agoSet up automatic rebasing for security-* branches
Michał Kępień [Thu, 30 Apr 2026 09:58:55 +0000 (11:58 +0200)] 
Set up automatic rebasing for security-* branches

Introduce a set of private branches containing only security fixes that
are automatically rebased onto the corresponding open source branches
whenever new changes are merged.  Each rebase triggers a basic build,
failing the CI job if the build breaks.

When a security-* branch is rebased, create a CI pipeline for its new
revision and rebase its corresponding bind-9.x-sub branch (if it exists)
on top of it, creating a rebase chain.

Report any failures in the process via Mattermost.

These changes enable treating security fixes similarly to other code
changes, without deferring merges all the way until release prep.

(cherry picked from commit af7d5e566ee0bf1d6c761a4301f7b3072d5080bd)

7 weeks ago[9.20] fix: usr: prevent malicious DNSSEC zones from exhausting validator CPU
Ondřej Surý [Thu, 30 Apr 2026 11:24:00 +0000 (13:24 +0200)] 
[9.20] fix: usr: prevent malicious DNSSEC zones from exhausting validator CPU

A DNSSEC-signed zone could publish a DNSKEY with an unusually large
RSA public exponent and force any validator resolving names in that
zone to spend disproportionate CPU verifying signatures.  The
validator now rejects such DNSKEYs, matching the limit already
applied to keys read from files or HSMs.

Closes #5881

Backport of MR !11917

Merge branch 'backport-5881-rsa-exponent-keytrap-cpu-amplification-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11923

7 weeks agoReject RSA DNSKEYs with oversize public exponents at parse time
Ondřej Surý [Thu, 30 Apr 2026 05:01:53 +0000 (07:01 +0200)] 
Reject RSA DNSKEYs with oversize public exponents at parse time

The wire-format RSA DNSKEY parser was the only key path with no upper
bound on the public exponent — opensslrsa_parse and opensslrsa_fromlabel
already cap at RSA_MAX_PUBEXP_BITS.  An attacker-controlled DNSKEY could
therefore force a validator to compute s^e mod n with e up to ~|n| bits,
amplifying every verify by ~120x for typical 2048-bit moduli (OpenSSL
itself only caps the exponent for moduli above 3072 bits).  Apply the
same bit-count cap to wire-format keys.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit ab8c1a77e06bf7fc969ad1fac20c3ae5a96257e5)

7 weeks ago[9.20] fix: usr: Stop delv from aborting on a malformed query name
Ondřej Surý [Thu, 30 Apr 2026 10:08:04 +0000 (12:08 +0200)] 
[9.20] fix: usr: Stop delv from aborting on a malformed query name

delv aborts with SIGABRT instead of exiting cleanly when given a query
name that fails wire-format conversion (e.g. a label longer than 63
octets). After this change delv prints the parse error and exits with
a normal failure code.

Closes #5916

Backport of MR !11921

Merge branch 'backport-5916-delv-run-resolve-null-detach-abort-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11927

7 weeks agoSkip detach when delv's client never created
Ondřej Surý [Thu, 30 Apr 2026 07:38:40 +0000 (09:38 +0200)] 
Skip detach when delv's client never created

run_resolve allocates dns_client_t late, but the cleanup epilogue
called dns_client_detach() unconditionally. When convert_name() or
dns_client_create() failed first, the detach hit a NULL client and
the REQUIRE(DNS_CLIENT_VALID) inside it aborted the process with
SIGABRT instead of a clean error exit.

Guard the detach with a NULL check. Add a digdelv test that runs
delv on a query name whose first label exceeds 63 octets and
asserts the process does not exit 134.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit dba102ef16821f91f0494f9db5c9a646dcab913f)

7 weeks ago[9.20] fix: usr: prevent rare named crash when notifies are cancelled
Ondřej Surý [Thu, 30 Apr 2026 10:04:06 +0000 (12:04 +0200)] 
[9.20] fix: usr: prevent rare named crash when notifies are cancelled

Under heavy load, named could occasionally crash when a queued
outbound notify or zone refresh was cancelled at the moment it
was being sent — for example, while a zone was being reloaded or
removed.  The race that caused the crash is now prevented.

Closes #5915

Backport of MR !11918

Merge branch 'backport-5915-ratelimiter-dequeue-tick-uaf-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11922

7 weeks agoDispatch ratelimiter events under the lock
Ondřej Surý [Thu, 30 Apr 2026 05:39:23 +0000 (07:39 +0200)] 
Dispatch ratelimiter events under the lock

isc__ratelimiter_tick() and isc_ratelimiter_shutdown() each pulled
events out of rl->pending into a function-local list, dropped the
mutex, and then iterated.  ISC_LIST_APPEND leaves the link in the
LINKED state, so a concurrent isc_ratelimiter_dequeue() saw an
event as still queued, called ISC_LIST_UNLINK against rl->pending —
which patched the prev/next of the local list — and freed the
event before dispatch finished, producing either an INSIST in the
unlink macro or a use-after-free in the dispatch loop.

isc_async_run() is a non-blocking wfcq enqueue, so there is no
benefit to dropping the mutex around it.  Unlink each event and
hand it to isc_async_run() while still holding rl->lock; the
existing ISC_LINK_LINKED check in dequeue then correctly
distinguishes "still queued and cancellable" from "already taken".

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 4d465f4fa58abb79b90d9019900e7d543fb511ea)

7 weeks ago[9.20] fix: dev: free per-command rndc state when response serialisation fails
Ondřej Surý [Thu, 30 Apr 2026 08:31:47 +0000 (10:31 +0200)] 
[9.20] fix: dev: free per-command rndc state when response serialisation fails

When isccc_cc_towire failed while building an rndc reply,
control_respond returned without releasing the per-command request,
response, HMAC secret copy, and text buffer.  They were eventually
freed when the connection closed, but until then the HMAC key copy
stayed in named's memory.  The failure path now goes through the
same cleanup label as every other error.

Closes #5913

Backport of MR !11915

Merge branch 'backport-5913-controlconf-control-respond-cleanup-leak-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11919

7 weeks agoRun conn_cleanup on isccc_cc_towire failure in control_respond
Ondřej Surý [Thu, 30 Apr 2026 04:29:21 +0000 (06:29 +0200)] 
Run conn_cleanup on isccc_cc_towire failure in control_respond

The bare return left conn->secret, conn->response, conn->request, and
conn->text pinned until the connection itself was torn down — every
other error in the function reaches conn_cleanup via goto, and the
success path falls into the same label, so the towire-failure return
was the lone outlier.  Send it through the existing cleanup path.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 1b681dfa2ff408f40ca5e3453e336ff8864af27c)

7 weeks ago[9.20] fix: dev: Fix swapped arguments in redirect2() single-label branch
Ondřej Surý [Thu, 30 Apr 2026 05:39:10 +0000 (07:39 +0200)] 
[9.20] fix: dev: Fix swapped arguments in redirect2() single-label branch

On a recursive resolver with nxdomain-redirect configured, an
NXDOMAIN result for a query whose qname is the root could corrupt
the view's nxdomain-redirect target, after which the redirect
feature stopped working for every subsequent query in that view
until named was restarted.

Closes #5908

Backport of MR !11908

Merge branch 'backport-5908-query-redirect2-name-copy-arg-swap-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11913

7 weeks agoFix swapped arguments in redirect2() single-label branch
Ondřej Surý [Wed, 29 Apr 2026 17:23:19 +0000 (19:23 +0200)] 
Fix swapped arguments in redirect2() single-label branch

For a query whose qname is the root, the labels==1 branch in
redirect2() called dns_name_copy(redirectname, view->redirectzone)
with arguments reversed, overwriting the view-global
nxdomain-redirect target with the empty redirectname rather than
copying the configured target into the per-query lookup name.  After
the corruption, view->redirectzone names the root, so
dns_name_issubdomain() makes redirect2() short-circuit for every
subsequent query and the nxdomain-redirect feature stops working
until named is restarted.

Triggering this needs the resolver to receive an NXDOMAIN for the
root from upstream, which does not happen in normal DNS operation.

Swap the arguments to match the dns_name_copy(source, dest)
signature.  Add a system test that issues a root query through the
nxdomain-redirect resolver and verifies the redirect feature still
works for a normal NXDOMAIN-producing query afterwards.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit c62f24f7eea4447609e4e3f14773ae7a1beb6709)

7 weeks ago[9.20] fix: usr: Fix rndc-confgen aborting on HMAC-SHA-384/512 keys above 512 bits
Ondřej Surý [Thu, 30 Apr 2026 05:06:31 +0000 (07:06 +0200)] 
[9.20] fix: usr: Fix rndc-confgen aborting on HMAC-SHA-384/512 keys above 512 bits

`rndc-confgen -A hmac-sha384` and `-A hmac-sha512` documented a `-b`
range of 1..1024, but any value above 512 aborted on hardened builds
instead of producing a key. The full advertised range now works.

Closes #5903

Backport of MR !11903

Merge branch 'backport-5903-hmac-generate-stack-overflow-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11910

7 weeks agoSize HMAC key generation buffers to the maximum block size
Ondřej Surý [Wed, 29 Apr 2026 14:23:10 +0000 (16:23 +0200)] 
Size HMAC key generation buffers to the maximum block size

hmac_generate() declared its on-stack nonce buffer as
unsigned char data[ISC_MAX_MD_SIZE], i.e. 64 bytes. That is the maximum
digest size, but the buffer is filled up to the algorithm's HMAC block
size, which is 128 bytes for SHA-384 and SHA-512. Asking rndc-confgen
for an HMAC-SHA-384 or HMAC-SHA-512 key with -b > 512 (the documented
range allows up to 1024) wrote past the end of the stack buffer; on
hardened builds this aborted with a stack-smash detector firing
instead of producing a key.

Use the existing ISC_MAX_BLOCK_SIZE (128) for the buffer so the full
1..1024 range advertised by -A hmac-sha{384,512} works as documented.
The matching key_rawsecret[64] in confgen's generate_key() is enlarged
the same way so the generated key fits when dumped to the buffer.

Add a system test that exercises rndc-confgen across the previously
overflowing keysizes; with -Db_sanitize=address it caught the abort
before the fix.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 46f6bb6364db1dcbbfb2a2add72cff45fd1bda22)

7 weeks ago[9.20] fix: usr: Fix suppressed missing-glue check in named-checkzone
Ondřej Surý [Wed, 29 Apr 2026 16:13:23 +0000 (18:13 +0200)] 
[9.20] fix: usr: Fix suppressed missing-glue check in named-checkzone

named-checkzone and named-checkconf -z silently skipped the
missing-glue check for any NS name that had already triggered an
extra-AAAA-glue warning, so zones missing required A glue could pass
validation and be deployed with broken delegations.

Backport of MR !11899

Merge branch 'backport-ondrej/check-tool-err-glue-code-collision-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11905

7 weeks agoResolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision
Ondřej Surý [Wed, 29 Apr 2026 12:03:38 +0000 (14:03 +0200)] 
Resolve ERR_MISSING_GLUE / ERR_EXTRA_AAAA value collision

Both constants were defined as 5. The symbol table used by checkns() to
deduplicate log messages keys on (name, error_code), so logging an
extra-AAAA error caused logged() to also return true for the
missing-glue check, silently skipping the entire missing-glue block for
the same name in named-checkzone and named-checkconf -z.

Convert the ERR_* defines to an auto-numbered enum so the compiler
guarantees the values stay pairwise distinct.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 72d21a08063400d9a3e9c3d13ccc5ac28bf457c1)

7 weeks ago[9.20] chg: nil: Disable licensing check for root.hints
Colin Vidal [Tue, 28 Apr 2026 14:51:41 +0000 (16:51 +0200)] 
[9.20] chg: nil: Disable licensing check for root.hints

Removing REUSE licensing header check for `root.hints` files.

Backport of MR !11893

Merge branch 'backport-colin/disable-licensing-check-roothints-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11894

7 weeks agoRemove licensing header check for `root.hint[s]`
Colin Vidal [Tue, 28 Apr 2026 13:46:57 +0000 (14:46 +0100)] 
Remove licensing header check for `root.hint[s]`

Removing REUSE licensing header check for `root.hint` and `root.hints`
files.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit 19a446f00e572e13597b080934e52e034f2a4cc3)

7 weeks ago[9.20] new: doc: Add AI coding assistants guidance to CONTRIBUTING.md
Ondřej Surý [Mon, 27 Apr 2026 08:58:12 +0000 (10:58 +0200)] 
[9.20] new: doc: Add AI coding assistants guidance to CONTRIBUTING.md

Adapted from the Linux kernel's Documentation/process/coding-assistants.rst
to the BIND 9 context. Adds three subsections under the existing
"Guidelines for Tool-Generated Content" section:

- Licensing and legal requirements (MPL-2.0, SPDX identifiers).
- Signed-off-by and Developer Certificate of Origin: AI agents must
  not add Signed-off-by trailers; only the human submitter may
  certify the DCO.
- Attribution: the Assisted-by: AGENT_NAME:MODEL_VERSION trailer
  for recording AI involvement, with an explicit prohibition on
  AI-added Co-Authored-By trailers (Co-Authored-By designates a
  human co-author who shares responsibility).

Backport of MR !11888

Merge branch 'backport-ondrej/coding-assistants-doc-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11891

7 weeks agoAdd AI coding assistants guidance to CONTRIBUTING.md
Ondřej Surý [Wed, 22 Apr 2026 13:01:34 +0000 (15:01 +0200)] 
Add AI coding assistants guidance to CONTRIBUTING.md

Adapted from the Linux kernel's Documentation/process/coding-assistants.rst
to the BIND 9 context. Adds three subsections under the existing
"Guidelines for Tool-Generated Content" section:

- Licensing and legal requirements (MPL-2.0, SPDX identifiers).
- Signed-off-by and Developer Certificate of Origin: AI agents must
  not add Signed-off-by trailers; only the human submitter may
  certify the DCO.
- Attribution: the Assisted-by: AGENT_NAME:MODEL_VERSION trailer
  for recording AI involvement, with an explicit prohibition on
  AI-added Co-Authored-By trailers (Co-Authored-By designates a
  human co-author who shares responsibility).

(cherry picked from commit 2339bcd49381f4ab58c3f7cc9f43e4edc57bbf67)

2 months ago[9.20] fix: usr: Fix named crash when processing SIG records in dynamic updates
Ondřej Surý [Fri, 17 Apr 2026 17:24:17 +0000 (19:24 +0200)] 
[9.20] fix: usr: Fix named crash when processing SIG records in dynamic updates

Previously, :iscman:`named` could abort if a client sent a dynamic update containing a SIG record (the legacy signature type) to a zone configured with an update-policy. The function `dns_db_findrdataset` had an incorrect requirements prerequisite that prevented SIG records being looked up, which was triggered as part of processing an UPDATE request and could be triggered remotely by any client permitted to send updates. This has been fixed by ensuring that SIG records are handled consistently with RRSIG records during update processing.

Closes #5818

Backport of MR !11864

Merge branch 'backport-5818-fix-update-of-sig-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11876

2 months agoAdd test for SIG in prequisites of dynamic update
Matthijs Mekking [Thu, 16 Apr 2026 14:17:34 +0000 (16:17 +0200)] 
Add test for SIG in prequisites of dynamic update

Make sure the nameserver correctly handles SIG records in the
prerequisites of the dynamic update. The first check is to ensure that
the prerequisites are not examined prior to checking the credentials.

The second test case checks that the SIG present prerequisite is
examined and therefore refuses the update. Also this should not trigger
an assertion failure in dns__db_findrdataset() (due to the REQUIRE()
only accepted dns_rdatatype_rrsig when the covers parameter was set).

(cherry picked from commit 51f27fda46870acea69835f82835ca857c000bd0)

2 months agoAdd AXFR regression test for SIG covers preservation
Ondřej Surý [Thu, 16 Apr 2026 11:25:03 +0000 (13:25 +0200)] 
Add AXFR regression test for SIG covers preservation

diff.c rdata_covers() runs on both dns_diff_apply (IXFR, ns/update.c
dynamic updates) and dns_diff_load (AXFR).  After the previous commit
refused SIG and NXT in dynamic updates, the AXFR path remains the
most natural way to drive legacy SIG records into a secondary's zone
DB and regression-gate the rdata_covers() fix.

The test adds ans11 as an AsyncDnsServer primary for a small zone
whose AXFR carries two SIG rdatas at the same owner with different
covered types (A, MX) and different TTLs (600, 1200), and declares
ns6 a secondary of that zone.  With the bug present, dns_diff_load
groups both tuples at typepair (SIG, 0) and the MX-covering record
inherits the first-seen TTL (600); the fix keeps them at (SIG, A)
and (SIG, MX) with their original TTLs.

rndc dumpdb -zones on the secondary is used to inspect stored state
directly, because the wire-level SIG query response merges
same-(owner,type,class) RRs and masks the per-rdataset TTLs.

(cherry picked from commit e9f880c78ff3c2f799763628060eca0f0d64e70f)

2 months agoRefuse SIG and NXT records in dynamic updates
Ondřej Surý [Thu, 16 Apr 2026 10:23:34 +0000 (12:23 +0200)] 
Refuse SIG and NXT records in dynamic updates

SIG (24) and NXT (30) are obsolete DNSSEC record types, superseded by
RRSIG and NSEC in RFC 3755.  Allowing them through dynamic update
exposes two distinct bugs that the surrounding GL#5818 work already
fixes as defense-in-depth:

  - dns__db_findrdataset() used to REQUIRE that (covers == 0 ||
    type == RRSIG), which aborts named when a SIG update reaches the
    prescan foreach_rr() call.  Fixed to accept dns_rdatatype_issig().
  - diff.c rdata_covers() used to test only RRSIG, dropping the
    covered-type field for SIG rdatas; the zone DB then filed every
    SIG rdataset under typepair (SIG, 0) instead of
    (SIG, covered_type) and follow-up adds collided at that bucket.
    Fixed to use dns_rdatatype_issig().

Both underlying bugs are still reachable via inbound zone transfer
(diff.c rdata_covers() runs from both dns_diff_apply on the IXFR path
and dns_diff_load on the AXFR path), so the type-helper fixes above
remain necessary.  For the dynamic-update path, the simplest and
safest posture is to refuse SIG and NXT outright at the front door in
ns/update.c, alongside the existing NSEC/NSEC3/non-apex-RRSIG
refusals.  KEY remains permitted because it is still used to carry
public keys for SIG(0) transaction authentication.

The existing tcp-self SIG regression test is repointed to assert
REFUSED on the SIG add, a symmetric NXT test is added, and the
SIG-via-dyn-update covers-bucket test is removed because it is no
longer reachable through this entry point; AXFR-based coverage of
diff.c rdata_covers() follows in a separate commit.

(cherry picked from commit 3a44a13232991ba054aa157a1c3ffb8376359b42)

2 months agoAdd regression test for SIG covers being dropped in dns_diff_apply
Ondřej Surý [Thu, 16 Apr 2026 09:16:40 +0000 (11:16 +0200)] 
Add regression test for SIG covers being dropped in dns_diff_apply

rdata_covers() in lib/dns/diff.c tests `type == dns_rdatatype_rrsig`
instead of dns_rdatatype_issig(), so for a legacy SIG (24) rdata it
returns 0 and the covered type is discarded on the dynamic-update /
IXFR path.  The zone DB then files every SIG rdataset under typepair
(SIG, 0) instead of (SIG, covered_type), and a follow-up add with a
different covers field but a different TTL collides at that bucket,
trips DNS_DBADD_EXACTTTL in qpzone, returns DNS_R_NOTEXACT, and comes
back to the client as SERVFAIL.

The new test adds a PTR to establish the node (tcp-self requires the
client IP's reverse form to equal the owner), then two SIG updates
with different covers and different TTLs; on a buggy build the second
update is SERVFAIL and named logs `dns_diff_apply: .../SIG/IN: add
not exact`.  The test is expected to pass once rdata_covers() is
switched to dns_rdatatype_issig(), matching the fix already adopted
for dns__db_findrdataset() on this branch and the helper pattern used
in master.c, xfrout.c, and qpcache.c.

(cherry picked from commit b9fc0e595b5f907654bc241efee5f942d57b7903)

2 months agoFix dropped covers field for SIG records in dns_diff_apply
Ondřej Surý [Thu, 16 Apr 2026 09:21:48 +0000 (11:21 +0200)] 
Fix dropped covers field for SIG records in dns_diff_apply

rdata_covers() in lib/dns/diff.c discriminated only on
dns_rdatatype_rrsig (46) and returned 0 for the legacy SIG (24), so
the covered-type field was silently discarded on the dynamic-update
and IXFR paths.  Every SIG rdataset was then filed in the zone DB
under typepair (SIG, 0) instead of (SIG, covered_type); a second SIG
add with a different covers but a different TTL collided at that
bucket, tripped DNS_DBADD_EXACTTTL in qpzone, returned
DNS_R_NOTEXACT, and came back to the client as SERVFAIL.

Use dns_rdatatype_issig() here so both SIG and RRSIG carry their
covers through the diff, matching the helper pattern already used in
lib/dns/master.c, lib/ns/xfrout.c, lib/dns/qpcache.c, and the
dns__db_findrdataset() REQUIRE that the surrounding merge request
just relaxed.

(cherry picked from commit 0a5ba57116857779680d76fe4b20e125f3bc3b71)

2 months agoAdd system test for SIG record handling in update-policy tcp-self
Ondřej Surý [Tue, 7 Apr 2026 14:40:36 +0000 (16:40 +0200)] 
Add system test for SIG record handling in update-policy tcp-self

Verify that a SIG record sent via TCP dynamic update is accepted
by the tcp-self update-policy and correctly stored in the zone.

(cherry picked from commit ecddeab6962fe7aab70ccaff56fab8f496316a9b)

2 months agoFix assertion failure in dns_db_findrdataset() for SIG records
Mark Andrews [Tue, 7 Apr 2026 14:39:57 +0000 (16:39 +0200)] 
Fix assertion failure in dns_db_findrdataset() for SIG records

dns__db_findrdataset() had a REQUIRE() that only accepted
dns_rdatatype_rrsig when the covers parameter was set.  A dynamic
update containing a SIG record (type 24) would trigger this
assertion, crashing named.  Use dns_rdatatype_issig() to accept
both SIG and RRSIG.

(cherry picked from commit 03edeccaa16991e05c101ae82a03568ae1b2dbd0)

2 months ago[9.20] fix: dev: Fix inverted gethostname() check in rndc status
Ondřej Surý [Fri, 17 Apr 2026 16:46:53 +0000 (18:46 +0200)] 
[9.20] fix: dev: Fix inverted gethostname() check in rndc status

The replacement of named_os_gethostname() with raw gethostname()
inverted the success check: the "localhost" fallback runs on success,
and on failure the uninitialized hostname buffer is read by snprintf(),
leaking stack memory via the rndc status reply.

Closes #5889

Backport of MR !11879

Merge branch 'backport-5889-fix-gethostname-inverted-check-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11881

2 months agoFix inverted gethostname() check in rndc status
Ondřej Surý [Fri, 17 Apr 2026 14:28:50 +0000 (16:28 +0200)] 
Fix inverted gethostname() check in rndc status

When named_os_gethostname() was replaced with raw gethostname(), the
success/failure polarity was flipped: the fallback to "localhost" now
runs on success and the hostname buffer is left uninitialized on
failure.  In the failure path, snprintf() then reads the uninitialized
stack buffer, disclosing stack contents via the rndc status reply.

(cherry picked from commit f7859247df222fa17a0ad52f8ce87816e06984ec)

2 months ago[9.20] chg: test: Reimplement xfer/ans5 using ControllableAsyncServer
Štěpán Balážik [Fri, 17 Apr 2026 15:16:41 +0000 (15:16 +0000)] 
[9.20] chg: test: Reimplement xfer/ans5 using ControllableAsyncServer

Backport of MR !11626

Merge branch 'backport-stepan/xfer-asyncserver-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11878

2 months agoReimplement xfer/ans5 using ControllableAsyncServer
Štěpán Balážik [Fri, 23 Jan 2026 18:51:45 +0000 (19:51 +0100)] 
Reimplement xfer/ans5 using ControllableAsyncServer

Remove the last usage of the `ans.pl` server and the server itself.

(cherry picked from commit f9ed3650acdc2c5b38d8b36729b045ca63f983ef)

2 months agoConvert responses to bytes before logging them in asyncserver
Štěpán Balážik [Wed, 21 Jan 2026 18:34:29 +0000 (19:34 +0100)] 
Convert responses to bytes before logging them in asyncserver

Ensure that the actual packet contents are logged including the TSIG
record which is calculated on `to_wire` call.

(cherry picked from commit 37b0502cf4c610fc629d45b9c086096228c735b6)

2 months agoImprove readability of endianness conversions
Štěpán Balážik [Fri, 10 Apr 2026 16:25:17 +0000 (18:25 +0200)] 
Improve readability of endianness conversions

Replace the less obvious and less explicit `struct.unpack()` and
`struct.pack()` calls with calls to `int.from_bytes()` and
`int.to_bytes()`, respectively.

(cherry picked from commit e43fa1dc5ad3cecd5b762b0bd8d4156e1c48595b)

2 months agoRefactor AxfrHandler and hoist it to isctest.asyncserver
Štěpán Balážik [Mon, 19 Jan 2026 21:04:32 +0000 (22:04 +0100)] 
Refactor AxfrHandler and hoist it to isctest.asyncserver

It will be useful in the xfer system test as well.

(cherry picked from commit a58952e1f74a4fc6726de955327d540f0d935049)

2 months agoFix FallbackTooManyRecordsAxfrHandler to follow convention
Štěpán Balážik [Mon, 19 Jan 2026 20:49:36 +0000 (21:49 +0100)] 
Fix FallbackTooManyRecordsAxfrHandler to follow convention

All the other subclasses AxfrHandler send three messages.
This oversight was inherited from the original Perl implementation of
the server and was not fixed in 46ecbbe where it was rewritten.

This allows refactoring and sharing of the superclass.

(cherry picked from commit 93a807948902eca1add65bc7bd57a445e1ab75f7)

2 months ago[9.20] new: ci: Add "assign-milestones" job to CI
Andoni Duarte [Fri, 17 Apr 2026 09:49:27 +0000 (09:49 +0000)] 
[9.20] new: ci: Add "assign-milestones" job to CI

After a release is signed (the "sign" job), the "assign-milestones" job
will assign issues and merge requests to the corresponding version
milestones.

Backport of MR !11868

Merge branch 'backport-andoni/add-assign-milestone-ci-job-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11871

2 months agoAdd job to assign issues and merge requests to version milestones
Andoni Duarte Pintado [Thu, 26 Feb 2026 09:06:48 +0000 (10:06 +0100)] 
Add job to assign issues and merge requests to version milestones

After a release is signed (the "sign" job), the "assign-milestones" job
will assign issues and merge requests to the corresponding version
milestones.

(cherry picked from commit ad95cdb9e2ffeca43a652df2042c90191a515ce8)

2 months ago[9.20] new: ci: Extend the prepare-release-announcement job to post release links
Andoni Duarte [Fri, 17 Apr 2026 08:53:49 +0000 (08:53 +0000)] 
[9.20] new: ci: Extend the prepare-release-announcement job to post release links

The prepare-release-announcement job is now extended so that after
creating the announcement MR, it posts a message with links to the newly
released versions to Mattermost.

Backport of MR !11860

Merge branch 'backport-andoni/extend-prepare-release-announcement-with-urls-message-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11869

2 months agoExtend the prepare-release-announcement job post release links
Andoni Duarte Pintado [Thu, 16 Apr 2026 13:59:27 +0000 (15:59 +0200)] 
Extend the prepare-release-announcement job post release links

The prepare-release-announcement job is now extended so that after
creating the announcement MR, it posts a message with links to the newly
released versions to Mattermost.

(cherry picked from commit a486a38a7f023d26bdb4b5e4008c0c9a13638a73)

2 months ago[9.20] new: doc: Document opt-in 🤖 marker for agent-authored issues and MRs
Ondřej Surý [Thu, 16 Apr 2026 17:10:39 +0000 (19:10 +0200)] 
[9.20] new: doc: Document opt-in 🤖 marker for agent-authored issues and MRs

Add short notes in CONTRIBUTING.md telling automated agents to append
🤖 to the title of issues and merge requests so they can be routed
through the streamlined agent triage/merge process.

Backport of MR !11861

Merge branch 'backport-ondrej/agent-contributing-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11862

2 months agoDocument opt-in 🤖 marker for agent-authored issues and MRs
Ondřej Surý [Thu, 16 Apr 2026 16:51:01 +0000 (18:51 +0200)] 
Document opt-in 🤖 marker for agent-authored issues and MRs

Add short notes in CONTRIBUTING.md telling automated agents to append
🤖 to the title of issues and merge requests so they can be routed
through the streamlined agent triage/merge process.

(cherry picked from commit 2ec8d3ce7ca7128bd0710d440671eb22146876a3)

2 months agoChange the CONTRIBUTING to use Developer's Certificate of Origin 1.1
Ondřej Surý [Thu, 16 Oct 2025 16:23:17 +0000 (18:23 +0200)] 
Change the CONTRIBUTING to use Developer's Certificate of Origin 1.1

(cherry picked from commit 845eb2ebbc0f07fd9588ba844e61d09afd4165e4)

2 months ago[9.20] chg: ci: Test development version of libuv in CI backport-5882-fxhash-fix-9.20
Štěpán Balážik [Wed, 15 Apr 2026 14:49:04 +0000 (14:49 +0000)] 
[9.20] chg: ci: Test development version of libuv in CI

Recently, a broken version of libuv was released breaking BIND on
several platforms. The offending [commit](https://github.com/libuv/libuv/issues/5030) was on the development branch
for months, but we didn't notice.

In nightly pipelines, build the current 'main' (actually 'v1.x') branch
of libuv and run the unit and system tests against it.

Backport of MR !11647

Merge branch 'backport-stepan/prelease-testing-for-libuv-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11842

2 months agoTest development version of libuv in CI
Štěpán Balážik [Mon, 9 Mar 2026 16:26:13 +0000 (17:26 +0100)] 
Test development version of libuv in CI

Recently, a broken version of libuv was released breaking BIND on
several platforms. The offending commit [1] was on the development
branch for months, but we didn't notice.

In nightly pipelines, build the current 'main' (actually 'v1.x') branch
of libuv and run the unit and system tests against it.

[1]: https://github.com/libuv/libuv/issues/5030

(cherry picked from commit 23d11de2b4024ab7eae3f2a2031a3ef1969b234c)

2 months ago[9.20] fix: usr: Remove unnecessary dns_name_free call
Mark Andrews [Wed, 15 Apr 2026 03:53:52 +0000 (13:53 +1000)] 
[9.20] fix: usr: Remove unnecessary dns_name_free call

When processing a catalog zone member's primaries definition and
there is a TXT record containing an invalid name TSIG key name,
dns_name_free was incorrectly called triggering an assertion.
This has been fixed.

Closes #5858

Backport of MR !11832

Merge branch 'backport-5858-remove-unnecessary-dns-name-free-call-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11848

2 months agoChecking invalid TSIG key name in a catalog zone
Mark Andrews [Fri, 10 Apr 2026 03:05:31 +0000 (13:05 +1000)] 
Checking invalid TSIG key name in a catalog zone

(cherry picked from commit 213e59ccf56f4d66cf65f363be4563f2e853d12f)

2 months agoRemove unnecessary dns_name_free call
Mark Andrews [Fri, 10 Apr 2026 03:07:26 +0000 (13:07 +1000)] 
Remove unnecessary dns_name_free call

When processing a catalog zone member's primaries definition and
there is a TXT record containing an invalid name TSIG key name,
dns_name_free was incorrectly called triggering an assertion.
This has been fixed.

(cherry picked from commit 9f411c93c4d87b8097d39024da5a9da447cddaf7)

2 months ago[9.20] fix: usr: Fix zone verification of NSEC3 signed zones 318792
Mark Andrews [Fri, 10 Apr 2026 08:08:15 +0000 (18:08 +1000)] 
[9.20] fix: usr: Fix zone verification of NSEC3 signed zones

Previously, when computing the compressed bitmap during verification of an NSEC3-signed zone, an undersized buffer was used that resulted in an out-of-bounds write if there were too many active windows in the bitmap. This impacted mirror zones which are NSEC3-signed, `dnssec-signzone` and `dnssec-verifyzone`. This has been fixed.

Closes #5834

Backport of MR !11804

Merge branch 'backport-5834-fix-cbm-size-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11833

2 months agoChecking maximal sized compresses bit map works
Mark Andrews [Fri, 10 Apr 2026 07:21:42 +0000 (17:21 +1000)] 
Checking maximal sized compresses bit map works

Add records that will be at end of each compressed bitmap less 1
of the NSEC3 record. Zone verification should still work.

(cherry picked from commit e9a58de251e87227d573937d7838544a89c3091e)

2 months agoUse the correct maximal compressed bit map buffer size
Mark Andrews [Thu, 26 Mar 2026 02:10:45 +0000 (13:10 +1100)] 
Use the correct maximal compressed bit map buffer size

There are up to 256 windows in a NSEC/NSEC3 compressed bit
map of 32 + 2 octets each.

(cherry picked from commit e43e4bd20a99860e79294afbcc9b75f01ff28c26)

2 months ago[9.20] new: test: System test requires the h2 module
Michal Nowak [Thu, 9 Apr 2026 15:55:47 +0000 (17:55 +0200)] 
[9.20] new: test: System test requires the h2 module

Backport of MR !11829

Merge branch 'backport-mnowak/require-h2-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11830

2 months agoSystem test requires the h2 module
Michal Nowak [Thu, 9 Apr 2026 14:53:29 +0000 (16:53 +0200)] 
System test requires the h2 module

(cherry picked from commit 8b4b1aa6d9ad9767fb5b152c4fe628daa164cb86)

2 months ago[9.20] fix: ci: Purge distros token in a separate CI job
Michał Kępień [Thu, 9 Apr 2026 11:48:45 +0000 (13:48 +0200)] 
[9.20] fix: ci: Purge distros token in a separate CI job

The "publish" job runs on a dedicated, locked-down runner that lacks the
Python modules necessary to execute the manage_distros_token.py script.
Instead of deleting the token within the "publish" job, purge it in a
separate job that automatically runs on the "base" image after the
"publish" job succeeds.  Define "rules" for the new job so that the
token is only deleted for security releases, as it should have been
initially.

Backport of MR !11817

Merge branch 'backport-michal/purge-distros-token-in-a-separate-ci-job-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11826

2 months agoPurge distros token in a separate CI job
Michał Kępień [Thu, 9 Apr 2026 11:23:57 +0000 (13:23 +0200)] 
Purge distros token in a separate CI job

The "publish" job runs on a dedicated, locked-down runner that lacks the
Python modules necessary to execute the manage_distros_token.py script.
Instead of deleting the token within the "publish" job, purge it in a
separate job that automatically runs on the "base" image after the
"publish" job succeeds.  Define "rules" for the new job so that the
token is only deleted for security releases, as it should have been
initially.

(cherry picked from commit 36411e7c84384168ab3c0e3d107be459326c1647)

2 months ago[9.20] chg: test: Bump ns6 reconfigure timeout to 30 seconds
Michal Nowak [Thu, 9 Apr 2026 04:46:19 +0000 (06:46 +0200)] 
[9.20] chg: test: Bump ns6 reconfigure timeout to 30 seconds

Rarely, RNDC fails to reconfigure zones on FreeBSD in the default 10
seconds.

Backport of MR !11820

Merge branch 'backport-mnowak/xfer-bump-reconfigure-timeout-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11821

2 months agoBump ns6 reconfigure timeout to 30 seconds
Michal Nowak [Wed, 8 Apr 2026 19:07:06 +0000 (21:07 +0200)] 
Bump ns6 reconfigure timeout to 30 seconds

Rarely, RNDC fails to reconfigure zones on FreeBSD in the default 10
seconds.

(cherry picked from commit 723c199daae4881911fc1ae6ac3c868c0370d551)

2 months ago[9.20] fix: doc: nsupdate does not handle zero length RDATA well
Mark Andrews [Thu, 9 Apr 2026 02:07:26 +0000 (12:07 +1000)] 
[9.20] fix: doc: nsupdate does not handle zero length RDATA well

Nsupdate does not distinguish between a non-existing RDATA field
and an empty RDATA field when determining which action is desired
when the RDATA field is empty. This only affects a few data types,
like APL, which allow an empty RDATA field.  Document a workaround
of using the '\# 0' form for entering these specific records. e.g.

    # delete the APL RRset
    update delete IN APL
    # delete the APL record with a zero length rdata
    update delete IN APL \# 0

Closes #5835

Backport of MR !11775

Merge branch 'backport-5835-nsupdate-doc-zero-length-rdata-how-to-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11823

2 months agonsupdate does not handle zero length RDATA well
Mark Andrews [Tue, 31 Mar 2026 01:26:42 +0000 (12:26 +1100)] 
nsupdate does not handle zero length RDATA well

Nsupdate does not distinguish between a non-existing RDATA field
and an empty RDATA field when determining which action is desired
when the RDATA field is empty. This only affects a few data types,
like APL, which allow an empty RDATA field.  Document a workaround
of using the '\# 0' form for entering these specific records. e.g.

    # delete the APL RRset
    update delete IN APL
    # delete the APL record with a zero length rdata
    update delete IN APL \# 0

(cherry picked from commit f45762a5beea8dd07604e49ba225bebe09f9f970)

2 months agofix: test: Fix strstr const inheritance issue in test code
Michal Nowak [Wed, 8 Apr 2026 09:40:42 +0000 (11:40 +0200)] 
fix: test: Fix strstr const inheritance issue in test code

The const property was discarded by a strstr call in test-data.c.
This has been fixed.

Closes #5861

Merge branch '5861-fix-const-inheritance-issue-in-test' into 'bind-9.20'

See merge request isc-projects/bind9!11815

2 months agoFix strstr const inheritance issue in test code
Mark Andrews [Tue, 7 Apr 2026 22:57:05 +0000 (08:57 +1000)] 
Fix strstr const inheritance issue in test code

A strstr call discarded the const attribute.  Rework the code
preserving the const attribute.

2 months ago[9.20] fix: test: Check exit status of dig and nsupdate in nsupdate system test
Mark Andrews [Tue, 7 Apr 2026 21:58:22 +0000 (07:58 +1000)] 
[9.20] fix: test: Check exit status of dig and nsupdate in nsupdate system test

Add missing failure checks to six dig and nsupdate invocations in nsupdate system test so that command failures are properly caught instead of silently ignored.

Backport of MR !11811

Merge branch 'backport-marka/check-return-codes-in-nsupdate-test-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11813

2 months agoCheck exit status of dig and nsupdate in nsupdate system test
Mark Andrews [Thu, 19 Mar 2026 04:18:46 +0000 (15:18 +1100)] 
Check exit status of dig and nsupdate in nsupdate system test

Add missing `|| ret=1` to six dig and nsupdate invocations in
tests.sh so that command failures are properly caught instead
of silently ignored.

(cherry picked from commit 9ba03a1848904b605f64fbfe3dab00b551828e4b)

2 months ago[9.20] new: doc: Use ubuntu-24.04 for RTD, bump Python version
Michal Nowak [Tue, 7 Apr 2026 15:32:31 +0000 (17:32 +0200)] 
[9.20] new: doc: Use ubuntu-24.04 for RTD, bump Python version

Backport of MR !11806

Merge branch 'backport-mnowak/rtd-image-bump-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11809

2 months agoUse ubuntu-24.04 for RTD, bump Python version
Michal Nowak [Tue, 7 Apr 2026 11:35:03 +0000 (13:35 +0200)] 
Use ubuntu-24.04 for RTD, bump Python version

(cherry picked from commit 3a8e2f742716cd209b500db0431d18627fccf291)

2 months ago[9.20] chg: dev: Fix off by one error in dnssec-ksr sign
Matthijs Mekking [Tue, 7 Apr 2026 08:33:13 +0000 (08:33 +0000)] 
[9.20] chg: dev: Fix off by one error in dnssec-ksr sign

If the inception time of the signature is exactly equal to the inactive time of the key, add the signature.

Backport of MR !11791

Merge branch 'backport-matthijs-skr-off-by-one-bug-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11795

2 months agoAlso fix off by one error in system test
Matthijs Mekking [Thu, 2 Apr 2026 08:54:53 +0000 (10:54 +0200)] 
Also fix off by one error in system test

The system test was also subject to the same off by one bug that also
existed in the code. That is: if the inception time of the signature
is exactly equal to the inactive time of the key, we still have to
expect the signature.

(cherry picked from commit d9b6036e0f3b6a407e0035edbe6da613660219f4)

2 months agoAdd fast test case
Matthijs Mekking [Thu, 2 Apr 2026 08:06:08 +0000 (10:06 +0200)] 
Add fast test case

This specific test case triggered a bug where the SKR included bundles
with unsigned DNSKEY RRsets (signatures where omitted because the
inception time was equal to the inactive time of the key).

(cherry picked from commit 784a441e2d8eb86d32d5e79202d03fc4a6838289)

2 months agoFix off by one error in dnssec-ksr sign
Matthijs Mekking [Thu, 2 Apr 2026 08:01:27 +0000 (10:01 +0200)] 
Fix off by one error in dnssec-ksr sign

If the inception time of the signature is exactly equal to the
inactive time of the key, still include the signature. Otherwise there
may be corner cases where signatures are omitted erroneously.

(cherry picked from commit bc6dad585d897234cae63f3ebe2d8b962329ef35)

2 months ago[9.20] chg: dev: Revert isdelegation() to return boolean value again
Matthijs Mekking [Tue, 7 Apr 2026 08:23:57 +0000 (08:23 +0000)] 
[9.20] chg: dev: Revert isdelegation() to return boolean value again

Closes #5838

Backport of MR !11792

Merge branch 'backport-5838-cid-645252-control-flow-issues-deadcode-in-validator-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11802

2 months agoRename isdelegation() to is_insecure_referral()
Matthijs Mekking [Thu, 2 Apr 2026 09:20:32 +0000 (11:20 +0200)] 
Rename isdelegation() to is_insecure_referral()

The name 'isdelegation()' was confusing. This function is not checking
whether this message is a delegation, but whether the denial of
existence proofs in this message is a proof of a referral to an
unsigned zone.

The name 'is_unsecure_referral()' is more appropriate.

(cherry picked from commit e0f09bb3743015b405ae48c9664f46a422f546e2)

2 months agoRevert isdelegation() to return boolean value again
Matthijs Mekking [Thu, 2 Apr 2026 09:16:29 +0000 (11:16 +0200)] 
Revert isdelegation() to return boolean value again

The isdelegation() was changed to return an isc_result_t because the
idea was to have a separate return value DNS_R_NSEC3ITERRANGE to signal
to the caller we could not verify the proof because of too many
iterations in the NSEC3 record, or perhaps ISC_R_UNEXPECTED for a more
generic cause that verification was not done.

But this would make error handling more fragile and all we care about
is whether we can reliably say the NS bit was not set.

If we can not reliably say so, we have to treat it as an insecure
referrral.

Since the answer is either yes or no, we can revert back to returning
a boolean value.

(cherry picked from commit 3ac1bb1c391394d23a40facd424e49acfa5513bf)

2 months ago[9.20] fix: usr: Fix a possible race condition during zone transfers
Arаm Sаrgsyаn [Fri, 3 Apr 2026 13:42:15 +0000 (13:42 +0000)] 
[9.20] fix: usr: Fix a possible race condition during zone transfers

The :iscman:`named` process could terminate unexpectedly
when processing an IXFR message during a zone transfer.
This has been fixed.

Closes #5767

Backport of MR !11781

Merge branch 'backport-5767-use-after-free-xfrin_reset-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11799

2 months agoRewrite xfer/ans11/ans.py to use AsyncDnsServer
Nicki Křížek [Thu, 2 Apr 2026 12:40:25 +0000 (12:40 +0000)] 
Rewrite xfer/ans11/ans.py to use AsyncDnsServer

Replace the hand-rolled threaded socket server with the standard
AsyncDnsServer framework used by other ans.py servers in the test suite.

The DNS wire-format message builders (IXFR diff, AXFR, SOA, SERVFAIL)
are retained unchanged since they produce carefully crafted messages
needed to trigger the IXFR->AXFR race condition. The server
infrastructure is replaced:

- Manual TCP/UDP socket management and threading replaced by
  AsyncDnsServer, which handles both protocols, pidfile lifecycle,
  and signal handling.
- Query parsing replaced by the framework's dns.message-based parser;
  query dispatch moved into IxfrRaceHandler.get_responses().
- The axfr_done_event threading.Event replaced by a boolean instance
  variable on IxfrRaceHandler, safe within the single asyncio event
  loop.
- For IXFR over TCP, the handler yields two BytesResponseSend actions
  (msg1 then msg2) so the framework sends both with TCP length prefixes,
  preserving the race-triggering sequence.
- For IXFR over UDP, the TC flag is set on the response to force TCP
  retry.
- Unused encode_name_compressed() and parse_dns_query() removed.

Also fix a timing issue that might result in the initial transfer not
being done by the time the test is executed -- since ns11 is started
after ns6. Ensure the initial transfer has happened before running the
ixfr_race test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 187e571f4d21a13508bf6cda9ff09c5ce8a67dca)

2 months agoFix a race condition in xfrin_recv_done() when calling xfrin_reset()
Aram Sargsyan [Wed, 4 Mar 2026 16:25:33 +0000 (16:25 +0000)] 
Fix a race condition in xfrin_recv_done() when calling xfrin_reset()

When the xfrin_recv_done() function decides to retry the transfer
using AXFR because of a previous error, it calls the xfrin_reset()
function which calls dns_db_closeversion() on 'xfr->ver'. The problem
is that the ixfr processing of a previous message could be still
in process in a worker thread, which then can use freed 'xfr->ver'.

If there is an ongoing worker thread delay the AXFR retry until after
the worker thread has finished its work.

(cherry picked from commit 141ff7bfa7bf97b5d2b55a8417c847ac81ca5bc1)

2 months agoAdd a test to check for IXFR->AXFR race-condition
Aram Sargsyan [Thu, 5 Mar 2026 11:15:38 +0000 (11:15 +0000)] 
Add a test to check for IXFR->AXFR race-condition

The test initiates a zone transfer with IXFR, which produces
a big amount of differences and then generates an error. The
secondary should be able to gracefully shutdown the ongoing
IXFR transfer and retry with AXFR without race conditions
between them.

This test checks for an issue (GL#5767) but since a race
condition is usually time-sensitive it might require several
attempts before it reproduces the issue.

(cherry picked from commit 5c248e7d1acb97468d304d0e44f0074c5fbfc750)

2 months ago[9.20] new: test: Add regression test for NSEC proof after unsigned-to-signed IXFR
Ondřej Surý [Fri, 3 Apr 2026 05:16:29 +0000 (07:16 +0200)] 
[9.20] new: test: Add regression test for NSEC proof after unsigned-to-signed IXFR

Test that a secondary receiving an IXFR transitioning a zone from
unsigned to NSEC-signed returns the correct covering NSEC record
for empty non-terminal names.

Backport of MR !11786

Merge branch 'backport-ondrej/fix-nsec-ixfr-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11797

2 months agoAdd regression test for NSEC proof after unsigned-to-signed IXFR
Ondřej Surý [Thu, 2 Apr 2026 08:45:03 +0000 (10:45 +0200)] 
Add regression test for NSEC proof after unsigned-to-signed IXFR

Test that a secondary receiving an IXFR transitioning a zone from
unsigned to NSEC-signed returns the correct covering NSEC record
for empty non-terminal names.

Add isctest.query.wait_for_serial() shared helper for waiting until
a server has a specific SOA serial.

(cherry picked from commit 8a4990d6ff692b50c3b295456b74b33441337cde)

2 months ago[9.20] fix: usr: Use the zone file's basename as origin in DNSSEC tools
Evan Hunt [Thu, 2 Apr 2026 06:48:14 +0000 (06:48 +0000)] 
[9.20] fix: usr: Use the zone file's basename as origin in DNSSEC tools

In `dnssec-signzone` and `dnssec-verify`, when the zone origin is not specified using the `-o` parameter, the default behavior is to try to sign using the zone's file name as the origin. So, for example, `dnssec-signzone -S example.com` will work, so long as the file name matches the zone name.

This now also works if the zone is in a different directory. For example, `dnssec-signzone -S zones/example.com` will set the origin value to `example.com`.

Closes #5678

Backport of MR !11360

Merge branch 'backport-5678-signzone-basename-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11784

2 months agoTest dnssec tools using zone file basename as origin
Matthijs Mekking [Wed, 1 Apr 2026 09:11:55 +0000 (11:11 +0200)] 
Test dnssec tools using zone file basename as origin

Add test cases where dnssec-signzone and dnssec-verify use the
zone file's basename as the origin when '-o' is omitted.

(cherry picked from commit 1251ae896c06c1a2e8c7953042f859847dacfa6b)

2 months agouse the zone file's basename as origin in dnssec tools
Evan Hunt [Wed, 10 Dec 2025 00:52:44 +0000 (16:52 -0800)] 
use the zone file's basename as origin in dnssec tools

In dnssec-signzone and dnssec-verify, if the zone origin is not
specified using the `-o` parameter, the default behavior is to try
to use the zone's file name as the origin. So, for example,
`dnssec-signzone -S example.com` or 'dnssec-verify example.com'
will work, so long as the file name matches the zone name.

This now also works if the zone is in a different directory.
For example, `dnssec-signzone -S zones/example.com` or
'dnssec-verify zones/example.com' will set the origin value
to `example.com`.

(cherry picked from commit b8cb65db93a3daeb01f55d157580f492ded066fa)

2 months agoMerge tag 'v9.20.22' into bind-9.20
Michal Nowak [Wed, 1 Apr 2026 14:55:45 +0000 (14:55 +0000)] 
Merge tag 'v9.20.22' into bind-9.20

2 months agoUpdate BIND version for release v9.20.22
Michal Nowak [Tue, 31 Mar 2026 16:31:08 +0000 (18:31 +0200)] 
Update BIND version for release

2 months agonew: doc: Prepare documentation for BIND 9.20.22
Michal Nowak [Tue, 31 Mar 2026 16:24:44 +0000 (18:24 +0200)] 
new: doc: Prepare documentation for BIND 9.20.22

This has been reverted.

Merge branch 'mnowak/prepare-documentation-for-bind-9.20.22' into 'v9.20.22-release'

See merge request isc-private/bind9!972

2 months agoRemove changelog for GL #5747
Michal Nowak [Tue, 31 Mar 2026 16:05:04 +0000 (18:05 +0200)] 
Remove changelog for GL #5747

2 months ago[9.20] chg: nil: License test data files in REUSE.toml
Nicki Křížek [Tue, 31 Mar 2026 15:57:42 +0000 (17:57 +0200)] 
[9.20] chg: nil: License test data files in REUSE.toml

In order to avoid the need to repeat the license header in named.conf
files and zone files, add the paths to REUSE.toml to assign the license.

Backport of MR !11766

Merge branch 'backport-nicki/reuse-cover-configs-and-zones-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11773

2 months agoRemove release note for GL #5747
Michal Nowak [Tue, 31 Mar 2026 14:20:02 +0000 (16:20 +0200)] 
Remove release note for GL #5747

This has been reverted.

2 months agoTweak and reword release notes
Michal Nowak [Tue, 31 Mar 2026 10:14:13 +0000 (12:14 +0200)] 
Tweak and reword release notes

2 months agoPrepare release notes for BIND 9.20.22
Michal Nowak [Tue, 31 Mar 2026 15:33:57 +0000 (17:33 +0200)] 
Prepare release notes for BIND 9.20.22

2 months agoGenerate changelog for BIND 9.20.22
Michal Nowak [Tue, 31 Mar 2026 15:33:09 +0000 (17:33 +0200)] 
Generate changelog for BIND 9.20.22

2 months agoRemove license header files from _common test files
Nicki Křížek [Mon, 30 Mar 2026 15:53:08 +0000 (17:53 +0200)] 
Remove license header files from _common test files

These are either config file or zone file snippets. Their license is
declared in REUSE.toml.

(cherry picked from commit 2390bd3a8f636d45f017c8a61cabde243bf16a23)

2 months agoLicense test data files in REUSE.toml
Nicki Křížek [Mon, 30 Mar 2026 15:52:14 +0000 (17:52 +0200)] 
License test data files in REUSE.toml

In order to avoid the need to repeat the license header in named.conf
files and zone files, add the paths to REUSE.toml to assign the license.

All shared snippets in bin/tests/system/_common and
bin/tests/system/**named.conf* files are covered.

Note that the existing rule **/**.db** already covers zone files. Only
remove the extraneous special-cases.

(cherry picked from commit ef57bd3a02ff458e8c542ba9447f15106aae3a60)

2 months agochg: doc: Set up version for BIND 9.20.23
Michal Nowak [Tue, 31 Mar 2026 08:18:26 +0000 (10:18 +0200)] 
chg: doc: Set up version for BIND 9.20.23

Merge branch 'mnowak/set-up-version-for-bind-9.20.23' into 'bind-9.20'

See merge request isc-projects/bind9!11771

2 months agoUpdate BIND version to 9.20.23-dev
Michal Nowak [Tue, 31 Mar 2026 08:16:58 +0000 (10:16 +0200)] 
Update BIND version to 9.20.23-dev

2 months ago[9.20] chg: nil: Fix INSIST copy-paste error checking RADIX_V4 instead of RADIX_V6
Ondřej Surý [Mon, 30 Mar 2026 17:02:15 +0000 (19:02 +0200)] 
[9.20] chg: nil: Fix INSIST copy-paste error checking RADIX_V4 instead of RADIX_V6

The INSIST in isc_radix_insert() checks node->data[RADIX_V4] and
node->node_num[RADIX_V4] twice due to a copy-paste error, never
verifying the RADIX_V6 fields.

Fix the second pair to check RADIX_V6.

Backport of MR !11664

Merge branch 'backport-ondrej/fix-copy-paste-error-checking-RADIX_V4-instead-of-RADIX_V6-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11686