Commit graph

44395 commits

Author SHA1 Message Date
Michal Nowak
40c375c58e new: ci: Add Fedora 43
Merge branch 'mnowak/fedora-43' into 'main'

See merge request isc-projects/bind9!11285
2025-11-27 16:35:22 +01:00
Michal Nowak
350c3a9a19
Add Fedora 43 2025-11-27 16:30:30 +01:00
Nicki Křížek
d2777a6e78 new: test: Create trust anchors from isctest.kasp.Key
Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.

Merge branch 'nicki/pytest-add-trust-anchor-template' into 'main'

See merge request isc-projects/bind9!11201
2025-11-27 14:49:01 +01:00
Nicki Křížek
2f2be20547 Mock DSDigest for compatibility with older dnspython
DSDigest class isn't available prior to dnspython 2.0.0 and prior to Add
an isctest.compat.DSDigest compatibility hack to support those versions.
2025-11-27 14:02:49 +01:00
Nicki Křížek
f6cb154b65 Add a template for TA and generate it from isctest.kasp.Key
Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.
2025-11-27 14:02:49 +01:00
Nicki Křížek
0bf20f8d68 Parse DNSKEY into a dnspython type in isctest.kasp.Key.dnskey
Previously, a DNSKEY string from keyfile was returned. This made the
function brittle for further processing, as the string would have to be
split up, concatenated, and TTL could be missing, making string indices
context-dependent.

Parse the DNSKEY rrset into a proper dnspython object and return it.
This makes the output more predictable and reliable, as all the
neccessary parsing is done by dnspython.
2025-11-27 14:02:49 +01:00
Alessio Podda
1ede6683cd fix: dev: Add support for more linkers with LTO
Link-time optimization requires close coordination between the compiler
and the linker, so not all combinations of compiler and linker support
it.

Previously, when compiling with Clang, we checked only for lld. With
this commit, we expand the list of supported linkers we check for.

Closes #5536

Merge branch '5536-more-supported-linker-ids' into 'main'

See merge request isc-projects/bind9!11022
2025-11-27 12:36:57 +00:00
Alessio Podda
1378aeefa5 Add auto LTO option
Add an auto option to named-lto that disables weird setups like clang +
ld.bfd.
2025-11-27 13:00:22 +01:00
Alessio Podda
d5b8adf084 Rename -Dnamed-lto=off to -Dnamed-lto=disabled
Meson boolean options are usually configured with enabled/disabled
instead of on/off. Make things more consistent with other meson options
by renaming -Dnamed-lto=off to -Dnamed-lto=disabled.
2025-11-27 13:00:22 +01:00
Alessio Podda
fbecbfd5e2 Add support for more linkers with LTO
Link-time optimization requires close coordination between the compiler
and the linker, so not all combinations of compiler and linker support
it.

Previously, when compiling with Clang, we checked only for lld. With
this commit, we expand the list of supported linkers we check for.
2025-11-27 13:00:22 +01:00
Ondřej Surý
d8410f93d2 chg: dev: Use malloc_usable_size()/malloc_size() for memory accounting
Restore usage of malloc_usable_size()/malloc_size(), but this time only
for memory accounting and statistics purposes.  This should reduce the
memory footprint in case of compilation without jemalloc as we don't
have to keep track of the allocated memory size ourselves.

Merge branch 'ondrej/use-malloc_usable_size-when-available' into 'main'

See merge request isc-projects/bind9!11271
2025-11-27 12:42:09 +01:00
Ondřej Surý
d6e2bf2b3d
Use malloc_usable_size()/malloc_size() for memory accounting
Restore usage of malloc_usable_size()/malloc_size(), but this time only
for memory accounting and statistics purposes.  This should reduce the
memory footprint in case of compilation without jemalloc as we don't
have to keep track of the allocated memory size ourselves.
2025-11-27 11:07:55 +01:00
Ondřej Surý
def4be7cb6 rem: dev: Remove internal memory filling in favor of jemalloc opt.junk
Instead of having our own implementation of memory junk filling, rely on
the jemalloc opt.junk feature (set with MALLOC_CONF="junk:true").

Merge branch 'ondrej/remove-memfill' into 'main'

See merge request isc-projects/bind9!11270
2025-11-27 10:40:28 +01:00
Ondřej Surý
52e2cb4d56
Enable junk filling via jemalloc option in the CI
Since the filling memory with junk patterns have been removed from ISC
memory context in favor of jemalloc opt.junk option, enable the jemalloc
behaviour by default in the GitLab CI.
2025-11-27 10:40:18 +01:00
Ondřej Surý
d08d0d81ac
Remove internal memory filling in favor of jemalloc opt.junk
Instead of having our own implementation of memory junk filling, rely on
the jemalloc opt.junk feature (set with MALLOC_CONF="junk:true").
2025-11-27 10:40:18 +01:00
Ondřej Surý
c1fea47f75 chg: nil: Add optional debugging output for fetch context reference counting
As the fetch context reference counting was converted to userspace RCU
reference counting, the ability to debug the reference counting was
lost.  Restore the debugging by adding the optional compile-time enabled
debugging output again.

Merge branch 'ondrej/add-tracing-to-fctx-reference-counting' into 'main'

See merge request isc-projects/bind9!11230
2025-11-27 10:39:37 +01:00
Ondřej Surý
3e971db1ed
Add optional debugging output for fetch context reference counting
As the fetch context reference counting was converted to userspace RCU
reference counting, the ability to debug the reference counting was
lost.  Restore the debugging by adding the optional compile-time enabled
debugging output again.
2025-11-27 10:39:23 +01:00
Ondřej Surý
aa14165656 chg: nil: Split qctx_destroy() into qctx_deinit() and qctx_destroy()
The qctx_destroy() only needs to be called on allocated memory and
qctx_deinit() needs to be called always.  Also remove .allocated member
from the query_ctx_t structure.

Merge branch 'ondrej/add-qctx-deinit' into 'main'

See merge request isc-projects/bind9!11273
2025-11-27 10:38:58 +01:00
Ondřej Surý
e94a31a666
Split qctx_destroy() into qctx_deinit() and qctx_destroy()
The qctx_destroy() only needs to be called on allocated memory and
qctx_deinit() needs to be called always.  Also remove .allocated member
from the query_ctx_t structure.
2025-11-27 10:37:58 +01:00
Ondřej Surý
7a8f4e136c fix: nil: Remove .delegating flag from the qpcache
The .delegating flag was only set, but never used in the dns_qpcache.
Remove it completely together with the code that was locking the node
to set the flag if the added type was DNAME.

Merge branch 'ondrej/remove-delegating-from-qpcache' into 'main'

See merge request isc-projects/bind9!10980
2025-11-27 10:37:36 +01:00
Ondřej Surý
0232017604
Remove .delegating flag from the qpcache
The .delegating flag was only set, but never used in the dns_qpcache.
Remove it completely together with the code that was locking the node
to set the flag if the added type was DNAME.
2025-11-27 10:37:09 +01:00
Ondřej Surý
6fd209b6f0 chg: dev: Use atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer
Upstream has removed the atomics implementation of CMM_LOAD_SHARED and
CMM_STORE_SHARED as these can be used also with non-stdatomics types.
As we only use the CMM api with stdatomics types, we can restore the
previous behaviour to prevent ThreadSanitizer warnings.

Closes #5660

Merge branch '5660-use-atomics-for-CMM-api-with-thread-sanitizer' into 'main'

See merge request isc-projects/bind9!11288
2025-11-27 10:31:57 +01:00
Ondřej Surý
539be61b68
Use atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer
Upstream has removed the atomics implementation of CMM_LOAD_SHARED and
CMM_STORE_SHARED as these can be used also with non-stdatomics types.
As we only use the CMM api with stdatomics types, we can restore the
previous behaviour to prevent ThreadSanitizer warnings.
2025-11-26 17:14:12 +01:00
Andoni Duarte
1b127320b3 chg: ci: Fix wiki.wireshark.org links in doc/arm
Fix the broken link https://wiki.wireshark.org/TLS#tls-decryption to
simply https://wiki.wireshark.org/TLS. The links in the wireshark
wiki have been updated somewhen after october 2025 as shown by
https://web.archive.org/web/20251008165051/https://wiki.wireshark.org/TLS#tls-decryption and https://wiki.wireshark.org/TLS.

Merge branch 'andoni/fix-wireshark-links-in-doc-arm' into 'main'

See merge request isc-projects/bind9!11284
2025-11-26 14:06:24 +00:00
Andoni Duarte Pintado
fe98568be6 Update wiki.wireshark.org link in doc/arm
Fix the broken link https://wiki.wireshark.org/TLS#tls-decryption.
Since their TOC also has the wrong anchor, we remove it altogether,
i.e. https://wiki.wireshark.org/TLS.
2025-11-26 14:30:26 +01:00
Nicki Křížek
693566b66e chg: ci: Adjust respdiff threshold
Closes #5649

Merge branch 'nicki/respdiff-threshold' into 'main'

See merge request isc-projects/bind9!11262
2025-11-25 15:51:21 +01:00
Nicki Křížek
bcc4369b0b Increase the threshold for respdiff-third-party
There are multiple reasons for the increased amount of differences we've
been seeing lately and for the raise of the threshold:

1. Recent hardening against cache poisoning (CVE-2025-40778) have
   uncovered a few edge cases where the domain can't be properly
   resolved with the new protections in place, but those are issues with
   upstream configuration and DNS setup.
2. The same hardening magnified some behaviour differences between 9.21
   and older versions. Some misconfigured domains, which can be resolved
   with BIND 9.20 and older are no longer resolvable in 9.21+. This can
   be again attributed to upstream DNS misconfiguration. See #5649.
3. A change in the respdiff CI job to include timeouts in the
   comparison, or rather, increasing the timeouts to resolve the
   previously timed out queries, which are typically failures. With the
   previous job configuration, those were omitted from comparison,
   because they were timeouts. Now, there should be no timeouts, but
   there is a slight increase in the amount of differences for the
   threshold evaluation.
2025-11-25 15:05:16 +01:00
Nicki Křížek
92ae687649 Set stricter respdiff:recent-named threshold
This job is testing the current BIND implementation against the latest
released version. Unless there has been a behaviour change, there should
be no difference.

In practice, there is a small number of differences caused by upstream
discrepencies. Some of those cause "upstream unstable" answers which are
excluded from the results, but statistically, some of those will end up
being detected as differences on the resolver under test.

Currently, there seems to be about 300 upstream unstable answers with
typically around 50-60 differences. Setting the threshold to 0.1 should
be stable enough to pass if there are no changes, yet sensitive enough
to detect even fairly small changes to behaviour.
2025-11-25 15:05:16 +01:00
Michal Nowak
e49ec0a71f chg: test: Disable 'doh' unit test on Enterprise Linux 8
Disable test that fails for months on this platform.

Closes #5448

Merge branch '5448-disable-doh-unit-test-on-el8' into 'main'

See merge request isc-projects/bind9!11276
2025-11-25 13:29:26 +01:00
Michal Nowak
1684556577
Disable 'doh' unit test on Enterprise Linux 8
Disable test that fails for months on this platform.
2025-11-25 10:55:03 +01:00
Mark Andrews
8d9d25f6d4 fix: nil: Restore recording ns_statscounter_edns0out
Change d5e4684b3d accidentally caused
ns_statscounter_edns0out to no longer be incremented.  This has been
corrected.

Closes #5654

Merge branch '5654-restore-recording-ns_statscounter_edns0out' into 'main'

See merge request isc-projects/bind9!11267
2025-11-25 15:05:11 +11:00
Mark Andrews
98e4204db9 Check nsstats statistics in bind9.xml 2025-11-25 13:26:50 +11:00
Mark Andrews
f0f0728989 Restore recording ns_statscounter_edns0out
Change d5e4684b accidentally caused ns_statscounter_edns0out to no
longer be incremented.  This has been corrected.
2025-11-25 13:26:50 +11:00
Matthijs Mekking
ddd1040761 fix: usr: Fix bug where zone switches from NSEC3 to NSEC after retransfer
When a zone is re-transferred, but the zone journal on an inline-signing secondary is out of sync, the zone could fall back to using NSEC records instead of NSEC3. This has been fixed.

Closes #5527

Merge branch '5527-retransfer-nsec3-bug' into 'main'

See merge request isc-projects/bind9!11226
2025-11-24 13:23:21 +00:00
Matthijs Mekking
6dcb9ce77f Skip private records when syncing secure db
When synchronizing the secure database, we skip DNSSEC records that
BIND 9 maintains with inline-signing. We should also skip private
RDATA type records that are used to track the current state of a
zone-signing process.
2025-11-24 10:21:33 +01:00
Matthijs Mekking
be3e4c83d0 Test retransfer with NSEC3 policy
If the primary has been updated, but the secondary has not been
notified, the journal will go out of date. An 'rndc retransfer' causes
the zone to force an AXFR, removing and rebuilding zone and journal
files.

This test reproduces a bug that in such scenario, an NSEC3 signed zone
falls back to NSEC.
2025-11-24 10:21:33 +01:00
Colin Vidal
376313c8dc fix: nil: Do not log no root hints of _bind chaos view
The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc (part of effective
configuration changes).

The reason is that since 27c4f68dcc, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. The changes omit the
(now removed, since 6b5f714e53) `need_hints` bool that was disabling the
warning for the builtin view (_bind/CH).

This disable that log again when configuring _bind/CH view.

Merge branch 'colin/nohintswarn-bindchaos' into 'main'

See merge request isc-projects/bind9!11264
2025-11-22 04:51:30 +01:00
Colin Vidal
68fda6a035 do not log "no root hints for view '_bind'"
The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc (part of effective
configuration changes).

The reason is that since 27c4f68dcc, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. Those changes omitted
the `need_hints` bool that disabled the warning for the builtin view.
This commit silences the log message again.
2025-11-21 14:21:44 -08:00
Evan Hunt
b4d638473e chg: dev: add dns_message functions to set EDNS options
The new `dns_message_ednsinit()` and `dns_message_ednsaddopt()` functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.

Merge branch 'each-refactor-message-edns' into 'main'

See merge request isc-projects/bind9!11261
2025-11-21 21:18:25 +00:00
Evan Hunt
d5e4684b3d remove dns_message_buildopt
now that the EDNS state is stored within dns_message_t, it's no longer
necessary to have a public API call to build an opt rdataset; we can
just have dns_message_setopt() build the opt record internally.
2025-11-21 11:13:21 -08:00
Evan Hunt
2d3439ee02 add dns_message API to add EDNS options
The new dns_message_ednsinit() and dns_message_ednsaddopt() functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.
2025-11-21 11:13:18 -08:00
Matthijs Mekking
8750a685f9 chg: test: Rewrite nsec3 system test to pytest
Merge branch 'matthijs-pytestify-nsec3' into 'main'

See merge request isc-projects/bind9!11030
2025-11-21 14:03:05 +00:00
Matthijs Mekking
ba211de912 Wait longer before keymgr is done
To check if the key managing for a zone is done, we check a log message.
On some machines, with many zones this may take some time.

Increate the timeout to a minute. Note that most zones will continue
their test case much faster, but with many zones there may be some
straggling.
2025-11-21 14:20:58 +01:00
Matthijs Mekking
8cfccb9eac Wait until zones are signed before reconfig
In order to make the tests run reliable, first make sure the key
managing for all the zones has finished before doing running the
reconfig command.
2025-11-21 14:20:58 +01:00
Nicki Křížek
66e4146a88 Only render required zones in config for nsec3 tests
When all zones are configured, regardless of whether the test module
actually uses them, it makes debugging the logs needlessly more
complicated, as there is a bunch of stuff going on that is completely
unrelated to the test.

Define a list of tested zones in each test module and only render the
named.conf with those zones defined.
2025-11-21 14:20:58 +01:00
Matthijs Mekking
9ee62467a6 Move nsec3-change.kasp test to separate module
This zone has a specific corner case to be tested during the setup.
Move it to a separate module so it is less convoluted.
2025-11-21 13:50:13 +01:00
Matthijs Mekking
7762b2391e Move check_nsec3_case to common code
With the nsec and nsec3 test cases being nearly identical for all
modules, these can be be unified and moved to common.py.
2025-11-21 13:50:13 +01:00
Matthijs Mekking
29816eb621 Clean up shell tests remnants
Now that all tests are covered by pytest, we can remove the remnants
of the shell test script.
2025-11-21 13:50:13 +01:00
Matthijs Mekking
3f5d295e29 Rewrite nsec3 system test to pytest (4/4)
Convert the final nsec3 system test case that deals with empty
non-terminals. This is a regression test case for GL #5108.
2025-11-21 13:50:13 +01:00
Matthijs Mekking
f98f6ee3d6 Rewrite nsec3 system test to pytest (3/4)
This converts two test cases:

1. A zone that previously failed to load is now fixed. Make sure the
   zone is signed correctly with the right NSEC3 parameters.

2. Test case to ensure the salt is the same after a restart, i.e. no
   re-salting takes place. Previously we only tested with salt length
   0, this commit adds a test case for salt length 8 as well.
2025-11-21 13:50:13 +01:00