]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
21 months ago[9.18] fix: dev: Check the result of dirfd() before calling unlinkat()
Ondřej Surý [Mon, 19 Aug 2024 11:23:13 +0000 (11:23 +0000)] 
[9.18] fix: dev: Check the result of dirfd() before calling unlinkat()

Instead of directly using the result of dirfd() in the unlinkat() call,
check whether the returned file descriptor is actually valid.  That
doesn't really change the logic as the unlinkat() would fail with
invalid descriptor anyway, but this is cleaner and will report the right
error returned directly by dirfd() instead of EBADF from unlinkat().

Closes #4853

Backport of MR !9316

Merge branch 'backport-4853-check-result-of-dirfd-in-isc_log-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9344

21 months agoCheck the result of dirfd() before calling unlinkat()
Ondřej Surý [Thu, 15 Aug 2024 07:23:31 +0000 (09:23 +0200)] 
Check the result of dirfd() before calling unlinkat()

Instead of directly using the result of dirfd() in the unlinkat() call,
check whether the returned file descriptor is actually valid.  That
doesn't really change the logic as the unlinkat() would fail with
invalid descriptor anyway, but this is cleaner and will report the right
error returned directly by dirfd() instead of EBADF from unlinkat().

(cherry picked from commit 59f4fdebc07441a5c7419488990f4b82c6a22eeb)

21 months ago[9.18] chg: dev: Remove code to read and parse /proc/net/if_inet6 on Linux
Ondřej Surý [Mon, 19 Aug 2024 11:01:43 +0000 (11:01 +0000)] 
[9.18] chg: dev: Remove code to read and parse /proc/net/if_inet6 on Linux

The getifaddr() works fine for years, so we don't have to
keep the callback to parse /proc/net/if_inet6 anymore.

Closes #4852

Backport of MR !9315

Merge branch 'backport-4852-handle-errors-from-rewind-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9342

21 months agoRemove code to read and parse /proc/net/if_inet6 on Linux
Ondřej Surý [Thu, 15 Aug 2024 08:50:22 +0000 (10:50 +0200)] 
Remove code to read and parse /proc/net/if_inet6 on Linux

The getifaddr() works fine for years, so we don't have to
keep the callback to parse /proc/net/if_inet6 anymore.

(cherry picked from commit 2fbf9757b85ef1efc2bd311dac0c77c2a77889cd)

21 months agoIgnore errno returned from rewind() in the interface iterator
Ondřej Surý [Thu, 15 Aug 2024 07:12:18 +0000 (09:12 +0200)] 
Ignore errno returned from rewind() in the interface iterator

The clang-scan 19 has reported that we are ignoring errno after the call
to rewind().  As we don't really care about the result, just silence the
error, the whole code will be removed in the development version anyway
as it is not needed.

(cherry picked from commit dda5ba53dfaa3926b16cf3c786ae2395ced89ca3)

21 months ago[9.18] chg: test: For TSAN builds, use libraries from /opt/tsan
Ondřej Surý [Fri, 16 Aug 2024 08:40:48 +0000 (08:40 +0000)] 
[9.18] chg: test: For TSAN builds, use libraries from /opt/tsan

The new TSAN images, the TSAN-enabled images install libraries to
opt/tsan, synchronize the configure options and CFLAGS between gcc:tsan
and clang:tsan images and set the PKG_CONFIG_PATH to /opt/tsan/lib.

Additionally, drop Debian bullseye that's EOL now.

Backport of MR !9324

Merge branch 'backport-ondrej/use-staging-tsan-images-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9326

21 months agoRetire Debian 11 "bullseye"
Michal Nowak [Fri, 16 Aug 2024 06:31:51 +0000 (08:31 +0200)] 
Retire Debian 11 "bullseye"

A follow-up to isc-projects/bind9!9324.

21 months agoRemove Debian bullseye jobs
Ondřej Surý [Thu, 15 Aug 2024 18:21:46 +0000 (20:21 +0200)] 
Remove Debian bullseye jobs

The Debian bullseye has reached end-of-life, remove it from the CI.

(cherry picked from commit d02d6af2b9ac6e74c433c01d63e37c87e14b254e)

21 months agoFor TSAN builds, use libraries from /opt/tsan
Ondřej Surý [Thu, 15 Aug 2024 17:54:58 +0000 (19:54 +0200)] 
For TSAN builds, use libraries from /opt/tsan

The new TSAN images, the TSAN-enabled images install libraries to
/opt/tsan, synchronize the configure options and CFLAGS between gcc:tsan
and clang:tsan images and set the PKG_CONFIG_PATH to /opt/tsan/lib.

(cherry picked from commit 2a46396f295146b3868d89c8d8136fd3574579e5)

21 months ago[9.18] chg: ci: Check that generated changelog entry doesn't break docs build
Nicki Křížek [Wed, 14 Aug 2024 19:15:25 +0000 (19:15 +0000)] 
[9.18] chg: ci: Check that generated changelog entry doesn't break docs build

Since changelog entries are now generated from MR title&description,
they aren't sanity checked during a regular docs build. If these contain
special sequences that will be interpreted by sphinx, it might result in
breakage that would have to be amended manually.

Add a CI check to test a doc build with changelog after the MR is merged
to ensure that the docs can be built when generating changelog from
pristine git contents.

Related #4847

Backport of MR !9294

Merge branch 'backport-nicki/add-changelog-entry-check-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9312

21 months agoUse python3 in shebang lines for util scripts
Nicki Křížek [Tue, 13 Aug 2024 12:00:43 +0000 (14:00 +0200)] 
Use python3 in shebang lines for util scripts

Some distributions (notably, debian bookworm) have deprecated the
`python` interpreter in favor of `python3`. Since our scripts are
python3 anyway, use the proper numbered version in shebang to make
scripts easily executable.

(cherry picked from commit 480dcdef9af36283273fdd88021ee525f7a7f287)

21 months agoCheck that generated changelog entry doesn't break docs build
Nicki Křížek [Mon, 12 Aug 2024 12:51:31 +0000 (14:51 +0200)] 
Check that generated changelog entry doesn't break docs build

Since changelog entries are now generated from MR title&description,
they aren't sanity checked during a regular docs build. If these contain
special sequences that will be interpreted by sphinx, it might result in
breakage that would have to be amended manually.

Add a CI check to test a doc build with changelog after the MR is merged
to ensure that the docs can be built when generating changelog from
pristine git contents.

(cherry picked from commit bf69e8f149d539e4a5d21638c77c1b9a2d29347d)

21 months ago[9.18] chg: doc: Fix ordering of gitchangelog replacement regexs
Nicki Křížek [Wed, 14 Aug 2024 15:20:55 +0000 (15:20 +0000)] 
[9.18] chg: doc: Fix ordering of gitchangelog replacement regexs

Ensure the issue number in changelog isn't accidentally removed for backport MRs.

Backport of MR !9295

Merge branch 'backport-nicki/fix-gitchangelog-replacement-regexs-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9309

21 months agoFix ordering of gitchangelog replacement regexs
Nicki Křížek [Tue, 13 Aug 2024 08:33:02 +0000 (10:33 +0200)] 
Fix ordering of gitchangelog replacement regexs

Prior to this change, the issue number could be accidentally removed by
the `Backport of` text, depending on the order of the MR description
contents. Ensure all the removals for text in MR descriptions happen
first, and only then run the replacement regex for issue number, which
appends it to the end of the last non-empty line (which will no longer
be removed).

The only removals that happen after the replacement are guaranteed to
always happen after the end of MR description, since they're
auto-generated by gitlab when the merge commit is created, thus won't
affect the line with the issue number.

Also remove the needless isc-private/bind9 replacement. References
to private MRs are already removed by the very first regex.

(cherry picked from commit 37274bebe147a1dc95565e3e1bbb2c112778ecbf)

21 months ago[9.18] chg: Make every changelog entry a separate code block
Michal Nowak [Thu, 8 Aug 2024 16:01:59 +0000 (16:01 +0000)] 
[9.18] chg: Make every changelog entry a separate code block

LaTeX in CI and on ReadTheDocs [fails][1] to render a PDF version of ARM if
the Changelog section is included. The running theory is that the
verbatim section of more than twenty thousand lines is too big to meet
LaTeX self-imposed constraints, and it fails with:

    ! TeX capacity exceeded, sorry [main memory size=5000000].

Or it just hangs if extra_mem_bot=30000000 is set in
/etc/texmf/texmf.d/01main_memory_bump.cnf:

    ! Dimension too large.
    \fb@put@frame ...p \ifdim \dimen@ >\ht \@tempboxa

    \fb@putboxa #1\fb@afterfra...
    l.56913 \end{sphinxVerbatim}

Make each BIND 9 release a separate code block to work around the issue.
Further split up the sections for some exceptionally large releases, for
the same reason.

[1]: https://gitlab.isc.org/isc-projects/bind9/-/jobs/4584011

Backport of MR !9266

Merge branch 'backport-mnowak/fix-arm-changelog-section-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9290

21 months agoSplit up changelog into per-release code blocks
Michal Nowak [Wed, 7 Aug 2024 10:39:23 +0000 (12:39 +0200)] 
Split up changelog into per-release code blocks

LaTeX in CI and on ReadTheDocs fails to render a PDF version of ARM if
the Changelog section is included. The running theory is that the
verbatim section of more than twenty thousand lines is too big to meet
LaTeX self-imposed constraints, and it fails with:

    ! TeX capacity exceeded, sorry [main memory size=5000000].

Or it just hangs if extra_mem_bot=30000000 is set in
/etc/texmf/texmf.d/01main_memory_bump.cnf:

    ! Dimension too large.
    \fb@put@frame ...p \ifdim \dimen@ >\ht \@tempboxa

    \fb@putboxa #1\fb@afterfra...
    l.56913 \end{sphinxVerbatim}

Make each BIND 9 release a separate code block to work around the issue.
Further split up the sections for some exceptionally large releases, for
the same reason.

(cherry picked from commit bc802359b05deb7a4b14eeb7eaca9e26bdb6b97f)

21 months ago[9.18] new: usr: Tighten 'max-recursion-queries' and add 'max-query-restarts' option
Evan Hunt [Wed, 7 Aug 2024 23:22:22 +0000 (23:22 +0000)] 
[9.18] new: usr: Tighten 'max-recursion-queries' and add 'max-query-restarts' option

There were cases in resolver.c when the `max-recursion-queries` quota was ineffective. It was possible to craft zones that would cause a resolver to waste resources by sending excessive queries while attempting to resolve a name. This has been addressed by correcting errors in the implementation of `max-recursion-queries`, and by reducing the default value from 100 to 32.

In addition, a new `max-query-restarts` option has been added which limits the number of times a recursive server will follow CNAME or DNAME records before terminating resolution. This was previously a hard-coded limit of 16, and now defaults to 11.

Closes #4741

Backport of MR !9281

Merge branch 'backport-4741-reclimit-restarts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9283

21 months agoimplement 'max-query-restarts'
Evan Hunt [Wed, 26 Jun 2024 06:49:00 +0000 (23:49 -0700)] 
implement 'max-query-restarts'

implement, document, and test the 'max-query-restarts' option
which specifies the query restart limit - the number of times
we can follow CNAMEs before terminating resolution.

(cherry picked from commit 104f3b82fb7c7cd03edc36507b167cfc6e11d17c)

21 months agoreduce the max-recursion-queries default to 32
Evan Hunt [Tue, 25 Jun 2024 21:39:58 +0000 (14:39 -0700)] 
reduce the max-recursion-queries default to 32

the number of iterative queries that can be sent to resolve a
name now defaults to 32 rather than 100.

(cherry picked from commit 7e3b425dc283df66df9c46002307ab676e10e4fd)

21 months agomake "max_restarts" a configurable value
Evan Hunt [Tue, 25 Jun 2024 21:30:20 +0000 (14:30 -0700)] 
make "max_restarts" a configurable value

MAX_RESTARTS is no longer hard-coded; ns_server_setmaxrestarts()
and dns_client_setmaxrestarts() can now be used to modify the
max-restarts value at runtime. in both cases, the default is 11.

(cherry picked from commit c5588babaf89f3e3ad2edccaada716e55c135dd3)

21 months agoreduce MAX_RESTARTS to 11
Evan Hunt [Tue, 25 Jun 2024 19:28:23 +0000 (12:28 -0700)] 
reduce MAX_RESTARTS to 11

the number of steps that can be followed in a CNAME chain
before terminating the lookup has been reduced from 16 to 11.
(this is a hard-coded value, but will be made configurable later.)

(cherry picked from commit 05d78671bb6a5ba63d78d77339e17cbc73f18188)

21 months agoadd debug logging when creating or attaching to a query counter
Evan Hunt [Tue, 25 Jun 2024 18:02:49 +0000 (11:02 -0700)] 
add debug logging when creating or attaching to a query counter

fctx_create() now logs at debug level 9 when the fctx attaches
to an existing counter or creates a new one.

(cherry picked from commit 825f3d68c5b041b53f13a8c5b4dc431ca9b5887f)

21 months agoapply max-recursion-queries quota to validator queries
Evan Hunt [Wed, 22 May 2024 22:17:47 +0000 (15:17 -0700)] 
apply max-recursion-queries quota to validator queries

previously, validator queries for DNSKEY and DS records were
not counted toward the quota for max-recursion-queries; they
are now.

(cherry picked from commit af7db8951364a89c468eda1535efb3f53adc2c1f)

21 months agoattach query counter to NS fetches
Evan Hunt [Wed, 22 May 2024 20:02:16 +0000 (13:02 -0700)] 
attach query counter to NS fetches

there were cases in resolver.c when queries for NS records were
started without passing a pointer to the parent fetch's query counter;
as a result, the max-recursion-queries quota for those queries started
counting from zero, instead of sharing the limit for the parent fetch,
making the quota ineffective in some cases.

(cherry picked from commit d3b7e92783754e9a4ce93046fadcb96c5439a0d7)

21 months ago[9.18] chg: test: Use new images with TSAN-enabled libraries
Ondřej Surý [Wed, 7 Aug 2024 16:02:10 +0000 (16:02 +0000)] 
[9.18] chg: test: Use new images with TSAN-enabled libraries

The new Fedora 40 TSAN images use libuv, urcu and OpenSSL libraries compiled with ThreadSanitizer.  This (in theory) should enable better detection of memory races in those (most important) libraries.

Backport of MR !9264

Merge branch 'backport-ondrej/test-new-tsan-images-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9277

21 months agoAdd configure for libraries in /usr/local for the gcc:tsan job
Ondřej Surý [Tue, 6 Aug 2024 14:01:54 +0000 (16:01 +0200)] 
Add configure for libraries in /usr/local for the gcc:tsan job

The TSAN-enabled libraries are installed to /usr/local, pass the
PKG_CONFIG_PATH and few other options to CFLAGS to the configure
arguments.

(cherry picked from commit ed766efc15da8b1ca3c597b5b53ab7e2bd331e85)

21 months ago[9.18] fix: dev: Disassociate the SSL object from the cached SSL_SESSION
Ondřej Surý [Wed, 7 Aug 2024 16:01:11 +0000 (16:01 +0000)] 
[9.18] fix: dev: Disassociate the SSL object from the cached SSL_SESSION

When the SSL object was destroyed, it would invalidate all SSL_SESSION
objects including the cached, but not yet used, TLS session objects.

Properly disassociate the SSL object from the SSL_SESSION before we
store it in the TLS session cache, so we can later destroy it without
invalidating the cached TLS sessions.

Closes #4834

Backport of MR !9271

Merge branch 'backport-4834-detach-SSL-from-cached-SSL_SESSION-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9279

21 months agoDisassociate the SSL object from the cached SSL_SESSION
Ondřej Surý [Wed, 7 Aug 2024 12:58:02 +0000 (14:58 +0200)] 
Disassociate the SSL object from the cached SSL_SESSION

When the SSL object was destroyed, it would invalidate all SSL_SESSION
objects including the cached, but not yet used, TLS session objects.

Properly disassociate the SSL object from the SSL_SESSION before we
store it in the TLS session cache, so we can later destroy it without
invalidating the cached TLS sessions.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
Co-authored-by: Aram Sargsyan <aram@isc.org>
(cherry picked from commit c11b736e44a5f637eff9babcd65cc2958f52e7ce)

21 months ago[9.18] fix: dev: Attach/detach to the listening child socket when accepting TLS
Ondřej Surý [Wed, 7 Aug 2024 16:00:55 +0000 (16:00 +0000)] 
[9.18] fix: dev: Attach/detach to the listening child socket when accepting TLS

When TLS connection (TLSstream) connection was accepted, the children
listening socket was not attached to sock->server and thus it could have
been freed before all the accepted connections were actually closed.

In turn, this would cause us to call isc_tls_free() too soon - causing
cascade errors in pending SSL_read_ex() in the accepted connections.

Properly attach and detach the children listening socket when accepting
and closing the server connections.

Closes #4833

Backport of MR !9270

Merge branch 'backport-4833-tlssock-needs-to-attach-to-child-tlslistener-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9278

21 months agoAttach/detach to the listening child socket when accepting TLS
Ondřej Surý [Wed, 7 Aug 2024 06:43:12 +0000 (08:43 +0200)] 
Attach/detach to the listening child socket when accepting TLS

When TLS connection (TLSstream) connection was accepted, the children
listening socket was not attached to sock->server and thus it could have
been freed before all the accepted connections were actually closed.

In turn, this would cause us to call isc_tls_free() too soon - causing
cascade errors in pending SSL_read_ex() in the accepted connections.

Properly attach and detach the children listening socket when accepting
and closing the server connections.

(cherry picked from commit 684f3eb8e62fb2dd2e6adf3272e87b1fd4b08579)

21 months ago[9.18] fix: dev: Make hypothesis optional for system tests
Petr Špaček [Wed, 7 Aug 2024 12:11:10 +0000 (12:11 +0000)] 
[9.18] fix: dev: Make hypothesis optional for system tests

Ensure that system tests can be executed without Python hypothesis
package.

Closes #4831

Backport of MR !9265

Merge branch 'backport-4831-isctest-make-hypothesis-optional-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9268

21 months agoMake hypothesis optional for system tests
Nicki Křížek [Tue, 6 Aug 2024 15:14:21 +0000 (17:14 +0200)] 
Make hypothesis optional for system tests

Ensure that system tests can be executed without Python hypothesis
package.

(cherry picked from commit e6a7695600764d6e8f37556d0dd5ecfb44d73fe3)

21 months ago[9.18] fix: dev: Don't loop indefinitely when isc_task quantum is 'unlimited'
Ondřej Surý [Wed, 7 Aug 2024 06:32:42 +0000 (06:32 +0000)] 
[9.18] fix: dev: Don't loop indefinitely when isc_task quantum is 'unlimited'

Don't run more events than already scheduled.  If the quantum is set to
a high value, the task_run() would execute already scheduled, and all
new events that result from running event->ev_action().

Setting quantum to a number of scheduled events will postpone events
scheduled after we enter the loop here to the next task_run()
invocation.

Merge branch 'ondrej/dont-run-more-events-than-scheduled-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9257

21 months agoDon't loop indefinitely when isc_task quantum is 'unlimited'
Ondřej Surý [Thu, 7 Mar 2024 12:39:46 +0000 (13:39 +0100)] 
Don't loop indefinitely when isc_task quantum is 'unlimited'

Don't run more events than already scheduled.  If the quantum is set to
a high value, the task_run() would execute already scheduled, and all
new events that result from running event->ev_action().

Setting quantum to a number of scheduled events will postpone events
scheduled after we enter the loop here to the next task_run()
invocation.

21 months ago[9.18] chg: dev: Use _exit() in the fatal() function
Ondřej Surý [Tue, 6 Aug 2024 14:11:15 +0000 (14:11 +0000)] 
[9.18] chg: dev: Use _exit() in the fatal() function

Since the fatal() isn't a correct but rather abrupt termination of the
program, we want to skip the various atexit() calls because not all
memory might be freed during fatal() call, etc.  Using _exit() instead
of exit() has this effect - the program will end, but no destructors or
atexit routines will be called.

Backport of MR !8703

Merge branch 'backport-ondrej/use-_exit-in-fatal-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9263

21 months agoUse EXIT_SUCCESS and EXIT_FAILURE
Ondřej Surý [Wed, 7 Feb 2024 13:50:38 +0000 (14:50 +0100)] 
Use EXIT_SUCCESS and EXIT_FAILURE

Instead of randomly using -1 or 1 as a failure status, properly utilize
the EXIT_FAILURE define that's platform specific (as it should be).

(cherry picked from commit76997983fde02d9c32aa23bda30b65f1ebd4178c)

21 months agoUse _exit() in the fatal() function
Ondřej Surý [Wed, 7 Feb 2024 13:44:39 +0000 (14:44 +0100)] 
Use _exit() in the fatal() function

Since the fatal() isn't a correct but rather abrupt termination of the
program, we want to skip the various atexit() calls because not all
memory might be freed during fatal() call, etc.  Using _exit() instead
of exit() has this effect - the program will end, but no destructors or
atexit routines will be called.

(cherry picked from commit 4bec711fe3643f50f525b1879b43eeb9be1a0b7a)

22 months ago[9.18] fix: usr: Raise the log level of priming failures
Ondřej Surý [Mon, 5 Aug 2024 14:05:31 +0000 (14:05 +0000)] 
[9.18] fix: usr: Raise the log level of priming failures

When a priming query is complete, it's currently logged at level ISC_LOG_DEBUG(1), regardless of success or failure. We are now raising it to ISC_LOG_NOTICE in the case of failure. [GL #3516]

Closes #3516

Backport of MR !9121

Merge branch 'backport-3516-log-priming-errors-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9251

22 months agoraise the log level of priming failures
Evan Hunt [Mon, 1 Jul 2024 20:00:04 +0000 (13:00 -0700)] 
raise the log level of priming failures

when a priming query is complete, it's currently logged at
level ISC_LOG_INFO, regardless of success or failure. we
are now changing it to ISC_LOG_NOTICE in the case of failure
and ISC_LOG_DEBUG(1) in case of success.

(cherry picked from commit a84d54c6ff8edf4b0bd36c84fab1cae37684f7f8)

22 months agofix: usr: Add a compatibility shim for older libuv versions (< 1.19.0)
Ondřej Surý [Mon, 5 Aug 2024 10:29:41 +0000 (10:29 +0000)] 
fix: usr: Add a compatibility shim for older libuv versions (< 1.19.0)

The uv_stream_get_write_queue_size() is supported only in relatively newer versions of libuv (1.19.0 or higher).  Provide a compatibility shim for this function , so BIND 9 can be built in environments with older libuv version.

Fixes: #4822
Merge branch 'uv_stream_get_write_queue_size_wrapper' into 'bind-9.18'

See merge request isc-projects/bind9!9153

22 months agoadd a trivial wrapper for uv_stream_get_write_queue_size
JINMEI Tatuya [Tue, 16 Jul 2024 12:15:03 +0000 (21:15 +0900)] 
add a trivial wrapper for uv_stream_get_write_queue_size

22 months ago[9.18] fix: test: Use LC_ALL to override all system locales
Ondřej Surý [Mon, 5 Aug 2024 09:12:30 +0000 (09:12 +0000)] 
[9.18] fix: test: Use LC_ALL to override all system locales

The system tests were overriding the local locale by setting LANG to C.
This does not override the locale in case there are individual LC_<*>
variables like LC_CTYPE explicitly set.

Use LC_ALL=C instead which is the proper way of overriding all currently
set locales.

Backport of MR !9109

Merge branch 'backport-ondrej/use-LC_ALL-not-LANG-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9236

22 months agoUse LC_ALL to override all system locales
Ondřej Surý [Tue, 18 Jun 2024 06:56:18 +0000 (08:56 +0200)] 
Use LC_ALL to override all system locales

The system tests were overriding the local locale by setting LANG to C.
This does not override the locale in case there are individual LC_<*>
variables like LC_CTYPE explicitly set.

Use LC_ALL=C instead which is the proper way of overriding all currently
set locales.

22 months ago[9.18] fix: usr: Remove extra newline from yaml output
Mark Andrews [Mon, 5 Aug 2024 05:17:11 +0000 (05:17 +0000)] 
[9.18] fix: usr: Remove extra newline from yaml output

I split this into two commits, one for the actual newline removal, and one for issues I found, ruining the yaml output when some errors were outputted.

Closes: #4772
Backport of MR !9112

Merge branch 'backport-yaml-indent-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9232

22 months agoRemove newlines from dighost errors calls
Yedaya Katsman [Sun, 16 Jun 2024 20:10:28 +0000 (23:10 +0300)] 
Remove newlines from dighost errors calls

Not all invocations had it, and this makes it more consistent with
dighost_warning. Also remove the conditional newline when not outputting
yaml

(cherry picked from commit 1dd76fe78051b926f2f7b614a40af550c6c6cdf2)

22 months agoRemove extra newline from +yaml output
Yedaya Katsman [Sun, 16 Jun 2024 20:09:53 +0000 (23:09 +0300)] 
Remove extra newline from +yaml output

The newlines weren't needed for the yaml syntax, and took up space.

(cherry picked from commit 8986dda74a6ef4ca09655293a5b17b252279eec6)

22 months ago[9.18] fix: dev: CID 498025 and CID 498031: Overflowed constant INTEGER_OVERFLOW
Mark Andrews [Mon, 5 Aug 2024 01:38:09 +0000 (01:38 +0000)] 
[9.18] fix: dev: CID 498025 and CID 498031: Overflowed constant INTEGER_OVERFLOW

Add INSIST to fail if the multiplication would cause the variables to overflow.

Closes #4798

Backport of MR !9131

Merge branch 'backport-4798-cid-498025-and-cid-498031-overflowed-constant-integer_overflow-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9230

22 months agoPrevent overflow of bufsize
Mark Andrews [Tue, 9 Jul 2024 01:55:46 +0000 (11:55 +1000)] 
Prevent overflow of bufsize

If bufsize overflows we will have an infinite loop.  In practice
this will not happen unless we have made a coding error.  Add an
INSIST to detect this condition.

    181retry:
    182        isc_buffer_allocate(mctx, &b, bufsize);
    183        result = dns_rdata_totext(rdata, NULL, b);
    184        if (result == ISC_R_NOSPACE) {
    185                isc_buffer_free(&b);

    CID 498031: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
    overflow_const: Expression bufsize, which is equal to 0, overflows
    the type that receives it, an unsigned integer 32 bits wide.
    186                bufsize *= 2;
    187                goto retry;
    188        }

(cherry picked from commit 20ac13fb234f9bca37fe8b86910df805779a7621)

22 months agoPrevent overflow of size
Mark Andrews [Tue, 9 Jul 2024 01:59:39 +0000 (11:59 +1000)] 
Prevent overflow of size

If size overflows we will have an infinite loop.  In practice
this will not happen unless we have made a coding error.  Add
an INSIST to detect this condition.

    181        while (!done) {
    182                isc_buffer_allocate(mctx, &b, size);
    183                result = dns_rdata_totext(rdata, NULL, b);
    184                if (result == ISC_R_SUCCESS) {
    185                        printf("%.*s\n", (int)isc_buffer_usedlength(b),
    186                               (char *)isc_buffer_base(b));
    187                        done = true;
    188                } else if (result != ISC_R_NOSPACE) {
    189                        check_result(result, "dns_rdata_totext");
    190                }
    191                isc_buffer_free(&b);

    CID 498025: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
    overflow_const: Expression size, which is equal to 0, overflows the type that
    receives it, an unsigned integer 32 bits wide.
    192                size *= 2;
    193        }

(cherry picked from commit e7ef0a60ab4ffedf5a8defe86a02452b0ee124ab)

22 months ago[9.18] chg: test: Expand the wildcard system test with wider use of hypothesis
Petr Špaček [Fri, 2 Aug 2024 12:32:48 +0000 (12:32 +0000)] 
[9.18] chg: test: Expand the wildcard system test with wider use of hypothesis

Backport of MR !8461

Merge branch 'stepan/hypothesis-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9072

22 months agoAdd a helper for uncompressed length of dnspython's dns.name.Name
Štěpán Balážik [Tue, 14 May 2024 14:26:44 +0000 (16:26 +0200)] 
Add a helper for uncompressed length of dnspython's dns.name.Name

This is useful for generating using hypothesis but also for other
cases.

(cherry picked from commit 9584a7bdcd5978165a14348247fa670025172257)

22 months agoMove hypothesis strategies to isctest for later reuse
Štěpán Balážik [Tue, 23 Apr 2024 14:45:45 +0000 (16:45 +0200)] 
Move hypothesis strategies to isctest for later reuse

`isctest.hypothesis` seems to be a nice place to have these.

(cherry picked from commit bb1e5cfa092cc18da43fbf37db3fcfb5f7c8713c)

22 months agoDisable deadlines for hypothesis tests when running in CI
Štěpán Balážik [Tue, 23 Apr 2024 13:48:18 +0000 (15:48 +0200)] 
Disable deadlines for hypothesis tests when running in CI

The times it takes to run tests CI vary significantly enough
that it makes hypothesis test reach their deadlines and fail randomly
marking the tests as flaky.

This commit disables the deadlines when running in CI.

(cherry picked from commit f55cacbbfd5eeaeb8e521895a0ffab8addeaad6f)

22 months agoTest nested wildcard special case in the respective system test
Štěpán Balážik [Mon, 29 Jan 2024 17:56:32 +0000 (18:56 +0100)] 
Test nested wildcard special case in the respective system test

See final remark of RFC 4592 2.2.1. for details.

(cherry picked from commit 9943172566e44ee4a93944e257717eb116b337f4)

22 months agoExpand the wildcard system test with wider use of hypothesis
Štěpán Balážik [Thu, 2 Nov 2023 15:03:54 +0000 (16:03 +0100)] 
Expand the wildcard system test with wider use of hypothesis

The queries are now generated more generally (i. e. they have
multiple labels, etc.).

(cherry picked from commit d0cfbd398e786b1565c80216ccca974e5fb2fec8)

22 months agoAdd hypothesis strategies for generating DNS names and company
Štěpán Balážik [Thu, 2 Nov 2023 15:00:46 +0000 (16:00 +0100)] 
Add hypothesis strategies for generating DNS names and company

The most important being `dns_names` that generates dns.name.Name
objects based on given paramaters.

No guarantees are given when it comes the uniformity of generated
samples, however it plays nicely with the hypothesis' shrinking
algorithm.

Once we use hypothesis more widely (in at least one more test) this file
should be moved for it to be reused easily.

(cherry picked from commit 5d738cd9edacbd5b8f83f28aefeccf0b2913cbab)

22 months agoExtend isctest package with more utility functions
Štěpán Balážik [Thu, 21 Dec 2023 19:25:20 +0000 (20:25 +0100)] 
Extend isctest package with more utility functions

Check for more rcodes and various properties needed in the wildcard
test. Add a `name` module for various dns.name.Name operations (with
`prepend_label` function only now).

Expose `timeout` as a parameter of `query.tcp`/`query.udp`.

(cherry picked from commit e7d46ad8ba17725a934ec84512644f837513b8d3)

22 months agoSilent pylint's line-too-long warning as it's handled better by black
Štěpán Balážik [Thu, 2 Nov 2023 15:29:46 +0000 (16:29 +0100)] 
Silent pylint's line-too-long warning as it's handled better by black

Black allows the lines with string literals to be longer, which is
convenient for descriptive error messages.

(cherry picked from commit 02d1c5fc8914a3656d7dc124a43dc1273da441c8)

22 months ago[9.18] new: doc: Clarify how to print default dnssec-policy
Petr Špaček [Fri, 2 Aug 2024 09:15:16 +0000 (09:15 +0000)] 
[9.18] new: doc: Clarify how to print default dnssec-policy

Backport of MR !9092

Merge branch 'backport-pspacek/doc-dnssec-policy-default-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9226

22 months agoClarify how to print default dnssec-policy
Petr Špaček [Fri, 7 Jun 2024 07:45:48 +0000 (09:45 +0200)] 
Clarify how to print default dnssec-policy

Reading the source tree is unnecessarily complicated, we now have
command line option to print defaults.

(cherry picked from commit 1e1334a32206d26c3f9762e5b5364b5b19f65761)

22 months ago[9.18] fix: dev: Remove unnecessary operations
Mark Andrews [Fri, 2 Aug 2024 08:13:49 +0000 (08:13 +0000)] 
[9.18] fix: dev: Remove unnecessary operations

Decrementing optlen immediately before calling continue is unneccesary
and inconsistent with the rest of dns_message_pseudosectiontoyaml
and dns_message_pseudosectiontotext.  Coverity was also reporting
an impossible false positive overflow of optlen (CID 499061).

    4176                        } else if (optcode == DNS_OPT_CLIENT_TAG) {
    4177                                uint16_t id;
    4178                                ADD_STRING(target, "; CLIENT-TAG:");
    4179                                if (optlen == 2U) {
    4180                                        id = isc_buffer_getuint16(&optbuf);
    4181                                        snprintf(buf, sizeof(buf), " %u
", id);
    4182                                        ADD_STRING(target, buf);

    CID 499061: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
    overflow_const: Expression optlen, which is equal to 65534, underflows
    the type that receives it, an unsigned integer 16 bits wide.
    4183                                        optlen -= 2;
    4184                                        POST(optlen);
    4185                                        continue;
    4186                                }
    4187                        } else if (optcode == DNS_OPT_SERVER_TAG) {

Backport of MR !9130

Merge branch 'backport-marka-remove-unnecessary-operations-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9224

22 months agoRemove unnecessary operations
Mark Andrews [Tue, 9 Jul 2024 00:29:30 +0000 (10:29 +1000)] 
Remove unnecessary operations

Decrementing optlen immediately before calling continue is unneccesary
and inconsistent with the rest of dns_message_pseudosectiontoyaml
and dns_message_pseudosectiontotext.  Coverity was also reporting
an impossible false positive overflow of optlen (CID 499061).

    4176                        } else if (optcode == DNS_OPT_CLIENT_TAG) {
    4177                                uint16_t id;
    4178                                ADD_STRING(target, "; CLIENT-TAG:");
    4179                                if (optlen == 2U) {
    4180                                        id = isc_buffer_getuint16(&optbuf);
    4181                                        snprintf(buf, sizeof(buf), " %u\n", id);
    4182                                        ADD_STRING(target, buf);

    CID 499061: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
    overflow_const: Expression optlen, which is equal to 65534, underflows
    the type that receives it, an unsigned integer 16 bits wide.
    4183                                        optlen -= 2;
    4184                                        POST(optlen);
    4185                                        continue;
    4186                                }
    4187                        } else if (optcode == DNS_OPT_SERVER_TAG) {

(cherry picked from commit 47338c2c876970cdd8c0e07532b88bc65bf1ea3c)

22 months ago[9.18] fix: test: digdelv system test can report more errors than there actually are
Mark Andrews [Fri, 2 Aug 2024 04:19:10 +0000 (04:19 +0000)] 
[9.18] fix: test: digdelv system test can report more errors than there actually are

Closes #4770

Backport of MR !9104

Merge branch 'backport-4770-digdelv-system-test-can-report-more-errors-than-they-actually-are-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9222

22 months agoReset 'ret' to zero at start of tests
Mark Andrews [Wed, 12 Jun 2024 22:57:14 +0000 (08:57 +1000)] 
Reset 'ret' to zero at start of tests

(cherry picked from commit 2dc2abd00df901f98592e2d2cadc953b54fcb5ea)

22 months ago[9.18] fix: usr: fix generation of 6to4-self name expansion from IPv4 address
Mark Andrews [Fri, 2 Aug 2024 00:56:33 +0000 (00:56 +0000)] 
[9.18] fix: usr: fix generation of 6to4-self name expansion from IPv4 address

The period between the most significant nibble of the encoded IPv4 address and the 2.0.0.2.IP6.ARPA suffix was missing resulting in the wrong name being checked. Add system test for 6to4-self implementation.

Closes #4766

Backport of MR !9099

Merge branch 'backport-4766-add-system-test-for-6to4-self-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9218

22 months agocheck 'update-policy 6to4-self' over IPv6
Mark Andrews [Fri, 7 Jun 2024 03:28:48 +0000 (13:28 +1000)] 
check 'update-policy 6to4-self' over IPv6

(cherry picked from commit 3b0de4773bb0d485fbc079152e08a261718005d6)

22 months agocheck 'update-policy 6to4-self' over IPv4
Mark Andrews [Wed, 5 Jun 2024 05:22:17 +0000 (15:22 +1000)] 
check 'update-policy 6to4-self' over IPv4

(cherry picked from commit b28e5ff72174ebc91f0247e22efa6177fa0ccfcc)

22 months agoAdd missing period to generated IPv4 6to4 name
Mark Andrews [Wed, 5 Jun 2024 03:59:39 +0000 (13:59 +1000)] 
Add missing period to generated IPv4 6to4 name

The period between the most significant nibble of the IPv4 address
and the 2.0.0.2.IP6.ARPA suffix was missing resulting in the wrong
name being checked.

(cherry picked from commit bca63437a15d857cdf79ca1f1bbcb5e5062e5fb8)

22 months ago[9.18] chg: doc: update querylog documentation in ARM
Arаm Sаrgsyаn [Thu, 1 Aug 2024 19:26:40 +0000 (19:26 +0000)] 
[9.18] chg: doc: update querylog documentation in ARM

Add a note that 'rndc reload' and 'rndc reconfig' can't change the
querylog option during the runtime of named.

Closes #4801

Backport of MR !9136

Merge branch 'backport-4801-arm-querylog-clarification-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9207

22 months agoUpdate querylog documentation in ARM
Aram Sargsyan [Wed, 10 Jul 2024 12:42:16 +0000 (12:42 +0000)] 
Update querylog documentation in ARM

Add a note that 'rndc reload' and 'rndc reconfig' can't change the
querylog option during the runtime of named.

(cherry picked from commit 8fd7da2a9edc0210a91a5a058ec79ec7a7d16c43)

22 months ago[9.18] fix: usr: fix false QNAME minimisation error being reported
Mark Andrews [Thu, 1 Aug 2024 06:38:16 +0000 (06:38 +0000)] 
[9.18] fix: usr: fix false QNAME minimisation error being reported

Remove the false positive "success resolving" log message when QNAME minimisation is in effect and the final result is NXDOMAIN.

Closes #4784

Backport of MR !9117

Merge branch 'backport-4784-false-qname-minimisation-error-being-reported-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9216

22 months agoTest that false positive "success resolving" is not logged
Mark Andrews [Tue, 25 Jun 2024 04:00:51 +0000 (14:00 +1000)] 
Test that false positive "success resolving" is not logged

(cherry picked from commit 111e28521497b105c3835ee57f92c7971f93a9eb)

22 months agoCleanup old clang-format string splitting
Mark Andrews [Tue, 25 Jun 2024 06:42:25 +0000 (16:42 +1000)] 
Cleanup old clang-format string splitting

(cherry picked from commit 6d1c7beb154eaa6390921a64d280f7f76512be18)

22 months agoRemove false positive qname minimisation error
Mark Andrews [Thu, 20 Jun 2024 04:02:24 +0000 (14:02 +1000)] 
Remove false positive qname minimisation error

Don't report qname minimisation NXDOMAIN errors when the result is
NXDOMAIN.

(cherry picked from commit f78beca942ce76dde023ef1ec641924b5fe567e8)

22 months ago[9.18] fix: usr: Dig +yaml was producing unexpected and/or invalid YAML output
Mark Andrews [Thu, 1 Aug 2024 04:34:57 +0000 (04:34 +0000)] 
[9.18] fix: usr: Dig +yaml was producing unexpected and/or invalid YAML output

Closes #4796

Backport of MR !9127

Merge branch 'backport-4796-yaml-stringify-question-and-records-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9214

22 months agoTest yaml output with yaml specials
Mark Andrews [Mon, 8 Jul 2024 05:49:48 +0000 (15:49 +1000)] 
Test yaml output with yaml specials

(cherry picked from commit fadf461761dd20d5175f9eff446cbef37360385d)

22 months agoFix yaml output
Mark Andrews [Mon, 8 Jul 2024 04:00:14 +0000 (14:00 +1000)] 
Fix yaml output

In yaml mode we emit a string for each question and record.  Certain
names and data could result in invalid yaml being produced.  Use single
quote string for all questions and records.  This requires that single
quotes get converted to two quotes within the string.

(cherry picked from commit 393d7fa78e7344b515e0d271009e29754980bb36)

22 months ago[9.18] chg: test: resolver system test didn't fail on all subtest errors
Mark Andrews [Thu, 1 Aug 2024 03:30:34 +0000 (03:30 +0000)] 
[9.18] chg: test: resolver system test didn't fail on all subtest errors

Closes #4774

Backport of MR !9105

Merge branch 'backport-4774-resolver-system-test-didn-t-fail-on-all-subtest-errors-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9212

22 months agoresolver system test didn't record all failures
Mark Andrews [Mon, 17 Jun 2024 01:36:41 +0000 (11:36 +1000)] 
resolver system test didn't record all failures

(cherry picked from commit 5843b29f472cff3dad8bbc2b381a1f0d917fe862)

22 months ago[9.18] fix: usr: SVBC alpn text parsing failed to reject zero length alpn
Mark Andrews [Thu, 1 Aug 2024 02:28:23 +0000 (02:28 +0000)] 
[9.18] fix: usr: SVBC alpn text parsing failed to reject zero length alpn

Closes #4775

Backport of MR !9106

Merge branch 'backport-4775-reject-zero-length-alpn-in-alpn-fromtext-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9210

22 months agoCheck invalid alpn empty value
Mark Andrews [Sun, 30 Jun 2024 23:23:31 +0000 (09:23 +1000)] 
Check invalid alpn empty value

(cherry picked from commit fa35c673018cadcaca0d238e5a53d68b68164081)

22 months agoCheck invalid alpn produced due to missing double escapes
Mark Andrews [Mon, 17 Jun 2024 07:00:36 +0000 (17:00 +1000)] 
Check invalid alpn produced due to missing double escapes

(cherry picked from commit a49b2a3568a3cc4c5396add46ea35700ef87058e)

22 months agoProperly reject zero length ALPN in commatxt_fromtext
Mark Andrews [Mon, 17 Jun 2024 13:16:28 +0000 (23:16 +1000)] 
Properly reject zero length ALPN in commatxt_fromtext

ALPN are defined as 1*255OCTET in RFC 9460.  commatxt_fromtext was not
rejecting invalid inputs produces by missing a level of escaping
which where later caught be dns_rdata_fromwire on reception.

These inputs should have been rejected

svcb in svcb 1 1.svcb alpn=\,abc
svcb1 in svcb 1 1.svcb alpn=a\,\,abc

and generated 00 03 61 62 63 and 01 61 00 02 61 62 63 respectively.

The correct inputs to include commas in the alpn requires double
escaping.

svcb in svcb 1 1.svcb alpn=\\,abc
svcb1 in svcb 1 1.svcb alpn=a\\,\\,abc

and generate 04 2C 61 62 63 and 06 61 2C 2C 61 62 63 respectively.

(cherry picked from commit b51c9eb7975ad883fc6380347b9be56d4976e730)

22 months ago[9.18] fix: usr: return SERVFAIL for a too long CNAME chain
Arаm Sаrgsyаn [Wed, 31 Jul 2024 16:29:24 +0000 (16:29 +0000)] 
[9.18] fix: usr: return SERVFAIL for a too long CNAME chain

When cutting a long CNAME chain, named was returning NOERROR
instead of SERVFAIL (alongside with a partial answer). This
has been fixed.

Closes #4449

Backport of MR !9090

Merge branch 'backport-4449-return-servfail-for-a-long-cname-chain-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9204

22 months agoUpdate the chain test
Aram Sargsyan [Thu, 6 Jun 2024 20:49:34 +0000 (20:49 +0000)] 
Update the chain test

Update the CNAME chain test to correspond to the changed behavior,
because now named returns SERVFAIL when hitting the maximum query
restarts limit (e.g. happening when following a long CNAME chain).

In the current test auth will hit the limit and return partial data
with a SERVFAIL code, while the resolver will return no data with
a SERVFAIL code after auth returns SERVFAIL to it.

(cherry picked from commit 7751c7eca6ad543106e2517e5e172ad30aeb6c76)

22 months agoTest that a long CNAME chain causes SERVFAIL
Aram Sargsyan [Thu, 6 Jun 2024 12:10:19 +0000 (12:10 +0000)] 
Test that a long CNAME chain causes SERVFAIL

Also check that the expected partial answer in returned too.

(cherry picked from commit 580f872fe13a85b71c5f2483aa297445759583c2)

22 months agoReturn SERVFAIL for a too long CNAME chain
Aram Sargsyan [Thu, 6 Jun 2024 12:06:59 +0000 (12:06 +0000)] 
Return SERVFAIL for a too long CNAME chain

Due to the maximum query restart limitation a long CNAME chain
it is cut after 16 queries but named still returns NOERROR.

Return SERVFAIL instead and the partial answer.

(cherry picked from commit b621f1d88e2a8a4e22d871e90e58ef4bd4b6050f)

22 months ago[9.18] fix: usr: Properly calculate the amount of system memory
Mark Andrews [Wed, 31 Jul 2024 08:50:00 +0000 (08:50 +0000)] 
[9.18] fix: usr: Properly calculate the amount of system memory

On 32 bit machines isc_meminfo_totalphys could return an incorrect value.

Closes #4799

Backport of MR !9132

Merge branch 'backport-4799-cid-498034-overflowed-return-value-integer_overflow-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9200

22 months agoProperly compute the physical memory size
Mark Andrews [Tue, 9 Jul 2024 02:37:13 +0000 (12:37 +1000)] 
Properly compute the physical memory size

On a 32 bit machine casting to size_t can still lead to an overflow.
Cast to uint64_t.  Also detect all possible negative values for
pages and pagesize to silence warning about possible negative value.

    39#if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
     1. tainted_data_return: Called function sysconf(_SC_PHYS_PAGES),
           and a possible return value may be less than zero.
     2. assign: Assigning: pages = sysconf(_SC_PHYS_PAGES).
    40        long pages = sysconf(_SC_PHYS_PAGES);
    41        long pagesize = sysconf(_SC_PAGESIZE);
    42
     3. Condition pages == -1, taking false branch.
     4. Condition pagesize == -1, taking false branch.
    43        if (pages == -1 || pagesize == -1) {
    44                return (0);
    45        }
    46
     5. overflow: The expression (size_t)pages * pagesize might be negative,
           but is used in a context that treats it as unsigned.

    CID 498034: (#1 of 1): Overflowed return value (INTEGER_OVERFLOW)
    6. return_overflow: (size_t)pages * pagesize, which might have underflowed,
       is returned from the function.
    47        return ((size_t)pages * pagesize);
    48#endif /* if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) */

(cherry picked from commit e8dbc5db929c40174780b95540e33cc228bb2391)

22 months ago[9.18] chg: dev: Fix data race in clean_finds_at_name
Mark Andrews [Wed, 31 Jul 2024 06:33:18 +0000 (06:33 +0000)] 
[9.18] chg: dev: Fix data race in clean_finds_at_name

Stop updating `find.result_v4` and `find.result_v4` in `clean_finds_at_name`. The values are supposed to be static.

Closes #4118

Backport of MR !9108

Merge branch 'backport-4118-data-race-lib-dns-adb-c-1537-in-clean_finds_at_name-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9198

22 months agoDo not update find.result_v4 and find.result_v6
Mark Andrews [Tue, 18 Jun 2024 06:22:31 +0000 (16:22 +1000)] 
Do not update find.result_v4 and find.result_v6

These values are supposed to be static for the life of the find and
clean_finds_at_name was updating them resulting in TSAN error
reports.

    WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
      #0 clean_finds_at_name lib/dns/adb.c:1537
      #1 fetch_callback lib/dns/adb.c:4009
      #2 task_run lib/isc/task.c:815
      #3 isc_task_run lib/isc/task.c:896
      #4 isc__nm_async_task netmgr/netmgr.c:848
      #5 process_netievent netmgr/netmgr.c:920
      #6 process_queue netmgr/netmgr.c:1013
      #7 process_all_queues netmgr/netmgr.c:767
      #8 async_cb netmgr/netmgr.c:796
      #9 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163
      #10 isc__trampoline_run lib/isc/trampoline.c:189

    Previous read of size 4 at 0x000000000001 by thread T2:
      #0 findname lib/dns/resolver.c:3749
      #1 fctx_getaddresses lib/dns/resolver.c:3993
      #2 fctx_try lib/dns/resolver.c:4390
      #3 rctx_nextserver lib/dns/resolver.c:10356
      #4 rctx_done lib/dns/resolver.c:10503
      #5 resquery_response lib/dns/resolver.c:8511
      #6 udp_recv lib/dns/dispatch.c:638
      #7 isc__nm_async_readcb netmgr/netmgr.c:2885
      #8 isc__nm_readcb netmgr/netmgr.c:2858
      #9 udp_recv_cb netmgr/udp.c:650
      #10 isc__nm_udp_read_cb netmgr/udp.c:1057
      #11 uv__udp_recvmsg /usr/src/libuv-v1.44.1/src/unix/udp.c:303
      #12 isc__trampoline_run lib/isc/trampoline.c:189

(cherry picked from commit 53a5f50e9d12a333e58ddcfeb0d283e0bfa9c985)

22 months ago[9.18] fix: test: Prevent intermittent setup.sh failures in the "statschannel" system...
Mark Andrews [Wed, 31 Jul 2024 05:41:40 +0000 (05:41 +0000)] 
[9.18] fix: test: Prevent intermittent setup.sh failures in the "statschannel" system test

Don't verify the just signed zone as the RRSIGs could have expired before the signing process completes

Closes #4781 #2476

Backport of MR !9114

Merge branch 'backport-4781-statschannel-setup-can-fail-due-to-short-validity-interval-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9196

22 months agoDisable post zone verification for manykeys
Mark Andrews [Wed, 19 Jun 2024 02:45:09 +0000 (12:45 +1000)] 
Disable post zone verification for manykeys

As the expiration time is now+1 the RRSIG records may expire before
the verification step happens.

(cherry picked from commit 0d69afd764f4fcd390d8c4ed7a7bf6ef1d8ae501)

22 months ago[9.18] fix: usr: Update key lifetime and metadata after dnssec-policy reconfig
Matthijs Mekking [Tue, 30 Jul 2024 15:31:37 +0000 (15:31 +0000)] 
[9.18] fix: usr: Update key lifetime and metadata after dnssec-policy reconfig

Adjust key state and timing metadata if dnssec-policy key lifetime configuration is updated, so that it also
affects existing keys.

Closes #4677

Backport of MR !9118

Merge branch 'backport-4677-dnssec-policy-key-lifetime-reconfigure-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9192

22 months agoFix kasp system test
Matthijs Mekking [Tue, 30 Jul 2024 12:32:31 +0000 (14:32 +0200)] 
Fix kasp system test

In 9.18, 'inline-signing yes;' must also be configured explicitly for
zones using dnssec-policy without a configured 'allow-update' or
'update-policy'.

22 months agoNo longer update key lifetime if key is retired
Matthijs Mekking [Mon, 24 Jun 2024 13:18:40 +0000 (15:18 +0200)] 
No longer update key lifetime if key is retired

The key lifetime should no longer be adjusted if the key is being
retired earlier, for example because a manual rollover was started.

This would falsely be seen as a dnssec-policy lifetime reconfiguration,
and would adjust the retire/removed time again.

This also means we should update the status output, and the next
rollover scheduled is now calculated using (retire-active) instead of
key lifetime.

(cherry picked from commit 129973ebb0deb20405da553f20b5e8cdfe9a0e80)

22 months agoUpdate key lifetime and metadata after reconfig
Matthijs Mekking [Mon, 24 Jun 2024 13:14:16 +0000 (15:14 +0200)] 
Update key lifetime and metadata after reconfig

If dnssec-policy is reconfigured and the key lifetime has changed,
update existing keys with the new lifetime and adjust the retire
and removed timing metadata accordingly.

If the key has no lifetime yet, just initialize the lifetime. It
may be that the retire/removed timing metadata has already been set.

Skip keys which goal is not set to omnipresent. These keys are already
in the progress of retiring, or still unused.

(cherry picked from commit 1cec0b04481567e814ee3388f84ecf2daf87f169)

22 months agoTest updating dnssec-policy key lifetime
Matthijs Mekking [Mon, 24 Jun 2024 09:18:40 +0000 (11:18 +0200)] 
Test updating dnssec-policy key lifetime

Check if the key lifetime is updated in the key files. Make sure the
inactive and removed timing metadata are adjusted accordingly.

(cherry picked from commit 2237895bb4d06a1f9f127b11a320ae6ecf12053c)

22 months agoMove dnssec-policy to kasp-fips.conf.in
Matthijs Mekking [Mon, 24 Jun 2024 08:01:37 +0000 (10:01 +0200)] 
Move dnssec-policy to kasp-fips.conf.in

All dnssec-policy configurations are here, so why not this one?

(cherry picked from commit 93326e3e180f4cb2d5fe0b01ba99941d5ec74355)

22 months ago[9.18] fix: usr: Fix dig +timeout argument when using +https
Matthijs Mekking [Tue, 30 Jul 2024 09:41:50 +0000 (09:41 +0000)] 
[9.18] fix: usr:  Fix dig +timeout argument when using +https

The +timeout argument was not used on DoH connections. This has been fixed.

Closes #4806

Merge branch '4806-dig-https-local-timeout-ignored-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9161