]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoMerge branch '4386-fix-assertion-failure-when-using--X-named-option' into 'main'
Ondřej Surý [Thu, 26 Oct 2023 11:43:13 +0000 (11:43 +0000)] 
Merge branch '4386-fix-assertion-failure-when-using--X-named-option' into 'main'

Fix assertion failure when using -X and lock-file in configuration

Closes #4386

See merge request isc-projects/bind9!8427

2 years agoAdd CHANGES and release note for [GL #4386]
Ondřej Surý [Thu, 26 Oct 2023 08:59:53 +0000 (10:59 +0200)] 
Add CHANGES and release note for [GL #4386]

2 years agoFix assertion failure when using -X and lock-file in configuration
Ondřej Surý [Thu, 26 Oct 2023 08:54:28 +0000 (10:54 +0200)] 
Fix assertion failure when using -X and lock-file in configuration

When 'lock-file <lockfile1>' was used in configuration at the same time
as using `-X <lockfile2>` in `named` invocation, there was an invalid
logic that would lead to a double isc_mem_strdup() call on the
<lockfile2> value.

Skip the second allocation if `lock-file` is being used in
configuration, so the <lockfile2> is used only single time.

2 years agoMerge branch 'tkrizek/shfmt' into 'main'
Tom Krizek [Thu, 26 Oct 2023 09:01:06 +0000 (09:01 +0000)] 
Merge branch 'tkrizek/shfmt' into 'main'

Enforce shell script codestyle with shfmt

See merge request isc-projects/bind9!8419

2 years agoIgnore shell script formatting in git blame
Tom Krizek [Tue, 24 Oct 2023 12:55:07 +0000 (14:55 +0200)] 
Ignore shell script formatting in git blame

2 years agoAdd editorconfig file for shell style
Tom Krizek [Wed, 25 Oct 2023 08:14:12 +0000 (10:14 +0200)] 
Add editorconfig file for shell style

2 years agoRun shfmt in CI
Tom Krizek [Tue, 24 Oct 2023 12:56:06 +0000 (14:56 +0200)] 
Run shfmt in CI

Ensure our shell script format stays consistent in the future.

2 years agoReformat shell scripts with shfmt
Tom Krizek [Tue, 24 Oct 2023 12:43:14 +0000 (14:43 +0200)] 
Reformat shell scripts with shfmt

All changes in this commit were automated using the command:

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

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)

2 years agoMerge branch '4390-allow-changing-liburcu-mode-only-in-developer-mode' into 'main'
Ondřej Surý [Thu, 26 Oct 2023 08:21:49 +0000 (08:21 +0000)] 
Merge branch '4390-allow-changing-liburcu-mode-only-in-developer-mode' into 'main'

Allowing changing Userspace-RCU variant only in developer mode

Closes #4390

See merge request isc-projects/bind9!8425

2 years agoRemove Userspace-RCU signal variant
Ondřej Surý [Thu, 26 Oct 2023 07:17:17 +0000 (09:17 +0200)] 
Remove Userspace-RCU signal variant

The signal variant of Userspace-RCU has been deprecated upstream.
Remove the support for compiling with it from configure.ac.

2 years agoAllowing changing Userspace-RCU variant only in developer mode
Ondřej Surý [Thu, 26 Oct 2023 07:14:10 +0000 (09:14 +0200)] 
Allowing changing Userspace-RCU variant only in developer mode

The Userspace-RCU variants other than membarrier is untested and at
least in QSBR case it's broken.  Allow changing the Userspace-RCU
variant only in the developer's mode.

2 years agoMerge branch '4385-qp-lookup-race' into 'main'
Evan Hunt [Thu, 26 Oct 2023 07:34:57 +0000 (07:34 +0000)] 
Merge branch '4385-qp-lookup-race' into 'main'

prevent a possible race in dns_qpmulti_query()

Closes #4385

See merge request isc-projects/bind9!8421

2 years agoPrevent a possible race in dns_qpmulti_query() and _snapshot()
Evan Hunt [Wed, 25 Oct 2023 21:59:55 +0000 (14:59 -0700)] 
Prevent a possible race in dns_qpmulti_query() and _snapshot()

The `.reader` member of dns_qpmulti_t was accessed without RCU
protection; reader_open() calls rcu_dereference() on it, and this
call needs to be inside an RCU critical section.

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

These are relicts of the isc_qsbr - in the QSBR mode the rcu_read_lock()
and rcu_read_unlock() are no-ops and whole event loop is a critical section.

2 years agoMerge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed'...
Mark Andrews [Thu, 26 Oct 2023 07:02:01 +0000 (07:02 +0000)] 
Merge branch '4387-lock-file-is-deleted-on-exit-even-if-lock-acquisition-failed' into 'main'

Resolve "lock file is deleted on exit even if lock acquisition failed"

Closes #4387

See merge request isc-projects/bind9!8422

2 years agoAdd release note for [GL #4387]
Mark Andrews [Thu, 26 Oct 2023 05:14:02 +0000 (16:14 +1100)] 
Add release note for [GL #4387]

2 years agoAdd CHANGES note for [GL #4387]
Mark Andrews [Thu, 26 Oct 2023 04:07:58 +0000 (15:07 +1100)] 
Add CHANGES note for [GL #4387]

2 years agoCheck that the lock file was not removed too early
Mark Andrews [Thu, 26 Oct 2023 04:07:58 +0000 (15:07 +1100)] 
Check that the lock file was not removed too early

When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

2 years agoOnly remove the lock file if we managed to lock it
Mark Andrews [Thu, 26 Oct 2023 03:50:43 +0000 (14:50 +1100)] 
Only remove the lock file if we managed to lock it

The lock file was being removed when we hadn't successfully locked
it which defeated the purpose of the lockfile.  Adjust cleanup_lockfile
such that it only unlinks the lockfile if we have successfully locked
the lockfile and it is still active (lockfile != NULL).

2 years agoMerge branch 'ondrej/dns_message-refactoring' into 'main'
Ondřej Surý [Wed, 25 Oct 2023 10:37:16 +0000 (10:37 +0000)] 
Merge branch 'ondrej/dns_message-refactoring' into 'main'

Refactor and cleanup the dns_message unit

See merge request isc-projects/bind9!8400

2 years agoRefactor dns_message using ISC_LIST_FOREACH macros
Ondřej Surý [Thu, 19 Oct 2023 08:22:59 +0000 (10:22 +0200)] 
Refactor dns_message using ISC_LIST_FOREACH macros

Do a light refactoring and cleanups that replaces common list walking
patterns with ISC_LIST_FOREACH macros and split some nested loops into
separate static functions to reduce the nesting depth.

2 years agoAdd ISC_LIST_FOREACH_REV(_SAFE) macros
Ondřej Surý [Thu, 19 Oct 2023 08:21:20 +0000 (10:21 +0200)] 
Add ISC_LIST_FOREACH_REV(_SAFE) macros

Add complementary macros to ISC_LIST_FOREACH(_SAFE) that walk the lists
in reverse.

  * ISC_LIST_FOREACH_REV(list, elt, link) - walk the static list from
    tail to head
  * ISC_LIST_FOREACH_REV_SAFE(list, elt, link, next) - walk the list
    from tail to head in a manner that's safe against list member
    deletions

2 years agoAdd dns__message_putassociatedrdataset() to deduplicate code
Ondřej Surý [Thu, 19 Oct 2023 07:41:55 +0000 (09:41 +0200)] 
Add dns__message_putassociatedrdataset() to deduplicate code

There was a lot of internal code looking like this:

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

Deduplicate the code into local dns__message_puttemprdataset() routine,
and drop the INSIST() which is checked in dns_rdataset_disassociate().

2 years agoRemove unused dns_message_movename() method
Ondřej Surý [Wed, 18 Oct 2023 14:19:41 +0000 (16:19 +0200)] 
Remove unused dns_message_movename() method

Since dns_message_movename() was unused, it could be removed from the
code based to declutter the API.

2 years agoMerge branch '4379-dont-reuse-TCP-dispatches-in-dns_xfrin' into 'main'
Ondřej Surý [Tue, 24 Oct 2023 12:19:23 +0000 (12:19 +0000)] 
Merge branch '4379-dont-reuse-TCP-dispatches-in-dns_xfrin' into 'main'

Add option to mark TCP dispatch as unshared

Closes #4379

See merge request isc-projects/bind9!8408

2 years agoAdd CHANGES note for [GL #4379]
Ondřej Surý [Fri, 20 Oct 2023 06:20:30 +0000 (08:20 +0200)] 
Add CHANGES note for [GL #4379]

2 years agoAdd dispatch_getcp and dispatch_newtcp tests
Ondřej Surý [Mon, 23 Oct 2023 10:26:50 +0000 (12:26 +0200)] 
Add dispatch_getcp and dispatch_newtcp tests

Refactor the dispatch unit test to use more local variables (previously
dispatchmgr, dispatch and dispentry were all global), and add two new
tests:

* dispatch_getcp - test whether the TCP connection will get reused
* dispatch_newtcp - test that the TCP connection will not get reused
                    when DNS_DISPATCHOPT_UNSHARED is in effect

2 years agoAdd option to mark TCP dispatch as unshared
Ondřej Surý [Fri, 20 Oct 2023 06:14:27 +0000 (08:14 +0200)] 
Add option to mark TCP dispatch as unshared

The current dispatch code could reuse the TCP connection when
dns_dispatch_gettcp() would be used first.  This is problematic as the
dns_resolver doesn't use TCP connection sharing, but dns_request could
get the TCP stream that was created outside of the dns_request.

Add new DNS_DISPATCHOPT_UNSHARED option to dns_dispatch_createtcp() that
would prevent the TCP stream to be reused.  Use that option in the
dns_resolver call to dns_dispatch_createtcp() to prevent dns_request
from reusing the TCP connections created by dns_resolver.

Additionally, the dns_xfrin unit added TCP connection sharing for
incoming transfers.  While interleaving *xfr streams on a TCP connection
should work this should be a deliberate change and be property of the
server that can be controlled.  Additionally some level of parallel TCP
streams is desirable.  Revert to the old behaviour by removing the
dns_dispatch_gettcp() calls from dns_xfrin and use the new option to
prevent from sharing the transfer streams with dns_request.

2 years agoMerge branch '4380-keep-the-offloaded-work-result-local' into 'main'
Ondřej Surý [Tue, 24 Oct 2023 10:49:42 +0000 (10:49 +0000)] 
Merge branch '4380-keep-the-offloaded-work-result-local' into 'main'

Don't set the offloaded work result from main thread

Closes #4380

See merge request isc-projects/bind9!8407

2 years agoDon't set the offloaded work result from main thread
Ondřej Surý [Fri, 20 Oct 2023 05:58:26 +0000 (07:58 +0200)] 
Don't set the offloaded work result from main thread

The xfrin_recv_done() was accessing xfr->result where we stored the
result of the offloaded work from a thread that could receive data while
processing the transfer on the offloaded thread.

Completely remove the offloaded result from the dns_xfrin_t structure
and keep it local for *xfr_apply() and *xfr_apply_done() as the failure
is already recorded in .shutdown_result and we now that the processing
has failed because .shuttingdown has been already set.

2 years agoMerge branch '4377-sd_notify-RELOADING-add-MONOTONIC_USEC-field' into 'main'
Arаm Sаrgsyаn [Mon, 23 Oct 2023 14:49:14 +0000 (14:49 +0000)] 
Merge branch '4377-sd_notify-RELOADING-add-MONOTONIC_USEC-field' into 'main'

Resolve "named support of a systemd unit with 'notify-reload' service type is incomplete"

Closes #4377

See merge request isc-projects/bind9!8403

2 years agoAdd a CHANGES note for [GL #4377]
Aram Sargsyan [Thu, 19 Oct 2023 13:08:26 +0000 (13:08 +0000)] 
Add a CHANGES note for [GL #4377]

2 years agosd_notify(3): set the MONOTONIC_USEC field with RELOADING=1
Aram Sargsyan [Thu, 19 Oct 2023 12:57:13 +0000 (12:57 +0000)] 
sd_notify(3): set the MONOTONIC_USEC field with RELOADING=1

When using sd_notify(3) to send a message to the service manager
about named being reloaded, systemd also requires the MONOTONIC_USEC
field to be set to the current monotonic time in microseconds,
otherwise the 'systemctl reload' command fails.

Add the MONOTONIC_USEC field to the message.

See 'man 5 systemd.service' for more information.

2 years agoMerge branch '4381-assert-in-dns__catz_update_cb-on-shutdown' into 'main'
Arаm Sаrgsyаn [Mon, 23 Oct 2023 09:39:14 +0000 (09:39 +0000)] 
Merge branch '4381-assert-in-dns__catz_update_cb-on-shutdown' into 'main'

Resolve "Assertion failure in dns__catz_update_cb() on shutdown"

Closes #4381

See merge request isc-projects/bind9!8409

2 years agoAdd a CHANGES note for [GL #4381]
Aram Sargsyan [Fri, 20 Oct 2023 10:55:14 +0000 (10:55 +0000)] 
Add a CHANGES note for [GL #4381]

2 years agoFix shutdown races in catzs
Aram Sargsyan [Fri, 20 Oct 2023 10:45:35 +0000 (10:45 +0000)] 
Fix shutdown races in catzs

The dns__catz_update_cb() does not expect that 'catzs->zones'
can become NULL during shutdown.

Add similar checks in the dns__catz_update_cb() and dns_catz_zone_get()
functions to protect from such a case. Also add an INSIST in the
dns_catz_zone_add() function to explicitly state that such a case
is not expected there, because that function is called only during a
reconfiguration.

2 years agoMerge branch '4152-reproducer-stack-exhaustion' into 'main'
Michal Nowak [Fri, 20 Oct 2023 14:23:20 +0000 (14:23 +0000)] 
Merge branch '4152-reproducer-stack-exhaustion' into 'main'

Add test for CVE-2023-3341

See merge request isc-projects/bind9!8410

2 years agoAdd test for CVE-2023-3341
Michal Nowak [Wed, 12 Jul 2023 08:26:53 +0000 (10:26 +0200)] 
Add test for CVE-2023-3341

2 years agoMerge branch '4372-assertion-failure-in-dispatch-c' into 'main'
Mark Andrews [Fri, 20 Oct 2023 09:26:07 +0000 (09:26 +0000)] 
Merge branch '4372-assertion-failure-in-dispatch-c' into 'main'

Resolve "Assertion failure in dispatch.c"

Closes #4372

See merge request isc-projects/bind9!8397

2 years agoAdd CHANGES note for [GL #4372]
Mark Andrews [Thu, 19 Oct 2023 03:52:15 +0000 (14:52 +1100)] 
Add CHANGES note for [GL #4372]

2 years agoTest xfrin's handing of EDNS failure scenarios
Mark Andrews [Thu, 19 Oct 2023 03:38:59 +0000 (14:38 +1100)] 
Test xfrin's handing of EDNS failure scenarios

We test EDNS requests returning FORMERR where named is expected
to retry without EDNS.

We test EDNS requests returning NOTIMP where named is expected
to fail the transfer as the remote end is not protocol compliant.

2 years agohandle pre-existing disp/dispentry when retrying
Evan Hunt [Wed, 18 Oct 2023 20:07:24 +0000 (13:07 -0700)] 
handle pre-existing disp/dispentry when retrying

when xfrin_start() is called to retry a transfer, close the existing
dispatch entry and reuse the existing dispatch.

2 years agoTest NOTIMP being returned to an IXFR request in xfrin
Mark Andrews [Wed, 18 Oct 2023 07:13:52 +0000 (18:13 +1100)] 
Test NOTIMP being returned to an IXFR request in xfrin

The server is expected to retry the transfer using SOA and if
the returned serial is greater than the current serial AXFR.

Check the log that IXFR is request.

2 years agoMerge branch '4101-update-b-root-server-net-addresses' into 'main'
Mark Andrews [Fri, 20 Oct 2023 03:44:36 +0000 (03:44 +0000)] 
Merge branch '4101-update-b-root-server-net-addresses' into 'main'

Resolve "Update b.root-server.net addresses"

Closes #4101

See merge request isc-projects/bind9!8371

2 years agoAdd release note for [GL #4101]
Mark Andrews [Wed, 11 Oct 2023 23:26:38 +0000 (10:26 +1100)] 
Add release note for [GL #4101]

2 years agoAdd CHANGES note for [GL #4101]
Mark Andrews [Wed, 11 Oct 2023 23:24:50 +0000 (10:24 +1100)] 
Add CHANGES note for [GL #4101]

2 years agoSuppress reporting upcoming changes in root hints
Mark Andrews [Tue, 17 Oct 2023 23:45:41 +0000 (10:45 +1100)] 
Suppress reporting upcoming changes in root hints

To reduce the amount of log spam when root servers change their
addresses keep a table of upcoming changes by expected date and time
and suppress reporting differences for them until then.

Add initial entry for B.ROOT-SERVERS.NET, Nov 27, 2023.

2 years agoUpdate b.root-servers.net IP addresses
Mark Andrews [Wed, 11 Oct 2023 23:19:38 +0000 (10:19 +1100)] 
Update b.root-servers.net IP addresses

This covers both root hints and the default primaries for the root
zone mirror.  The official change date is Nov 27, 2023.

2 years agoMerge branch '4367-offload-ixfr-processing' into 'main'
Ondřej Surý [Thu, 19 Oct 2023 13:40:09 +0000 (13:40 +0000)] 
Merge branch '4367-offload-ixfr-processing' into 'main'

Offload AXFR and IXFR processing

Closes #4367

See merge request isc-projects/bind9!8399

2 years agoAdd CHANGES and release note for [GL #4367]
Ondřej Surý [Mon, 16 Oct 2023 14:31:56 +0000 (16:31 +0200)] 
Add CHANGES and release note for [GL #4367]

2 years agoOffload AXFR and IXFR processing
Ondřej Surý [Fri, 13 Oct 2023 12:41:22 +0000 (14:41 +0200)] 
Offload AXFR and IXFR processing

Instead of processing received data synchronously, store the incoming
differences in the list and process them asynchronously when we need to
commit the data into the database and/or journal.

2 years agoRemove all locking from XFR
Ondřej Surý [Fri, 13 Oct 2023 10:16:37 +0000 (12:16 +0200)] 
Remove all locking from XFR

Instead of locking the struct dns_xfrin members that get accessed from
the statistics, convert those into atomic types and use atomic accesses
to prevent ThreadSanitizer from blowing up.

In fact, even the atomic operations are not really needed here, because
all writes are done from a single thread and we don't really require
consistency from the statistics.  It's easier to use atomics here, but
it is slightly confusing as it suggests there might be multithreaded
accesses to those variables while in fact, the only off-thread access
happens when collecting the statistics.

2 years agoCleanup wrong whitespace in dns/diff.h
Ondřej Surý [Fri, 13 Oct 2023 05:46:14 +0000 (07:46 +0200)] 
Cleanup wrong whitespace in dns/diff.h

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().