]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
8 months agoAdd debugging for the crash 5507-debug-branch
Ondřej Surý [Fri, 5 Sep 2025 16:49:19 +0000 (18:49 +0200)] 
Add debugging for the crash

8 months agochg: doc: Document rndc dnssec -step
Petr Špaček [Thu, 4 Sep 2025 13:49:56 +0000 (13:49 +0000)] 
chg: doc: Document rndc dnssec -step

Related to #4606

Merge branch '4606-document-rndc-dnssec-step' into 'main'

See merge request isc-projects/bind9!10941

8 months agoDocument rndc dnssec -step
Matthijs Mekking [Thu, 4 Sep 2025 07:45:11 +0000 (09:45 +0200)] 
Document rndc dnssec -step

This documentation was missing from !10774.

8 months agofix: dev: RPZ 'servfail-until-ready': skip updating SERVFAIL cache
Petr Špaček [Wed, 3 Sep 2025 13:23:38 +0000 (13:23 +0000)] 
fix: dev: RPZ 'servfail-until-ready': skip updating SERVFAIL cache

In order to not pollute the SERVFAIL cache with the configured
SERVFAIL answers while RPZ is loading, set the NS_CLIENTATTR_NOSETFC
attribute for the client.

Merge branch 'aram/rpz-servfail-until-ready-tunings' into 'main'

See merge request isc-projects/bind9!10904

8 months agoLog the servfail-until-ready message not faster than once per second
Aram Sargsyan [Wed, 27 Aug 2025 15:25:43 +0000 (15:25 +0000)] 
Log the servfail-until-ready message not faster than once per second

Since the log level has been raised, busy servers can "explode" from
the amount of log messages. Use the usual practice of logging "every
once in a while".

8 months agoChange the "RPZ not ready yet" message and its log level
Aram Sargsyan [Wed, 27 Aug 2025 14:35:09 +0000 (14:35 +0000)] 
Change the "RPZ not ready yet" message and its log level

The "RPZ not ready yet" message is logged at debug 3 level. Use the
info level instead for better visibility.

After raising the log level, the rpz_log_fail_helper() function starts
appending " failed: " the the message. Change the log message so it
makes more sense.

8 months agoRPZ 'servfail-until-ready': skip updating SERVFAIL cache
Aram Sargsyan [Wed, 27 Aug 2025 14:33:01 +0000 (14:33 +0000)] 
RPZ 'servfail-until-ready': skip updating SERVFAIL cache

In order to not pollute the SERVFAIL cache with the configured
SERVFAIL answers while RPZ is loading, set the NS_CLIENTATTR_NOSETFC
attribute for the client.

8 months agochg: doc: Clarify rrset-order random distribution
Ondřej Surý [Wed, 3 Sep 2025 06:50:50 +0000 (08:50 +0200)] 
chg: doc: Clarify rrset-order random distribution

The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.

Closes #5485

Merge branch 'ondrej/clarify-rrset-order-random' into 'main'

See merge request isc-projects/bind9!10909

8 months agoClarify rrset-order random distribution
Ondřej Surý [Thu, 28 Aug 2025 09:40:37 +0000 (11:40 +0200)] 
Clarify rrset-order random distribution

The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.

8 months agonew: usr: Support for parsing HHIT and BRID records has been added
Mark Andrews [Wed, 3 Sep 2025 00:47:37 +0000 (10:47 +1000)] 
new: usr: Support for parsing HHIT and BRID records has been added

Closes #5444

Merge branch '5444-add-hhit-and-brid-records' into 'main'

See merge request isc-projects/bind9!10795

8 months agoAdd tests for BRID and HHIT
Mark Andrews [Wed, 30 Jul 2025 05:22:05 +0000 (15:22 +1000)] 
Add tests for BRID and HHIT

8 months agoAdd support for parsing and displaying BRID rdata type
Mark Andrews [Wed, 30 Jul 2025 03:12:13 +0000 (13:12 +1000)] 
Add support for parsing and displaying BRID rdata type

8 months agoAdd support for parsing and displaying HHIT rdata type
Mark Andrews [Wed, 30 Jul 2025 03:11:40 +0000 (13:11 +1000)] 
Add support for parsing and displaying HHIT rdata type

8 months agofix: usr: RPZ canonical warning displays zone entry incorrectly
Mark Andrews [Tue, 2 Sep 2025 23:41:18 +0000 (09:41 +1000)] 
fix: usr: RPZ canonical warning displays zone entry incorrectly

When an IPv6 rpz prefix entry is entered incorrectly the log
message was just displaying the prefix rather than the full
entry.  This has been corrected.

Closes #5491

Merge branch '5491-rpz-canonical-warning-displays-zone-entry-incorrectly' into 'main'

See merge request isc-projects/bind9!10890

8 months agoAdd non canonical form entry to trigger log message
Mark Andrews [Mon, 25 Aug 2025 01:19:37 +0000 (11:19 +1000)] 
Add non canonical form entry to trigger log message

8 months agoRPZ canonical warning displays zone entry incorrectly
Mark Andrews [Mon, 25 Aug 2025 00:32:36 +0000 (10:32 +1000)] 
RPZ canonical warning displays zone entry incorrectly

Do not insert a NUL into ip_str too early as the full value
is needed later.  Only insert the NUL immediately before
displaying just the prefix string.

8 months agorem: nil: Remove qname/qtype from dns_adb_createfind() call
Ondřej Surý [Tue, 2 Sep 2025 19:41:05 +0000 (21:41 +0200)] 
rem: nil: Remove qname/qtype from dns_adb_createfind() call

Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.

Merge branch 'ondrej/minor-dns_adb-cleanup' into 'main'

See merge request isc-projects/bind9!10918

8 months agoRemove qname/qtype from dns_adb_createfind() call
Ondřej Surý [Sun, 31 Aug 2025 17:34:35 +0000 (19:34 +0200)] 
Remove qname/qtype from dns_adb_createfind() call

Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.

8 months agochg: test: Wait for rekey_done log in rollover system tests
Matthijs Mekking [Tue, 2 Sep 2025 13:03:08 +0000 (13:03 +0000)] 
chg: test: Wait for rekey_done log in rollover system tests

Waiting for "keymgr: done" logs caused some manual-mode tests to fail intermittently. Waiting for "rekey done" logs should be more reliable.

Closes #5493

Merge branch '5493-algoroll-csk-step3-manual-unstable-test' into 'main'

See merge request isc-projects/bind9!10923

8 months agoWait for rekey_done log in rollover system tests
Matthijs Mekking [Mon, 1 Sep 2025 15:11:51 +0000 (17:11 +0200)] 
Wait for rekey_done log in rollover system tests

Waiting for "keymgr: done" logs caused some manual-mode tests to fail
intermittently. Waiting for "rekey done" logs should be more reliable.

8 months agochg: dev: Lazily allocate fetch counter
Alessio Podda [Tue, 2 Sep 2025 09:57:30 +0000 (09:57 +0000)] 
chg: dev: Lazily allocate fetch counter

The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.

Merge branch 'alessio/lazy-fetch-counter-alloc' into 'main'

See merge request isc-projects/bind9!10917

8 months agoLazily allocate fetch counter
Alessio Podda [Sat, 30 Aug 2025 07:21:20 +0000 (09:21 +0200)] 
Lazily allocate fetch counter

The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.

8 months agonew: test: Test another 'stale-answer-client-timeout 0' scenario
Andoni Duarte [Tue, 2 Sep 2025 08:50:18 +0000 (08:50 +0000)] 
new: test: Test another 'stale-answer-client-timeout 0' scenario

Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.

Closes #5372

Merge branch '5372-serve-stale-crash-on-insist-unreachable-test' into 'main'

See merge request isc-projects/bind9!10920

8 months agoTest another 'stale-answer-client-timeout 0' scenario
Aram Sargsyan [Wed, 18 Jun 2025 13:29:53 +0000 (13:29 +0000)] 
Test another 'stale-answer-client-timeout 0' scenario

Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.

8 months agorem: usr: Obsolete the "tkey-domain" statement
Michał Kępień [Mon, 1 Sep 2025 20:29:23 +0000 (22:29 +0200)] 
rem: usr: Obsolete the "tkey-domain" statement

Mark the ``tkey-domain`` statement as obsolete, since it has not had any
effect on server behavior since support for TKEY Mode 2 (Diffie-Hellman)
was removed (in BIND 9.20.0).

See #4204

Merge branch '4204-obsolete-tkey-domain' into 'main'

See merge request isc-projects/bind9!10798

8 months agoObsolete the "tkey-domain" statement
Michał Kępień [Mon, 1 Sep 2025 19:35:33 +0000 (21:35 +0200)] 
Obsolete the "tkey-domain" statement

The "tkey-domain" statement has effectively been a no-op since commit
bd4576b3cef88bcb78ae0dd7619019be4fdfb2ea, which removed the only bit of
code using it: the logic implementing TKEY Mode 2 (Diffie-Hellman).

A subsequent cleanup commit, 885c132f4ae6d895ee973648e15d9e61d01555a8,
also missed the opportunity to remove the "tkey-domain" statement
altogether.

Mark the "tkey-domain" statement as obsolete and remove all code and
documentation related to it.

8 months agorem: usr: Deprecate the "tkey-gssapi-credential" statement
Michał Kępień [Mon, 1 Sep 2025 19:33:33 +0000 (21:33 +0200)] 
rem: usr: Deprecate the "tkey-gssapi-credential" statement

The :any:`tkey-gssapi-keytab` statement allows GSS-TSIG to be set up in
a simpler and more reliable way than using the
:any:`tkey-gssapi-credential` statement and setting environment
variables (e.g. ``KRB5_KTNAME``). Therefore, the
:any:`tkey-gssapi-credential` statement has been deprecated;
:any:`tkey-gssapi-keytab` should be used instead.

For configurations currently using a combination of both
:any:`tkey-gssapi-keytab` *and* :any:`tkey-gssapi-credential`, the
latter should be dropped and the keytab pointed to by
:any:`tkey-gssapi-keytab` should now only contain the credential
previously specified by :any:`tkey-gssapi-credential`.

See #4204

Merge branch '4204-deprecate-tkey-gssapi-credential' into 'main'

See merge request isc-projects/bind9!10782

8 months agoDeprecate the "tkey-gssapi-credential" statement
Michał Kępień [Mon, 1 Sep 2025 19:23:30 +0000 (21:23 +0200)] 
Deprecate the "tkey-gssapi-credential" statement

The "tkey-gssapi-keytab" statement enables GSS-TSIG to be set up in a
simpler and more reliable way than using the "tkey-gssapi-credential"
statement and setting environment variables (e.g. KRB5_KTNAME).

Mark the "tkey-gssapi-credential" statement as deprecated to eventually
only have one method for setting up GSS-TSIG in named.  Do not mention
"tkey-gssapi-credential" in the section of the ARM on dynamic updates.

8 months agonew: ci: Add Debian "trixie"
Michal Nowak [Mon, 1 Sep 2025 15:05:34 +0000 (17:05 +0200)] 
new: ci: Add Debian "trixie"

Merge branch 'mnowak/add-debian-trixie' into 'main'

See merge request isc-projects/bind9!10827

8 months agoDrop unused env variable SCANBUILD
Michal Nowak [Mon, 18 Aug 2025 14:56:48 +0000 (16:56 +0200)] 
Drop unused env variable SCANBUILD

8 months agoscan-build does not need to wait for previous stages
Michal Nowak [Wed, 6 Aug 2025 15:49:34 +0000 (17:49 +0200)] 
scan-build does not need to wait for previous stages

8 months agoMake "trixie" the base image
Michal Nowak [Tue, 5 Aug 2025 16:23:10 +0000 (18:23 +0200)] 
Make "trixie" the base image

8 months agoMove CI and QA tools from Debian "sid" to "trixie"
Michal Nowak [Tue, 5 Aug 2025 16:19:34 +0000 (18:19 +0200)] 
Move CI and QA tools from Debian "sid" to "trixie"

Debian "sid" is not a stable test bed and should be avoided.

8 months agoAdd Debian "trixie"
Michal Nowak [Tue, 5 Aug 2025 16:16:15 +0000 (18:16 +0200)] 
Add Debian "trixie"

8 months agochg: nil: Refactoring in the qpcache and qpzone
Ondřej Surý [Thu, 28 Aug 2025 18:11:14 +0000 (20:11 +0200)] 
chg: nil: Refactoring in the qpcache and qpzone

- Remove double non-NULL guard around bindrdataset()
- Add DNS_SLABTOP_FOREACH macros
- Made add() function in qpcache a single pass

Merge branch 'ondrej/add-DNS_SLABTOP_FOREACH' into 'main'

See merge request isc-projects/bind9!10879

8 months agoAlways scan all the slab headers when adding new entry
Ondřej Surý [Wed, 27 Aug 2025 12:05:30 +0000 (14:05 +0200)] 
Always scan all the slab headers when adding new entry

The existing logic would always scan the headers if:
- adding negative cache entry that's NXDOMAIN or negative RRSIG
- adding positive cache entry
- the type doesn't exist in the node

As the rest is relatively minor - we only delete rrset from resolver
on broken chain and most negative entries don't exist in the case
anyway, it feels like the extra logic to decide whether we should do
full scan or not is just complicating things.

Remove the extra logic and always scan all the slabtop/slabheaders in
the node when adding new entry into the cache.

8 months agoAdd few missing qpcache_hit() calls
Ondřej Surý [Wed, 27 Aug 2025 11:52:42 +0000 (13:52 +0200)] 
Add few missing qpcache_hit() calls

There were couple of missing qpcache_hit() calls in qpcache.c:add()
function where existing data was better than the newly added header.

8 months agoRefactoring in qpcache.c:add()
Ondřej Surý [Wed, 27 Aug 2025 04:58:39 +0000 (06:58 +0200)] 
Refactoring in qpcache.c:add()

There were several consequtive foreach loops when adding new entry into
the cache.  Merge the multiple foreach loops into a single pass loop
with some effort and a lot of comments.

8 months agoAdd DNS_SLABTOP_FOREACH macros
Ondřej Surý [Thu, 21 Aug 2025 06:56:29 +0000 (08:56 +0200)] 
Add DNS_SLABTOP_FOREACH macros

Add foreach macros to iterate through the dns_slabtop_t
single-linked lists.

8 months agoRemove double non-NULL guard around bindrdataset()
Ondřej Surý [Thu, 21 Aug 2025 06:56:29 +0000 (08:56 +0200)] 
Remove double non-NULL guard around bindrdataset()

The bindrdataset() already has a logic to skip the rest of the function
if the passed rdataset is NULL.  Remove the external guarding for
'addedrdataset' to simplify the code flow both from the zone and cache
databases.

8 months agochg: dev: move handle to keystores from the view to zonemgr
Colin Vidal [Thu, 28 Aug 2025 15:30:57 +0000 (17:30 +0200)] 
chg: dev: move handle to keystores from the view to zonemgr

This is a follow-up of !10895 where the keystore pointer was removed
from the zone (as not specific to the zone) and moved to the view. But
in order to avoid adding extra lifecycle dependencies from the zone to
the view, the keystore pointer is now moved to the zonemgr, which also
makes more sense as this is a global settings, and zonemgr wraps a bunch
of other global settings to be accessibles from the zones.

Because the zonemgr lifecycle is the same of the keystores (which are
both depending on named_g_server) this should be a safe change.

Merge branch 'colin/keystores-zonemgr' into 'main'

See merge request isc-projects/bind9!10901

8 months agomove handle to keystores from the view to zonemgr
Colin Vidal [Wed, 27 Aug 2025 12:52:07 +0000 (14:52 +0200)] 
move handle to keystores from the view to zonemgr

This is a follow-up of !10895 where the keystore pointer was removed
from the zone (as not specific to the zone) and moved to the view. But
in order to avoid adding extra lifecycle dependencies from the zone to
the view, the keystore pointer is now moved to the zonemgr, which also
makes more sense as this is a global settings, and zonemgr wraps a bunch
of other global settings to be accessibles from the zones.

Because the zonemgr lifecycle is the same of the keystores (which are
both depending on named_g_server) this should be a safe change.

8 months agofix: dev: Add and use __attribute__((nonnull)) in dnssec-signzone.c
Ondřej Surý [Thu, 28 Aug 2025 14:24:08 +0000 (16:24 +0200)] 
fix: dev: Add and use __attribute__((nonnull)) in dnssec-signzone.c

Clang 20 was spuriously warning about the possibility of passing a NULL file pointer
to `fprintf()`, which uses the 'nonnull' attribute. To silence the warning, the functions
calling `fprintf()` have been marked with the same attribute to assure that NULL can't be
passed to them in the first place.

Close #5487

Merge branch '5487-mark-passed-file-pointer-as-nonnull-in-dnssec-signzone' into 'main'

See merge request isc-projects/bind9!10888

8 months agoAdd and use __attribute__((nonnull)) in dnssec-signzone.c
Ondřej Surý [Thu, 21 Aug 2025 21:51:38 +0000 (23:51 +0200)] 
Add and use __attribute__((nonnull)) in dnssec-signzone.c

Clang 20 is complaining about passing NULL to an argument with 'nonnull'
attribute.  Mark these two functions with the same attribute to assure
that these two function also don't accept NULL as an argument.

8 months agofix: dev: Ensure file descriptors 0-2 are in use
Ondřej Surý [Thu, 28 Aug 2025 08:56:29 +0000 (10:56 +0200)] 
fix: dev: Ensure file descriptors 0-2 are in use

libuv expect file descriptors <= STDERR_FILENO are in use. otherwise,
it may abort when closing a file descriptor it opened.

Closes #5226

Merge branch 'main' into 'main'

See merge request isc-projects/bind9!10582

8 months agoTest command line tools without stdio fds
Petr Špaček [Tue, 1 Jul 2025 09:12:15 +0000 (11:12 +0200)] 
Test command line tools without stdio fds

Testing all combinations seems unnecessary but is cheap.
I was too lazy to run this against all tools we have. nsupdate was
chosen because it is one of few tools which actually use stdin and the
original issue was reproducible even without any network communication,
which was not the case for simple dig invocation.

Sorry for new shell test but doing this in Python seemed very
complicated and fragile.

8 months agoensure file descriptors 0-2 are in use before using libuv
Thomas Abraham [Mon, 30 Jun 2025 18:03:56 +0000 (14:03 -0400)] 
ensure file descriptors 0-2 are in use before using libuv

libuv expects file descriptors <= STDERR_FILENO are in use. otherwise,
it may abort when closing a file descriptor it opened.

See https://github.com/libuv/libuv/pull/4559

Closes #5226

8 months agofix: usr: Fix a catalog zone issue when having an unset 'default-primaries' configura...
Arаm Sаrgsyаn [Wed, 27 Aug 2025 16:16:05 +0000 (16:16 +0000)] 
fix: usr: Fix a catalog zone issue when having an unset 'default-primaries' configuration clause

A catalog zone with an unset ``default-primaries`` clause could cause
an unexpected termination of the :iscman:`named` process after two
reloading or reconfiguration commands. This has been fixed.

Closes #5494

Merge branch '5494-catz-crash-with-unset-default-primaries-and-double-reconfig' into 'main'

See merge request isc-projects/bind9!10896

8 months agoAdd a catalog zone with an unset 'default-primaries' to the catz test
Aram Sargsyan [Tue, 26 Aug 2025 14:57:02 +0000 (14:57 +0000)] 
Add a catalog zone with an unset 'default-primaries' to the catz test

And unset 'default-primaries' is causing an assertion failure after
two reload/reconfig commands. Add such a catalog zone to check the fix.

8 months agoFix a bug in configure_catz_zone()
Aram Sargsyan [Tue, 26 Aug 2025 14:58:32 +0000 (14:58 +0000)] 
Fix a bug in configure_catz_zone()

When dns_catz_zone_add() returns ISC_R_EXISTS and there is no
'default-primaries' or 'default-masters', the ISC_R_EXISTS result
code doesn't get reset to ISC_R_SUCCESS, and the function returns
ISC_R_EXISTS instead of ISC_R_SUCCESS. Which means that the zone
is successfully added, but the caller assumes that the function has
failed.

Reset 'result' to ISC_R_SUCCESS when dns_catz_zone_add() returns
ISC_R_EXISTS (it's not an error condition).

Refactor the code go call dns_catz_zone_add() when all other error
conditions are already checked.

8 months agochg: doc: Clarify forward, stub, and static-stub zone usage
Petr Špaček [Wed, 27 Aug 2025 14:17:19 +0000 (14:17 +0000)] 
chg: doc: Clarify forward, stub, and static-stub zone usage

Merge branch 'pspacek/doc-forward-stub-zones' into 'main'

See merge request isc-projects/bind9!10417

8 months agoClarify forward, stub, and static-stub zone usage
Petr Špaček [Tue, 22 Apr 2025 09:37:09 +0000 (11:37 +0200)] 
Clarify forward, stub, and static-stub zone usage

Clarify that forwarding points to a resolver and stub to auths.
Add cross-links. Rewrite stub zone type description.

8 months agochg: dev: Rewrite the bit rotate functions using __builtin or generic
Ondřej Surý [Wed, 27 Aug 2025 09:53:13 +0000 (11:53 +0200)] 
chg: dev: Rewrite the bit rotate functions using __builtin or generic

In gcc 15, __builtin_stdc_rotate_{left,right} was added.  Use these
builtins when available otherwise rewrite the ISC_ROTATE_LEFT and
ISC_ROTATE_RIGHT using _Generic.

Merge branch 'ondrej/use-__builtin_stdc_rotate_left_right' into 'main'

See merge request isc-projects/bind9!10893

8 months agoRewrite the bit rotate functions using __builtin or generic
Ondřej Surý [Tue, 26 Aug 2025 05:31:07 +0000 (07:31 +0200)] 
Rewrite the bit rotate functions using __builtin or generic

In gcc 15, __builtin_stdc_rotate_{left,right} was added.  Use these
builtins when available otherwise rewrite the ISC_ROTATE_LEFT and
ISC_ROTATE_RIGHT using _Generic.

8 months agochg: dev: move keystores handle from the zone to the view
Colin Vidal [Wed, 27 Aug 2025 09:01:15 +0000 (11:01 +0200)] 
chg: dev: move keystores handle from the zone to the view

The list of keystores is owned by the single server object
(named_g_server), but dns_zone_t has a pointer into it in order to
preserve encapsulation (lib/dns won't link to bin/named for good
reasons).

However, getting the keystores from the zone uses the zone lock whereas
this is not needed (as the pointer value doesn't depends on the zone,
and is initialized only with the same named_g_server->keystores value);
also storing an extra pointer per zone is not needed; also, there was a
logic based on the zone->secure property which was not needed (as there
is only one keystore).

The keystores pointer is now accessible and lock-free at view level,
it also simplifies a bit the various zone configuration APIs (server.c,
zoneconf.c).

Merge branch 'colin/move-keystore-to-view' into 'main'

See merge request isc-projects/bind9!10895

8 months agomove keystores handle from the zone to the view
Colin Vidal [Tue, 26 Aug 2025 13:05:55 +0000 (15:05 +0200)] 
move keystores handle from the zone to the view

The list of keystores is owned by the single server object
(named_g_server), but dns_zone_t has a pointer into it in order to
preserve encapsulation (lib/dns won't link to bin/named for good
reasons).

However, getting the keystores from the zone uses the zone lock whereas
this is not needed (as the pointer value doesn't depends on the zone,
and is initialized only with the same named_g_server->keystores value);
also storing an extra pointer per zone is not needed; also, there was a
logic based on the zone->secure property which was not needed (as there
is only one keystore).

The keystores pointer is now accessible and lock-free at view level,
it also simplifies a bit the various zone configuration APIs (server.c,
zoneconf.c).

8 months agofix: usr: Prevent spurious SERVFAILs for certain 0-TTL resource records
Ondřej Surý [Tue, 26 Aug 2025 19:03:43 +0000 (21:03 +0200)] 
fix: usr: Prevent spurious SERVFAILs for certain 0-TTL resource records

Under certain circumstances, BIND 9 can return SERVFAIL when updating
existing entries in the cache with new NS, A, AAAA, or DS records with 0-TTL.

Closes #5294

Merge branch '5294-preserve-ZEROTTL-on-cache-update' into 'main'

See merge request isc-projects/bind9!10897

8 months agoDon't preserve cache entries if new TTL is smaller than existing
Ondřej Surý [Tue, 26 Aug 2025 16:18:12 +0000 (18:18 +0200)] 
Don't preserve cache entries if new TTL is smaller than existing

Under certain circumstances, cache entries with equivalent rdataset
might not get replaced.  Previously such entry would get preserved
regardless of the new TTL and expire time on the existing header would
get updated when the expire time was less than the expire time on the
existing header.  Change the logic to preserve the existing header only
if the new expire time is larger than the existing one and replace the
existing cache entry when the new expire time is less than the existing
one.

Co-authored-by: Jinmei Tatuya <jtatuya@infoblox.com>
8 months agoPreserve ZEROTTL attribute when replacing NS RRset
Ondřej Surý [Tue, 26 Aug 2025 15:52:45 +0000 (17:52 +0200)] 
Preserve ZEROTTL attribute when replacing NS RRset

Previously, BIND 9 would drop the ZEROTTL attribute when updating
previously cached NS entry with ZEROTTL attribute set.

Co-authored-by: Jinmei Tatuya <jtatuya@infoblox.com>
8 months agochg: dev: Improve C23 compatibility
Ondřej Surý [Tue, 26 Aug 2025 14:35:53 +0000 (16:35 +0200)] 
chg: dev: Improve C23 compatibility

Use C23 stdckdint.h when available and define ckd_{mul,add,sub} shims to __builtin_{mul,add,sub}_overflow(). Require all the __builtin functions to be supported to further simplify the non-C23 implementation.  Rename the <stdbit.h>-shims in <isc/bit.h> to their C23 names.

Merge branch 'ondrej/use-stdckdint.h-if-available' into 'main'

See merge request isc-projects/bind9!10818

8 months agoUse the <stdbit.h> names for bit manipulation shims
Ondřej Surý [Wed, 20 Aug 2025 13:08:39 +0000 (15:08 +0200)] 
Use the <stdbit.h> names for bit manipulation shims

When <stdbit.h> is unavailable, use the stdc names like stdc_count_zeros
instead of ISC_COUNT_ZERO macros to simplify the code.

8 months agoSimplify add/sub/mul overflow checks
Ondřej Surý [Tue, 5 Aug 2025 06:19:20 +0000 (08:19 +0200)] 
Simplify add/sub/mul overflow checks

Use C23 stdckdint.h when available and define ckd_{mul,add,sub} shims to
__builtin_{mul,add,sub}_overflow().  Require the __builtin functions
unconditionally.

8 months agoRequire the __builtin functions unconditionally
Ondřej Surý [Tue, 5 Aug 2025 06:19:20 +0000 (08:19 +0200)] 
Require the __builtin functions unconditionally

Currently following __builtin functions are used:

    __builtin_add_overflow
    __builtin_mul_overflow
    __builtin_prefetch
    __builtin_sub_overflow
    __builtin_unreachable

These are generally available on our supported platform, and also we use
some of these unconditionally anyway in qp.c.  Thus make the support for
these functions mandatory so we fail early in the 'setup' step.

8 months agofix: ci: Reverse config grammar checks and docs builds
Petr Špaček [Tue, 26 Aug 2025 10:13:10 +0000 (10:13 +0000)] 
fix: ci: Reverse config grammar checks and docs builds

See #5379

Merge branch 'pspacek/fix-doc-misc-patch-generator' into 'main'

See merge request isc-projects/bind9!10891

8 months agoReverse config grammar checks and docs builds
Petr Špaček [Mon, 25 Aug 2025 16:04:33 +0000 (18:04 +0200)] 
Reverse config grammar checks and docs builds

Make grammar check in CI more user friendly. Previously Sphinx docs
build might have failed because outdated grammar files and this would
have prevented CI from generating grammar file patch.

8 months agofix: dev: Update fxhash constants
Ondřej Surý [Tue, 26 Aug 2025 07:46:14 +0000 (09:46 +0200)] 
fix: dev: Update fxhash constants

The fxhash implementation was missing a constant for 32-bit platforms.
This has been fixed.  Constant for 64-bit platform was update to match
the current Rust constants.

Merge branch 'ondrej/update-fxhash-constants' into 'main'

See merge request isc-projects/bind9!10894

8 months agoUpdate fxhash constants
Ondřej Surý [Tue, 26 Aug 2025 05:56:03 +0000 (07:56 +0200)] 
Update fxhash constants

The fxhash implementation was missing a constant for 32-bit platforms.
This has been fixed.  Constant for 64-bit platform was update to match
the current Rust constants.

8 months agofix: dev: Allow negative RRSIGs in the qpcache again
Ondřej Surý [Tue, 26 Aug 2025 07:40:53 +0000 (09:40 +0200)] 
fix: dev: Allow negative RRSIGs in the qpcache again

The previous refactoring added an assertion failure when negative RRSIG
would be added to the cache database.  As result, any query for RRSIG in
any unsigned zone would trigger that assertion failure.

Allow the negative RRSIG entries to be stored in the cache database
again as not caching these would trigger new remote fetch every time
such query would be received from a client.

Closes #5489

Merge branch '5489-allow-negative-RRSIGs-in-qpcache' into 'main'

See merge request isc-projects/bind9!10876

8 months agoAllow negative RRSIGs in the qpcache again
Ondřej Surý [Thu, 21 Aug 2025 06:56:29 +0000 (08:56 +0200)] 
Allow negative RRSIGs in the qpcache again

The previous refactoring added an assertion failure when negative RRSIG
would be added to the cache database.  As result, any query for RRSIG in
any unsigned zone would trigger that assertion failure.

Allow the negative RRSIG entries to be stored in the cache database
again as not caching these would trigger new remote fetch every time
such query would be received from a client.

8 months agoAdd a test for non-existence of RRSIG in the unsigned zone
Ondřej Surý [Thu, 21 Aug 2025 07:47:32 +0000 (09:47 +0200)] 
Add a test for non-existence of RRSIG in the unsigned zone

This tests that the result is NOERROR and a single SOA record is
returned.

8 months agofix: dev: Fix ISC_ROTATE_LEFTSIZE macro on MacOS"
Ondřej Surý [Tue, 26 Aug 2025 05:33:22 +0000 (07:33 +0200)] 
fix: dev: Fix ISC_ROTATE_LEFTSIZE macro on MacOS"

Closes #5497

Merge branch '5497-isc_rotate_leftsize-doesn-t-work-on-macos' into 'main'

See merge request isc-projects/bind9!10892

8 months agoWorkaround the compile failure on macOS
Ondřej Surý [Tue, 26 Aug 2025 04:53:27 +0000 (06:53 +0200)] 
Workaround the compile failure on macOS

The following check:

    __builtin_types_compatible_p(size_t, uint64_t)

doesn't work with default compiler on macOS.  Workaround the issue
by typing the size_t to matching unsigned int type.

8 months agofix: dev: switch bit rotation functions to statement expressions
Aydın Mercan [Mon, 25 Aug 2025 12:08:44 +0000 (15:08 +0300)] 
fix: dev: switch bit rotation functions to statement expressions

Using `static inline` functions in the headers break gcov as it cannot
properly track the hits. To fix the issue, convert the expressions to
statement macros. The added static assertions will ensure integer
promotion cannot occur unlike its previous function counterpart.

Merge branch 'aydin/rotate-as-macro' into 'main'

See merge request isc-projects/bind9!10878

8 months agoswitch bit rotation functions to statement expressions
Aydın Mercan [Thu, 21 Aug 2025 12:24:40 +0000 (15:24 +0300)] 
switch bit rotation functions to statement expressions

Using `static inline` functions in the headers break gcov as it cannot
properly track the hits. To fix the issue, convert the expressions to
statement macros. The added static assertions will ensure integer
promotion cannot occur unlike its previous function counterpart.

8 months agonew: usr: Add a new 'servfail-until-ready' configuration option for RPZ
Arаm Sаrgsyаn [Fri, 22 Aug 2025 18:37:20 +0000 (18:37 +0000)] 
new: usr: Add a new 'servfail-until-ready' configuration option for RPZ

By default, when :iscman:`named` is started it may start answering to
queries before the response policy zones are completely loaded
and processed. This new feature gives an option to the users to
tell :iscman:`named` that incoming requests should result in SERVFAIL answer
until all the response policy zones are processed and ready. Note that if
one or more response policy zones fail to load, :iscman:`named` starts
responding to queries according to those zones that did load.

Closes #5222

Merge branch '5222-stop-sending-responses-until-rpz-is-ready' into 'main'

See merge request isc-projects/bind9!10839

8 months agoTest the new 'servfail-until-ready' option
Aram Sargsyan [Fri, 8 Aug 2025 12:24:47 +0000 (12:24 +0000)] 
Test the new 'servfail-until-ready' option

Test whether 'servfail-until-ready yes' works by enabling slow
RPZ loading with a USDT probe activation, and checking that named
returns SERVFAIL during the initial RPZ zones processing stage.

The test requires SystemTap (stap, dtrace) to activate the USDT
probe.

8 months agoImplement '-T slowrpz' named testing option
Aram Sargsyan [Tue, 19 Aug 2025 09:10:06 +0000 (09:10 +0000)] 
Implement '-T slowrpz' named testing option

When used, named processes RPZ zones slowly. Useful for system tests.

8 months agoAdd a new 'servfail-until-ready' configuration option for RPZ
Aram Sargsyan [Mon, 19 May 2025 17:11:57 +0000 (17:11 +0000)] 
Add a new 'servfail-until-ready' configuration option for RPZ

By default, when named is started it may start answering to
queries before the response policy zones are completely loaded
and processed. This new feature gives an option to the users to
tell named that incoming requests should result in SERVFAIL anwser
until all the response policy zones are procesed and ready.

8 months agoAdd 'first_time' member to 'dns_rpz_zones_t'
Aram Sargsyan [Fri, 8 Aug 2025 12:08:55 +0000 (12:08 +0000)] 
Add 'first_time' member to 'dns_rpz_zones_t'

During the initial configuration of named after startup, 'first_time'
is true. This is needed for implementing the new 'servfail-until-ready'
configuration option, which should take into effect only during the
initial configuration.

8 months agonew: usr: Add manual mode configuration option to dnsec-policy
Matthijs Mekking [Thu, 21 Aug 2025 15:18:15 +0000 (15:18 +0000)] 
new: usr: Add manual mode configuration option to dnsec-policy

Add a new option ``manual-mode`` to :any:`dnssec-policy`. The intended use is that if it is enabled, it will not automatically move to the
next state transition, but instead the transition is logged. Only after manual confirmation with ``rndc dnssec -step`` the transition is made.

Closes #4606

Merge branch '4606-dnssec-policy-dry-run' into 'main'

See merge request isc-projects/bind9!10774

8 months agoTest manual-mode error case
Matthijs Mekking [Wed, 20 Aug 2025 13:41:13 +0000 (15:41 +0200)] 
Test manual-mode error case

If we hit an error when issuing an 'rndc dnssec -step' command, and the
keymgr runs again at a later scheduled time, we don't want to enforce
transitions.

8 months agoTest manual-mode while enabling DNSSEC
Matthijs Mekking [Thu, 24 Jul 2025 12:57:35 +0000 (14:57 +0200)] 
Test manual-mode while enabling DNSSEC

Similar to previous commit.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with ZSK rollover
Matthijs Mekking [Thu, 24 Jul 2025 12:12:23 +0000 (14:12 +0200)] 
Test manual-mode with ZSK rollover

Similar to previous commit.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with KSK rollover
Matthijs Mekking [Thu, 24 Jul 2025 10:05:06 +0000 (12:05 +0200)] 
Test manual-mode with KSK rollover

Similar to previous commit.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with CSK rollover (2)
Matthijs Mekking [Thu, 24 Jul 2025 09:42:59 +0000 (11:42 +0200)] 
Test manual-mode with CSK rollover (2)

Similar to previous commit.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with CSK rollover (1)
Matthijs Mekking [Wed, 23 Jul 2025 13:04:36 +0000 (15:04 +0200)] 
Test manual-mode with CSK rollover (1)

Similar to previous commits.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with KSK/ZSK algorithm rollover
Matthijs Mekking [Wed, 23 Jul 2025 08:34:07 +0000 (10:34 +0200)] 
Test manual-mode with KSK/ZSK algorithm rollover

Similar to the previous commit that tests CSK algorithm rollover.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoTest manual-mode with CSK algorithm rollover
Matthijs Mekking [Wed, 23 Jul 2025 07:27:04 +0000 (09:27 +0200)] 
Test manual-mode with CSK algorithm rollover

Update check_rollover_step to return the found keys. This can be used
to test that keymgr-manual-mode messages are correctly logged.

Parametrize each test case and in case of manual-mode, execute
additional checks. First a keymgr run should not change the existing
key state (with exceptions of timing events such as moving from
RUMOURED to OMNIPRESENT, and from UNRETENTIVE to HIDDEN). Appropriate
messages must be logged.

After enforcing the next step with 'rndc dnssec -step', the key state
should be the same as if the step were to be taken automatically.

8 months agoAdd manual-mode parameter to isctest.kasp
Matthijs Mekking [Thu, 24 Jul 2025 09:09:01 +0000 (11:09 +0200)] 
Add manual-mode parameter to isctest.kasp

Key state transitions may be blocked by manual-mode, meaning key
timing metadata may not be respected and can be inaccurate. For these
tests use the state values to determine whether the DNSKEY/CDS/CDNSKEY
RRset must be published or not.

8 months agoPrepare rollover system tests for manual-mode
Matthijs Mekking [Tue, 22 Jul 2025 08:59:13 +0000 (10:59 +0200)] 
Prepare rollover system tests for manual-mode

For the algorithm, CSK, KSK, ZSK rollovers, enabling DNSSEC and going
insecure, add new zones to be tested in manual-mode.

8 months agoDetect if keymgr made changes
Matthijs Mekking [Thu, 24 Jul 2025 09:14:16 +0000 (11:14 +0200)] 
Detect if keymgr made changes

If so we also want to tickle the apex because DNSKEY/CDNSKEY/CDS
RRsets may need to be re-signed.

Note that this may be overzealous, because if state transitions
happen just because of timing events (RUMOURED -> OMNIPRESENT,
UNRETENTIVE -> HIDDEN) this would have to cause changes in the
zone DNSSEC records.

8 months agoImplement manual-mode for kasp
Matthijs Mekking [Wed, 19 Mar 2025 16:10:25 +0000 (17:10 +0100)] 
Implement manual-mode for kasp

When a key retire, key generation/introduction, or a state transition
to RUMOURED/UNRETENTIVE should happen, instead they are logged.
When those logs look good, you can run 'rndc dnssec -step' to run the
keymgr and apply those steps.

8 months agoAdd manual-mode config option
Matthijs Mekking [Mon, 17 Feb 2025 11:05:25 +0000 (12:05 +0100)] 
Add manual-mode config option

Add a new option 'manual-mode' to 'dnssec-policy'. The intended
use is that if it is enabled, it will not automatically move to the
next state transition (RUMOURED, UNRETENTIVE), only after manual
confirmation. The intended state transition should be logged.

8 months agofix: nil: Fix ISC_LEADING_ZEROS and ISC_TRAILING_ZEROS macros
Mark Andrews [Wed, 20 Aug 2025 23:54:29 +0000 (09:54 +1000)] 
fix: nil: Fix ISC_LEADING_ZEROS and ISC_TRAILING_ZEROS macros

Closes #5488

Merge branch '5488-fix-isc-leading-trailing-zeros-macros' into 'main'

See merge request isc-projects/bind9!10875

8 months agoFix ISC_LEADING_ZEROS and ISC_TRAILING_ZEROS macros
Mark Andrews [Wed, 20 Aug 2025 09:38:00 +0000 (19:38 +1000)] 
Fix ISC_LEADING_ZEROS and ISC_TRAILING_ZEROS macros

8 months agoMerge tag 'v9.21.11'
Andoni Duarte Pintado [Wed, 20 Aug 2025 16:09:46 +0000 (18:09 +0200)] 
Merge tag 'v9.21.11'

8 months agonew: test: Test migrating to dnsec-policy alessio/always-preallocate-sigrdataset-baseline
Matthijs Mekking [Tue, 19 Aug 2025 14:07:21 +0000 (14:07 +0000)] 
new: test: Test migrating to dnsec-policy

Various test cases where legacy keys exist and are used to migrate to 'dnssec-policy'. These once existed as shell script but were removed because 'auto-dnssec' was removed. But the test cases are still useful if one wants to migrate to 'dnssec-policy' with such legacy keys, so it would be good to resurrect these tests.

Closes #3769

Merge branch '3769-migrate-zsk-ksk-plit' into 'main'

See merge request isc-projects/bind9!10787

8 months agoAdd a test case for no -P sync
Matthijs Mekking [Tue, 29 Jul 2025 08:15:00 +0000 (10:15 +0200)] 
Add a test case for no -P sync

This is a follow-up from the test cases that were added long time ago
that cover migrating to dnssec-policy.

The test covers legacy keys that do not have the SyncPublish timing
metadata set.

8 months agoTest migration to dnssec-policy
Matthijs Mekking [Mon, 28 Jul 2025 08:05:46 +0000 (10:05 +0200)] 
Test migration to dnssec-policy

Various test cases where legacy keys exist and are used to migrate to
dnssec-policy. These once existed as shell script but were removed
because auto-dnssec was removed. But the test cases are still useful
if one wants to migrate to dnssec-policy with such legacy keys.

The tests were previously removed in commit
906dd57b68dab3526af82ec266f413e11391394d as part of MR !8085.

8 months agoAllow for lifetime not set in state file
Matthijs Mekking [Tue, 29 Jul 2025 07:22:00 +0000 (09:22 +0200)] 
Allow for lifetime not set in state file

When migrating to dnssec-policy, keys that do not match will not have
a lifetime set. Adjust the test code to allow for that. Setting '-'
in a key properties string signals lifetime is expected not to be set.