]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoRework opensslecdsa_link to handle legacy key objects w/ openssl3
Timo Teräs [Wed, 9 Aug 2023 13:39:08 +0000 (16:39 +0300)] 
Rework opensslecdsa_link to handle legacy key objects w/ openssl3

Due to bug in openssl3, the pkcs11-engine is made the default
provider if enabled. This causes key generation and load to
return legacy objects.

Openssl3 has limited glue and does not support the full set
of new style parameter to be inqueried from legacy key objects

Rewrite required functions to use first the new API (if available),
but fallback to the old API (if available). For the methods that
have proper OpenSSL compatiblity glue, ship only one version.

2 years agoMerge branch '4273-streamdns-eagain' into 'main'
Arаm Sаrgsyаn [Thu, 24 Aug 2023 12:43:31 +0000 (12:43 +0000)] 
Merge branch '4273-streamdns-eagain' into 'main'

Resolve "crash while receiving 64 kiB message over TCP"

Closes #4273

See merge request isc-projects/bind9!8231

2 years agoFix a condition in isc_dnsstream_assembler_incoming()
Aram Sargsyan [Tue, 22 Aug 2023 12:18:09 +0000 (12:18 +0000)] 
Fix a condition in isc_dnsstream_assembler_incoming()

Before calling isc_buffer_putmem(), there is a condition to check
that 'buf_size' is greater than 0. At this point 'buf_size' is
guaranteed to be greater than zero, so either the condition is
redundant, or 'unprocessed_size' should be checked instead, which
seems more logical, because calling isc_buffer_putmem() with
'unprocessed_size' being zero is not useful, although harmless.

2 years agoHandle cases when buf_size is zero
Aram Sargsyan [Tue, 22 Aug 2023 12:10:40 +0000 (12:10 +0000)] 
Handle cases when buf_size is zero

The isc_dnsstream_assembler_incoming() inline function expects that
when 'buf_size' is zero, then 'buf' must be NULL. The expectation is
not correct, because those values come from the libuv read callback,
and its documentation notes[1] that 'nread' ('buf_size' here) might
be 0, which does not indicate an error or EOF, but is equivalent to
EAGAIN or EWOULDBLOCK under read(2).

Change the isc_dnsstream_assembler_incoming() inline function to
remove the invalid expectation.

[1] https://docs.libuv.org/en/v1.x/stream.html#c.uv_read_cb

2 years agoAdd a a tcp system test case
Aram Sargsyan [Thu, 24 Aug 2023 11:41:07 +0000 (11:41 +0000)] 
Add a a tcp system test case

The new test sends a 64 KiB message over TCP to named, and expects
it to handle it correctly.

2 years agoMerge branch 'ondrej/remove-i386-as-fully-supported-platform' into 'main'
Ondřej Surý [Wed, 23 Aug 2023 14:55:14 +0000 (14:55 +0000)] 
Merge branch 'ondrej/remove-i386-as-fully-supported-platform' into 'main'

Move i386 and armhf to the Best-Effort category

See merge request isc-projects/bind9!8223

2 years agoSplit the CPU architectures into more categories
Ondřej Surý [Mon, 21 Aug 2023 15:53:15 +0000 (17:53 +0200)] 
Split the CPU architectures into more categories

Move i386 and other less common or ancient CPU architectures to
Community-Maintened category.  Move armhf and arm64 to the Best-Effort
category as we do test them as part of development work (new MacBooks
are all arm64), we don't really do full set of tests in the CI.

2 years agoMerge branch 'ondrej-cleanup-qp-in-forwarders' into 'main'
Ondřej Surý [Wed, 23 Aug 2023 13:50:03 +0000 (13:50 +0000)] 
Merge branch 'ondrej-cleanup-qp-in-forwarders' into 'main'

Refactor cleanup code in the qp-trie for the forwarders table

See merge request isc-projects/bind9!8212

2 years agoRefactor cleanup code in the qp-trie for the forwarders table
Ondřej Surý [Thu, 17 Aug 2023 10:39:10 +0000 (12:39 +0200)] 
Refactor cleanup code in the qp-trie for the forwarders table

Instead of duplicating the destroy_forwarders() code in the cleanup
sections, just call dns_forwarders_detach() every time - in case of
failure, the forwarders aren't going to be attached, and forwarders
object will be destroyed right away.

2 years agoMerge branch 'ondrej-cleanup-mem-macros' into 'main'
Ondřej Surý [Wed, 23 Aug 2023 12:50:08 +0000 (12:50 +0000)] 
Merge branch 'ondrej-cleanup-mem-macros' into 'main'

Remove some unnecessary token pasting macrology

See merge request isc-projects/bind9!8236

2 years agoFix the style of an array de-allocation in dnssec-cds
Tony Finch [Mon, 12 Jun 2023 11:51:02 +0000 (12:51 +0100)] 
Fix the style of an array de-allocation in dnssec-cds

Mention the element size explicitly, so that `matching_sigs()`,
`signed_loose()`, and `signed_strict()` use the same calculation.

2 years agoGet rid of unnecessary macros in the system test dyndb driver
Tony Finch [Mon, 12 Jun 2023 11:08:07 +0000 (12:08 +0100)] 
Get rid of unnecessary macros in the system test dyndb driver

CHECKED_MEM_GET and ZERO_PTR are built-in features of isc_mem.

2 years agoRemove some unnecessary token pasting macrology
Tony Finch [Thu, 8 Jun 2023 11:57:32 +0000 (12:57 +0100)] 
Remove some unnecessary token pasting macrology

There used to be an extra layer of indirection in the memory functions
for certain dynamic linking scenarios. This involved variant spellings
like isc__mem and isc___mem. The isc___mem variants were removed in
commit 7de846977b2a4fd3 so the token pasting is no longer needed and
only serves to obfuscate.

2 years agoMerge branch '3001-pytest-nitpicks' into 'main'
Tom Krizek [Wed, 23 Aug 2023 12:48:58 +0000 (12:48 +0000)] 
Merge branch '3001-pytest-nitpicks' into 'main'

system tests stability tweaks and cleanup

Closes #3001

See merge request isc-projects/bind9!8239

2 years agoAllow re-runs of rrl system test
Tom Krizek [Tue, 22 Aug 2023 16:49:55 +0000 (18:49 +0200)] 
Allow re-runs of rrl system test

The rrl system test has been unstable and producing false positive
results for years (GL #172). Allow the test to be re-run (once) to
reduce the noise it causes.

2 years agoAllow re-runs of reclimit system test
Tom Krizek [Tue, 22 Aug 2023 16:46:05 +0000 (18:46 +0200)] 
Allow re-runs of reclimit system test

The reclimit system test has been unstable and producing false positive
results for years (GL #1587). Allow the test to be re-run (once) to
reduce the noise it causes.

2 years agoAllow re-runs of qmin system test
Tom Krizek [Tue, 22 Aug 2023 16:39:51 +0000 (18:39 +0200)] 
Allow re-runs of qmin system test

The qmin test is inherently unstable. It fails quite often with failure
modes described in GL #904. Allow the pytest runner to re-run the test
up to 3 times to only detect a more persistent and reproducible failures
rather than random noise caused by the nature of the test.

2 years agoDisable loadtime check in statschannel test
Tom Krizek [Tue, 22 Aug 2023 15:59:16 +0000 (17:59 +0200)] 
Disable loadtime check in statschannel test

It is better to disable the specific check that causes the test to fail
rather than mark the entire test as xfail, which can mask other issues
which the test is capable of detecting.

2 years agoci: fix after_script for out-of-tree tests
Tom Krizek [Tue, 22 Aug 2023 15:26:14 +0000 (17:26 +0200)] 
ci: fix after_script for out-of-tree tests

The commands in after_script run in a new shell, separate from
before_script and script commands. Since the pytest.log.txt is for out
of tree tests is present in the build directory, switch to it (if set)
before running any postprocessing commands.

2 years agoClean up pytest .gitignore file
Tom Krizek [Tue, 22 Aug 2023 15:20:51 +0000 (17:20 +0200)] 
Clean up pytest .gitignore file

The _last_test_run entry was accidentally added in !8194. It came from a
work-in-progress version of the MR and was left there during a rebase.

2 years agoSkip checkds test on Python<3.7
Tom Krizek [Tue, 22 Aug 2023 15:09:59 +0000 (17:09 +0200)] 
Skip checkds test on Python<3.7

checkds test requires the capture_output argument for subprocess.run()
which was added in Python 3.7.

2 years agoMerge branch '4271-disable-DTrace-in-FIPS-jobs' into 'main'
Ondřej Surý [Wed, 23 Aug 2023 09:07:05 +0000 (09:07 +0000)] 
Merge branch '4271-disable-DTrace-in-FIPS-jobs' into 'main'

Disable tracing in the FIPS enabled builds

Closes #4271

See merge request isc-projects/bind9!8235

2 years agoDisable tracing in the FIPS enabled builds
Ondřej Surý [Wed, 23 Aug 2023 05:46:27 +0000 (07:46 +0200)] 
Disable tracing in the FIPS enabled builds

The dtrace command fails with segmentation fault in the FIPS-enabled
builds, thus we need to disable the tracing in the CI for the FIPS
jobs.

2 years agoMerge branch '1181-nsupdate-tcp-soa-requests-main' into 'main'
Matthijs Mekking [Wed, 23 Aug 2023 08:29:08 +0000 (08:29 +0000)] 
Merge branch '1181-nsupdate-tcp-soa-requests-main' into 'main'

Don't do TCP SOA requests for default servers

Closes #1181

See merge request isc-projects/bind9!8192

2 years agoAdd release note and CHANGES for #1181
Matthijs Mekking [Thu, 10 Aug 2023 08:47:05 +0000 (10:47 +0200)] 
Add release note and CHANGES for #1181

2 years agoDon't do DoT SOA requests for default servers
Matthijs Mekking [Thu, 10 Aug 2023 08:41:28 +0000 (10:41 +0200)] 
Don't do DoT SOA requests for default servers

Default servers usually don't have DoT set up. Only do SOA queries if
the server is specified.

2 years agoMerge branch '4275-DTrace-on-macOS-only-needs-header' into 'main'
Ondřej Surý [Wed, 23 Aug 2023 06:59:50 +0000 (06:59 +0000)] 
Merge branch '4275-DTrace-on-macOS-only-needs-header' into 'main'

Don't generate the probes.lo on macOS

Closes #4275

See merge request isc-projects/bind9!8234

2 years agoRegenerate the DTrace generated files on configure change
Ondřej Surý [Wed, 23 Aug 2023 05:40:20 +0000 (07:40 +0200)] 
Regenerate the DTrace generated files on configure change

The DTrace generated files were missing dependency on the Makefile, so
they didn't get regenerated when ./configure was re-run.  This would
create problem especially between ./configure --enable-tracing vs
./configure --disable-tracing invocations.

2 years agoDon't generate the probes.lo on macOS
Ondřej Surý [Wed, 23 Aug 2023 05:33:50 +0000 (07:33 +0200)] 
Don't generate the probes.lo on macOS

The DTrace on macOS only needs header file and the dtrace command
doesn't have the -G option.  Skip generating the object file on macOS,
so the build doesn't fail.

2 years agoMerge branch '3835-cname-wildcard-loop-followup' into 'main'
Evan Hunt [Mon, 21 Aug 2023 21:29:56 +0000 (21:29 +0000)] 
Merge branch '3835-cname-wildcard-loop-followup' into 'main'

prevent query_coveringnsec() from running twice

See merge request isc-projects/bind9!8214

2 years agoCHANGES for [GL #3835]
Evan Hunt [Thu, 17 Aug 2023 17:06:14 +0000 (10:06 -0700)] 
CHANGES for [GL #3835]

2 years agoprevent query_coveringnsec() from running twice
Evan Hunt [Fri, 19 May 2023 05:02:06 +0000 (22:02 -0700)] 
prevent query_coveringnsec() from running twice

when synthesizing a new CNAME, we now check whether the target
matches the query already being processed. if so, we do not
restart the query; this prevents a waste of resources.

2 years agoMerge branch '4249-compile-test-files-during-make' into 'main'
Tom Krizek [Mon, 21 Aug 2023 19:13:13 +0000 (19:13 +0000)] 
Merge branch '4249-compile-test-files-during-make' into 'main'

Compile system test binaries during make

Closes #4249

See merge request isc-projects/bind9!8189

2 years agoci: Disable dnsrps for respdiff jobs compiled with ASAN/TSAN
Tom Krizek [Wed, 9 Aug 2023 13:42:05 +0000 (15:42 +0200)] 
ci: Disable dnsrps for respdiff jobs compiled with ASAN/TSAN

The dnsrps build assumes that dlopen is available from libc. This
assumption isn't met when attempting to build with address or thread
sanitizer on debian (bullseye, bookworm). Disable dnsrps build to avoid
the issue, since it's not needed anyway for our respdiff tests.

See commit b396f555861f11d7d6cee2ceb0d94abb733e1101 for more info about
the dnsrps build.

2 years agoResolve scan-build issue in dummylib.c
Tom Krizek [Wed, 9 Aug 2023 11:42:23 +0000 (13:42 +0200)] 
Resolve scan-build issue in dummylib.c

Value stored to 'rdatap' is never read. Remove the line which has no
effect.

2 years agoCompile system test binaries during make
Tom Krizek [Mon, 7 Aug 2023 14:59:11 +0000 (16:59 +0200)] 
Compile system test binaries during make

Using check_PROGRAMS would postpone compiling the binaries needed by
system tests until `make check` would be called. Since it's preferable
to invoke pytest directly to run the system test suite, compile these
binaries without installing them during `make all` instead by using
noinst_PROGRAMS.

This removes the need to use TESTS= make -e check hack invoked from
pytest to work around this issue.

2 years agoMerge branch '4041-add-userspace-tracing' into 'main'
Ondřej Surý [Mon, 21 Aug 2023 18:04:05 +0000 (18:04 +0000)] 
Merge branch '4041-add-userspace-tracing' into 'main'

Add support for userspace tracing via USDT

Closes #4041

See merge request isc-projects/bind9!7872

2 years agoAdd CHANGES and release note for [GL #4041]
Ondřej Surý [Thu, 27 Apr 2023 11:40:24 +0000 (13:40 +0200)] 
Add CHANGES and release note for [GL #4041]

2 years agoAdd zone name to the LIBDNS_XFRIN probes
Ondřej Surý [Mon, 14 Aug 2023 12:24:52 +0000 (14:24 +0200)] 
Add zone name to the LIBDNS_XFRIN probes

We already print the formatted zone name via the xfrin_log() function,
generate the text once and store it in xfr->info static buffer.  Then we
can reuse the string to pass it to the LIBDNS_XFRIN probes.

2 years agoAdd a probe when the response rate limiting drops or slips query
Ondřej Surý [Thu, 27 Apr 2023 11:57:00 +0000 (13:57 +0200)] 
Add a probe when the response rate limiting drops or slips query

Add a trace point that would report when a query gets dropped or slipped
by rate limits. It reports the client IP, the zone, and the RRL result
code.

Co-authored-by: Paul Frieden <pfrieden@yahooinc.com>
2 years agoAdd tracing probes to the dns_xfrin unit
Ondřej Surý [Tue, 31 Jan 2023 09:14:21 +0000 (10:14 +0100)] 
Add tracing probes to the dns_xfrin unit

Add tracing probes to incoming transfers, so we can accurately measure
the individual events when sending, receiving and parsing the incoming
transfers.

2 years agoAdd tracing probes to the isc_job unit
Ondřej Surý [Mon, 30 Jan 2023 15:20:40 +0000 (16:20 +0100)] 
Add tracing probes to the isc_job unit

Add tracing probes to isc_job unit:

 * libisc:job_cb_before - before the job callback is called
 * libisc:job_cb_after - after the job callback is called

2 years agoAdd tracing probes to the custom isc_rwlock implementation
Ondřej Surý [Mon, 30 Jan 2023 14:42:20 +0000 (15:42 +0100)] 
Add tracing probes to the custom isc_rwlock implementation

Add tracing probes to ISC own isc_rwlock implementation to allow
fine-grained tracing.  The pthread rwlock already has probes inside
glibc, and it's difficult to add probes to headers included from the
other libraries.

2 years agoAdd support for User Statically Defined Tracing (USDT) probes
Ondřej Surý [Mon, 30 Jan 2023 14:36:49 +0000 (15:36 +0100)] 
Add support for User Statically Defined Tracing (USDT) probes

This adds support for User Statically Defined Tracing (USDT).  On
Linux, this uses the header from SystemTap and dtrace utility, but the
support is universal as long as dtrace is available.

Also add the required infrastructure to add probes to libisc, libdns and
libns libraries, where most of the probes will be.

2 years agoMerge branch '3893-make-debian-12-bookworm-base-image' into 'main'
Michal Nowak [Mon, 21 Aug 2023 15:19:49 +0000 (15:19 +0000)] 
Merge branch '3893-make-debian-12-bookworm-base-image' into 'main'

Make Debian 12 "bookworm" the base image

See merge request isc-projects/bind9!8075

2 years agoMove clang:bullseye PKCS11 testing to gcc:bullseye
Michal Nowak [Wed, 9 Aug 2023 19:13:30 +0000 (21:13 +0200)] 
Move clang:bullseye PKCS11 testing to gcc:bullseye

Move clang:bullseye:amd64 PKCS11 testing to the gcc:bullseye:amd64 job
to evenly represent compilers in PKCS11 testing.

2 years agoDrop unnecessary gcovr workarounds
Michal Nowak [Mon, 24 Jul 2023 15:30:35 +0000 (17:30 +0200)] 
Drop unnecessary gcovr workarounds

Many problems of the Debian 11 gcovr version were fixed in the Debian 12
one. Replace workarounds we accumulated over the years with two new,
simple ones.

2 years agoDrop PKCS11 testing from "sid", restore it on "clang:bookworm"
Michal Nowak [Mon, 24 Jul 2023 15:17:54 +0000 (17:17 +0200)] 
Drop PKCS11 testing from "sid", restore it on "clang:bookworm"

The gcc:sid:amd64 job was used to test PKCS11 via the OpenSSL engine API
but is now designated for future PKCS11 testing via the provider API.

The ability to use PKCS11 via engine API in clang:bookworm:amd64 has
been restored using only deprecated APIs in OpenSSL 3.

2 years agoDisable mandoc stylistic warning
Michal Nowak [Mon, 24 Jul 2023 15:08:07 +0000 (17:08 +0200)] 
Disable mandoc stylistic warning

We are not concerned by the "input text line longer than 80 bytes"
stylistic warning.

2 years agoDrop unneeded -Wno-compound-token-split-by-macro option
Michal Nowak [Mon, 24 Jul 2023 15:04:01 +0000 (17:04 +0200)] 
Drop unneeded -Wno-compound-token-split-by-macro option

Debian 12 has Perl 5.36 and the option is no longer needed.

2 years agoReintroduce Debian 11 "bullseye" Clang and GCC jobs
Michal Nowak [Mon, 24 Jul 2023 14:55:20 +0000 (16:55 +0200)] 
Reintroduce Debian 11 "bullseye" Clang and GCC jobs

2 years agoMake Debian 12 "bookworm" the base image
Michal Nowak [Mon, 24 Jul 2023 14:19:33 +0000 (16:19 +0200)] 
Make Debian 12 "bookworm" the base image

Just replace "bullseye" with "bookworm" and reintroduce Debian 11
"bullseye" later.

2 years agoMerge branch '4265-remove-caching-of-netmgr-sockets-and-uvreqs' into 'main'
Ondřej Surý [Mon, 21 Aug 2023 14:35:37 +0000 (14:35 +0000)] 
Merge branch '4265-remove-caching-of-netmgr-sockets-and-uvreqs' into 'main'

Limit the number of inactive handles and uvreqs kept for reuse

Closes #4265

See merge request isc-projects/bind9!8206

2 years agoAdd CHANGES note for [GL #4265]
Ondřej Surý [Wed, 16 Aug 2023 12:52:45 +0000 (14:52 +0200)] 
Add CHANGES note for [GL #4265]

2 years agoLimit the memory pool for the uvreqs
Ondřej Surý [Wed, 16 Aug 2023 14:55:02 +0000 (16:55 +0200)] 
Limit the memory pool for the uvreqs

Set the number of maximum free items for the uvreq memory pool to 64.

2 years agoLimit the number of inactive handles kept for reuse
Ondřej Surý [Wed, 16 Aug 2023 14:30:53 +0000 (16:30 +0200)] 
Limit the number of inactive handles kept for reuse

Instead of growing and never shrinking the list of the inactive
handles (to be reused mostly on the UDP connections), limit the number
of maximum number of inactive handles kept to 64.  Instead of caching
the inactive handles for all listening sockets, enable the caching on on
UDP listening sockets.  For TCP, the handles were cached for each
accepted socket thus reusing the handles only for long-standing TCP
connections, but not reusing the handles across different TCP streams.

2 years agoMerge branch '4252-pytest-symlink-to-test-artifacts' into 'main'
Tom Krizek [Mon, 21 Aug 2023 13:55:07 +0000 (13:55 +0000)] 
Merge branch '4252-pytest-symlink-to-test-artifacts' into 'main'

Create symlinks to test artifacts for pytest runner

Closes #4252

See merge request isc-projects/bind9!8194

2 years ago.gitignore temporary directories and symlinks in system test dir
Tom Krizek [Wed, 16 Aug 2023 11:45:29 +0000 (13:45 +0200)] 
.gitignore temporary directories and symlinks in system test dir

2 years agoAdd clean-local target to clean pytest runner artifacts
Tom Krizek [Wed, 16 Aug 2023 08:38:09 +0000 (10:38 +0200)] 
Add clean-local target to clean pytest runner artifacts

The command finds all directories in bin/tests/system which contain an
underscore. Underscore indicates either a temporary directory (_tmp_), a
symlink to test artifacts (TESTNAME_MODULENAME), or a python-related
cache. Using underscore for a system test name is invalid and a hyphen
must be used instead.

2 years agoSilence pylint's refactoring suggestions for system_test_dir()
Tom Krizek [Thu, 10 Aug 2023 14:53:10 +0000 (16:53 +0200)] 
Silence pylint's refactoring suggestions for system_test_dir()

While it'd be fairly easy to split the function up into smaller ones,
the readability wouldn't be improved in this case. Silence the
suggestions instead.

2 years agoImprove tempdir logging for pytest runner
Tom Krizek [Thu, 10 Aug 2023 14:24:38 +0000 (16:24 +0200)] 
Improve tempdir logging for pytest runner

At the end of the test, display the symlink path to the artifact
directory in case it's preserved. Log the full tempdir name in debug
log.

2 years agoCreate symlinks to test artifacts for pytest runner
Tom Krizek [Thu, 10 Aug 2023 14:14:08 +0000 (16:14 +0200)] 
Create symlinks to test artifacts for pytest runner

While temporary directories are useful for test execution to keep
everything clean, they are difficult to work with manually. Create a
symlink for each test artifact directory with a stable and predictable
path. The symlink always either points to the latest artifacts, or is
missing in case the last run succeeded.

Ensure these symlinked directories aren't detected as test suites by the
pytest runner.

2 years agoMerge branch '4125-release-notes' into 'main'
Ondřej Surý [Mon, 21 Aug 2023 13:19:00 +0000 (13:19 +0000)] 
Merge branch '4125-release-notes' into 'main'

Add release note for [GL #4125]

Closes #4125

See merge request isc-projects/bind9!8216

2 years agoAdd release note for [GL #4125]
Ondřej Surý [Mon, 21 Aug 2023 13:15:26 +0000 (15:15 +0200)] 
Add release note for [GL #4125]

2 years agoMerge branch '4246-remove-legacy-test-runner-from-ci' into 'main'
Tom Krizek [Mon, 21 Aug 2023 13:13:33 +0000 (13:13 +0000)] 
Merge branch '4246-remove-legacy-test-runner-from-ci' into 'main'

Use pytest runner for out-of-tree and OpenBSD system tests in CI

Closes #4246

See merge request isc-projects/bind9!8193

2 years agoImprove pytest message when sanitizer report is found
Tom Krizek [Wed, 9 Aug 2023 15:49:27 +0000 (17:49 +0200)] 
Improve pytest message when sanitizer report is found

2 years agoci: remove legacy system test runner template
Tom Krizek [Tue, 8 Aug 2023 11:24:58 +0000 (13:24 +0200)] 
ci: remove legacy system test runner template

2 years agoci: run out-of-tree system tests with pytest runner
Tom Krizek [Tue, 8 Aug 2023 11:23:20 +0000 (13:23 +0200)] 
ci: run out-of-tree system tests with pytest runner

Out-of-tree builds are built in a directory that is different from
source directory. The build directory doesn't contain the non-compiled
test files from bin/tests/system which are the test cases required by
the pytest runner.

In order to run the system tests for out-of-tree build, copy over the
contents (tests) of bin/tests/system/ from the source directory into the
build directory. Then, it is possible to invoke the pytest runner inside
the build directory.

2 years agoci: use pytest system test runner on OpenBSD
Tom Krizek [Mon, 7 Aug 2023 12:37:40 +0000 (14:37 +0200)] 
ci: use pytest system test runner on OpenBSD

A supported pytest version finally made it to OpenBSD repositories,
allowing us to run system tests with the pytest runner.

2 years agoMerge branch '4125-statschannel-content-length-overflow' into 'main'
Ondřej Surý [Mon, 21 Aug 2023 13:01:28 +0000 (13:01 +0000)] 
Merge branch '4125-statschannel-content-length-overflow' into 'main'

Parse statschannel Content-Length: more carefully

Closes #4125

See merge request isc-projects/bind9!8018

2 years agoAdd CHANGES entry for [GL #4125]
Tony Finch [Fri, 9 Jun 2023 08:33:57 +0000 (09:33 +0100)] 
Add CHANGES entry for [GL #4125]

2 years agoParse statschannel Content-Length: more carefully
Tony Finch [Fri, 9 Jun 2023 08:33:57 +0000 (09:33 +0100)] 
Parse statschannel Content-Length: more carefully

A negative or excessively large Content-Length could cause a crash
by making `INSIST(httpd->consume != 0)` fail.

2 years agoMerge branch 'michal/post-release-tweaks' into 'main'
Michał Kępień [Thu, 17 Aug 2023 15:31:51 +0000 (15:31 +0000)] 
Merge branch 'michal/post-release-tweaks' into 'main'

Post-release tweaks (cross-version testing cleanup, release checklist tweaks)

See merge request isc-projects/bind9!8210

2 years agoUpdate release checklist
Michał Kępień [Thu, 17 Aug 2023 15:30:37 +0000 (17:30 +0200)] 
Update release checklist

Update the release checklist with links to recently implemented tools
for automating certain tasks.

2 years agoRevert "Exclude dupsigs and keymgr2kasp from cross-version-config-tests"
Michał Kępień [Thu, 17 Aug 2023 15:30:37 +0000 (17:30 +0200)] 
Revert "Exclude dupsigs and keymgr2kasp from cross-version-config-tests"

This reverts commit 4eac32fe231093f5d448c5925654e69099d5da43.

With the v9.19.16 release tag merged, the "cross-version-config-tests"
GitLab CI job will no longer fail due to the two relevant system tests
being absent from the development branch.  This makes the pytest
filtering expression added to work around that issue unnecessary, so
remove it.

2 years agoMerge branch '4139-test_send_timeout-check-can-be-unstable' into 'main'
Michal Nowak [Thu, 17 Aug 2023 13:11:04 +0000 (13:11 +0000)] 
Merge branch '4139-test_send_timeout-check-can-be-unstable' into 'main'

Make the test_send_timeout check more stable

Closes #4139

See merge request isc-projects/bind9!8168

2 years agoMark test_send_timeout as flaky
Michal Nowak [Tue, 15 Aug 2023 15:23:30 +0000 (17:23 +0200)] 
Mark test_send_timeout as flaky

In some cases, BIND is not fast enough to fill the send buffer and
manages to answer all queries, contrary to what the test expects.
Repeat the check up to 3 times to limit this test instability.

2 years agoAdd custom flaky decorator to handle unstable tests
Tom Krizek [Thu, 17 Aug 2023 08:30:46 +0000 (10:30 +0200)] 
Add custom flaky decorator to handle unstable tests

If the flaky plugin for pytest is available, use its decorator to
support re-running unstable tests. In case the package is missing,
execute the test as usual without attempts to re-run it in case of
failure.

This is mostly intended to increase the test stability in CI. Using a
custom decorator enables us to keep the flaky package as an optional
dependency.

2 years agoMerge tag 'v9.19.16'
Michał Kępień [Thu, 17 Aug 2023 12:10:53 +0000 (14:10 +0200)] 
Merge tag 'v9.19.16'

2 years agoMerge branch 'mnowak/clean-leftover-files' into 'main'
Michal Nowak [Wed, 16 Aug 2023 12:45:24 +0000 (12:45 +0000)] 
Merge branch 'mnowak/clean-leftover-files' into 'main'

Clean leftover files in autosign and masterformat

See merge request isc-projects/bind9!8167

2 years agoClean leftover files in autosign and masterformat
Michal Nowak [Thu, 3 Aug 2023 08:44:09 +0000 (10:44 +0200)] 
Clean leftover files in autosign and masterformat

The following files were reported in CI by the legacy system test runner
and prevented job to pass. They should be removed.

    $ if git rev-parse > /dev/null 2>&1; then ( ! grep "^I:.*:file.*not removed$" *.log ); fi
    autosign.log:I:autosign:file autosign/ns3/kskonly.example.db.jbk not removed
    autosign.log:I:autosign:file autosign/ns3/optout.example.db.jbk not removed
    autosign.log:I:autosign:file autosign/ns3/reconf.example.db.jbk not removed
    masterformat.log:I:masterformat:file masterformat/ns1/signed.db.raw.jbk not removed
    masterformat.log:I:masterformat:file masterformat/ns1/signed.db.raw.signed not removed
    masterformat.log:I:masterformat:file masterformat/ns1/signed.db.raw.signed.jnl not removed

Don't print an error when the ns*/inactive directory is not
present:

    rmdir: ns*/inactive: No such file or directory

Remove nsupdate.out.test file instead of nsupdate.out, as the latter
does not exist.

2 years agoMerge branch '4228-fix-heap-use-after-free-in-dns_dispatch_createtcp' into 'main'
Ondřej Surý [Wed, 16 Aug 2023 07:22:23 +0000 (07:22 +0000)] 
Merge branch '4228-fix-heap-use-after-free-in-dns_dispatch_createtcp' into 'main'

Attach to the dns_dispatchmgr in the dns_view object

Closes #4228

See merge request isc-projects/bind9!8203

2 years agoAdd CHANGES note for [GL #4228]
Ondřej Surý [Tue, 15 Aug 2023 16:01:48 +0000 (18:01 +0200)] 
Add CHANGES note for [GL #4228]

2 years agoAttach to the dns_dispatchmgr in the dns_view object
Ondřej Surý [Tue, 15 Aug 2023 15:29:27 +0000 (17:29 +0200)] 
Attach to the dns_dispatchmgr in the dns_view object

The dns_dispatchmgr object was only set in the dns_view object making it
prone to use-after-free in the dns_xfrin unit when shutting down named.

Remove dns_view_setdispatchmgr() and optionally pass the dispatchmgr
directly to dns_view_create() when it is attached and not just assigned,
so the dns_dispatchmgr doesn't cease to exist too early.

The dns_view_getdnsdispatchmgr() is now protected by the RCU lock, the
dispatchmgr reference is incremented, so the caller needs to detach from
it, and the function can return NULL in case the dns_view has been
already shut down.

2 years agoMerge branch 'each-qp-nta' into 'main'
Evan Hunt [Tue, 15 Aug 2023 17:16:21 +0000 (17:16 +0000)] 
Merge branch 'each-qp-nta' into 'main'

Use a QP trie for the NTA table, forwarders and key tables

See merge request isc-projects/bind9!7811

2 years agoAdd CHANGES note for [GL !7811]
Ondřej Surý [Tue, 15 Aug 2023 12:21:41 +0000 (14:21 +0200)] 
Add CHANGES note for [GL !7811]

2 years agouse a qp-trie for the keytable
Evan Hunt [Sat, 15 Apr 2023 21:49:45 +0000 (14:49 -0700)] 
use a qp-trie for the keytable

Instead of an RBT for the trust anchor tables, use a QP-trie.

2 years agouse a qp-trie for the forwarders table
Evan Hunt [Thu, 6 Apr 2023 06:08:12 +0000 (23:08 -0700)] 
use a qp-trie for the forwarders table

Instead of an RBT for the forwarders table, use a QP trie.

We now use reference counting for dns_forwarders_t. When a forwarders
object is retrieved by dns_fwdtable_find(), it must now be explicitly
detached by the caller afterward.

QP tries require stored objects to include their names, so the
the forwarders object now has that. This obviates the need to
pass back a separate 'foundname' value from dns_fwdtable_find().

2 years agoclean up some unused functions
Evan Hunt [Thu, 6 Apr 2023 05:23:55 +0000 (22:23 -0700)] 
clean up some unused functions

dns_fwdtable_delete() was only used by dns_client_clearservers(),
which in turn was never used. both functions have now been deleted.

2 years agouse a qp-trie for the NTA table
Evan Hunt [Wed, 5 Apr 2023 07:36:37 +0000 (00:36 -0700)] 
use a qp-trie for the NTA table

replace the red-black tree used by the negative trust anchor table
with a QP trie.

because of this change, dns_ntatable_init() can no longer fail, and
neither can dns_view_initntatable(). these functions have both been
changed to type void.

2 years agorename dns_qp_findname_parent() to _findname_ancestor()
Evan Hunt [Wed, 5 Apr 2023 07:36:37 +0000 (00:36 -0700)] 
rename dns_qp_findname_parent() to _findname_ancestor()

this function finds the closest matching ancestor, but the function
name could be read to imply that it returns the direct parent node;
this commit suggests a slightly less misleading name.

2 years agoImprove qp-trie leaf return values
Tony Finch [Thu, 6 Apr 2023 10:24:47 +0000 (11:24 +0100)] 
Improve qp-trie leaf return values

Make the `pval_r` and `ival_r` out arguments optional.

Add `pval_r` and `ival_r` out arguments to `dns_qp_deletekey()`
and `dns_qp_deletename()`, to return the deleted leaf.

2 years agoMerge branch 'fanf/add-SET_IF_NOT_NULL-macro' into 'main'
Ondřej Surý [Tue, 15 Aug 2023 11:23:27 +0000 (11:23 +0000)] 
Merge branch 'fanf/add-SET_IF_NOT_NULL-macro' into 'main'

A SET_IF_NOT_NULL() macro for optional return values

See merge request isc-projects/bind9!8201

2 years agoApply the SET_IF_NOT_NULL() semantic patch
Tony Finch [Thu, 6 Apr 2023 15:32:16 +0000 (16:32 +0100)] 
Apply the SET_IF_NOT_NULL() semantic patch

    spatch --sp-file cocci/set_if_not_null.spatch --use-gitgrep --dir "." --include-headers --in-place

2 years agoA SET_IF_NOT_NULL() macro for optional return values
Tony Finch [Thu, 6 Apr 2023 10:30:00 +0000 (11:30 +0100)] 
A SET_IF_NOT_NULL() macro for optional return values

The SET_IF_NOT_NULL() macro avoids a fair amount of tedious boilerplate,
checking pointer parameters to see if they're non-NULL and updating
them if they are.  The macro was already in the dns_zone unit, and this
commit moves it to the <isc/util.h> header.

I have included a Coccinelle semantic patch to use SET_IF_NOT_NULL()
where appropriate. The patch needs an #include in `openssl_shim.c`
in order to work.

2 years agoMerge branch '4259-statschannel-leftovers' into 'main'
Mark Andrews [Tue, 15 Aug 2023 04:21:33 +0000 (04:21 +0000)] 
Merge branch '4259-statschannel-leftovers' into 'main'

Resolve "Statschannel leftovers"

Closes #4259

See merge request isc-projects/bind9!8199

2 years agoRemove bind9.xsl.1, bind9.xsl.2 and bind9.xsl.3
Mark Andrews [Tue, 15 Aug 2023 00:26:29 +0000 (10:26 +1000)] 
Remove bind9.xsl.1, bind9.xsl.2 and bind9.xsl.3

2 years agoMerge branch '4238-the-mkeys-system-test-can-update-the-root-zone-too-fast' into...
Mark Andrews [Mon, 14 Aug 2023 23:23:33 +0000 (23:23 +0000)] 
Merge branch '4238-the-mkeys-system-test-can-update-the-root-zone-too-fast' into 'main'

Resolve "The mkeys system test can update the root zone too fast"

Closes #4238

See merge request isc-projects/bind9!8161

2 years agoAdd sleeps so that the modification time changes
Mark Andrews [Wed, 2 Aug 2023 06:16:30 +0000 (16:16 +1000)] 
Add sleeps so that the modification time changes

The mkeys system test could fail because root zone was resigned
within the same second as it was previously signed causing reloads
to fail.  Add delays to the test to prevent this.

2 years agoMerge branch '4124-check-statschannel-if-modified-since' into 'main'
Ondřej Surý [Mon, 14 Aug 2023 10:59:02 +0000 (10:59 +0000)] 
Merge branch '4124-check-statschannel-if-modified-since' into 'main'

Fix a stack buffer overflow in the statistics channel

Closes #4124

See merge request isc-projects/bind9!8195