]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoRemove the logic that applies differences when over limit
Ondřej Surý [Thu, 12 Oct 2023 15:48:56 +0000 (17:48 +0200)] 
Remove the logic that applies differences when over limit

The ixfr_putdata() and axfr_putdata() had a logic to apply dns_diff when
the number of pending tuples went over 100.  Since we are going to
offload the XFR data processing, we don't need to do that anymore.

2 years agoCleanup the FAIL() macro in the dns_xfrin
Ondřej Surý [Thu, 12 Oct 2023 15:44:51 +0000 (17:44 +0200)] 
Cleanup the FAIL() macro in the dns_xfrin

The FAIL() macro was just setting the result and jumping to failure,
unobfuscate the code by removing the macro.

2 years agoMerge branch 'ondrej/disable-memory-context-for-OpenSSL-1.x' into 'main'
Ondřej Surý [Thu, 19 Oct 2023 12:56:39 +0000 (12:56 +0000)] 
Merge branch 'ondrej/disable-memory-context-for-OpenSSL-1.x' into 'main'

Disable OpenSSL memory contexts for OpenSSL < 3.0.0

See merge request isc-projects/bind9!8402

2 years agoDisable OpenSSL memory contexts for OpenSSL < 3.0.0
Ondřej Surý [Thu, 19 Oct 2023 09:39:53 +0000 (11:39 +0200)] 
Disable OpenSSL memory contexts for OpenSSL < 3.0.0

OpenSSL 1.1 has already reached end-of-life and since we are
experiencing a weird memory leak in the mirror system test on just
Ubuntu 20.04 (Focal) with OpenSSL 1.1, we disable the legacy code for
enabling memory contexts for OpenSSL < 3.0.0 in this commit.

2 years agoMerge branch '4375-qp_test-fix' into 'main'
Arаm Sаrgsyаn [Thu, 19 Oct 2023 09:30:59 +0000 (09:30 +0000)] 
Merge branch '4375-qp_test-fix' into 'main'

Fix an error in the qp_test.c unit test

Closes #4375

See merge request isc-projects/bind9!8401

2 years agoFix an error in the qp_test.c unit test
Aram Sargsyan [Thu, 19 Oct 2023 08:46:58 +0000 (08:46 +0000)] 
Fix an error in the qp_test.c unit test

In order to check whether there are enough inserted values the
code uses the 'tests' variable (loop counter), which is unreliable,
because the loop sometimes removes an item instead of inserting
one (when the randomly generated item already exists).

Instead of the loop counter, use the existing variable 'inserted',
which should indicate the correct number of the inserted items.

2 years agoMerge branch '4260-adjust-udp-refresh-timeouts' into 'main'
Mark Andrews [Wed, 18 Oct 2023 06:07:32 +0000 (06:07 +0000)] 
Merge branch '4260-adjust-udp-refresh-timeouts' into 'main'

Adjust UDP zone maintenance timeouts

Closes #4260

See merge request isc-projects/bind9!8205

2 years agoadd CHANGES for [GL #4260]
Mark Andrews [Wed, 16 Aug 2023 06:29:46 +0000 (16:29 +1000)] 
add CHANGES for [GL #4260]

2 years agoAdjust UDP timeouts used in zone maintenance
Mark Andrews [Wed, 16 Aug 2023 04:40:12 +0000 (14:40 +1000)] 
Adjust UDP timeouts used in zone maintenance

Drop timeout before resending a UDP request from 15 seconds to 5
seconds and add 1 second to the total time to allow for the reply
to the third request to arrive.  This will speed up the time it
takes for named to recover from a lost packet when refreshing a
zone and for it to determine that a primary is down.

2 years agoMerge branch 'mnowak/llvm-17' into 'main'
Michal Nowak [Tue, 17 Oct 2023 15:55:09 +0000 (15:55 +0000)] 
Merge branch 'mnowak/llvm-17' into 'main'

Update clang to version 17

See merge request isc-projects/bind9!8366

2 years agoUpdate the source code formatting using clang-format-17
Michal Nowak [Tue, 10 Oct 2023 14:55:13 +0000 (16:55 +0200)] 
Update the source code formatting using clang-format-17

2 years agoUpdate clang to version 17
Michal Nowak [Tue, 10 Oct 2023 13:10:00 +0000 (15:10 +0200)] 
Update clang to version 17

2 years agoMerge branch '4349-document-inline-signing-defaults' into 'main'
Matthijs Mekking [Tue, 17 Oct 2023 09:26:09 +0000 (09:26 +0000)] 
Merge branch '4349-document-inline-signing-defaults' into 'main'

Resolve "Document the complex defaults of inline-signing"

Closes #4349

See merge request isc-projects/bind9!8372

2 years agoAdd release note and CHANGES for #4349
Matthijs Mekking [Mon, 16 Oct 2023 09:06:06 +0000 (11:06 +0200)] 
Add release note and CHANGES for #4349

2 years agoUpdate addzone test
Matthijs Mekking [Thu, 12 Oct 2023 11:56:46 +0000 (13:56 +0200)] 
Update addzone test

Now that inline-signing is ignored when there is no dnssec-policy,
add 'dnssec-policy default;' to the zones when attempting to add them
via 'rndc addzone'.

2 years agoUpdate inline-signing documentation
Matthijs Mekking [Thu, 12 Oct 2023 10:04:30 +0000 (12:04 +0200)] 
Update inline-signing documentation

Add the missing documentation for 'dnssec-policy/inline-signing'.
Update the zone-only option 'inline-signing' to indicate that the
use of inline signing should be set in 'dnssec-policy' and that this
is merely a way to override the value for the given zone.

(cherry picked from commit 2b7381950d17fe4d289959e5f76f020cc462200a)

2 years agoIgnore inline-signing by default
Matthijs Mekking [Thu, 12 Oct 2023 10:02:02 +0000 (12:02 +0200)] 
Ignore inline-signing by default

Ignore the option 'inline-signing' unless there is a 'dnssec-policy'
configured for the zone. Having inline signing enabled while the zone
is not DNSSEC signed does not make sense.

If there is a 'dnssec-policy' the 'inline-signing' zone-only option
can be used to override the value for the given zone.

2 years agoMerge branch '4365-update-dangerfile-py-to-know-about-cve' into 'main'
Mark Andrews [Tue, 17 Oct 2023 01:58:06 +0000 (01:58 +0000)] 
Merge branch '4365-update-dangerfile-py-to-know-about-cve' into 'main'

Resolve "Update dangerfile.py to know about `:cve:`"

Closes #4365

See merge request isc-projects/bind9!8387

2 years agoUpdate dangerfile.py to know about ':cve:'
Mark Andrews [Tue, 10 Oct 2023 00:25:05 +0000 (11:25 +1100)] 
Update dangerfile.py to know about ':cve:'

2 years agoMerge branch 'matthijs-kasp-system-test-nit-fixes' into 'main'
Matthijs Mekking [Mon, 16 Oct 2023 10:33:05 +0000 (10:33 +0000)] 
Merge branch 'matthijs-kasp-system-test-nit-fixes' into 'main'

Two minor fixes in the kasp system test

See merge request isc-projects/bind9!8389

2 years agoTwo minor fixes in the kasp system test
Matthijs Mekking [Mon, 16 Oct 2023 09:08:59 +0000 (11:08 +0200)] 
Two minor fixes in the kasp system test

The 'dynamic-signed-inline-signing.kasp' zone was set up with
the environment variable 'ksktimes', but that should be 'csktimes'
which is set one line above. Since the values are currently the same
the behavior is identical, but of course it should use the correct
variable.

The 'step4.enable-dnssec.autosign' zone was set up twice. This is
unnecessary.

2 years agoMerge branch '4350-resign-triggered-on-raw-dnssec-zone' into 'main'
Matthijs Mekking [Mon, 16 Oct 2023 08:21:25 +0000 (08:21 +0000)] 
Merge branch '4350-resign-triggered-on-raw-dnssec-zone' into 'main'

Don't schedule resign for raw version of an inline-signing zone

Closes #4350

See merge request isc-projects/bind9!8385

2 years agoAdd changes and release note for #4350
Matthijs Mekking [Fri, 13 Oct 2023 14:46:25 +0000 (16:46 +0200)] 
Add changes and release note for #4350

2 years agoDon't resign raw version of the zone
Matthijs Mekking [Fri, 13 Oct 2023 09:46:05 +0000 (11:46 +0200)] 
Don't resign raw version of the zone

Update the function 'set_resigntime()' so that raw versions of
inline-signing zones are not scheduled to be resigned.

Also update the check in the same function for zone is dynamic, there
exists a function 'dns_zone_isdynamic()' that does a similar thing
and is more complete.

Also in 'zone_postload()' check whether the zone is not the raw
version of an inline-signing zone, preventing calculating the next
resign time.

2 years agoAdd test case for GL #4350
Matthijs Mekking [Fri, 13 Oct 2023 13:17:29 +0000 (15:17 +0200)] 
Add test case for GL #4350

Add a test scenario for a dynamic zone that uses inline-signing which
accidentally has signed the raw version of the zone.

This should not trigger resign scheduling on the raw version of the
zone.

2 years agoMerge branch 'ondrej/convert-dns_acl-rwlock-to-rcu' into 'main'
Ondřej Surý [Fri, 13 Oct 2023 12:44:53 +0000 (12:44 +0000)] 
Merge branch 'ondrej/convert-dns_acl-rwlock-to-rcu' into 'main'

Convert rwlock in dns_acl to RCU

See merge request isc-projects/bind9!8378

2 years agoConvert rwlock in dns_acl to RCU
Ondřej Surý [Fri, 13 Oct 2023 06:59:41 +0000 (08:59 +0200)] 
Convert rwlock in dns_acl to RCU

The dns_aclenv_t contains two dns_acl_t - localhost and localnets that
can be swapped with a different ACLs as we configure BIND 9.  Instead of
protecting those two pointers with heavyweight read-write lock, use RCU
mechanism to dereference and swap the pointers.

2 years agoConvert manual dns_{acl,aclenv}_{attach,detach} to ISC_REFCOUNT_IMPL
Ondřej Surý [Fri, 13 Oct 2023 06:22:27 +0000 (08:22 +0200)] 
Convert manual dns_{acl,aclenv}_{attach,detach} to ISC_REFCOUNT_IMPL

Instead of having a manual set of functions, use ISC_REFCOUNT_IMPL macro
to implement the attach, detach, ref and unref functions.

2 years agoRefactor dns_{acl,aclenv}_create to return void
Ondřej Surý [Fri, 13 Oct 2023 06:17:31 +0000 (08:17 +0200)] 
Refactor dns_{acl,aclenv}_create to return void

The dns_{acl,aclenv}_create() can't fail, so change it to return void.

2 years agoConvert manual dns_iptable_{attach,detach} to ISC_REFCOUNT_IMPL
Ondřej Surý [Fri, 13 Oct 2023 06:12:51 +0000 (08:12 +0200)] 
Convert manual dns_iptable_{attach,detach} to ISC_REFCOUNT_IMPL

Instead of having a manual set of functions, use ISC_REFCOUNT_IMPL macro
to implement the attach, detach, ref and unref functions.

2 years agoRefactor dns_iptable_create() to return void
Ondřej Surý [Fri, 13 Oct 2023 06:05:30 +0000 (08:05 +0200)] 
Refactor dns_iptable_create() to return void

The dns_iptable_create() cannot fail now, so change it to return void.

2 years agoRefactor isc_radix_create to return void
Ondřej Surý [Fri, 13 Oct 2023 06:03:06 +0000 (08:03 +0200)] 
Refactor isc_radix_create to return void

The isc_radix_create() can't fail, so change it to return void.

2 years agoMerge branch '4360-fix-undefined-behaviours-detected-by-llvm-17' into 'main'
Arаm Sаrgsyаn [Fri, 13 Oct 2023 11:15:02 +0000 (11:15 +0000)] 
Merge branch '4360-fix-undefined-behaviours-detected-by-llvm-17' into 'main'

Resolve "Undefined behaviours detected by LLVM 17 (noop_accept_cb, dns__nta_shutdown_cb)"

Closes #4360

See merge request isc-projects/bind9!8376

2 years agoFix undefined behaviour occurrences
Aram Sargsyan [Thu, 12 Oct 2023 14:10:43 +0000 (14:10 +0000)] 
Fix undefined behaviour occurrences

The undefined behaviour was detected by LLVM 17. Fix the affected
functions definitions to match the expected function type.

2 years agoMerge branch 'ondrej/dont-undef-TRACE-define' into 'main'
Ondřej Surý [Fri, 13 Oct 2023 09:47:11 +0000 (09:47 +0000)] 
Merge branch 'ondrej/dont-undef-TRACE-define' into 'main'

Don't undef <unit>_TRACE, instead add comment how to enable it

See merge request isc-projects/bind9!8381

2 years agoDon't undef <unit>_TRACE, instead add comment how to enable it
Ondřej Surý [Fri, 13 Oct 2023 08:08:26 +0000 (10:08 +0200)] 
Don't undef <unit>_TRACE, instead add comment how to enable it

In units that support detailed reference tracing via ISC_REFCOUNT
macros, we were doing:

    /* Define to 1 for detailed reference tracing */
    #undef <unit>_TRACE

This would prevent using -D<unit>_TRACE=1 in the CFLAGS.

Convert the above mentioned snippet with just a comment how to enable
the detailed reference tracing:

    /* Add -D<unit>_TRACE=1 to CFLAGS for detailed reference tracing */

2 years agoMerge branch 'pspacek/doc-and-build-tweaks' into 'main'
Petr Špaček [Fri, 13 Oct 2023 07:25:32 +0000 (07:25 +0000)] 
Merge branch 'pspacek/doc-and-build-tweaks' into 'main'

Describe BIND threat model

See merge request isc-projects/bind9!8364

2 years agoDescribe BIND threat model
Petr Špaček [Tue, 10 Oct 2023 09:27:16 +0000 (11:27 +0200)] 
Describe BIND threat model

Basically all local data is considered trusted, and proper ACLs and
limits need to be explicitly configured. We are also free to let
protocol non-compliant servers burn in flames.

2 years agoAdd qplookups test to .gitignore
Petr Špaček [Tue, 10 Oct 2023 07:32:03 +0000 (09:32 +0200)] 
Add qplookups test to .gitignore

2 years agoMerge branch '4362-qp-crash' into 'main'
Evan Hunt [Thu, 12 Oct 2023 19:04:14 +0000 (19:04 +0000)] 
Merge branch '4362-qp-crash' into 'main'

check chain length is nonzero before examining last entry

Closes #4362

See merge request isc-projects/bind9!8370

2 years agocheck chain length is nonzero before examining last entry
Evan Hunt [Wed, 11 Oct 2023 18:03:00 +0000 (11:03 -0700)] 
check chain length is nonzero before examining last entry

It was possible to reach add_link() without visiting an
intermediate node first, and the check for a duplicate entry
could then cause a crash.

Credit to OSS-Fuzz for discovering this error.

2 years agoMerge branch 'michal/remove-pdf-related-bits-from-the-build-system' into 'main'
Michał Kępień [Thu, 12 Oct 2023 12:37:48 +0000 (12:37 +0000)] 
Merge branch 'michal/remove-pdf-related-bits-from-the-build-system' into 'main'

Remove PDF-related bits from the build system

See merge request isc-projects/bind9!8350

2 years agoRemove PDF-related bits from the build system
Michał Kępień [Thu, 12 Oct 2023 12:24:42 +0000 (14:24 +0200)] 
Remove PDF-related bits from the build system

Read the Docs is capable of building the PDF version of the BIND 9 ARM
using just the contents of the doc/arm/ directory - it does not need the
build system to facilitate that.  Since the BIND 9 ARM is also built in
other formats when "make doc" is run, drop the parts of the build system
that enable building the PDF version as they pull in complexity without
bringing much added value in return.  Update related files accordingly.

2 years agoMerge branch '4326-remove-locking-from-copy_namehook_lists' into 'main'
Ondřej Surý [Thu, 12 Oct 2023 10:43:50 +0000 (10:43 +0000)] 
Merge branch '4326-remove-locking-from-copy_namehook_lists' into 'main'

Replace some ADB entry locking with atomics to reduce ADB contention

Closes #4326

See merge request isc-projects/bind9!8328

2 years agoAdd CHANGES note for [GL #4326]
Ondřej Surý [Thu, 21 Sep 2023 13:31:47 +0000 (15:31 +0200)] 
Add CHANGES note for [GL #4326]

2 years agoUse mul and div instead of bitshifts to calculate srtt
Ondřej Surý [Thu, 12 Oct 2023 07:20:42 +0000 (09:20 +0200)] 
Use mul and div instead of bitshifts to calculate srtt

There was a microoptimization for smoothing srtt with bitshifts.  Revert
the code to use * 98 / 100, it doesn't really make that difference on
modern CPUs, for comparison here:

    muldiv:
    imul    eax, edi, 98
    imul    rax, rax, 1374389535
    shr     rax, 37
    ret
    shift:
    mov     eax, edi
    sal     eax, 9
    sub     eax, edi
    shr     eax, 9
    ret

2 years agoSkip the no-op code in adjustsrtt()
Ondřej Surý [Thu, 12 Oct 2023 07:17:40 +0000 (09:17 +0200)] 
Skip the no-op code in adjustsrtt()

If factor == DNS_ADB_RTTADJAGE and addr->entry->lastage == now we would
load value into new_srtt and then immediatelly store it back which
triggers the synchronization between threads using .srtt values.

2 years agoReplace some ADB entry locking with atomics to reduce ADB contention
Ondřej Surý [Thu, 21 Sep 2023 09:59:01 +0000 (11:59 +0200)] 
Replace some ADB entry locking with atomics to reduce ADB contention

Use atomics on couple of ADB entry members (.srtt, .flags, .expires, and
.lastage) to remove ADB entry locking from couple of hot spots.  The
most prominent place is copy_namehook_lists() that gets called under ADB
name lock and if the namehook list is long it acquires-releases quite a
few ADB entry locks.  Changing those ADB entry members to atomics
allowed us to new_adbaddrinfo() not require locked ADB entry and since
adbentry_overquota() already used atomics and handling lame information
was dropped in the previous commit, we could not make the
copy_namehook_lists() lockless.

The other hotspot is dns_adb_adjustsrtt() and dns_adb_agesrtt() that can
now use atomics because .srtt is already atomic_uint.

And the last place that could now use atomics is dns_adb_changeflags().

2 years agoRemove dns_adblameinfo from dns_adb
Ondřej Surý [Thu, 21 Sep 2023 13:20:58 +0000 (15:20 +0200)] 
Remove dns_adblameinfo from dns_adb

Keeping the information about lame server in the ADB was done in !322 to
fix following security issue:

    [CVE-2021-25219] Disable "lame-ttl" cache

The handling of the lame servers needs to be redesigned and it is not
going to be enabled any time soon, and the current code is just dead
code that takes up space, code and stands in the way of making ADB work
faster.

Remove all the internals needed for handling the lame servers in the ADB
for now.  It might get reintroduced later if and when we redesign ADB.

2 years agoMerge branch '4354-statschannel-test-opesbsd' into 'main'
Arаm Sаrgsyаn [Thu, 12 Oct 2023 09:37:11 +0000 (09:37 +0000)] 
Merge branch '4354-statschannel-test-opesbsd' into 'main'

Resolve "Checking zone transfer information in the statistics channel fails on OpenBSD"

Closes #4354

See merge request isc-projects/bind9!8367

2 years agoMake the statschannel system test portable
Aram Sargsyan [Tue, 10 Oct 2023 10:41:07 +0000 (10:41 +0000)] 
Make the statschannel system test portable

The usage of the newline in the replacement part of the 'sed' call
works in GNU systems, but not in OpenBSD. Use 'awk' instead.

Also use the extended syntax of regular expressions for 'grep', which
is similarly more portable across the supported systems.

2 years agoMerge branch 'matthijs-fix-build-usdt' into 'main'
Matthijs Mekking [Tue, 10 Oct 2023 15:43:59 +0000 (15:43 +0000)] 
Merge branch 'matthijs-fix-build-usdt' into 'main'

Fix build error related to USDT

See merge request isc-projects/bind9!8368

2 years agoFix build error related to USDT
Matthijs Mekking [Tue, 10 Oct 2023 12:18:07 +0000 (14:18 +0200)] 
Fix build error related to USDT

The trace.h file is listed twice in the Makefile. This incidentally
caused an error where the build refused to replace an earlier placed
trace.h file.

2 years agoMerge branch 'each-qp-rpz' into 'main'
Evan Hunt [Tue, 10 Oct 2023 06:56:21 +0000 (06:56 +0000)] 
Merge branch 'each-qp-rpz' into 'main'

convert the RPZ summary database to to use a QP trie

See merge request isc-projects/bind9!8352

2 years agoCHANGES for [GL !8352]
Evan Hunt [Sat, 30 Sep 2023 09:08:35 +0000 (02:08 -0700)] 
CHANGES for [GL !8352]

2 years agoreduce search_lock coverage
Evan Hunt [Sat, 30 Sep 2023 20:23:51 +0000 (13:23 -0700)] 
reduce search_lock coverage

now that we're using qpmulti for the summary database, we
no longer need to hold search_lock for it. we do still need
it for the radix tree and the trigger counts.

2 years agoconvert the RPZ summary database to to use a QP trie
Evan Hunt [Sat, 30 Sep 2023 04:40:29 +0000 (21:40 -0700)] 
convert the RPZ summary database to to use a QP trie

now that we have the QP chain mechanism, we can convert the
RPZ summary database to use a QP trie instead of an RBT.

also revised comments throughout the file accordingly, and
incidentally cleaned up calls to new_node(), which can no
longer fail.

2 years agofix build bug with DNS_RPZ_TRACE
Evan Hunt [Fri, 29 Sep 2023 23:16:49 +0000 (16:16 -0700)] 
fix build bug with DNS_RPZ_TRACE

nonstardard naming of ref/unref and attach/detach functions caused
build errors when using DNS_RPZ_TRACE; this has been fixed.

2 years agofix a QP chain bug
Evan Hunt [Sat, 30 Sep 2023 05:31:17 +0000 (22:31 -0700)] 
fix a QP chain bug

depending on how the QP trie is traversed during a lookup, it is
possible for a search to terminate on a leaf which is a partial
match, without that leaf being added to the chain. to ensure the
chain is correct in this case, when a partial match condition is
detected via qpkey_compare(), we will call add_link() again, just
in case.  (add_link() will check for a duplicated node, so it will
be harmless if it was already done.)

2 years agoMerge branch 'ondrej/fix-load_names-benchmark' into 'main'
Ondřej Surý [Mon, 9 Oct 2023 19:09:25 +0000 (19:09 +0000)] 
Merge branch 'ondrej/fix-load_names-benchmark' into 'main'

Use read number of items instead of raw array size in load_names

See merge request isc-projects/bind9!8361

2 years agoAdd base testing set of names for load-names benchmark
Ondřej Surý [Fri, 6 Oct 2023 08:30:21 +0000 (10:30 +0200)] 
Add base testing set of names for load-names benchmark

This was generated from dnsperf queryfile with following script:

    #!/usr/bin/env python3
    names = {}

    import sys

    i = 0
    for line in iter(sys.stdin.readline, ''):
name = line.rstrip('\n')
if not name in names:
    names[name] = line
    print(f"{i},{name}")
    i += 1
if i >= 1024*1024:
    break

2 years agoFix hashmap part of load-names benchmark
Ondřej Surý [Fri, 6 Oct 2023 08:28:32 +0000 (10:28 +0200)] 
Fix hashmap part of load-names benchmark

The name_match() was errorneously converting struct item into dns_name
pointer.  Correctly retype void *node to struct item * first and then
use item.fixed.name to pass the name to dns_name_equal() function.

2 years agoUse read number of items instead of raw array size in load_names
Ondřej Surý [Fri, 6 Oct 2023 08:06:36 +0000 (10:06 +0200)] 
Use read number of items instead of raw array size in load_names

The load_names benchmark expected the input CSV with domains would fill
the whole item array and it would crash when the number of lines would
be less than that.

Fix the expectations by using the real number or lines read to calculate
the array start and end position for each benchmark thread.

2 years agoMerge branch 'michal/move-linux-stress-tests-to-autoscaled-instances' into 'main'
Michał Kępień [Fri, 6 Oct 2023 11:09:41 +0000 (11:09 +0000)] 
Merge branch 'michal/move-linux-stress-tests-to-autoscaled-instances' into 'main'

Move Linux "stress" tests to autoscaled instances

See merge request isc-projects/bind9!8359

2 years agoMove Linux "stress" tests to autoscaled instances
Michał Kępień [Fri, 6 Oct 2023 11:07:55 +0000 (13:07 +0200)] 
Move Linux "stress" tests to autoscaled instances

The autoscaling GitLab CI runners currently used for most GitLab CI jobs
spin up AWS EC2 instances that are at least as powerful as the dedicated
instances used for running "stress" tests.  Move all Linux-based
"stress" tests to autoscaling GitLab CI runners to enable deprovisioning
Linux AWS instances reserved for running "stress" tests.  Leave FreeBSD
"stress" tests intact as there is currently no support for autoscaling
BSD instances.

2 years agoMerge branch 'mnowak/monitor-stuck-system-tests' into 'main'
Michal Nowak [Thu, 5 Oct 2023 16:24:37 +0000 (16:24 +0000)] 
Merge branch 'mnowak/monitor-stuck-system-tests' into 'main'

Report hung system tests

See merge request isc-projects/bind9!8245

2 years agoReport hung system tests
Michal Nowak [Wed, 16 Aug 2023 14:19:30 +0000 (16:19 +0200)] 
Report hung system tests

At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.

2 years agoMerge branch '4253-detect-duplicate-controls' into 'main'
Mark Andrews [Thu, 5 Oct 2023 01:32:40 +0000 (01:32 +0000)] 
Merge branch '4253-detect-duplicate-controls' into 'main'

Detect duplicate "controls" configuration

Closes #4253

See merge request isc-projects/bind9!8313

2 years agoAdd CHANGES note for [GL #4253]
Mark Andrews [Wed, 20 Sep 2023 03:03:10 +0000 (13:03 +1000)] 
Add CHANGES note for [GL #4253]

2 years agoCheck that duplicate control sockets are caught
Mark Andrews [Wed, 20 Sep 2023 02:58:14 +0000 (12:58 +1000)] 
Check that duplicate control sockets are caught

2 years agoDetect duplicate use of control sockets in named.conf
Mark Andrews [Wed, 20 Sep 2023 02:53:35 +0000 (12:53 +1000)] 
Detect duplicate use of control sockets in named.conf

Specifying duplicate control sockets can lead to hard to diagnose
rndc connection failures.

2 years agoMerge branch 'pspacek/cross-version-tests-junit' into 'main'
Petr Špaček [Wed, 4 Oct 2023 12:51:02 +0000 (12:51 +0000)] 
Merge branch 'pspacek/cross-version-tests-junit' into 'main'

Generate and capture JUnit XML output from cross-version-config-tests

See merge request isc-projects/bind9!8354

2 years agoGenerate and capture JUnit XML output from cross-version-config-tests
Petr Špaček [Tue, 3 Oct 2023 09:15:39 +0000 (11:15 +0200)] 
Generate and capture JUnit XML output from cross-version-config-tests

2 years agoMerge branch 'pspacek/fix-no-case-compression-docs' into 'main'
Petr Špaček [Tue, 3 Oct 2023 12:36:41 +0000 (12:36 +0000)] 
Merge branch 'pspacek/fix-no-case-compression-docs' into 'main'

Fix no-case-compress description in the ARM

See merge request isc-projects/bind9!8312

2 years agoFix no-case-compress description in the ARM
Petr Špaček [Tue, 19 Sep 2023 14:31:58 +0000 (16:31 +0200)] 
Fix no-case-compress description in the ARM

We confused ourselves, it seems.

2 years agoMerge branch '4343-cid-465861-unnecessary-null-check-in-ns__client_setup' into 'main'
Arаm Sаrgsyаn [Thu, 28 Sep 2023 14:49:28 +0000 (14:49 +0000)] 
Merge branch '4343-cid-465861-unnecessary-null-check-in-ns__client_setup' into 'main'

Remove unnecessary NULL-checks in ns__client_setup()

Closes #4343

See merge request isc-projects/bind9!8347

2 years agoRemove unnecessary NULL-checks in ns__client_setup()
Aram Sargsyan [Thu, 28 Sep 2023 13:43:18 +0000 (13:43 +0000)] 
Remove unnecessary NULL-checks in ns__client_setup()

All these pointers are guaranteed to be non-NULL.

Additionally, update a comment to remove obviously outdated
information about the function's requirements.

2 years agoMerge branch '4331-resolver.c-assert-uninitialized-link' into 'main'
Arаm Sаrgsyаn [Thu, 28 Sep 2023 09:32:04 +0000 (09:32 +0000)] 
Merge branch '4331-resolver.c-assert-uninitialized-link' into 'main'

Don't use an uninitialized link on an error path

Closes #4331

See merge request isc-projects/bind9!8343

2 years agoAdd a CHANGES note for [GL #4331]
Aram Sargsyan [Wed, 27 Sep 2023 11:34:30 +0000 (11:34 +0000)] 
Add a CHANGES note for [GL #4331]

2 years agoDon't use an uninitialized link on an error path
Aram Sargsyan [Wed, 27 Sep 2023 11:22:43 +0000 (11:22 +0000)] 
Don't use an uninitialized link on an error path

Move the block on the error path, where the link is checked, to a place
where it makes sense, to avoid accessing an unitialized link when
jumping to the 'cleanup_query' label from 4 different places. The link
is initialized only after those jumps happen.

In addition, initilize the link when creating the object, to avoid
similar errors.

2 years agoMerge branch 'each-qp-extensions' into 'main'
Evan Hunt [Thu, 28 Sep 2023 07:41:51 +0000 (07:41 +0000)] 
Merge branch 'each-qp-extensions' into 'main'

extensions to QP trie to support DNS databases

See merge request isc-projects/bind9!8338

2 years agoCHANGES for [GL !8338]
Evan Hunt [Wed, 27 Sep 2023 03:23:13 +0000 (20:23 -0700)] 
CHANGES for [GL !8338]

2 years agorename dns_qp_findname_ancestor() to dns_qp_lookup()
Evan Hunt [Wed, 27 Sep 2023 03:19:37 +0000 (20:19 -0700)] 
rename dns_qp_findname_ancestor() to dns_qp_lookup()

I am weary of typing so long a name. (plus, the name has become slightly
misleading now that the DNS_QPFIND_NOEXACT option no longer exists.)

2 years agorename QP-related types to use standard BIND nomenclature
Evan Hunt [Tue, 26 Sep 2023 20:38:12 +0000 (13:38 -0700)] 
rename QP-related types to use standard BIND nomenclature

changed type names in QP trie code to match the usual convention:
 - qp_node_t -> dns_qpnode_t
 - qp_ref_t -> dns_qpref_t
 - qp_shift_t -> dns_qpshift_t
 - qp_weight_t -> dns_qpweight_t
 - qp_chunk_t -> dns_qpchunk_t
 - qp_cell_t -> dns_qpcell_t

2 years agoget predecessor name in dns_qp_findname_ancestor()
Evan Hunt [Sat, 23 Sep 2023 22:58:46 +0000 (15:58 -0700)] 
get predecessor name in dns_qp_findname_ancestor()

dns_qp_findname_ancestor() now takes an optional 'predecessor'
parameter, which if non-NULL is updated to contain the DNSSEC
predecessor of the name searched for. this is done by constructing
an iterator stack while carrying out the search, so it can be used
to step backward if needed.

2 years agoremove DNS_QPFIND_NOEXACT
Evan Hunt [Sat, 23 Sep 2023 08:02:17 +0000 (01:02 -0700)] 
remove DNS_QPFIND_NOEXACT

since dns_qp_findname_ancestor() can now return a chain object, it is no
longer necessary to provide a _NOEXACT search option. if we want to look
up the closest ancestor of a name, we can just do a normal search, and
if successful, retrieve the second-to-last node from the QP chain.

this makes ancestor lookups slightly more complicated for the caller,
but allows us to simplify the code in dns_qp_findname_ancestor(), making
it easier to ensure correctness.  this was a fairly rare use case:
outside of unit tests, DNS_QPFIND_NOEXACT was only used in the zone
table, which has now been updated to use the QP chain.  the equivalent
RBT feature is only used by the resolver for cache lookups of 'atparent'
types (i.e, DS records).

2 years agoimprovements to the QP iterator
Evan Hunt [Tue, 19 Sep 2023 07:41:57 +0000 (00:41 -0700)] 
improvements to the QP iterator

- make iterators reversible: refactor dns_qpiter_next() and add a new
  dns_qpiter_prev() function to support iterating both forwards and
  backwards through a QP trie.
- added a 'name' parameter to dns_qpiter_next() (as well as _prev())
  to make it easier to retrieve the nodename while iterating, without
  having to construct it from pointer value data.

2 years agotidy the helper functions for retrieving twigs
Evan Hunt [Wed, 27 Sep 2023 16:08:37 +0000 (09:08 -0700)] 
tidy the helper functions for retrieving twigs

- the helper functions for accessing twigs beneath a branch
  (branch_twig_pos(), branch_twig_ptr(), etc) were somewhat confusing
  to read, since several of them were implemented by calling other
  helper functions. they now all show what they're really doing.
- branch_twigs_vector() has been renamed to simply branch_twigs().
- revised some unrelated comments in qp_p.h for clarity.

2 years agoadd a node chain traversal mechanism
Evan Hunt [Sat, 9 Sep 2023 00:44:53 +0000 (17:44 -0700)] 
add a node chain traversal mechanism

dns_qp_findname_ancestor() now takes an optional 'chain' parameter;
if set, the dns_qpchain object it points to will be updated with an
array of pointers to the populated nodes between the tree root and the
requested name. the number of nodes in the chain can then be accessed
using dns_qpchain_length() and the individual nodes using
dns_qpchain_node().

2 years agomodify dns_qp_findname_ancestor() to return found name
Evan Hunt [Thu, 7 Sep 2023 06:57:42 +0000 (23:57 -0700)] 
modify dns_qp_findname_ancestor() to return found name

add a 'foundname' parameter to dns_qp_findname_ancestor(),
and use it to set the found name in dns_nametree.

this required adding a dns_qpkey_toname() function; that was
done by moving qp_test_keytoname() from the test library to qp.c.
added some more test cases and fixed bugs with the handling of
relative and empty names.

2 years agoMerge branch 'each-qp-benchmark' into 'main'
Evan Hunt [Thu, 28 Sep 2023 07:00:10 +0000 (07:00 +0000)] 
Merge branch 'each-qp-benchmark' into 'main'

add a QP lookups benchmark

See merge request isc-projects/bind9!8345

2 years agoadd a "qplookups" benchmark test
Evan Hunt [Wed, 27 Sep 2023 22:37:30 +0000 (15:37 -0700)] 
add a "qplookups" benchmark test

this loads a file containing DNS names and measures the time it takes to:
1) iterate it,
2) look up each name with dns_qp_getname()
3) look up each name with dns_qp_findname_ancestor()
4) look up a modified name based on the name, to check performance
   when the name is not found.

2 years agominor cleanups
Evan Hunt [Wed, 27 Sep 2023 20:01:43 +0000 (13:01 -0700)] 
minor cleanups

- removed some commented-out code
- cleaned up uses of pval and ival that were not needed

2 years agoMerge branch '4338-fix-qpmulti-benchmark' into 'main'
Evan Hunt [Wed, 27 Sep 2023 19:35:20 +0000 (19:35 +0000)] 
Merge branch '4338-fix-qpmulti-benchmark' into 'main'

fix the qpmulti benchmark

Closes #4338

See merge request isc-projects/bind9!8344

2 years agofixed the qpmulti benchmark
Evan Hunt [Wed, 27 Sep 2023 18:49:21 +0000 (11:49 -0700)] 
fixed the qpmulti benchmark

the refactoring of isc_job_run() and isc_async_run() in 9.19.12
intefered with the way the qpmulti benchmark uses uv_idle.
it has now been modified to use isc_job/isc_async instead.

2 years agoMerge branch '4335-xfrin_xmlrender-cleanup-path-issue' into 'main'
Arаm Sаrgsyаn [Wed, 27 Sep 2023 11:19:51 +0000 (11:19 +0000)] 
Merge branch '4335-xfrin_xmlrender-cleanup-path-issue' into 'main'

Resolve "CID 465814: Control flow issues (DEADCODE) in statschannel.c"

Closes #4335

See merge request isc-projects/bind9!8334

2 years agoFix return value and docs for dns_zone_getxfr()
Aram Sargsyan [Mon, 25 Sep 2023 12:33:29 +0000 (12:33 +0000)] 
Fix return value and docs for dns_zone_getxfr()

When the given zone is not associated with a zone manager, the function
currently returns ISC_R_NOTFOUND, which is documented as the return
value for the case in which no incoming zone transfer is found.  Make
the function return ISC_R_FAILURE in such a case instead.

Also update the description of the function as the value it returns is
not meant to indicate whether an ongoing incoming transfer for the given
zone exists.  The boolean variables that the function sets via the
pointers provided as its parameters, combined with either keeping
'*xfrp' set to NULL or updating it to a valid pointer, can be used by
the caller to infer all the necessary information.

2 years agoFix error path issue in xfrin_xmlrender()
Aram Sargsyan [Mon, 25 Sep 2023 09:38:03 +0000 (09:38 +0000)] 
Fix error path issue in xfrin_xmlrender()

The TRY0 macro doesn't set the 'result' variable, so the error
log message is never printed. Remove the 'result' variable and
modify the function's control flow to be similar to the the
zone_xmlrender() function, with a separate error returning path.

2 years agoMerge branch 'ondrej/workaround-free_pools' into 'main'
Ondřej Surý [Tue, 26 Sep 2023 13:11:44 +0000 (13:11 +0000)] 
Merge branch 'ondrej/workaround-free_pools' into 'main'

Workaround compiler bug that optimizes setting .free_pools

See merge request isc-projects/bind9!8339

2 years agoWorkaround compiler bug that optimizes setting .free_pools
Ondřej Surý [Tue, 26 Sep 2023 12:29:54 +0000 (14:29 +0200)] 
Workaround compiler bug that optimizes setting .free_pools

The .free_pools bitfield would not be set on some levels of
optimizations - workaround the compiler bug by reordering the setting
the .freepools in the initializer.