Commit graph

43951 commits

Author SHA1 Message Date
Matthijs Mekking
6d89bfdf03 [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
2026-04-07 08:23:57 +00:00
Matthijs Mekking
f58554d05a 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 e0f09bb374)
2026-04-07 09:44:30 +02:00
Matthijs Mekking
bd852b1f97 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 3ac1bb1c39)
2026-04-07 09:44:19 +02:00
Arаm Sаrgsyаn
a48b287d9f [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
2026-04-03 13:42:15 +00:00
Nicki Křížek
dcc78517be 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 187e571f4d)
2026-04-03 12:05:44 +00:00
Aram Sargsyan
913f290e75 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 141ff7bfa7)
2026-04-03 12:05:44 +00:00
Aram Sargsyan
d1537583a7 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 5c248e7d1a)
2026-04-03 12:05:44 +00:00
Ondřej Surý
c830233fb7 [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
2026-04-03 07:16:29 +02:00
Ondřej Surý
1be03f3a10 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 8a4990d6ff)
2026-04-03 04:34:20 +00:00
Evan Hunt
097c14da45 [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
2026-04-02 06:48:14 +00:00
Matthijs Mekking
52abfa3e07 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 1251ae896c)
2026-04-01 23:08:14 -07:00
Evan Hunt
96da856018 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 b8cb65db93)
2026-04-01 20:48:09 +00:00
Michal Nowak
b370aacc2d Merge tag 'v9.20.22' into bind-9.20 2026-04-01 14:55:45 +00:00
Michal Nowak
e6099075cd
Update BIND version for release 2026-03-31 18:31:08 +02:00
Michal Nowak
be696478c7 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
2026-03-31 18:24:44 +02:00
Michal Nowak
f497fdcbb9
Remove changelog for GL #5747 2026-03-31 18:05:04 +02:00
Nicki Křížek
b04dcddf6c [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
2026-03-31 17:57:42 +02:00
Michal Nowak
f27cdfd1c4
Remove release note for GL #5747
This has been reverted.
2026-03-31 17:46:18 +02:00
Michal Nowak
46f68ac9bf
Tweak and reword release notes 2026-03-31 17:44:46 +02:00
Michal Nowak
bd5dd326cc
Prepare release notes for BIND 9.20.22 2026-03-31 17:33:57 +02:00
Michal Nowak
dfc2610057
Generate changelog for BIND 9.20.22 2026-03-31 17:33:09 +02:00
Nicki Křížek
2616cf7759 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 2390bd3a8f)
2026-03-31 17:09:20 +02:00
Nicki Křížek
74e2d36549 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 ef57bd3a02)
2026-03-31 17:09:20 +02:00
Michal Nowak
e13990a9e1 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
2026-03-31 10:18:26 +02:00
Michal Nowak
2e59948e25 Update BIND version to 9.20.23-dev 2026-03-31 10:16:58 +02:00
Ondřej Surý
85ecb978f1 [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
2026-03-30 19:02:15 +02:00
Ondřej Surý
98f5caea05 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.

(cherry picked from commit 3f15f2d9e5)
2026-03-30 19:01:29 +02:00
Ondřej Surý
e4399fc6b2 [9.20] fix: usr: Count temporal problems with DNSSEC validation as attempts
After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

Closes #5760

Backport of MR !11589

Merge branch 'backport-5760-count-DNSSEC-temporal-errors-as-validation-attempts-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11763
2026-03-30 19:01:19 +02:00
Ondřej Surý
bd3c7d8014
Count temporal problems with DNSSEC validation as attempts
After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

(cherry picked from commit 6ba57a1f0f)
2026-03-30 13:07:15 +02:00
Ondřej Surý
545ce3ae22 [9.20] fix: dev: Backport test for update-policy per-type max quota bypass via crafted UPDATE messages
An authenticated DDNS client could bypass update-policy per-type record limits
(e.g. TXT(3)) by including padding records in the UPDATE message that are
silently skipped during processing in the main branch.

As BIND 9.20 is not affected, only backport the test.

Closes #5799

Backport of MR !11708

Merge branch 'backport-5799-fix-counter-desync-in-SSU-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11760
2026-03-30 12:31:31 +02:00
Ondřej Surý
4c33f83a45
Fix update-policy per-type max quota bypass via counter desynchronization
The prescan and main update loops in DNS UPDATE processing both used the
same counter to index the maxbytype[] quota array.  The prescan loop
always incremented the counter, but the main loop had 14 continue paths
that skipped the increment.  This allowed an authenticated DDNS client to
craft an UPDATE message with padding records (e.g. CNAME+A pairs that
trigger CNAME-conflict skips) to shift the counter and read wrong quota
entries, bypassing per-type record limits entirely.

Fix by incrementing the counter unconditionally at the start of each
iteration in the main loop.

(cherry picked from commit bac40394d5)
2026-03-30 11:11:46 +02:00
Arаm Sаrgsyаn
ce365083d9 [9.20] fix: usr: Fix the processing of empty catalog zone ACLs
The :iscman:`named` process could terminate unexpectedly when
processing a catalog zone ACL in an APL resource record that
was completely empty. This has been fixed.

Closes #5801

Backport of MR !11740

Merge branch 'backport-5801-catz-empty-apl-rr-bug-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11759
2026-03-27 14:34:35 +00:00
Mark Andrews
9be3bccf6d Test the ability to walk the iterators multiple times
It should be possible to walk APL, HIP, HTTPS and SVBC record
elements multiple times.  We now test this.

(cherry picked from commit aa2a41b2d1)
2026-03-27 12:45:25 +00:00
Mark Andrews
8a3408c3b1 Allow the dns_rdata_in_apl structure to be walked twice
The offset value should be set prior to calculating the length.

(cherry picked from commit f2fd54f4b2)
2026-03-27 12:38:01 +00:00
Mark Andrews
6159980235 Test walking apl list entries
(cherry picked from commit e435b0b7fb)
2026-03-27 12:38:01 +00:00
Aram Sargsyan
e3aa88080e Test an empty APL record as catalog zone ACL
Test that named can process an empty APL record as a valid catalog
zone ACL.

(cherry picked from commit b82966000e)
2026-03-27 12:38:01 +00:00
Aram Sargsyan
dbd86cb6d2 Allow empty APL records
Allow empty APL records because RFC 3123 (Section 4) says "zero or
more items". This fixes processing of a catalog zone ACL (which is
based on APL records) when the zone contains an empty APL record or
when a zone update arrives which creates an empty APL record.

(cherry picked from commit 35b8af229e)
2026-03-27 12:38:00 +00:00
Michał Kępień
05679bda00 [9.20] fix: ci: Fixes and tweaks for release-related jobs
Backport of MR !11720

Merge branch 'backport-michal/release-job-tweaks-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11756
2026-03-25 18:16:10 +01:00
Michał Kępień
d23180e325 Fix distros token deletion in CI
Clone the BIND 9 QA repository before invoking a script in it.

(cherry picked from commit 2ffae8e52a)
2026-03-25 17:13:48 +00:00
Michał Kępień
9eea72e0d0 Prevent unscheduled release publication
The "publish" job has no dependencies on other jobs, so nothing prevents
it from being accidentally started before the scheduled publication
date.  Although publication still requires confirmation via an SSH
connection to a dedicated, locked-down runner, performing that action
prematurely may have drastic consequences.  Therefore, it is worth
implementing additional safeguards.

Add an extra check to the "publish" job to ensure it can only be run on
the scheduled publication day.  In exceptional circumstances, this check
can be overridden by setting the FORCE_PUBLICATION CI variable to any
non-empty value.

(cherry picked from commit ce977f53b9)
2026-03-25 17:13:48 +00:00
Michał Kępień
0f86eafac7 Tighten dependencies for tag-related jobs
The "merge-tag" and "update-stable-tag" jobs currently use the
"manual_release_job_qa" YAML anchor, which makes them depend on the
"staging" job.  Meanwhile, both of these jobs require the tag they were
created for to be public for them to work.  While this is harmless, as
these jobs will simply fail if they are run too early, it still makes
sense for them to depend on the "publish" job instead, if only to reduce
confusion in the pipeline view.  Adjust the "needs" key for the
"merge-tag" and "update-stable-tag" jobs accordingly.

(cherry picked from commit 722290dce6)
2026-03-25 17:13:48 +00:00
Michał Kępień
d99835fffb Extend artifact lifetime for Cloudsmith build jobs
The commit.txt file produced by each Cloudsmith build job is required to
run the corresponding publication job.  Therefore, the artifact lifetime
for the former must be long enough to prevent the file from expiring
before the publication job is run.  Set the lifetime of the artifacts
created by Cloudsmith build jobs to one month to ensure that the
publication jobs can access them.

(cherry picked from commit ce09f8d0f8)
2026-03-25 17:13:48 +00:00
Michał Kępień
ae7b9384fa Fix building EVN & -S Cloudsmith packages
Setting "artifacts: false" for the dependency on the "publish-private"
job prevents the url-*.txt files produced by that job from being pulled
from GitLab when the jobs that build EVN & -S Cloudsmith packages are
run, effectively breaking the latter.  Fix by making these jobs depend
on the artifacts of the "publish-private" job.

(cherry picked from commit b36f17238b)
2026-03-25 17:13:47 +00:00
Michał Kępień
1785c22cd7 [9.20] chg: test: Rename "nsec3-delegation" to "nsec3_delegation"
The "nsec3-delegation" test was added in a release branch, before commit
e40db975d9 introduced the current system
test naming convention.  Rename the test to comply with that convention.

Backport of MR !11753

Merge branch 'backport-michal/rename-nsec3-delegation-test-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11754
2026-03-25 18:03:23 +01:00
Michał Kępień
b1b3958eff Rename "nsec3-delegation" to "nsec3_delegation"
The "nsec3-delegation" test was added in a release branch, before commit
e40db975d9 introduced the current system
test naming convention.  Rename the test to comply with that convention.

(cherry picked from commit 48bf3d3e65)
2026-03-25 17:07:00 +01:00
Ondřej Surý
ee7832ae58 [9.20] sec: usr: Fix crash when reconfiguring zone update policy during active updates
Fixed a crash that could occur when running rndc reconfig to change a zone's update policy (e.g., from allow-update to update-policy) while DNS UPDATE requests were being processed for that zone.

ISC would like to thank Vitaly Simonovich for bringing this issue to our attention.

Fixes #5817

Backport of MR !11707

Merge branch 'backport-5817-fix-crash-via-SSU-table-desynchronization-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11738
2026-03-25 17:06:46 +01:00
Ondřej Surý
feb5dc7f98 Add regression test for TOCTOU race in DNS UPDATE SSU handling
Race rndc reconfig (toggling between allow-update and update-policy)
against a stream of DNS UPDATEs for 5 seconds and verify that named
does not crash.

Before the fix, the race between send_update() and update_action()
reading the SSU table independently could trigger an assertion
failure (INSIST) when the zone's update policy changed between the
two reads.

(cherry picked from commit c503b6eee8)
2026-03-25 16:16:22 +01:00
Ondřej Surý
c409b9a939 Fix TOCTOU race in DNS UPDATE SSU table handling
Pass the SSU table through the update event struct from
send_update() to update_action() instead of reading it from the
zone twice.  If rndc reconfig changed the zone's update policy
between the two reads (e.g., from allow-update to update-policy),
send_update() would skip the maxbytype allocation but
update_action() would see a non-NULL ssutable, triggering
INSIST(ssutable == NULL || maxbytype != NULL) and crashing named.

The ssutable reference is now taken once in send_update() and
transferred to update_action() via the event struct, ensuring
both functions see the same value.

(cherry picked from commit c172416559)
2026-03-25 16:16:22 +01:00
Michał Kępień
b040b566fe Merge tag 'v9.20.21' into bind-9.20 2026-03-25 14:24:13 +00:00
Michal Nowak
3abd82f2bf [9.20] fix: ci: Set User-Agent for Sphinx to fix gitlab.gnome.org
The linkcheck started to fail because of a new check on gitlab.gnome.org
that now forbids Sphinx User-Agent, returnin 406 HTTP status.

    (       chapter10: line  115) broken    https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home - 406 Client Error: Not Acceptable for url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home

Backport of MR !11747

Merge branch 'backport-mnowak/linkcheck-set-user-agent-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11748
2026-03-25 12:38:20 +01:00