Commit graph

43963 commits

Author SHA1 Message Date
Mark Andrews
dcd040dea9 [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
2026-04-09 12:07:26 +10:00
Mark Andrews
bc9c2539e3 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 f45762a5be)
2026-04-09 00:34:15 +00:00
Michal Nowak
dbfc344e63 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
2026-04-08 11:40:42 +02:00
Mark Andrews
5ccfb936ca Fix strstr const inheritance issue in test code
A strstr call discarded the const attribute.  Rework the code
preserving the const attribute.
2026-04-08 08:57:05 +10:00
Mark Andrews
60288be50f [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
2026-04-08 07:58:22 +10:00
Mark Andrews
6982d10993 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 9ba03a1848)
2026-04-07 17:32:53 +00:00
Michal Nowak
9cef150dee [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
2026-04-07 17:32:31 +02:00
Michal Nowak
a83db4cc20 Use ubuntu-24.04 for RTD, bump Python version
(cherry picked from commit 3a8e2f7427)
2026-04-07 14:12:20 +00:00
Matthijs Mekking
819df0d19e [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
2026-04-07 08:33:13 +00:00
Matthijs Mekking
eed010c3a5 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 d9b6036e0f)
2026-04-07 08:32:58 +00:00
Matthijs Mekking
14be941e78 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 784a441e2d)
2026-04-07 08:32:58 +00:00
Matthijs Mekking
ad45cdd383 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 bc6dad585d)
2026-04-07 08:32:58 +00:00
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