]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoAdd sleeps to ixfr system test
Mark Andrews [Wed, 5 Oct 2022 05:26:24 +0000 (16:26 +1100)] 
Add sleeps to ixfr system test

ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.

3 years agoMerge branch '3560-fix-view-resolver-layer-weak-references-violation' into 'main'
Evan Hunt [Wed, 5 Oct 2022 19:33:57 +0000 (19:33 +0000)] 
Merge branch '3560-fix-view-resolver-layer-weak-references-violation' into 'main'

Resolve violation of weak referencing dns_view

Closes #3560

See merge request isc-projects/bind9!6848

3 years agoRecord the 'edns-udp-size' in the view, not in the resolver
Ondřej Surý [Tue, 4 Oct 2022 15:07:19 +0000 (17:07 +0200)] 
Record the 'edns-udp-size' in the view, not in the resolver

Getting the recorded value of 'edns-udp-size' from the resolver requires
strong attach to the dns_view because we are accessing `view->resolver`.
This is not the case in places (f.e. dns_zone unit) where `.udpsize` is
accessed.  By moving the .udpsize field from `struct dns_resolver` to
`struct dns_view`, we can access the value directly even with weakly
attached dns_view without the need to lock the view because `.udpsize`
can be accessed after the dns_view object has been shut down.

3 years agoResolve violation of weak referencing dns_view
Ondřej Surý [Mon, 3 Oct 2022 13:54:12 +0000 (15:54 +0200)] 
Resolve violation of weak referencing dns_view

The dns_view implements weak and strong reference counting.  When strong
reference counting reaches zero, the adb, ntatable and resolver objects
are shut down and detached.

In dns_zone and dns_nta the dns_view was weakly attached, but the
view->resolver reference was accessed directly leading to dereferencing
the NULL pointer.

Add dns_view_getresolver() method which attaches to view->resolver
object under the lock (if it still exists) ensuring the dns_resolver
will be kept referenced until not needed.

3 years agoMerge branch 'mnowak/drop-flake8-ignore-lists' into 'main'
Michal Nowak [Wed, 5 Oct 2022 16:05:41 +0000 (16:05 +0000)] 
Merge branch 'mnowak/drop-flake8-ignore-lists' into 'main'

Drop flake8 ignore lists

See merge request isc-projects/bind9!6778

3 years agoDrop flake8 ignore lists
Michal Nowak [Thu, 15 Sep 2022 08:50:47 +0000 (10:50 +0200)] 
Drop flake8 ignore lists

flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.

3 years agoMerge branch '3580-coverity-constant-boolean-dead-code' into 'main'
Tony Finch [Wed, 5 Oct 2022 15:51:20 +0000 (15:51 +0000)] 
Merge branch '3580-coverity-constant-boolean-dead-code' into 'main'

Avoid dead code warning when using a constant boolean

Closes #3580

See merge request isc-projects/bind9!6862

3 years agoAvoid dead code warning when using a constant boolean
Tony Finch [Wed, 5 Oct 2022 11:11:41 +0000 (12:11 +0100)] 
Avoid dead code warning when using a constant boolean

The value of `sign_bit` is platform-dependent but constant at compile
time. Use a cast to convert the boolean `sign_bit` to 0 or 1 instead of
ternary `?:` because one branch of the conditional is dead code. (We
could leave out the cast to `size_t` but our style prefers to handle
booleans more explicitly, hence the `?:` that caused the issue.)

    *** CID 358310:  Possible Control flow issues  (DEADCODE)
    /lib/isc/resource.c: 118 in isc_resource_setlimit()
    112       * rlim_t, and whether rlim_t has a sign bit.
    113       */
    114      isc_resourcevalue_t rlim_max = UINT64_MAX;
    115      size_t wider = sizeof(rlim_max) - sizeof(rlim_t);
    116      bool sign_bit = (double)(rlim_t)-1 < 0;
    117
    >>>     CID 358310:  Possible Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression "1" inside this statement: "rlim_max >>= 8UL * wider + ...".
    118      rlim_max >>= CHAR_BIT * wider + (sign_bit ? 1 : 0);
    119      rlim_value = ISC_MIN(value, rlim_max);
    120      }
    121
    122      rl.rlim_cur = rl.rlim_max = rlim_value;
    123      unixresult = setrlimit(unixresource, &rl);

3 years agoMerge branch 'ondrej/add-isc_mem_zero' into 'main'
Ondřej Surý [Wed, 5 Oct 2022 14:44:36 +0000 (14:44 +0000)] 
Merge branch 'ondrej/add-isc_mem_zero' into 'main'

Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags)

See merge request isc-projects/bind9!6398

3 years agoAdd CHANGES note for [GL !6398]
Ondřej Surý [Fri, 26 Aug 2022 10:04:32 +0000 (12:04 +0200)] 
Add CHANGES note for [GL !6398]

3 years agoUse isc_mem_regetx() when appropriate
Ondřej Surý [Fri, 26 Aug 2022 09:58:51 +0000 (11:58 +0200)] 
Use isc_mem_regetx() when appropriate

While refactoring the isc_mem_getx(...) usage, couple places were
identified where the memory was resized manually.  Use the
isc_mem_reget(...) that was introduced in [GL !5440] to resize the
arrays via function rather than a custom code.

3 years agoUse designated initializers instead of memset()/MEM_ZERO for structs
Ondřej Surý [Fri, 26 Aug 2022 09:58:51 +0000 (11:58 +0200)] 
Use designated initializers instead of memset()/MEM_ZERO for structs

In several places, the structures were cleaned with memset(...)) and
thus the semantic patch converted the isc_mem_get(...) to
isc_mem_getx(..., ISC_MEM_ZERO).  Use the designated initializer to
initialized the structures instead of zeroing the memory with
ISC_MEM_ZERO flag as this better matches the intended purpose.

3 years agoAdd and use semantic patch to replace isc_mem_get/allocate+memset
Ondřej Surý [Fri, 3 Jun 2022 10:36:24 +0000 (12:36 +0200)] 
Add and use semantic patch to replace isc_mem_get/allocate+memset

Add new semantic patch to replace the straightfoward uses of:

  ptr = isc_mem_{get,allocate}(..., size);
  memset(ptr, 0, size);

with the new API call:

  ptr = isc_mem_{get,allocate}x(..., size, ISC_MEM_ZERO);

3 years agoReplace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags)
Ondřej Surý [Fri, 3 Jun 2022 10:23:49 +0000 (12:23 +0200)] 
Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags)

Previously, the isc_mem_get_aligned() and friends took alignment size as
one of the arguments.  Replace the specific function with more generic
extended variant that now accepts ISC_MEM_ALIGN(alignment) for aligned
allocations and ISC_MEM_ZERO for allocations that zeroes
the (re-)allocated memory before returning the pointer to the caller.

3 years agoMerge branch '3582-coverity-bench-siphash' into 'main'
Tony Finch [Wed, 5 Oct 2022 12:10:18 +0000 (12:10 +0000)] 
Merge branch '3582-coverity-bench-siphash' into 'main'

Suppress division by zero warning

Closes #3582

See merge request isc-projects/bind9!6863

3 years agoSuppress division by zero warning
Tony Finch [Wed, 5 Oct 2022 11:31:42 +0000 (12:31 +0100)] 
Suppress division by zero warning

Coverity is optimistic that we might do thousands of hashes in less
than a microsecond.

    /tests/bench/siphash.c: 54 in main()
    48      count++;
    49      }
    50
    51      isc_time_now_hires(&finish);
    52
    53      us = isc_time_microdiff(&finish, &start);
    >>>     CID 358309:  Integer handling issues  (DIVIDE_BY_ZERO)
    >>>     In expression "count * 1000UL / us", division by expression "us" which may be zero has undefined behavior.
    54      printf("%f us wide-lower len %3zu, %7llu kh/s (%llx)\n",
    55             (double)us / 1000000.0, len,
    56             (unsigned long long)(count * 1000 / us),
    57             (unsigned long long)sum);
    58      }
    59

3 years agoMerge branch '3572-fix-duplicate-link-anchor' into 'main'
Petr Špaček [Wed, 5 Oct 2022 09:44:15 +0000 (09:44 +0000)] 
Merge branch '3572-fix-duplicate-link-anchor' into 'main'

Deduplicate link anchors in the ARM

See merge request isc-projects/bind9!6846

3 years agoRemove manually defined anchors pointing to statement definitions
Petr Špaček [Tue, 4 Oct 2022 09:00:54 +0000 (11:00 +0200)] 
Remove manually defined anchors pointing to statement definitions

This is hopefully end of duplication. This batch did not cause clashes
in Sphinx but it was pointless nonetheless as we have auto-generated
anchors for all statements.

3 years agoRemove trailing whitespaces
Tom Krizek [Mon, 3 Oct 2022 16:19:45 +0000 (18:19 +0200)] 
Remove trailing whitespaces

3 years agoDeduplicate link anchors in the ARM
Petr Špaček [Fri, 30 Sep 2022 11:57:17 +0000 (13:57 +0200)] 
Deduplicate link anchors in the ARM

Some statement names like "allow-query" had manually defined link anchor
_allow-query and also implicit anchor created by
.. namedconf:statement:: syntax. This causes warnings if a ambiguous
reference is made using :any:`allow-query` syntax.

Remove (hopefully all) manually defined anchors which pointed to
identical place as the implicit anchor. This allows :any: to work.

In rare cases where manual anchor points to descriptive text separated
from statement definition the reference was disamguated by replacing
:any:`notify` with :ref:`notify` (for manual anchor)
vs. :namedconf:ref:`notify` (for statement definition).

Please note that `options` statement is a trap: It is ambiguous even
without manual anchor because rndc.conf has its own `options`. Use
:namedconf:ref:`options` vs. :rndcconf:ref:`options` to select
appropriate target.

3 years agoMerge branch '3338-zero-system-test-add-forensics' into 'main'
Mark Andrews [Wed, 5 Oct 2022 08:26:00 +0000 (08:26 +0000)] 
Merge branch '3338-zero-system-test-add-forensics' into 'main'

Add additional forensics to zero system test

See merge request isc-projects/bind9!6295

3 years agoAdd additional forensics to zero system test
Mark Andrews [Thu, 12 May 2022 00:30:42 +0000 (10:30 +1000)] 
Add additional forensics to zero system test

3 years agoMerge branch 'pspacek/tsan-ci-artifacts-fix' into 'main'
Petr Špaček [Wed, 5 Oct 2022 07:43:56 +0000 (07:43 +0000)] 
Merge branch 'pspacek/tsan-ci-artifacts-fix' into 'main'

Fix TSAN artifact gathering in CI

See merge request isc-projects/bind9!6853

3 years agoFix TSAN artifact gathering in CI
Petr Špaček [Tue, 4 Oct 2022 14:14:00 +0000 (16:14 +0200)] 
Fix TSAN artifact gathering in CI

Fixup for 2c3b2dabe9a6b3c4a10f6498a1169f39ed031eed.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243

3 years agoMerge branch 'matthijs-refactor-serve-stale' into 'main'
Matthijs Mekking [Wed, 5 Oct 2022 07:15:27 +0000 (07:15 +0000)] 
Merge branch 'matthijs-refactor-serve-stale' into 'main'

Refactor serve-stale stale-answer-client-timeout 0

See merge request isc-projects/bind9!6845

3 years agoIf refresh stale RRset times out, start stale-refresh-time
Matthijs Mekking [Fri, 30 Sep 2022 09:16:22 +0000 (11:16 +0200)] 
If refresh stale RRset times out, start stale-refresh-time

The previous commit failed some tests because we expect that if a
fetch fails and we have stale candidates in cache, the
stale-refresh-time window is started. This means that if we hit a stale
entry in cache and answering stale data is allowed, we don't bother
resolving it again for as long we are within the stale-refresh-time
window.

This is useful for two reasons:
- If we failed to fetch the RRset that we are looking for, we are not
  hammering the authoritative servers.

- Successor clients don't need to wait for stale-answer-client-timeout
  to get their DNS response, only the first one to query will take
  the latency penalty.

The latter is not useful when stale-answer-client-timeout is 0 though.

So this exception code only to make sure we don't try to refresh the
RRset again if it failed to do so recently.

3 years agoReuse recursion type code for refresh stale RRset
Matthijs Mekking [Thu, 29 Sep 2022 07:57:46 +0000 (09:57 +0200)] 
Reuse recursion type code for refresh stale RRset

Refreshing a stale RRset is similar to prefetching an RRset, so
reuse the existing code. When refreshing an RRset we need to clear
all db options related to serve-stale so that stale RRsets in cache
are ignored during the refresh.

We no longer need to set the "nodetach" flag, because the refresh
fetch is now a "fetch and forget". So we can detach from the client
in the query_send().

This code will break some serve-stale test cases, this will be fixed
in the successor commit.

TODO: add explanation why the serve-stale test cases fail.

3 years agoAdd new recursion type for refreshing stale RRset
Matthijs Mekking [Wed, 28 Sep 2022 13:13:11 +0000 (15:13 +0200)] 
Add new recursion type for refreshing stale RRset

Refreshing a stale RRset is similar to a prefetch query, so we can
refactor this code to use the new recursion types introduced in !5883.

3 years agoMerge branch 'ondrej-implement-case-insensitive-siphash-2-4' into 'main'
Ondřej Surý [Tue, 4 Oct 2022 09:03:00 +0000 (09:03 +0000)] 
Merge branch 'ondrej-implement-case-insensitive-siphash-2-4' into 'main'

Add a case-insensitive option directly to siphash 2-4 implementation

See merge request isc-projects/bind9!6789

3 years agoAdd a case-insensitive option directly to siphash 2-4 implementation
Ondřej Surý [Mon, 27 Jun 2022 08:13:19 +0000 (10:13 +0200)] 
Add a case-insensitive option directly to siphash 2-4 implementation

Formerly, the isc_hash32() would have to change the key in a local copy
to make it case insensitive.  Change the isc_siphash24() and
isc_halfsiphash24() functions to lowercase the input directly when
reading it from the memory and converting the uint8_t * array to
64-bit (respectively 32-bit numbers).

3 years agoA simple siphash benchmark
Tony Finch [Wed, 21 Sep 2022 12:38:08 +0000 (13:38 +0100)] 
A simple siphash benchmark

To see the effect of adding a case-insentitive option.

3 years agoMerge branch '3544-add-dohpath-parsing-to-svbc' into 'main'
Mark Andrews [Tue, 4 Oct 2022 04:30:04 +0000 (04:30 +0000)] 
Merge branch '3544-add-dohpath-parsing-to-svbc' into 'main'

Resolve "Add dohpath parsing to SVCB"

Closes #3544

See merge request isc-projects/bind9!6774

3 years agoUse strnstr implementation from FreeBSD if not provided by OS
Mark Andrews [Thu, 15 Sep 2022 07:03:50 +0000 (17:03 +1000)] 
Use strnstr implementation from FreeBSD if not provided by OS

3 years agoAdd release note for [GL #3544]
Mark Andrews [Thu, 15 Sep 2022 06:12:49 +0000 (16:12 +1000)] 
Add release note for [GL #3544]

3 years agoAdd CHANGES note for [GL #3544]
Mark Andrews [Thu, 15 Sep 2022 06:10:29 +0000 (16:10 +1000)] 
Add CHANGES note for [GL #3544]

3 years agoAdd support for 'dohpath' to SVCB (and HTTPS)
Mark Andrews [Thu, 15 Sep 2022 06:04:43 +0000 (16:04 +1000)] 
Add support for 'dohpath' to SVCB (and HTTPS)

dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).

3 years agoMerge branch '3549-isc-resource-ub' into 'main'
Tony Finch [Mon, 3 Oct 2022 11:38:20 +0000 (11:38 +0000)] 
Merge branch '3549-isc-resource-ub' into 'main'

Avoid signed integer overflow in isc_resource_setlimit()

Closes #3549

See merge request isc-projects/bind9!6788

3 years agoAvoid signed integer overflow in isc_resource_setlimit()
Tony Finch [Tue, 20 Sep 2022 13:32:01 +0000 (14:32 +0100)] 
Avoid signed integer overflow in isc_resource_setlimit()

On systems with signed rlim_t the old code calculated its maximum
value by shifting 1 into the sign bit, which is undefined behaviour.
Avoid the bug by using an unsigned shift.

3 years agoMerge branch 'ondrej-increase-the-time-to-wait-for-servers-to-gracefully-shutdown...
Ondřej Surý [Fri, 30 Sep 2022 15:38:47 +0000 (15:38 +0000)] 
Merge branch 'ondrej-increase-the-time-to-wait-for-servers-to-gracefully-shutdown' into 'main'

Be more patient when stopping servers in the system tests

See merge request isc-projects/bind9!6847

3 years agoBe more patient when stopping servers in the system tests
Ondřej Surý [Fri, 30 Sep 2022 14:01:49 +0000 (16:01 +0200)] 
Be more patient when stopping servers in the system tests

When the TCP test is run on the busy server, the server might take a
while to wind the server down because it might still be processing all
that 300k invalid XFR requests.

Increate the rncd wait time to 120 seconds, the SIGTERM time to 300
seconds, and reduce the time to wait for ans servers from 1200 second
to just 120 seconds.

3 years agoMerge branch '3571-fix-data-race-in-dns_nta' into 'main'
Ondřej Surý [Fri, 30 Sep 2022 14:18:29 +0000 (14:18 +0000)] 
Merge branch '3571-fix-data-race-in-dns_nta' into 'main'

Don't stop timer from dns__nta_shutdown()

Closes #3571

See merge request isc-projects/bind9!6844

3 years agoDon't stop timer from dns__nta_shutdown()
Ondřej Surý [Fri, 30 Sep 2022 08:52:14 +0000 (10:52 +0200)] 
Don't stop timer from dns__nta_shutdown()

The dns__nta_shutdown() could be run from different threads and it was
accessing nta->timer unlocked.  Don't check and stop the timer from
dns__nta_shutdown() directly, but leave it for the async callback.

3 years agoMerge branch '3555-refactor-isc_ratelimiter-API' into 'main'
Ondřej Surý [Fri, 30 Sep 2022 13:23:31 +0000 (13:23 +0000)] 
Merge branch '3555-refactor-isc_ratelimiter-API' into 'main'

Refactor isc_ratelimiter API

Closes #3555

See merge request isc-projects/bind9!6842

3 years agoRefactor isc_ratelimiter API
Ondřej Surý [Thu, 29 Sep 2022 07:30:20 +0000 (09:30 +0200)] 
Refactor isc_ratelimiter API

Because the dns_zonemgr_create() was run before the loopmgr was started,
the isc_ratelimiter API was more complicated that it had to be.  Move
the dns_zonemgr_create() to run_server() task which is run on the main
loop, and simplify the isc_ratelimiter API implementation.

The isc_timer is now created in the isc_ratelimiter_create() and
starting the timer is now separate async task as is destroying the timer
in case it's not launched from the loop it was created on.  The
ratelimiter tick now doesn't have to create and destroy timer logic and
just stops the timer when there's no more work to do.

This should also solve all the races that were causing the
isc_ratelimiter to be left dangling because the timer was stopped before
the last reference would be detached.

3 years agoAdd isc_ratelimiter API unit tests
Ondřej Surý [Thu, 29 Sep 2022 08:45:15 +0000 (10:45 +0200)] 
Add isc_ratelimiter API unit tests

The isc_ratelimiter API was missing unit tests.

Add a new set of unit tests for the isc_ratelimiter API.

3 years agoFix small problems in the isc_ratelimiter
Ondřej Surý [Thu, 29 Sep 2022 16:06:05 +0000 (18:06 +0200)] 
Fix small problems in the isc_ratelimiter

3 years agoAdd missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro
Ondřej Surý [Thu, 29 Sep 2022 08:46:36 +0000 (10:46 +0200)] 
Add missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro

The detach function in the ISC_REFCOUNT_IMPL macro was missing DbC
checks, add them.

3 years agoMerge branch '3569-dns-message-checksig-create-test-key-directory' into 'main'
Mark Andrews [Fri, 30 Sep 2022 02:42:18 +0000 (02:42 +0000)] 
Merge branch '3569-dns-message-checksig-create-test-key-directory' into 'main'

Resolve "dns_message_checksig under oss_fuzz is not seeing the data files"

Closes #3569

See merge request isc-projects/bind9!6840

3 years agoAdd CHANGES note for [GL #3569]
Mark Andrews [Thu, 29 Sep 2022 02:21:10 +0000 (12:21 +1000)] 
Add CHANGES note for [GL #3569]

3 years agoCreate a key directory in /tmp
Mark Andrews [Thu, 29 Sep 2022 02:12:58 +0000 (12:12 +1000)] 
Create a key directory in /tmp

Access to the source tree is not available with oss_fuzz.  Have
fuzz/dns_message_checksig build and populate a key directory for
the fuzzer to use.  This contains a key pair and a zone file which
has the public key from the key pair.  Clean it up on shutdown.

3 years agoMerge branch 'ondrej-remove-debug-print-from-run_server' into 'main'
Ondřej Surý [Thu, 29 Sep 2022 12:23:11 +0000 (12:23 +0000)] 
Merge branch 'ondrej-remove-debug-print-from-run_server' into 'main'

Remove debugging fprintf from run_server()

See merge request isc-projects/bind9!6843

3 years agoRemove debugging fprintf from run_server()
Ondřej Surý [Thu, 29 Sep 2022 11:46:31 +0000 (13:46 +0200)] 
Remove debugging fprintf from run_server()

In the loopmgr branch, we forgot the scissors^Hdebugging output in the
patient^Hnamed, remove it.

3 years agoMerge branch 'fanf-free-non-null' into 'main'
Tony Finch [Thu, 29 Sep 2022 10:07:46 +0000 (10:07 +0000)] 
Merge branch 'fanf-free-non-null' into 'main'

Improve DBC in isc_mem_free

See merge request isc-projects/bind9!6839

3 years agoImprove DBC in isc_mem_free
Tony Finch [Mon, 13 Jun 2022 11:00:01 +0000 (12:00 +0100)] 
Improve DBC in isc_mem_free

Unlike standard free(), isc_mem_free() is not a no-op when passed a
NULL pointer. For size accounting purposes it calls sallocx(), which
crashes when passed a NULL pointer. To get more helpful diagnostics,
REQUIRE() that the pointer is not NULL so that when the programmer
makes a mistake they get a backtrace that shows what went wrong.

3 years agoMerge branch '3534-make-the-isc_nm_udp_send-on-shutdown-callback-asynchronous' into...
Ondřej Surý [Thu, 29 Sep 2022 10:04:40 +0000 (10:04 +0000)] 
Merge branch '3534-make-the-isc_nm_udp_send-on-shutdown-callback-asynchronous' into 'main'

Call the isc__nm_udp_send() callbacks asynchronously on shutdown

Closes #3534

See merge request isc-projects/bind9!6828

3 years agoAdd developer documentation on the netmgr callbacks
Ondřej Surý [Thu, 29 Sep 2022 09:12:15 +0000 (11:12 +0200)] 
Add developer documentation on the netmgr callbacks

Extra care must be taken when executing the callbacks to prevent the
deadlocks on the caller's side.  Add a paragraph that addresses when we
can and when we cannot call the callbacks directly.

3 years agoCall the isc__nm_udp_send() callbacks asynchronously on shutdown
Ondřej Surý [Tue, 27 Sep 2022 13:20:33 +0000 (15:20 +0200)] 
Call the isc__nm_udp_send() callbacks asynchronously on shutdown

The isc__nm_udp_send() callback would be called synchronously when
shutting down or when the socket has been closed.  This could lead to
double locking in the calling code and thus those callbacks needs to be
called asynchronously.

3 years agoMerge branch '3512-xot-breaks-ddns-update-forwarding' into 'main'
Arаm Sаrgsyаn [Wed, 28 Sep 2022 10:28:05 +0000 (10:28 +0000)] 
Merge branch '3512-xot-breaks-ddns-update-forwarding' into 'main'

Resolve "XoT breaks DDNS update forwarding"

Closes #3512

See merge request isc-projects/bind9!6710

3 years agoAdd a release note for [GL #3512]
Aram Sargsyan [Wed, 28 Sep 2022 09:01:39 +0000 (09:01 +0000)] 
Add a release note for [GL #3512]

3 years agoAdd a CHANGES note for [GL #3512]
Aram Sargsyan [Wed, 28 Sep 2022 09:01:30 +0000 (09:01 +0000)] 
Add a CHANGES note for [GL #3512]

3 years agoTest dynamic update forwarding when using a TLS-enabled primary
Aram Sargsyan [Wed, 28 Sep 2022 09:01:19 +0000 (09:01 +0000)] 
Test dynamic update forwarding when using a TLS-enabled primary

Add several test cases in the 'upforwd' system test to make sure
that different scenarios of Dynamic DNS update forwarding are
tested, in particular when both the original and forwarded requests
are over Do53, or DoT, or they use different transports.

3 years agoFix dynamic update forwarding when using a TLS-enabled primary
Aram Sargsyan [Wed, 28 Sep 2022 09:01:05 +0000 (09:01 +0000)] 
Fix dynamic update forwarding when using a TLS-enabled primary

Now that the 'dns_request' supports using TLS transport, implement
dynamic update forwarding using DoT when the primary server is
configured to use a TLS transport.

Previously, when using such configuration, the dynamic update forwarding
feature was broken.

3 years agoMerge branch '3562-assign-default-value-to-suffix' into 'main'
Mark Andrews [Wed, 28 Sep 2022 00:09:28 +0000 (00:09 +0000)] 
Merge branch '3562-assign-default-value-to-suffix' into 'main'

Resolve "suffix may be used before being assigned in qmin/ans3/ans.py"

Closes #3562

See merge request isc-projects/bind9!6811

3 years agoSuffix may be used before it is assigned a value
Mark Andrews [Mon, 26 Sep 2022 04:49:44 +0000 (14:49 +1000)] 
Suffix may be used before it is assigned a value

    CID 350722 (#5 of 7): Bad use of null-like value (FORWARD_NULL)
        12. invalid_operation: Invalid operation on null-like value suffix.
    145        r.authority.append(
    146            dns.rrset.from_text(
    147                "icky.ptang.zoop.boing." + suffix,
    148                1,
    149                IN,
    150                NS,
    151                "a.bit.longer.ns.name." + suffix,
    152            )
    153        )

3 years agoMerge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2' into 'main'
Mark Andrews [Tue, 27 Sep 2022 23:46:26 +0000 (23:46 +0000)] 
Merge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2' into 'main'

Resolve "Missing RSA_free call in opensslrsa_verify2"

Closes #3551

See merge request isc-projects/bind9!6810

3 years agoAdd CHANGES note for [GL #3551]
Mark Andrews [Mon, 26 Sep 2022 02:12:30 +0000 (12:12 +1000)] 
Add CHANGES note for [GL #3551]

3 years agoCheck BN_dup results in rsa_check
Mark Andrews [Mon, 26 Sep 2022 02:06:44 +0000 (12:06 +1000)] 
Check BN_dup results in rsa_check

3 years agoFree 'n' on error path in rsa_check
Mark Andrews [Mon, 26 Sep 2022 02:05:33 +0000 (12:05 +1000)] 
Free 'n' on error path in rsa_check

3 years agoCheck that 'e' and 'n' are allocated in opensslrsa_fromdns
Mark Andrews [Mon, 26 Sep 2022 01:57:17 +0000 (11:57 +1000)] 
Check that 'e' and 'n' are allocated in opensslrsa_fromdns

3 years agoCheck that 'e' and 'n' are non-NULL in opensslrsa_todns
Mark Andrews [Mon, 26 Sep 2022 01:52:55 +0000 (11:52 +1000)] 
Check that 'e' and 'n' are non-NULL in opensslrsa_todns

3 years agoFree 'rsa' if 'e' is NULL in opensslrsa_verify2
Mark Andrews [Mon, 26 Sep 2022 01:51:05 +0000 (11:51 +1000)] 
Free 'rsa' if 'e' is NULL in opensslrsa_verify2

3 years agoMerge branch '3559-provide-custom-isc_mem-based-allocators-for-external-libraries...
Ondřej Surý [Tue, 27 Sep 2022 15:55:09 +0000 (15:55 +0000)] 
Merge branch '3559-provide-custom-isc_mem-based-allocators-for-external-libraries' into 'main'

Use custom isc_mem based allocator for libuv, OpenSSL, and libxml2

Closes #3559

See merge request isc-projects/bind9!6807

3 years agoAdd CHANGES note for [GL #3559]
Ondřej Surý [Fri, 23 Sep 2022 12:42:35 +0000 (14:42 +0200)] 
Add CHANGES note for [GL #3559]

3 years agoAdd autoconf option to enable memory leak detection in libraries
Ondřej Surý [Tue, 27 Sep 2022 11:35:26 +0000 (13:35 +0200)] 
Add autoconf option to enable memory leak detection in libraries

There's a known memory leak in the engine_pkcs11 at the time of writing
this and it interferes with the named ability to check for memory leaks
in the OpenSSL memory context by default.

Add an autoconf option to explicitly enable the memory leak detection,
and use it in the CI except for pkcs11 enabled builds.  When this gets
fixed in the engine_pkc11, the option can be enabled by default.

3 years agoCheck the libuv, OpenSSL and libxml2 memory context on exit
Ondřej Surý [Fri, 23 Sep 2022 14:06:42 +0000 (16:06 +0200)] 
Check the libuv, OpenSSL and libxml2 memory context on exit

As we can't check the deallocations done in the library memory contexts
by default because it would always fail on non-clean exit (that happens
on error or by calling exit() early), we just want to enable the checks
to be done on normal exit.

3 years agoUse custom isc_mem based allocator for libxml2
Ondřej Surý [Fri, 23 Sep 2022 12:36:54 +0000 (14:36 +0200)] 
Use custom isc_mem based allocator for libxml2

The libxml2 library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, strdup and free).

Create a memory context specifically for libxml2 to allow tracking the
memory usage that has originated from within libxml2.  This will provide
a separate memory context for libxml2 to track the allocations and when
shutting down the application it will check that all libxml2 allocations
were returned to the allocator.

Additionally, move the xmlInitParser() and xmlCleanupParser() calls from
bin/named/main.c to library constructor/destructor in libisc library.

3 years agoUse custom isc_mem based allocator for OpenSSL
Ondřej Surý [Fri, 23 Sep 2022 12:17:48 +0000 (14:17 +0200)] 
Use custom isc_mem based allocator for OpenSSL

The OpenSSL library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, and free).

Create a memory context specifically for OpenSSL to allow tracking the
memory usage that has originated from within OpenSSL.  This will provide
a separate memory context for OpenSSL to track the allocations and when
shutting down the application it will check that all OpenSSL allocations
were returned to the allocator.

3 years agoUse custom isc_mem based allocator for libuv
Ondřej Surý [Fri, 23 Sep 2022 11:54:33 +0000 (13:54 +0200)] 
Use custom isc_mem based allocator for libuv

The libuv library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, calloc and free).

Create a memory context specifically for libuv to allow tracking the
memory usage that has originated from within libuv.  This requires
libuv >= 1.38.0 which provides uv_library_shutdown() function that
assures no more allocations will be made.

3 years agoCheck for working __builtin_mul_overflow() implementation
Ondřej Surý [Fri, 23 Sep 2022 13:35:58 +0000 (15:35 +0200)] 
Check for working __builtin_mul_overflow() implementation

Instead of using generic HAVE_BUILTIN_OVERFLOW, we need to check whether
the overflow functions actually work as there was a bug in GCC that it
would not detect mul overflow when compiled with `-m32` option without
optimizations and the bug was fixed only for GCC 6.5+ and 7.3+/8+.

For further details see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82274

3 years agoMake the debugging flags local to the memory context
Ondřej Surý [Fri, 23 Sep 2022 11:49:31 +0000 (13:49 +0200)] 
Make the debugging flags local to the memory context

Previously, the isc_mem_debugging would be single global variable that
would affect the behavior of the memory context whenever it would be
changed which could be after some allocation were already done.

Change the memory debugging options to be local to the memory context
and immutable, so all allocations within the same memory context are
treated the same.

3 years agoMerge branch '3567-bump-the-minimal-libuv-version-to-1.34.0' into 'main'
Ondřej Surý [Tue, 27 Sep 2022 15:09:53 +0000 (15:09 +0000)] 
Merge branch '3567-bump-the-minimal-libuv-version-to-1.34.0' into 'main'

Bump the libuv requirement to libuv >= 1.34.0

Closes #3567

See merge request isc-projects/bind9!6826

3 years agoAdd CHANGES and release note for [GL #3567]
Ondřej Surý [Tue, 27 Sep 2022 12:16:17 +0000 (14:16 +0200)] 
Add CHANGES and release note for [GL #3567]

3 years agoBump the libuv requirement to libuv >= 1.34.0
Ondřej Surý [Tue, 27 Sep 2022 12:10:40 +0000 (14:10 +0200)] 
Bump the libuv requirement to libuv >= 1.34.0

By bumping the minimum libuv version to 1.34.0, it allows us to remove
all libuv shims we ever had and makes the code much cleaner.  The
up-to-date libuv is available in all distributions supported by BIND
9.19+ either natively or as a backport.

3 years agoDrop Ubuntu 18.04 bionic from the CI
Ondřej Surý [Tue, 27 Sep 2022 11:59:30 +0000 (13:59 +0200)] 
Drop Ubuntu 18.04 bionic from the CI

The Ubuntu 18.04 bionic will go EOL in April 2023 before the next stable
BIND 9 release, so we can drop this for the next stable BIND 9 release.

3 years agoDrop Debian buster from the CI
Ondřej Surý [Tue, 27 Sep 2022 11:56:55 +0000 (13:56 +0200)] 
Drop Debian buster from the CI

The Debian buster is official EOL and in the LTS mode, so we can drop
this for the next stable BIND 9 release.

3 years agoMerge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing' into ...
Matthijs Mekking [Tue, 27 Sep 2022 15:08:03 +0000 (15:08 +0000)] 
Merge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing' into 'main'

Add dnssec-policy inline-signing requirement to documentation

See merge request isc-projects/bind9!6823

3 years agoAdd inline-signing to config examples
Matthijs Mekking [Tue, 27 Sep 2022 10:04:37 +0000 (12:04 +0200)] 
Add inline-signing to config examples

Add 'inline-signing yes;' to configuration examples to have working
copy paste configurations.

3 years agoUpdate inline-signing requirement to ARM
Matthijs Mekking [Tue, 27 Sep 2022 09:57:53 +0000 (11:57 +0200)] 
Update inline-signing requirement to ARM

This change was made in !6403, but the appropriate documentation
changes were not applied to the ARM.

3 years agoAdd inline-signing requirement to DNSSEC Guide
Matthijs Mekking [Tue, 27 Sep 2022 09:46:23 +0000 (11:46 +0200)] 
Add inline-signing requirement to DNSSEC Guide

This change was made in !6403, but the appropriate documentation
changes were not applied to the DNSSEC Guide.

3 years agoMerge branch '3541-have-named-v-report-supported-algorithms' into 'main'
Petr Špaček [Tue, 27 Sep 2022 14:55:11 +0000 (14:55 +0000)] 
Merge branch '3541-have-named-v-report-supported-algorithms' into 'main'

Report supported crypto algorithms

Closes #3541

See merge request isc-projects/bind9!6771

3 years agoAdd release note for new crypto algorithm logging
Petr Špaček [Tue, 27 Sep 2022 13:13:13 +0000 (15:13 +0200)] 
Add release note for new crypto algorithm logging

3 years agoDocument list of crypto algorithms in named -V output
Petr Špaček [Tue, 27 Sep 2022 13:10:58 +0000 (15:10 +0200)] 
Document list of crypto algorithms in named -V output

3 years agoDeduplicate string formating
Mark Andrews [Wed, 14 Sep 2022 07:35:47 +0000 (17:35 +1000)] 
Deduplicate string formating

3 years agoAdd CHANGES entry for [GL #3541]
Mark Andrews [Wed, 14 Sep 2022 07:53:21 +0000 (17:53 +1000)] 
Add CHANGES entry for [GL #3541]

3 years agosilence scan-build false positive
Mark Andrews [Thu, 15 Sep 2022 08:04:52 +0000 (18:04 +1000)] 
silence scan-build false positive

3 years agoReport algorithms supported by named at startup
Mark Andrews [Wed, 14 Sep 2022 08:33:42 +0000 (18:33 +1000)] 
Report algorithms supported by named at startup

3 years agoHave 'named -V' report supported algorithms
Mark Andrews [Wed, 14 Sep 2022 07:35:47 +0000 (17:35 +1000)] 
Have 'named -V' report supported algorithms

These cover DNSSEC, DS, HMAC and TKEY algorithms.

3 years agoReplace alg_totext with dst_hmac_algorithm_totext
Mark Andrews [Thu, 15 Sep 2022 14:42:15 +0000 (00:42 +1000)] 
Replace alg_totext with dst_hmac_algorithm_totext

The new library function will be reused by subsequent commits.

3 years agoConvert DST_ALG defines to enum and group HMAC algorithms
Mark Andrews [Thu, 15 Sep 2022 09:18:53 +0000 (19:18 +1000)] 
Convert DST_ALG defines to enum and group HMAC algorithms

The HMACs and GSSAPI are just using unallocated values.
Moving them around shouldn't cause issues.
Only the dnssec system test knew the internal number in use for hmacmd5.

3 years agoMerge branch '3513-cid-356329-error-handling-in-dnssec-signzone.c' into 'main'
Arаm Sаrgsyаn [Tue, 27 Sep 2022 14:34:23 +0000 (14:34 +0000)] 
Merge branch '3513-cid-356329-error-handling-in-dnssec-signzone.c' into 'main'

Resolve "CID 356329: Error handling issues in bin/dnssec/dnssec-signzone.c"

Closes #3513

See merge request isc-projects/bind9!6714