Commit graph

40390 commits

Author SHA1 Message Date
Ondřej Surý
3e5fedfcfa 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 72d21a0806)
2026-04-29 15:32:03 +00:00
Colin Vidal
54b53117ef [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11895
2026-04-28 17:33:17 +02:00
Colin Vidal
c3f47e7b60 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 19a446f00e)
2026-04-28 15:58:18 +01:00
Ondřej Surý
fe14066331 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11892
2026-04-27 10:54:19 +02:00
Ondřej Surý
6ccb6f95f6 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 2339bcd493)
2026-04-27 08:12:34 +00:00
Ondřej Surý
df77c239ac [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11877
2026-04-20 12:14:57 +02:00
Matthijs Mekking
ab16e86a50
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 51f27fda46)
2026-04-20 11:21:14 +02:00
Ondřej Surý
a625a797e3
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 e9f880c78f)
2026-04-20 11:21:14 +02:00
Ondřej Surý
a61f9a09d7
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 3a44a13232)
2026-04-20 11:21:14 +02:00
Ondřej Surý
c3ccf8b287
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 b9fc0e595b)
2026-04-20 11:21:14 +02:00
Ondřej Surý
b575dbfd9e
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 0a5ba57116)
2026-04-20 11:21:14 +02:00
Ondřej Surý
88a87068fa
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 ecddeab696)
2026-04-20 11:21:14 +02:00
Mark Andrews
89c363b555
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 03edeccaa1)
2026-04-20 11:21:14 +02:00
Nicki Křížek
bb63fd9dac [9.18] chg: test: Move conftest log initialization to conftest.py
Backport of !8519

Merge branch 'backport-mr8519-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!11884
2026-04-20 11:14:10 +02:00
Tom Krizek
7a3f632b49 Move conftest log initialization to conftest.py
Initializing the conftest logging upon importing the isctest package
isn't practical when there are standalone pieces which can be used
outside of the testing framework, such as the asyncdnsserver module.

(cherry picked from commit 673387c4d5)
2026-04-20 10:29:16 +02:00
Ondřej Surý
c874e39a23 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11883
2026-04-17 18:46:49 +02:00
Ondřej Surý
8213b31e17
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 f7859247df)
2026-04-17 17:58:17 +02:00
Andoni Duarte
34f709db40 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11872
2026-04-17 09:49:44 +00:00
Andoni Duarte Pintado
d8b8347bbb 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 ad95cdb9e2)
2026-04-17 09:42:51 +00:00
Andoni Duarte
6bdc5ed1d6 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11870
2026-04-17 08:53:43 +00:00
Andoni Duarte Pintado
0c9377f436 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 a486a38a7f)
2026-04-17 08:52:06 +00:00
Ondřej Surý
c2c49ae8ed [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11863
2026-04-16 19:10:33 +02:00
Ondřej Surý
644e023409
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 2ec8d3ce7c)
2026-04-16 19:05:31 +02:00
Ondřej Surý
37bb5026e8
Change the CONTRIBUTING to use Developer's Certificate of Origin 1.1
(cherry picked from commit 845eb2ebbc)
2026-04-16 19:05:27 +02:00
Štěpán Balážik
5897f01054 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11843
2026-04-15 14:25:09 +00:00
Štěpán Balážik
be216b0080 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 23d11de2b4)
2026-04-15 13:42:24 +00:00
Mark Andrews
46aa4fd08d [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11849
2026-04-15 13:46:45 +10:00
Mark Andrews
298e60f877 Checking invalid TSIG key name in a catalog zone
(cherry picked from commit 213e59ccf5)
2026-04-15 12:21:48 +10:00
Mark Andrews
7c45caf6fe 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 9f411c93c4)
2026-04-15 12:21:48 +10:00
Mark Andrews
3a2e16ae65 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11834
2026-04-10 18:07:49 +10:00
Mark Andrews
abefcf7156 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 e9a58de251)
2026-04-10 17:28:34 +10:00
Mark Andrews
7f485d3a63 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 e43e4bd20a)
2026-04-10 06:23:59 +00:00
Michal Nowak
5717e5756f [9.18] new: test: System test requires the h2 module
Backport of MR !11829

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

See merge request isc-projects/bind9!11831
2026-04-09 17:55:56 +02:00
Michal Nowak
e10b61ba0c System test requires the h2 module
(cherry picked from commit 8b4b1aa6d9)
2026-04-09 15:39:17 +00:00
Michał Kępień
90127d5035 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11827
2026-04-09 13:48:49 +02:00
Michał Kępień
fe0eb473a6 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 36411e7c84)
2026-04-09 11:25:43 +00:00
Mark Andrews
95afb0f5b5 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11824
2026-04-09 12:07:11 +10:00
Mark Andrews
86fd564373 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:20 +00:00
Mark Andrews
8c45bb77b0 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11814
2026-04-08 07:57:36 +10:00
Mark Andrews
f768082d4b 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:58 +00:00
Michal Nowak
7137abcb2e [9.18] new: doc: Use ubuntu-24.04 for RTD, bump Python version
Backport of MR !11806

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

See merge request isc-projects/bind9!11810
2026-04-07 17:32:36 +02:00
Michal Nowak
ad249fcb74 Use ubuntu-24.04 for RTD, bump Python version
(cherry picked from commit 3a8e2f7427)
2026-04-07 14:12:25 +00:00
Matthijs Mekking
83e5e8c4d0 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11803
2026-04-07 08:26:17 +00:00
Matthijs Mekking
b5f3e92fa7 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:53:34 +02:00
Matthijs Mekking
33a3e1ebff 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:52:27 +02:00
Ondřej Surý
284a9e3a83 [9.18] 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.18' into 'bind-9.18'

See merge request isc-projects/bind9!11798
2026-04-03 07:46:17 +02:00
Ondřej Surý
c4123edd56
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 06:59:56 +02:00
Michal Nowak
c753aa955d Merge tag 'v9.18.48' into bind-9.18 2026-04-01 14:56:16 +00:00
Michal Nowak
b7f82d8c37
Update BIND version for release 2026-03-31 18:31:29 +02:00
Michal Nowak
979fbce8ca new: doc: Prepare documentation for BIND 9.18.48
Merge branch 'mnowak/prepare-documentation-for-bind-9.18.48' into 'v9.18.48-release'

See merge request isc-private/bind9!973
2026-03-31 18:28:09 +02:00