]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
13 months agochg: doc: Add a note on pregenerating keys
Matthijs Mekking [Mon, 14 Apr 2025 15:01:49 +0000 (15:01 +0000)] 
chg: doc: Add a note on pregenerating keys

With `dnssec-policy` you can pregenerate keys and if they are eligible, rather than creating a new key, a key is selected from the pregenerated keys. A key is eligible if it is unused, i.e it has no key timing metadata set.

Merge branch 'matthijs-clarify-pregenerating-keys' into 'main'

See merge request isc-projects/bind9!10385

13 months agoAdd a note about pregenarating keys for key rolls
Matthijs Mekking [Fri, 11 Apr 2025 18:16:39 +0000 (13:16 -0500)] 
Add a note about pregenarating keys for key rolls

With dnssec-policy you can pregenerate keys and if they are eligible,
rather than creating a new key, a key is selected from the pregenerated
keys. A key is eligible if it is unused, i.e it has no key timing
metadata set.

13 months agofix: test: Fix check_pid() in runtime system test on FreeBSD
Michal Nowak [Mon, 14 Apr 2025 10:56:13 +0000 (10:56 +0000)] 
fix: test: Fix check_pid() in runtime system test on FreeBSD

The original check_pid() always returned 0 on FreeBSD, even if the
process was still running. This makes the "verifying that named checks
for conflicting named processes" check fail on FreeBSD with TSAN.

Merge branch 'mnowak/fix-runtime-pid-check' into 'main'

See merge request isc-projects/bind9!10373

13 months agoFix check_pid() in runtime system test on FreeBSD
Michal Nowak [Thu, 3 Apr 2025 11:38:03 +0000 (13:38 +0200)] 
Fix check_pid() in runtime system test on FreeBSD

The original check_pid() always returned 0 on FreeBSD, even if the
process was still running. This makes the "verifying that named checks
for conflicting named processes" check fail on FreeBSD with TSAN.

13 months agochg: test: Use isctest.asyncserver in the "forward" test
Michał Kępień [Fri, 11 Apr 2025 14:51:14 +0000 (14:51 +0000)] 
chg: test: Use isctest.asyncserver in the "forward" test

Replace the custom DNS servers used in the "forward" system test with new
code based on the isctest.asyncserver module.

For ans6, instead of configuring the responses to send at runtime, set
them up when the server is started.  Make sure the server supports
toggling response sending at runtime to enable simulating forwarder
timeouts as required by one of the checks.

For ans11, put most of the responses to be provided by that server into
a zone file, only retaining code modifying zone-based answers in the
form of a response handler, to improve code readability.  Use explicit
domain names instead of variables as that server only handles a single
domain and fixed strings improve readability in this case.  Make sure
the server supports toggling response sending at runtime to enable
simulating forwarder timeouts as required by one of the checks.

Migrate sendcmd() and its uses to the new way of sending control queries
to custom servers used in system tests.

Depends on !10339

Merge branch 'michal/forward-asyncserver' into 'main'

See merge request isc-projects/bind9!10340

13 months agoUse isctest.asyncserver in the "forward" test
Michał Kępień [Fri, 11 Apr 2025 14:18:50 +0000 (09:18 -0500)] 
Use isctest.asyncserver in the "forward" test

Replace the custom DNS servers used in the "forward" system test with
new code based on the isctest.asyncserver module.

For ans6, instead of configuring the responses to send at runtime, set
them up when the server is started.  Make sure the server supports
toggling response sending at runtime to enable simulating forwarder
timeouts as required by one of the checks.

For ans11, put most of the responses to be provided by that server into
a zone file, only retaining code modifying zone-based answers in the
form of a response handler, to improve code readability.  Use explicit
domain names instead of variables as that server only handles a single
domain and fixed strings improve readability in this case.  Make sure
the server supports toggling response sending at runtime to enable
simulating forwarder timeouts as required by one of the checks.

Migrate sendcmd() and its uses to the new way of sending control queries
to custom servers used in system tests.

13 months agonew: test: Add support for control commands to isctest.asyncserver
Michał Kępień [Fri, 11 Apr 2025 14:17:22 +0000 (14:17 +0000)] 
new: test: Add support for control commands to isctest.asyncserver

Some BIND 9 system tests need to dynamically change custom server
behavior at runtime.  Existing custom servers typically use a separate
TCP socket for listening to control commands, which mimics what `named`
does, but adds extra complexity to the custom server's networking code
for no gain (given the purpose at hand).  There is also no common way of
performing typical runtime actions (like toggling response dropping)
across all custom servers.

Instead of listening on a separate TCP socket in `asyncserver.py`, make
it detect DNS queries to a "magic" domain (`_control.`) on the same port
as the one it uses for receiving "production" DNS traffic.  This enables
query/response logging code to be reused for control traffic, clearly
denotes behavior changes in packet captures, facilitates implementing
commonly used features as reusable chunks of code (by making them "own"
distinct subdomains of the control domain), voids the need for separate
tools sending control commands, and enables using DNS facilities for
returning information to the user (e.g. RCODE for status codes, TXT
records for additional information, etc.).

Merge branch 'michal/asyncserver-control-commands' into 'main'

See merge request isc-projects/bind9!10339

13 months agoAdd control command for toggling response dropping
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Add control command for toggling response dropping

Implement a reusable control command that makes it possible to
dynamically disable/enable sending responses to clients.  This is a
typical use case for custom DNS servers employed in various BIND 9
system tests.

13 months agoImplement control query handling
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Implement control query handling

Some BIND 9 system tests need to dynamically change custom server
behavior at runtime.  Existing custom servers typically use a separate
TCP socket for listening to control commands, which mimics what named
does, but adds extra complexity to the custom server's networking code
for no gain (given the purpose at hand).  There is also no common way of
performing typical runtime actions (like toggling response dropping)
across all custom servers.

Instead of listening on a separate TCP socket in asyncserver.py, make it
detect DNS queries to a "magic" domain ("_control.") on the same port as
the one it uses for receiving "production" DNS traffic.  This enables
query/response logging code to be reused for control traffic, clearly
denotes behavior changes in packet captures, facilitates implementing
commonly used features as reusable chunks of code (by making them "own"
distinct subdomains of the control domain), voids the need for separate
tools sending control commands, and enables using DNS facilities for
returning information to the user (e.g. RCODE for status codes, TXT
records for additional information, etc.).

13 months agoAdd debug logs for response handler matching
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Add debug logs for response handler matching

With multiple and/or dynamically managed response handlers at play, it
becomes useful for debugging purposes to know which handler (if any) was
used for preparing each response sent by the server.  Add debug logs
providing that information.  Make class name the default string
representation of each response handler to prettify logs.

13 months agoMake response handler management more flexible
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Make response handler management more flexible

Extend AsyncDnsServer.install_response_handler() so that the provided
response handler can be inserted at the beginning of the handler list.
This enables installing a response handler that takes priority over all
previously installed handlers.

Add a new method, AsyncDnsServer.uninstall_response_handler(), which
enables removing a previously installed response handler.

Together, these two methods provide full control over the response
handler list at runtime.

13 months agoAvoid global namespace pollution
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Avoid global namespace pollution

Add a main() function to all custom servers based on isctest.asyncserver
and move server startup code there.  This prevents redefining variables
from outer scope in custom server code as it evolves.

13 months agoGracefully handle invalid queries
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Gracefully handle invalid queries

Prevent custom servers based on asyncserver.py from exiting prematurely
due to unhandled exceptions raised as a result of attempting to parse
invalid queries sent by clients.

13 months agoFix Python 3.6 StreamWriter compatibility issue
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Fix Python 3.6 StreamWriter compatibility issue

The StreamWriter.wait_closed() method was introduced in Python 3.7, so
attempting to use it with Python 3.6 raises an exception.  This has not
been noticed before because awaiting StreamWriter.wait_closed() is the
last action taken for each TCP connection and unhandled exceptions were
not causing the scripts based on AsyncServer to exit prematurely until
the previous commit.

As per Python documentation [1], awaiting StreamWriter.wait_closed()
after calling StreamWriter.close() is recommended, but not mandatory, so
try to use it if it is available, without taking any fallback action in
case it isn't.

[1] https://docs.python.org/3.13/library/asyncio-stream.html#asyncio.StreamWriter.close

13 months agoEnsure uncaught exceptions kill custom servers
Michał Kępień [Fri, 11 Apr 2025 14:14:57 +0000 (09:14 -0500)] 
Ensure uncaught exceptions kill custom servers

Uncaught exceptions raised by tasks running on event loops are not
handled by Python's default exception handler, so they do not cause
scripts to die immediately with a non-zero exit code.  Set up an
exception handler for AsyncServer code that makes any uncaught exception
the result of the Future that the top-level coroutine awaits.  This
ensures that any uncaught exceptions cause scripts based on AsyncServer
to immediately exit with an error, enabling the system test framework to
fail tests in which custom servers encounter unforeseen problems.

13 months agochg: test: Rewrite kasp system test to pytest (1)
Matthijs Mekking [Thu, 10 Apr 2025 21:17:49 +0000 (21:17 +0000)] 
chg: test: Rewrite kasp system test to pytest (1)

Move test code that can be reused for the kasp pytest-based system test.

Merge branch 'matthijs-pytest-rewrite-kasp-system-test-1' into 'main'

See merge request isc-projects/bind9!10252

13 months agoUpdate _check_dnskeys function
Matthijs Mekking [Mon, 24 Feb 2025 10:35:37 +0000 (11:35 +0100)] 
Update _check_dnskeys function

In the kasp system test there are cases that the SyncPublish is not
set, nor it is required to do so. Update the _check_dnskeys function
accordingly.

13 months agoAdd support for TSIG in isctest.kasp
Matthijs Mekking [Fri, 14 Mar 2025 10:19:40 +0000 (11:19 +0100)] 
Add support for TSIG in isctest.kasp

For some kasp test we are going to need TSIG based queries to
differentiate between views.

13 months agoIntroduce pytest check_next_key_event, get_keyids
Matthijs Mekking [Fri, 14 Mar 2025 10:10:22 +0000 (11:10 +0100)] 
Introduce pytest check_next_key_event, get_keyids

For the kasp tests we need a new utility that can retrieve a list of
Keys from a given directory, belonging to a specific zone. This is
'keydir_to_keylist' and is the replacement of 'kasp.sh:get_keyids()'.

'next_key_event_eqauls' is a method to check when the next key event is
scheduled, needed for the rollover tests, and is the equivalent of shell
script 'check_next_key_event'.

13 months agoIntroduce pytest verify_keys and check_keytimes
Matthijs Mekking [Fri, 14 Mar 2025 09:51:36 +0000 (10:51 +0100)] 
Introduce pytest verify_keys and check_keytimes

This commit introduces replacements for the 'check_keys' and
'check_keytimes' from the shell test library. 'check_keys' is renamed
to 'verify_keys' because it does not assert.

For that, we introduce more functions for the class Key. The
'match_properties' function is used in 'verify_keys' to see if a set of
KeyProperties match the Key. This speficially ignores timing metadata.
The function resembles what is in 'kasp.sh:check_key()'.

The 'match_timingmetadata' function is used in 'check_keytimes' to see
if the timing metadata of a set of KeyProperties match the Key. The
values are checked in all three key files (except if the private key is
not available (set with properties["private"]), or if it is a legacy key
(set with properties["legacy"]).

An additional check function is added, to check if the key relationships
are set correctly. It follows a similar pattern as 'check_keytimes'. If
"Predecessor" and/or "Successor" are expected to be set in the state
file, this function checks so, and also verifies that they are not set
if they should not be.

13 months agoUpdate class Key
Matthijs Mekking [Fri, 14 Mar 2025 09:38:43 +0000 (10:38 +0100)] 
Update class Key

Because we want to check the metadata in all three files, a new
value in the Key class is added: 'privatefile'. The 'get_metadata'
function is adapted so that we can also check metadata in other files.

Introduce methods to easily retrieve the TTL and public DNSKEY record
from the keyfile.

When checking if the CDS is equal to the expected value, use the DNSKEY
TTL instead of hardcoded 3600.

13 months agoIntroduce class KeyProperties
Matthijs Mekking [Fri, 14 Mar 2025 09:23:37 +0000 (10:23 +0100)] 
Introduce class KeyProperties

In isctest.kasp, introduce a new class 'KeyProperties' that can be used
to check if a Key matches expected properties. Properties are for the
time being divided in three parts: 'properties' that contain some
attributes of the expected properties (such as are we dealing with a
legacy key, is the private key available, and other things that do not
fit the metadata exactly), 'metadata' that contains expected metadata
(such as 'Algorithm', 'Lifetime', 'Length'), and 'timing', which is
metadata of the class KeyTimingMetadata.

The 'default()' method fills in the expected properties for the default
DNSSEC policy.

The 'set_expected_times()' sets the expected timing metadata, derived
from when the key was created. This method can take an offset to push
the expected timing metadata a duration in the future or back into the
past. If 'pregenerated=True', derive the expected timing metadata from
the 'Publish' metadata derived from the keyfile, rather than from the
'Created' metadata.

The calculations in the 'Ipub', 'IpubC' and 'Iret' methods are derived
from RFC 7583 DNSSEC Key Rollover Timing Considerations.

13 months agoMove test code that can be reused to isctest
Matthijs Mekking [Thu, 13 Mar 2025 14:46:39 +0000 (15:46 +0100)] 
Move test code that can be reused to isctest

This is the first step of converting the kasp system test to pytest.
Well, perhaps not the first, because earlier the ksr system test was
already converted to pytest and then the `isctest/kasp.py` library
was already introduced. Lots of this code can be reused for the kasp
pytest code.

First of all, 'check_file_contents_equal' is moved out of the ksr test
and into the 'check' library. This feels the most appropriate place
for this function to be reused in other tests. Then, 'keystr_to_keylist'
is moved to the 'kasp' library.

Introduce two new methods that are unused in this point of time, but
we are going to need them for the kasp system test. 'zone_contains'
will be used to check if a signature exists in the zonefile. This way
we can tell whether the signature has been reused or refreshed.
'file_contents_contain' will be used to check if the comment and public
DNSKEY record in the keyfile is correct.

13 months agochg: doc: Set up version for BIND 9.21.8
Nicki Křížek [Thu, 10 Apr 2025 13:32:31 +0000 (13:32 +0000)] 
chg: doc: Set up version for BIND 9.21.8

Merge branch 'nicki/set-up-version-for-bind-9.21.8' into 'main'

See merge request isc-projects/bind9!10378

13 months agoUpdate BIND version to 9.21.8-dev
Nicki Křížek [Thu, 10 Apr 2025 13:21:13 +0000 (15:21 +0200)] 
Update BIND version to 9.21.8-dev

13 months agofix: usr: `check_private` failed to account for the length byte before the OID
Mark Andrews [Wed, 9 Apr 2025 20:05:54 +0000 (20:05 +0000)] 
fix: usr: `check_private` failed to account for the length byte before the OID

In PRIVATEOID keys, the key data begins with a length byte followed
by an ASN.1 object identifier that indicates the cryptographic algorithm
to use. Previously, the length byte was not accounted for when
checking the contents of keys and signatures, which could have led
to interoperability problems with any zones signed using PRIVATEOID.
This has been fixed.

Closes #5270

Merge branch '5270-fix-check-private' into 'main'

See merge request isc-projects/bind9!10372

13 months agoUpdate BIND version for release v9.21.7
Nicki Křížek [Wed, 9 Apr 2025 14:18:20 +0000 (16:18 +0200)] 
Update BIND version for release

13 months agonew: doc: Prepare documentation for BIND 9.21.7
Nicki Křížek [Wed, 9 Apr 2025 14:04:01 +0000 (14:04 +0000)] 
new: doc: Prepare documentation for BIND 9.21.7

Merge branch 'nicki/prepare-documentation-for-bind-9.21.7' into 'v9.21.7-release'

See merge request isc-private/bind9!789

14 months agoTweak and reword release notes
Nicki Křížek [Thu, 3 Apr 2025 13:36:08 +0000 (15:36 +0200)] 
Tweak and reword release notes

14 months agoFix rndc reset-stats documentation
Nicki Křížek [Thu, 3 Apr 2025 13:30:31 +0000 (15:30 +0200)] 
Fix rndc reset-stats documentation

Reformat the section to be more consistent with the rest of the rndc
documentation and avoid using :program: directive which would needlessly
break rst links.

14 months agoAdd missing commands to rndc --help
Nicki Křížek [Thu, 3 Apr 2025 12:59:07 +0000 (14:59 +0200)] 
Add missing commands to rndc --help

14 months agoFix OID check for PRIVATEOID keys and signatures
Mark Andrews [Thu, 3 Apr 2025 01:49:39 +0000 (12:49 +1100)] 
Fix OID check for PRIVATEOID keys and signatures

We were failing to account for the length byte before the OID.
See RFC 4034.

   Algorithm number 254 is reserved for private use and will never be
   assigned to a specific algorithm.  The public key area in the DNSKEY
   RR and the signature area in the RRSIG RR begin with an unsigned
   length byte followed by a BER encoded Object Identifier (ISO OID) of
   that length.  The OID indicates the private algorithm in use, and the
   remainder of the area is whatever is required by that algorithm.
   Entities should only use OIDs they control to designate their private
   algorithms.

14 months agoPrepare release notes for BIND 9.21.7
Nicki Křížek [Thu, 3 Apr 2025 11:11:46 +0000 (13:11 +0200)] 
Prepare release notes for BIND 9.21.7

14 months agoGenerate changelog for BIND 9.21.7
Nicki Křížek [Thu, 3 Apr 2025 11:10:36 +0000 (13:10 +0200)] 
Generate changelog for BIND 9.21.7

14 months agofix: usr: Stop caching lack of EDNS support
Nicki Křížek [Thu, 3 Apr 2025 10:51:47 +0000 (10:51 +0000)] 
fix: usr: Stop caching lack of EDNS support

`named` could falsely learn that a server doesn't support EDNS when
a spoofed response was received; that subsequently prevented DNSSEC
lookups from being made.  This has been fixed.

Closes https://gitlab.isc.org/isc-projects/bind9/-/issues/3949

Closes https://gitlab.isc.org/isc-projects/bind9/-/issues/5066

Merge branch '5066-stop-caching-lack-of-edns-support' into 'v9.21.7-release'

See merge request isc-private/bind9!776

14 months agoDon't cache lack of EDNS based on received responses
Mark Andrews [Thu, 16 Jan 2025 05:24:05 +0000 (16:24 +1100)] 
Don't cache lack of EDNS based on received responses

Caching prevents server upgrades being detected in a timely manner
and it can also prevent DNSSEC responses being requested.

14 months agofix: usr: Nested DNS validation could cause assertion failure
Ondřej Surý [Wed, 2 Apr 2025 16:41:57 +0000 (16:41 +0000)] 
fix: usr: Nested DNS validation could cause assertion failure

When multiple nested DNS validations were destroyed out of order,
the EDE context could be freed before all EDE codes were copied,
which could cause an assertion failure. This has been fixed.

Closes #5213

Merge branch '5213-use-dns_ede_copy-in-dns_validator' into 'main'

See merge request isc-projects/bind9!10365

14 months agoDon't copy EDE codes if source is same as destination
Ondřej Surý [Wed, 2 Apr 2025 16:06:52 +0000 (18:06 +0200)] 
Don't copy EDE codes if source is same as destination

If the nested DNS validator ends up in the same fetch because of the
loops, the code could be copying the EDE codes from the same source EDE
context as the destination EDE context.  Skip copying the EDE codes if
the source and the destination is the same.

14 months agoDon't pass edectx from fetch_and_forget
Ondřej Surý [Wed, 2 Apr 2025 15:38:31 +0000 (17:38 +0200)] 
Don't pass edectx from fetch_and_forget

Pass NULL as edectx for the fetch_and_forget() fetches as nobody
is reading the EDE contexts and it can mess the main client buffer.

14 months agoAdd static ede context into each validator layer
Ondřej Surý [Wed, 2 Apr 2025 14:31:54 +0000 (16:31 +0200)] 
Add static ede context into each validator layer

Instead of passing the edectx from the fetchctx into all subvalidators,
make the ede context ownership explict for dns_resolver_createfetch()
callers, and copy the ede result codes from the children validators to
the parent when finishing the validation process.

14 months agochg: dev: Remove zero initialization of large buffers
Alessio Podda [Wed, 2 Apr 2025 15:00:34 +0000 (15:00 +0000)] 
chg: dev: Remove zero initialization of large buffers

Profiles show that an high amount of CPU time spent in memset.
By removing zero initalization of certain large buffers we improve
performance in certain authoritative workloads.

Closes #5159

Merge branch '5159-do-not-zero-qp-search-buffers' into 'main'

See merge request isc-projects/bind9!10058

14 months agoRemove zero initialization of large buffers
alessio [Thu, 30 Jan 2025 11:33:48 +0000 (12:33 +0100)] 
Remove zero initialization of large buffers

Profiles show that an high amount of CPU time spent in memset.
By removing zero initalization of certain large buffers we improve
performance in certain authoritative workloads.

14 months agochg: ci: Update issue closing regex in dangerfile.py
Andoni Duarte [Wed, 2 Apr 2025 13:38:40 +0000 (13:38 +0000)] 
chg: ci: Update issue closing regex in dangerfile.py

Update issue regex in danger file

The regular expression in `dangerfile.py` has been updated to match
the one in GitLab and bind9-qa (isc-projects/bind9-qa!41), i.e.
https://docs.gitlab.com/user/project/issues/managing_issues/#default-closing-pattern.

Merge branch 'andoni/update-issue-regex-in-danger-file' into 'main'

See merge request isc-projects/bind9!10361

14 months agoUpdate issue closing regex in dangerfile.py
Andoni Duarte Pintado [Wed, 2 Apr 2025 12:14:36 +0000 (14:14 +0200)] 
Update issue closing regex in dangerfile.py

Update the regular expression used for extracting references to GitLab
issues closed by a given merge request so that it is identical to the
one used by GitLab [1].

See also isc-projects/bind9-qa!41

[1] https://docs.gitlab.com/user/project/issues/managing_issues/#default-closing-pattern

14 months agochg: nil: Suppress FreeBSD-specific TSAN false-positive lock-order-inversion
Arаm Sаrgsyаn [Wed, 2 Apr 2025 12:33:00 +0000 (12:33 +0000)] 
chg: nil: Suppress FreeBSD-specific TSAN false-positive lock-order-inversion

TSAN reports a lock-order-inversion (potential deadlock) issue in
`add_trace_entry()`.

While it is true that in one case a lock in the `isc_mem_t` structure is
locked first, and then a lock in the `FILE` structure is locked second,
and in the the second case it is the other way around, this isn't an
issue, because those are `FILE` structures for totally different files,
used in different parts of the code.

Closes #5266

Merge branch '5266-freebsd-suppress-tsan-lock-order-inversion-false-positive' into 'main'

See merge request isc-projects/bind9!10355

14 months agoSuppress FreeBSD-specific TSAN false-positive lock-order-inversion
Aram Sargsyan [Wed, 2 Apr 2025 08:38:58 +0000 (08:38 +0000)] 
Suppress FreeBSD-specific TSAN false-positive lock-order-inversion

TSAN reports a lock-order-inversion (potential deadlock) issue in
add_trace_entry():

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
      Cycle in lock order graph: M0001 (0x000000000001) => M0002 (0x000000000002) => M0001
      Mutex M0002 acquired here while holding mutex M0001 in main thread:
        #0 _pthread_mutex_lock /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1342:3
        #1 add_trace_entry lib/isc/mem.c:210:2
        #2 isc__mem_get lib/isc/mem.c:606:2
        #3 isc_buffer_allocate lib/isc/./include/isc/buffer.h:1080:23
        #4 pushandgrow lib/isc/lex.c:321:3
        #5 isc_lex_gettoken lib/isc/lex.c:445:22
        #6 cfg_gettoken lib/isccfg/parser.c:3490:11
        #7 cfg_parse_mapbody lib/isccfg/parser.c:2230:3
        #8 cfg_parse_obj lib/isccfg/parser.c:247:11
        #9 parse2 lib/isccfg/parser.c:628:11
        #10 cfg_parse_file lib/isccfg/parser.c:668:11
        #11 load_configuration bin/named/server.c:8069:13
        #12 run_server bin/named/server.c:9518:2
        #13 isc__async_cb lib/isc/async.c:110:3
        #14 uv__async_io /tmp/libuv-1.50.0/src/unix/async.c:208:5
        #15 uv__io_poll /tmp/libuv-1.50.0/src/unix/kqueue.c:369:9
        #16 uv_run /tmp/libuv-1.50.0/src/unix/core.c:460:5
        #17 loop_thread lib/isc/loop.c:327:6
        #18 thread_body lib/isc/thread.c:89:8
        #19 isc_thread_main lib/isc/thread.c:124:2
        #20 isc_loopmgr_run lib/isc/loop.c:513:2
        #21 main bin/named/main.c:1469:2
      Mutex M0001 previously acquired by the same thread here:
        #0 _pthread_mutex_lock /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1342:3
        #1 _flockfile /usr/src/lib/libc/stdio/_flock_stub.c:72:3
        #2 cfg_gettoken lib/isccfg/parser.c:3490:11
        #3 cfg_parse_mapbody lib/isccfg/parser.c:2230:3
        #4 cfg_parse_obj lib/isccfg/parser.c:247:11
        #5 parse2 lib/isccfg/parser.c:628:11
        #6 cfg_parse_file lib/isccfg/parser.c:668:11
        #7 load_configuration bin/named/server.c:8069:13
        #8 run_server bin/named/server.c:9518:2
        #9 isc__async_cb lib/isc/async.c:110:3
        #10 uv__async_io /tmp/libuv-1.50.0/src/unix/async.c:208:5
        #11 uv__io_poll /tmp/libuv-1.50.0/src/unix/kqueue.c:369:9
        #12 uv_run /tmp/libuv-1.50.0/src/unix/core.c:460:5
        #13 loop_thread lib/isc/loop.c:327:6
        #14 thread_body lib/isc/thread.c:89:8
        #15 isc_thread_main lib/isc/thread.c:124:2
        #16 isc_loopmgr_run lib/isc/loop.c:513:2
        #17 main bin/named/main.c:1469:2
      Mutex M0001 acquired here while holding mutex M0002 in main thread:
        #0 _pthread_mutex_lock /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1342:3
        #1 _flockfile /usr/src/lib/libc/stdio/_flock_stub.c:72:3
        #2 print_active lib/isc/mem.c:629:3
        #3 isc_mem_stats lib/isc/mem.c:694:2
        #4 main bin/named/main.c:1498:4
      Mutex M0002 previously acquired by the same thread here:
        #0 _pthread_mutex_lock /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1342:3
        #1 isc_mem_stats lib/isc/mem.c:668:2
        #2 main bin/named/main.c:1498:4
    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) lib/isc/mem.c:210:2 in add_trace_entry

In the first stack frame ('M0001'->'M0002' lock order) cfg_gettoken()
uses flockfile() to lock 'M0001' for the 'FILE' object associated with
the configuration file (e.g. the configuration file itself and
whatever it includes, like a zone database), then it locks a memory
context mutex M0002.

In the other stack frmae ('M0002'->'M0001' lock order) isc_mem_stats()
locks a memory context mutex M0002, then it uses fprintf(), which
internally locks a 'M0001' mutex with flockfile() to write into the
'named.memstats' memory statistics file.

While it is true that in one case a lock in the 'isc_mem_t' structure is
locked first, and then a lock in the 'FILE' structure is locked second,
and in the the second case it is the other way around, this isn't an
issue, because those are 'FILE' structures for totally different files,
used in different parts of the code.

It was also manually confirmed that 'named.memstats' doesn't get
processed by cfg_gettoken(), and is used only in the second stack
frame's code flow when named is exiting.

14 months agonew: ci: Allow pushing branches and tags to customer git repos
Nicki Křížek [Wed, 2 Apr 2025 11:03:30 +0000 (11:03 +0000)] 
new: ci: Allow pushing branches and tags to customer git repos

For pipelines in the private repository, add an optional manual job,
which allows the current branch to be pushed into the specified
customer's git repository. This can be useful to provide patch previews
for early testing.

For tags created in a private repository, add a manual job which pushes
the created tag to all entitled customers.

Merge branch 'nicki/ci-customer-git-automation' into 'main'

See merge request isc-projects/bind9!10323

14 months agoAllow pushing branches and tags to customer git repos
Nicki Křížek [Tue, 25 Mar 2025 15:51:24 +0000 (16:51 +0100)] 
Allow pushing branches and tags to customer git repos

For pipelines in the private repository, add an optional manual job,
which allows the current branch to be pushed into the specified
customer's git repository. This can be useful to provide patch previews
for early testing.

For tags created in a private repository, add a manual job which pushes
the created tag to all entitled customers.

14 months agochg: nil: Suppress FreeBSD-specific TSAN false-positive data race
Arаm Sаrgsyаn [Wed, 2 Apr 2025 08:35:04 +0000 (08:35 +0000)] 
chg: nil: Suppress FreeBSD-specific TSAN false-positive data race

TSAN reports a data race in FreeBSD's memset(), called by its
__crt_calloc() memory allocation function. There is a very similar
bug report [1] in FreeBSD bug tracker, and an existing code-review [2]
that tries to address an issue, the description of which is very
similar to what we are seeing.

Suppress this report by adding its signature to '.tsan-suppress'.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282794

[2] https://reviews.freebsd.org/D28536?id=86694

Closes #5267

Merge branch '5267-freebsd-suppress-tsan-data-race-false-positive' into 'main'

See merge request isc-projects/bind9!10353

14 months agoSuppress FreeBSD-specific TSAN false-positive data race
Aram Sargsyan [Tue, 1 Apr 2025 13:36:33 +0000 (13:36 +0000)] 
Suppress FreeBSD-specific TSAN false-positive data race

TSAN reports a data race in FreeBSD's memset(), called by its
__crt_calloc() memory allocation function. There is a very similar
bug report [1] in FreeBSD bug tracker, and an existing code-review [2]
that tries to address an issue, the description of which is very
similar to what we are seeing.

Suppress this report by adding its signature to '.tsan-suppress'.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282794
[2] https://reviews.freebsd.org/D28536?id=86694

14 months agofix: dev: Switch to ISC_LIST_FOREACH everywhere
Evan Hunt [Mon, 31 Mar 2025 21:21:06 +0000 (21:21 +0000)] 
fix: dev: Switch to ISC_LIST_FOREACH everywhere

The pattern `for (x = ISC_LIST_HEAD(...); x != NULL; ISC_LIST_NEXT(...)` has been changed to `ISC_LIST_FOREACH` throughout BIND, except in a few
cases where the change would be excessively complex.

In most cases this was a straightforward change. In some places, however, the list element variable was referenced after the loop ended. Where possible, code has now been refactored to avoid this necessity.

`ISC_LIST_FOREACH` has also been modified to use `typeof(list.head)` to declare list elements automatically. When the list object to be iterated is declared with a `const` qualifier, the qualifier is passed along to the element declaration, causing a compilation failure. To avoid this problem, some `const` qualifiers have been removed; where that was not possible, `UNCONST` was used.

Merge branch 'each-isc-list-foreach' into 'main'

See merge request isc-projects/bind9!10310

14 months agouse ISC_LIST_FOREACH in more places
Evan Hunt [Sat, 22 Mar 2025 22:26:16 +0000 (15:26 -0700)] 
use ISC_LIST_FOREACH in more places

use the ISC_LIST_FOREACH pattern in places where lists had
been iterated using a different pattern from the typical
`for` loop: for example, `while (!ISC_LIST_EMPTY(...))` or
`while ((e = ISC_LIST_HEAD(...)) != NULL)`.

14 months agoswitch to ISC_LIST_FOREACH everywhere
Evan Hunt [Fri, 21 Mar 2025 05:25:56 +0000 (22:25 -0700)] 
switch to ISC_LIST_FOREACH everywhere

the pattern `for (x = ISC_LIST_HEAD(...); x != NULL; ISC_LIST_NEXT(...)`
has been changed to `ISC_LIST_FOREACH` throughout BIND, except in a few
cases where the change would be excessively complex.

in most cases this was a straightforward change. in some places,
however, the list element variable was referenced after the loop
ended, and the code was refactored to avoid this necessity.

also, because `ISC_LIST_FOREACH` uses typeof(list.head) to declare
the list elements, compilation failures can occur if the list object
has a `const` qualifier.  some `const` qualifiers have been removed
from function parameters to avoid this problem, and where that was not
possible, `UNCONST` was used.

14 months agoimplicitly declare list elements in ISC_LIST_FOREACH macros
Evan Hunt [Thu, 20 Mar 2025 22:46:35 +0000 (15:46 -0700)] 
implicitly declare list elements in ISC_LIST_FOREACH macros

ISC_LIST_FOREACH and related macros now use 'typeof(list.head)' to
declare the list elements automatically; the caller no longer needs
to do so.

ISC_LIST_FOREACH_SAFE also now implicitly declares its own 'next'
pointer, so it only needs three parameters instead of four.

14 months agorem: dev: Cleanup dead code: CID 548247
Mark Andrews [Mon, 31 Mar 2025 20:17:57 +0000 (20:17 +0000)] 
rem: dev:  Cleanup dead code: CID 548247

Clean up dead code following merge of !10302.

Closes #5262

Merge branch '5262-cleanup-dead-code-cid-548247' into 'main'

See merge request isc-projects/bind9!10346

14 months agoRemove dead code in dns_message_sectiontotext
Mark Andrews [Sun, 30 Mar 2025 23:36:45 +0000 (10:36 +1100)] 
Remove dead code in dns_message_sectiontotext

Following the merge of !10302 this code to reset the result code
on ISC_R_NOMORE is no longer needed.

14 months agorem: usr: Drop readline alternatives in favor of libedit
Ondřej Surý [Mon, 31 Mar 2025 14:02:59 +0000 (14:02 +0000)] 
rem: usr: Drop readline alternatives in favor of libedit

Libedit is now ubiquitous and has a license compatible with
MPL 2.0. We are now dropping readline (GPL 3.0) and editline (obsolete) support
in favor of libedit.

Merge branch 'ondrej/cleanup-various-readline-libraries' into 'main'

See merge request isc-projects/bind9!10202

14 months agoDrop readline alternatives in favor of libedit
Ondřej Surý [Mon, 3 Mar 2025 11:32:14 +0000 (12:32 +0100)] 
Drop readline alternatives in favor of libedit

The libedit is now ubiquitous and has a licences compatible with
MPL 2.0.  Drop readline (GPL 3.0) and editline (obsolete) support
in favor of libedit.

14 months agochg: dev: Carefully check if the server name used for SNI is a hostname
Artem Boldariev [Mon, 31 Mar 2025 11:57:49 +0000 (11:57 +0000)] 
chg: dev: Carefully check if the server name used for SNI is a hostname

Previously the code would not check if the string intended to be used
for SNI is a hostname.

See also: !9923

Closes #5225

Merge branch '5225-dig-sni-fix' into 'main'

See merge request isc-projects/bind9!10254

14 months agoDispatch: carefully check if the server name for SNI is a hostname
Artem Boldariev [Tue, 18 Mar 2025 10:52:18 +0000 (12:52 +0200)] 
Dispatch: carefully check if the server name for SNI is a hostname

Previously the code would not check if the string intended to be used
for SNI is a hostname.

14 months agoDig: carefully check if the server name for SNI is a hostname
Artem Boldariev [Fri, 14 Mar 2025 19:35:39 +0000 (21:35 +0200)] 
Dig: carefully check if the server name for SNI is a hostname

Previously the code would not check if the string intended to be used
for SNI is a hostname.

14 months agoAdd isc_tls_valid_sni_hostname()
Artem Boldariev [Fri, 28 Mar 2025 07:20:16 +0000 (09:20 +0200)] 
Add isc_tls_valid_sni_hostname()

Add a function that checks if a 'hostname' is not a valid IPv4 or IPv6
address. Returns 'true' if the hostname is likely a domain name, and
'false' if it represents an IP address.

14 months agofix: test: fix out-of-tree mem_test
Colin Vidal [Fri, 28 Mar 2025 14:51:59 +0000 (14:51 +0000)] 
fix: test: fix out-of-tree mem_test

Previously changed mem_test (!10320) introduces a test which checks for
the value of `__FILE__`, which is different if the build is done
out-of-tree or not, even though this is not relevant for the test (only
the base filename is). This result in a broken test for out-of-tree
builds. Fix this by changing the way the "grep" is done in the test,
ignoring the optional path prefix in the filename.

Merge branch 'colin-fix-outoftree-memtest' into 'main'

See merge request isc-projects/bind9!10343

14 months agofix out-of-tree mem_test
Colin Vidal [Fri, 28 Mar 2025 11:55:49 +0000 (12:55 +0100)] 
fix out-of-tree mem_test

Previously changed mem_test (!10320) introduces a test which checks for
the value of `__FILE__`, which is different if the build is done
out-of-tree or not, even though this is not relevant for the test (only
the base filename is). This result in a broken test for out-of-tree
builds. Fix this by changing the way the "grep" is done in the test,
ignoring the optional path prefix in the filename.

14 months agofix: nil: Fix out-of-tree test
Evan Hunt [Fri, 28 Mar 2025 04:03:42 +0000 (04:03 +0000)] 
fix: nil: Fix out-of-tree test

A recent change to the dnssec system test depended on a file
that is only in the source tree, not in the build tree, and was
therefore not available in out-of-tree builds.

Merge branch 'each-fix-dnssec-oot' into 'main'

See merge request isc-projects/bind9!10342

14 months agoFix out-of-tree test
Evan Hunt [Fri, 28 Mar 2025 02:59:53 +0000 (19:59 -0700)] 
Fix out-of-tree test

A recent change to the dnssec system test depended on a file
that is only in the source tree, not in the build tree, and was
therefore not available in out-of-tree builds.

14 months agorem: pkg: Implement the systemd notification protocol manually to remove dependency...
Aydın Mercan [Thu, 27 Mar 2025 19:54:49 +0000 (19:54 +0000)] 
rem: pkg: Implement the systemd notification protocol manually to remove dependency on libsystemd.

Merge branch 'aydin/standalone-notification' into 'main'

See merge request isc-projects/bind9!10263

14 months agoimplement the systemd notification protocol manually, drop libsystemd
Aydın Mercan [Sun, 16 Mar 2025 16:54:18 +0000 (19:54 +0300)] 
implement the systemd notification protocol manually, drop libsystemd

libsystemd, despite being useful, adds a huge surface area for just
using the sd_notify API. libsystemd's surface has been exploited in the
past [1].

Implement the systemd notification protocol by hand since it is just
sending newline-delimited datagrams to a UNIX socket. The code shouldn't
need more attention in the future since the notification protocol is
covered under systemd's stability promise [2].

We don't need to support VSOCK-backed service notifications since they
are only intended for virtual machine inits.

[1]: https://www.openwall.com/lists/oss-security/2024/03/29/4
[2]: https://systemd.io/PORTABILITY_AND_STABILITY/

14 months agofix: dev: copy __FILE__ when allocating memory
Colin Vidal [Thu, 27 Mar 2025 12:15:24 +0000 (12:15 +0000)] 
fix: dev: copy __FILE__ when allocating memory

When allocating memory under -m trace|record, the __FILE__ pointer is
stored, so it can be printed out later in order to figure out in which
file an allocation leaked. (among others, like the line number).

However named crashes when called with -m record and using a plugin
leaking memory. The reason is that plugins are unloaded earlier than
when the leaked allocations are dumped (obviously, as it's done as late
as possible). In such circumstances, `__FILE__` is dangling because the
dynamically loaded library (the plugin) is not in memory anymore.

Fix the crash by systematically copying the `__FILE__` string
instead of copying the pointer. Of course, this make each allocation to
consume a bit more memory (and longer, as it needs to calculate the
length of `__FILE__`) but this occurs only under -m trace|record debugging
flags.

Merge branch 'colin-memdump-plugins' into 'main'

See merge request isc-projects/bind9!10320

14 months agocopy __FILE__ when allocating memory
Colin Vidal [Tue, 25 Mar 2025 13:35:49 +0000 (14:35 +0100)] 
copy __FILE__ when allocating memory

When allocating memory under -m trace|record, the __FILE__ pointer is
stored, so it can be printed out later in order to figure out in which
file an allocation leaked. (among others, like the line number).

However named crashes when called with -m record and using a plugin
leaking memory. The reason is that plugins are unloaded earlier than
when the leaked allocations are dumped (obviously, as it's done as late
as possible). In such circumstances, __FILE__ is dangling because the
dynamically loaded library (the plugin) is not in memory anymore.

Fix the crash by systematically copying the __FILE__ string
instead of copying the pointer. Of course, this make each allocation to
consume a bit more memory (and longer, as it needs to calculate the
length of __FILE__) but this occurs only under -m trace|record debugging
flags.

In term of unit test, because grepping in C is not fun, and because the
whole "syntax" of the dump output is tested in other tests, this simply
search for a substring in the whole buffer to make sure the expected
allocations are found.

14 months agonew: usr: Add an rndc command to reset some statistics counters
Arаm Sаrgsyаn [Thu, 27 Mar 2025 09:35:14 +0000 (09:35 +0000)] 
new: usr: Add an rndc command to reset some statistics counters

The new ``reset-stats`` command for ``rndc`` allows some statistics
counters to be reset during runtime. At the moment only two "high-water"
counters are supported, so the ability to reset them after the
initial peaks during the server's "warm-up" phase may be useful for
some operators.

Closes #5251

Merge branch '5251-feature-rndc-reset-high-water-statistics' into 'main'

See merge request isc-projects/bind9!10318

14 months agoDocument rndc reset-stats
Aram Sargsyan [Tue, 25 Mar 2025 10:50:08 +0000 (10:50 +0000)] 
Document rndc reset-stats

Add documentation for 'rndc reset-stats'.

14 months agoTest rndc reset-stats counter-name
Aram Sargsyan [Tue, 25 Mar 2025 10:49:03 +0000 (10:49 +0000)] 
Test rndc reset-stats counter-name

A a check to test if 'rndc reset-stats' works as expected.

14 months agoImplement rndc reset-stats counter-name
Aram Sargsyan [Tue, 25 Mar 2025 10:44:20 +0000 (10:44 +0000)] 
Implement rndc reset-stats counter-name

This new rndc option allows to reset some statistics counters during
runtime. At this moment only the high-water type counters are supported
as such an ability to reset them after the initial peaks during the
server's "warm-up" phase can be useful for some operators.

14 months agofix: dev: Refactor to use list-like macro for message sections
Alessio Podda [Thu, 27 Mar 2025 03:23:47 +0000 (03:23 +0000)] 
fix: dev: Refactor to use list-like macro for message sections

In the code base it is very common to iterate over all names in a message
section and all rdatasets for each name, but various idioms are used for
iteration.

This commit standardizes them as much as possible to a single idiom,
through the macro `MSG_SECTION_FOREACH`, similar to the existing
`ISC_LIST_FOREACH`.

Merge branch 'alessio/message-namelist-refactor' into 'main'

See merge request isc-projects/bind9!10302

14 months agoRefactor to use list-like macro for message sections
alessio [Wed, 19 Mar 2025 19:29:17 +0000 (20:29 +0100)] 
Refactor to use list-like macro for message sections

In the code base it is very common to iterate over all names in a message
section and all rdatasets for each name, but various idioms are used for
iteration.

This commit standardizes them as much as possible to a single idiom,
using the macro MSG_SECTION_FOREACH, similar to the existing
ISC_LIST_FOREACH.

14 months agochg: nil: Move application of dns64 to a separate function
Evan Hunt [Thu, 27 Mar 2025 00:06:22 +0000 (00:06 +0000)] 
chg: nil: Move application of dns64 to a separate function

The code in `query_dns64()` that applies the dns64 prefixes to an A rdataset has been moved into the `dns_dns64` module, and `dns_dns64_destroy()` now unlinks the dns64 object from its containing list.

With these changes, we no longer need the list-manipulation API calls, `dns_dns64_next()` and `dns_dns64_unlink()`.

Merge branch 'each-simplify-dns64' into 'main'

See merge request isc-projects/bind9!10324

14 months agomove application of dns64 to a separate function
Evan Hunt [Sun, 23 Mar 2025 20:45:04 +0000 (13:45 -0700)] 
move application of dns64 to a separate function

the code in query_dns64() that applies the dns64 prefixes to
an A rdataset has been moved into the dns_dns64 module, and
dns_dns64_destroy() now unlinks the dns64 object from its
containing list. with these changes, we no longer need the
list-manipulation API calls dns_dns64_next() and
dns_dns64_unlink().

14 months agodns_message_gettemp*() resets objects
Evan Hunt [Sun, 23 Mar 2025 20:45:04 +0000 (13:45 -0700)] 
dns_message_gettemp*() resets objects

callers of dns_message_gettemprdata() and dns_message_getrdatalist()
initialize the objects after retrieving them. this is no longer
necessary.

14 months agochg: usr: Improve the LRU cache-expiration mechanism
Evan Hunt [Wed, 26 Mar 2025 23:21:15 +0000 (23:21 +0000)] 
chg: usr: Improve the LRU cache-expiration mechanism

Improve the LRU cache-expiration mechanism to a SIEVE-LRU based mechanism that triggers when the cache is close to the `max-cache-size` limit.  This improves the recursive server performance.

Merge branch 'ondrej/sieve' into 'main'

See merge request isc-projects/bind9!10153

14 months agoAdd isc_sieve unit implementing SIEVE-LRU algorithm
Ondřej Surý [Sun, 23 Feb 2025 13:36:35 +0000 (14:36 +0100)] 
Add isc_sieve unit implementing SIEVE-LRU algorithm

This is the core implementation of the SIEVE algorithm described in the
following paper:

  Zhang, Yazhuo, Juncheng Yang, Yao Yue, Ymir Vigfusson, and K V
  Rashmi. “SIEVE Is Simpler than LRU: An Efficient Turn-Key Eviction
  Algorithm for Web Caches,” n.d.. available online from
  https://junchengyang.com/publication/nsdi24-SIEVE.pdf

14 months agonew: test: IPv6 case to isc_netaddr_masktoprefixlen tests
Colin Vidal [Wed, 26 Mar 2025 13:30:01 +0000 (13:30 +0000)] 
new: test: IPv6 case to isc_netaddr_masktoprefixlen tests

Unit test for isc_netaddr_masktoprefixlen were missing IPv6 mask cases.
Add those and few other IPv4 cases. Also, the test is refactored in
order to make it easy to add new cases.

Merge branch 'colin-netaddrmasktest' into 'main'

See merge request isc-projects/bind9!10328

14 months agoIPv6 case to isc_netaddr_masktoprefixlen tests
Colin Vidal [Wed, 26 Mar 2025 09:44:11 +0000 (10:44 +0100)] 
IPv6 case to isc_netaddr_masktoprefixlen tests

Unit test for isc_netaddr_masktoprefixlen were missing IPv6 mask cases.
Add those and few other IPv4 cases. Also, the test is refactored in
order to make it easy to add new cases.

14 months agofix: test: Silence warning initialising compressed
Mark Andrews [Wed, 26 Mar 2025 12:42:53 +0000 (12:42 +0000)] 
fix: test: Silence warning initialising compressed

The string literal initialalising compressed was too big for the
array as it has an unwanted NUL terminator.  This is allowed for
in C for historical reasons but produces a warning with some
compilers.  Adjust the declaration to include the NUL and adjust
the users to pass in an adjusted size which excludes the NUL rather
than sizeof(compressed).

Closes #5258

Merge branch '5258-avoid-warning-initialising-compresss' into 'main'

See merge request isc-projects/bind9!10326

14 months agoSilence warning when initialising compress
Mark Andrews [Wed, 26 Mar 2025 03:31:25 +0000 (14:31 +1100)] 
Silence warning when initialising compress

The string literal initialalising compressed was too big for the
array as it has an unwanted NUL terminator.  This is allowed for
in C for historical reasons but produces a warning with some
compilers.  Adjust the declaration to include the NUL and adjust
the users to pass in an adjusted size which excludes the NUL rather
than sizeof(compressed).

14 months agofix: ci: cross-version-config-tests should allow_failure due to !10262
Michal Nowak [Wed, 26 Mar 2025 10:18:38 +0000 (10:18 +0000)] 
fix: ci: cross-version-config-tests should allow_failure due to !10262

Merge branch 'mnowak/cross-version-config-tests-allow_failure' into 'main'

See merge request isc-projects/bind9!10327

14 months agocross-version-config-tests should allow_failure due to !10262
Michal Nowak [Wed, 26 Mar 2025 09:45:13 +0000 (10:45 +0100)] 
cross-version-config-tests should allow_failure due to !10262

14 months agofix: nil: Fix broken dnssec test
Evan Hunt [Wed, 26 Mar 2025 01:37:49 +0000 (01:37 +0000)] 
fix: nil: Fix broken dnssec test

When !10262 was rebased prior to merging, there was a new
use of dnssec-keygen -n in the dnssec system test that had
not been removed in the branch, causing a test failure.
This has been fixed.

Merge branch 'each-merge-error' into 'main'

See merge request isc-projects/bind9!10325

14 months agofix broken dnssec test
Evan Hunt [Wed, 26 Mar 2025 01:01:24 +0000 (18:01 -0700)] 
fix broken dnssec test

When !10262 was rebased prior to merging, there was a
use of dnssec-keygen -n in the dnssec system test that had
not been removed, causing a test failure. This has been fixed.

14 months agorem: usr: Remove unnecessary options in dnssec-keygen and dnssec-keyfromlabel
Evan Hunt [Tue, 25 Mar 2025 23:49:11 +0000 (23:49 +0000)] 
rem: usr: Remove unnecessary options in dnssec-keygen and dnssec-keyfromlabel

The `dnssec-keygen` utility (and `dnssec-keyfromlabel`, which was derived from it) had several options dating to the time when keys in DNS were still experimental and not fully specified, and when `dnssec-keygen` had the additional function of generating TSIG keys, which are now generated by `tsig-keygen`. These options are no longer necessary in the modern DNSSEC environment, and have been removed.

The removed options are:
- `-t` (key type), which formerly set flags to disable confidentiality or authentication support in a key; these are no longer used.
- `-n` (name type), which is now always set to "ZONE" for DNSKEY and "HOST" for KEY.
- `-p` (protocol), which is now always set to 3 (DNSSEC); no other value has ever been defined.
- `-s` (signatory field), which was never fully defined.
- `-d` (digest bits), which is meaningful only for TSIG keys.

Merge branch 'each-remove-keygen-options' into 'main'

See merge request isc-projects/bind9!10262

14 months agoRemove -d option from dnssec-keygen
Evan Hunt [Sat, 15 Mar 2025 19:07:42 +0000 (12:07 -0700)] 
Remove -d option from dnssec-keygen

The -d (digestbits) option was only applicable to HMAC keys, which
are no longer created by dnssec-keygen. The option can be removed.

14 months agoRemove -s option from dnssec-keygen
Evan Hunt [Sat, 15 Mar 2025 05:50:44 +0000 (22:50 -0700)] 
Remove -s option from dnssec-keygen

The -s option (previously incorrectly documented as "strength")
actually set the signatory flags for KEY fields, which are unused.
The option is not needed.

14 months agoRemove -p option from dnssec-keygen/keyfromlabel
Evan Hunt [Sat, 15 Mar 2025 05:41:12 +0000 (22:41 -0700)] 
Remove -p option from dnssec-keygen/keyfromlabel

The -p (protocol) option for all keys defaults to 3 (DNSSEC).
There is currently no practical reason to use any other value;
we can simplify things by removing the option.

14 months agoRemove -n option from dnssec-keygen/keyfromlabel
Evan Hunt [Fri, 14 Mar 2025 02:57:24 +0000 (19:57 -0700)] 
Remove -n option from dnssec-keygen/keyfromlabel

The -n (nametype) option for keys defaults to ZONE for DNSKEY
type keys, and HOST for KEY type keys. There is currently no
practical reason to use any other name type; we can simplify
things by removing the option.

14 months agoRemove -t option from dnssec-keygen/keyfromlabel
Evan Hunt [Thu, 13 Mar 2025 19:20:55 +0000 (12:20 -0700)] 
Remove -t option from dnssec-keygen/keyfromlabel

The key type flag (indicating whether a key is valid for
authentication, confidentiality, or both) is essentially
unused. By default, all DNSKEY and KEY records are valid
for both uses. Non-authenticating DNSKEY records are undefined
and meaningless, and validity checks for flags in KEY records
are sporadic at best.

We can simplify the parameters to dnssec-keygen by removing
the -t option completely.

14 months agofix: test: Limit X-Bloat header size to 100KB
Michal Nowak [Tue, 25 Mar 2025 15:52:47 +0000 (15:52 +0000)] 
fix: test: Limit X-Bloat header size to 100KB

Otherwise curl 8.13 rejects the line with:

    I:Check HTTP/1.1 keep-alive with truncated stream (21)
    curl: option --header: error encountered when reading a file
    curl: try 'curl --help' or 'curl --manual' for more information

Also, see https://github.com/curl/curl/pull/16572.

Closes #5249

Merge branch '5249-statschannel-limit-http-header-size' into 'main'

See merge request isc-projects/bind9!10319

14 months agoLimit X-Bloat header size to 100KB
Michal Nowak [Tue, 25 Mar 2025 13:14:52 +0000 (14:14 +0100)] 
Limit X-Bloat header size to 100KB

Otherwise curl 8.13 rejects the line with:

    I:Check HTTP/1.1 keep-alive with truncated stream (21)
    curl: option --header: error encountered when reading a file
    curl: try 'curl --help' or 'curl --manual' for more information

Also, see https://github.com/curl/curl/pull/16572.

14 months agorem: dev: Remove lock upgrading from the hot path in the QP cache
Ondřej Surý [Tue, 25 Mar 2025 09:58:09 +0000 (09:58 +0000)] 
rem: dev: Remove lock upgrading from the hot path in the QP cache

In QPcache, there were two places that tried to upgrade the lock.  In `clean_stale_header()`, the code would try to upgrade the lock and clean up the header, and in `qpzonode_release()`, the tree lock would be optionally upgraded, so we can clean up the node directly if empty. These
optimizations are not needed and they have no effect on the performance.

Merge branch 'ondrej/no-lock-upgrade-in-check_stale_headers' into 'main'

See merge request isc-projects/bind9!10305

14 months agoRemove lock upgrading from the hot path in the cache
Ondřej Surý [Fri, 21 Mar 2025 02:06:16 +0000 (03:06 +0100)] 
Remove lock upgrading from the hot path in the cache

In QPcache, there were two places that tried to upgrade the lock.  In
clean_stale_header(), the code would try to upgrade the lock and cleanup
the header, and in qpzonode_release(), the tree lock would be optionally
upgraded, so we can cleanup the node directly if empty.  These
optimizations are not needed and they have no effect on the performance.

14 months agofix: dev: Fix invalid cache-line padding for qpcache buckets
Ondřej Surý [Tue, 25 Mar 2025 09:56:49 +0000 (09:56 +0000)] 
fix: dev: Fix invalid cache-line padding for qpcache buckets

The isc_queue_t was missing in the calculation of the required
padding size inside the qpcache bucket structure.

Merge branch 'ondrej/qpcache-fix-invalid-padding' into 'main'

See merge request isc-projects/bind9!10306