Commit graph

40136 commits

Author SHA1 Message Date
Tom Krizek
ef4e2d2964
ci: move baseline version detection into separate job
Multiple CI jobs may utilize a baseline version, i.e. the version that
the current code should be tested against when doing comparative
testing. To avoid repeating the non-trivial detection of the baseline
version, move it into a separate job which creates an environment file
that subsequent jobs may require via `needs` option. It is then possible
to use the variable(s) defined in the script section of the new job.
2023-11-01 09:47:19 +01:00
Matthijs Mekking
3f205f3218 Merge branch '4355-serve-stale-unexpected-recursion' into 'main'
Don't ignore authoritative local zones when in serve-stale mode

Closes #4355

See merge request isc-projects/bind9!8415
2023-10-31 12:49:51 +00:00
Matthijs Mekking
ac19d43a32 Add release note and CHANGES for #4355 2023-10-30 20:07:01 +01:00
Matthijs Mekking
2322425016 Don't ignore auth zones when in serve-stale mode
When serve-stale is enabled and recursive resolution fails, the fallback
to lookup stale data always happens in the cache database. Any
authoritative data is ignored, and only information learned through
recursive resolution is examined.

If there is data in the cache that could lead to an answer, and this can
be just the root delegation, the resolver will iterate further, getting
closer to the answer that can be found by recursing down the root, and
eventually puts the final response in the cache.

Change the fallback to serve-stale to use 'query_getdb()', that finds
out the best matching database for the given query.
2023-10-30 20:07:01 +01:00
Matthijs Mekking
e196ba6168 Test case for issue #4355
Add a test case where serve-stale is enabled on a server that also
servers a local authoritative zone.

The particular case tests a lame delegation and checks if falling
back to serving stale data does not attempt to retrieve the query
by recursing from the root down.
2023-10-30 20:07:01 +01:00
Ondřej Surý
2a24ba4618 Merge branch 'ondrej/bump-dns_message-pools-size' into 'main'
Bump the mempool sizes in dns_message

See merge request isc-projects/bind9!8439
2023-10-28 06:52:30 +00:00
Ondřej Surý
c855ed6a0b
Bump the mempool sizes in dns_message
Increasing the initial and freemax sizes for dns_message memory pools
restores the root zone performance.  The former sizes were suited for
per-dns_message memory pools and we need to bump the sizes up for
per-thread memory pools.
2023-10-27 15:28:27 +02:00
Michał Kępień
61e12cde05 Merge branch '4390-always-use-default-rcu-variant-in-pairwise-builds' into 'main'
Always use default RCU variant in pairwise builds

Closes #4390

See merge request isc-projects/bind9!8438
2023-10-27 11:59:46 +00:00
Michał Kępień
bf518ba490
Always use default RCU variant in pairwise builds
Commit 42d43aa075 made --with-liburcu
depend on --enable-developer.  This broke pairwise testing as this new
dependency was not codified in configure.ac.  Since the --with-liburcu
option is currently just a convenience for developers, there is no need
to test building against all possible RCU variants in GitLab CI until
they actually work with BIND 9.  Update the pairwise testing
"configuration" in configure.ac so that builds with non-standard RCU
variants are not tested.
2023-10-27 13:19:03 +02:00
Ondřej Surý
ff28f9f8ac Merge branch '4392-increase-dispatch_test-timeouts' into 'main'
Bump the timeouts in the dispatch_test

Closes #4392

See merge request isc-projects/bind9!8437
2023-10-27 11:00:20 +00:00
Ondřej Surý
aa393b9e57
Bump the timeouts in the dispatch_test
The client connection timeout was set to just one second, which might
not be enough on busy systems (and the CI machines are oh-boy-busy).
Bump the server timeouts to 10 seconds and client timeouts to 5 seconds,
this will make the unit test run a little bit longer, but it should be
more reliable.
2023-10-27 12:55:51 +02:00
Ondřej Surý
b7e793b84c
Add tests/dns/badcache.out to .gitignore 2023-10-27 12:55:51 +02:00
Ondřej Surý
f71ca845c1 Merge branch '4211-fix-data-race-in-controlconf' into 'main'
Call isccc_ccmsg_invalidate() when shutting down the connection

Closes #4211

See merge request isc-projects/bind9!8426
2023-10-27 10:47:57 +00:00
Ondřej Surý
2d2c249958
Call isccc_ccmsg_invalidate() when shutting down the connection
Previously, the isccc_ccmsg_invalidate() was called from conn_free() and
this could lead to netmgr calling control_recvmessage() after we
detached the reading controlconnection_t reference, but it wouldn't be
the last reference because controlconnection_t is also attached/detached
when sending response or running command asynchronously.

Instead, move the isccc_ccmsg_invalidate() call to control_recvmessage()
error handling path to make sure that control_recvmessage() won't be
ever called again from the netmgr.
2023-10-27 10:53:26 +02:00
Ondřej Surý
07f569e2f6
Replace mutex for listener->connections with TID check
The controlconf channel runs single-threaded on the main thread.
Replace the listener->connections locking with check that we are still
running on the thread with TID 0.
2023-10-27 10:21:41 +02:00
Ondřej Surý
7a37c516d4 Merge branch '4391-remove-lock-file-and--X' into 'main'
Remove the lock-file configuration and -X argument to named

Closes #4391

See merge request isc-projects/bind9!8428
2023-10-27 06:36:16 +00:00
Ondřej Surý
3a08cb5807
Add CHANGES and release note for [GL #4391] 2023-10-26 22:43:03 +02:00
Ondřej Surý
f8e264ba6d
Remove the lock-file configuration and -X argument to named
The lock-file configuration (both from configuration file and -X
argument to named) has better alternatives nowadays.  Modern process
supervisor should be used to ensure that a single named process is
running on a given configuration.

Alternatively, it's possible to wrap the named with flock(1).
2023-10-26 22:42:37 +02:00
Ondřej Surý
d3f2766a79
Mark the lock-file configuration option as deprecated
This is first step in removing the lock-file configuration option, it
marks both the `lock-file` configuration directive and -X option to
named as deprecated.
2023-10-26 22:41:45 +02:00
Michal Nowak
40c4540cf9 Merge branch 'mnowak/openbsd-7.4' into 'main'
Add OpenBSD 7.4

See merge request isc-projects/bind9!8395
2023-10-26 14:31:13 +00:00
Michal Nowak
f8733fc051
Add OpenBSD 7.4 2023-10-26 16:27:56 +02:00
Arаm Sаrgsyаn
c70e9f0fef Merge branch 'aram/fix-lock-file-option-and--X-argument-issues' into 'main'
Fix assertion failure when using -X none and lock-file in configuration

See merge request isc-projects/bind9!8432
2023-10-26 13:11:30 +00:00
Aram Sargsyan
41945b32d7 Do not warn about lock-file option change when -X is used
When -X is used the 'lock-file' option change detection condition
is invalid, because it compares the 'lock-file' option's value to
the '-X' argument's value instead of the older 'lock-file' option
value (which was ignored because of '-X').

Don't warn about changing 'lock-file' option if '-X' is used.
2023-10-26 12:34:15 +00:00
Aram Sargsyan
bc891e749f Fix an invalid condition check when detecting a lock-file change
It is obvious that the '!cfg_obj_asstring(obj)' check should be
'cfg_obj_asstring(obj)' instead, because it is an AND logic chain
which further uses 'obj' as a string.

Fix the error.
2023-10-26 12:34:07 +00:00
Aram Sargsyan
fc2dd09390 Fix assertion failure when using -X none and lock-file in configuration
When 'lock-file <lockfile>' is used in configuration at the same time
as using '-X none' in 'named' invocation, there is an invalid
logic that would lead to a isc_mem_strdup() call on a NULL value.

Also, contradicting to ARM, 'lock-file none' is overriding the '-X'
argument.

Fix the overall logic, and make sure that the '-X' takes precedence to
'lock-file'.
2023-10-26 12:21:57 +00:00
Ondřej Surý
c6edfa398c Merge branch '4386-fix-assertion-failure-when-using--X-named-option' into 'main'
Fix assertion failure when using -X and lock-file in configuration

Closes #4386

See merge request isc-projects/bind9!8427
2023-10-26 11:43:13 +00:00
Ondřej Surý
8294a43acf
Add CHANGES and release note for [GL #4386] 2023-10-26 12:56:40 +02:00
Ondřej Surý
4f68def5e9
Fix assertion failure when using -X and lock-file in configuration
When 'lock-file <lockfile1>' was used in configuration at the same time
as using `-X <lockfile2>` in `named` invocation, there was an invalid
logic that would lead to a double isc_mem_strdup() call on the
<lockfile2> value.

Skip the second allocation if `lock-file` is being used in
configuration, so the <lockfile2> is used only single time.
2023-10-26 11:01:17 +02:00
Tom Krizek
f2225ca9af Merge branch 'tkrizek/shfmt' into 'main'
Enforce shell script codestyle with shfmt

See merge request isc-projects/bind9!8419
2023-10-26 09:01:06 +00:00
Tom Krizek
c8fb0b48e0
Ignore shell script formatting in git blame 2023-10-26 10:25:11 +02:00
Tom Krizek
bebdfa13be
Add editorconfig file for shell style 2023-10-26 10:23:52 +02:00
Tom Krizek
b6505ff573
Run shfmt in CI
Ensure our shell script format stays consistent in the future.
2023-10-26 10:23:52 +02:00
Tom Krizek
4cb8b13987
Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

  shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)
2023-10-26 10:23:50 +02:00
Ondřej Surý
dea544d651 Merge branch '4390-allow-changing-liburcu-mode-only-in-developer-mode' into 'main'
Allowing changing Userspace-RCU variant only in developer mode

Closes #4390

See merge request isc-projects/bind9!8425
2023-10-26 08:21:49 +00:00
Ondřej Surý
17f1d0e862
Remove Userspace-RCU signal variant
The signal variant of Userspace-RCU has been deprecated upstream.
Remove the support for compiling with it from configure.ac.
2023-10-26 10:20:29 +02:00
Ondřej Surý
42d43aa075
Allowing changing Userspace-RCU variant only in developer mode
The Userspace-RCU variants other than membarrier is untested and at
least in QSBR case it's broken.  Allow changing the Userspace-RCU
variant only in the developer's mode.
2023-10-26 10:20:29 +02:00
Evan Hunt
59e4c45fa5 Merge branch '4385-qp-lookup-race' into 'main'
prevent a possible race in dns_qpmulti_query()

Closes #4385

See merge request isc-projects/bind9!8421
2023-10-26 07:34:57 +00:00
Evan Hunt
03183baa6d Prevent a possible race in dns_qpmulti_query() and _snapshot()
The `.reader` member of dns_qpmulti_t was accessed without RCU
protection; reader_open() calls rcu_dereference() on it, and this
call needs to be inside an RCU critical section.

A similar problem was identified in the dns_qpmulti_snapshot() - the
RCU critical section was completely missing.

These are relicts of the isc_qsbr - in the QSBR mode the rcu_read_lock()
and rcu_read_unlock() are no-ops and whole event loop is a critical section.
2023-10-26 00:32:22 -07:00
Mark Andrews
17b0eff0cc Merge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed' into 'main'
Resolve "lock file is deleted on exit even if lock acquisition failed"

Closes #4387

See merge request isc-projects/bind9!8422
2023-10-26 07:02:01 +00:00
Mark Andrews
c1b8279ebb Add release note for [GL #4387] 2023-10-26 16:14:02 +11:00
Mark Andrews
a8613372c9 Add CHANGES note for [GL #4387] 2023-10-26 15:41:46 +11:00
Mark Andrews
811c9ee7d1 Check that the lock file was not removed too early
When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.
2023-10-26 15:41:46 +11:00
Mark Andrews
b9c789b8b3 Only remove the lock file if we managed to lock it
The lock file was being removed when we hadn't successfully locked
it which defeated the purpose of the lockfile.  Adjust cleanup_lockfile
such that it only unlinks the lockfile if we have successfully locked
the lockfile and it is still active (lockfile != NULL).
2023-10-26 14:55:31 +11:00
Ondřej Surý
8983bf8ed2 Merge branch 'ondrej/dns_message-refactoring' into 'main'
Refactor and cleanup the dns_message unit

See merge request isc-projects/bind9!8400
2023-10-25 10:37:16 +00:00
Ondřej Surý
6bb42939cf
Refactor dns_message using ISC_LIST_FOREACH macros
Do a light refactoring and cleanups that replaces common list walking
patterns with ISC_LIST_FOREACH macros and split some nested loops into
separate static functions to reduce the nesting depth.
2023-10-25 12:36:37 +02:00
Ondřej Surý
d2e84a4b97
Add ISC_LIST_FOREACH_REV(_SAFE) macros
Add complementary macros to ISC_LIST_FOREACH(_SAFE) that walk the lists
in reverse.

  * ISC_LIST_FOREACH_REV(list, elt, link) - walk the static list from
    tail to head
  * ISC_LIST_FOREACH_REV_SAFE(list, elt, link, next) - walk the list
    from tail to head in a manner that's safe against list member
    deletions
2023-10-25 12:36:13 +02:00
Ondřej Surý
fd732a7fb5
Add dns__message_putassociatedrdataset() to deduplicate code
There was a lot of internal code looking like this:

    INSIST(dns_rdataset_isassociated(rdataset));
    dns_rdataset_disassociated(rdataset)
    isc_mempool_put(msg->rdspool, rdataset);

Deduplicate the code into local dns__message_puttemprdataset() routine,
and drop the INSIST() which is checked in dns_rdataset_disassociate().
2023-10-25 12:36:08 +02:00
Ondřej Surý
5fca0fb519
Remove unused dns_message_movename() method
Since dns_message_movename() was unused, it could be removed from the
code based to declutter the API.
2023-10-25 11:43:10 +02:00
Ondřej Surý
1b387c204c Merge branch '4379-dont-reuse-TCP-dispatches-in-dns_xfrin' into 'main'
Add option to mark TCP dispatch as unshared

Closes #4379

See merge request isc-projects/bind9!8408
2023-10-24 12:19:23 +00:00
Ondřej Surý
5a1e0dbfd1
Add CHANGES note for [GL #4379] 2023-10-24 13:07:31 +02:00