]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoMerge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach' into 'main'
Ondřej Surý [Tue, 17 Jan 2023 21:47:14 +0000 (21:47 +0000)] 
Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach' into 'main'

Detach the views in zone_shutdown(), not in zone_free()

Closes #3801

See merge request isc-projects/bind9!7382

3 years agoAdd CHANGES and release note for [GL #3801]
Ondřej Surý [Tue, 17 Jan 2023 06:28:02 +0000 (07:28 +0100)] 
Add CHANGES and release note for [GL #3801]

3 years agoCommit the change of view for view->managed_keys
Ondřej Surý [Tue, 17 Jan 2023 06:21:34 +0000 (07:21 +0100)] 
Commit the change of view for view->managed_keys

When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

3 years agoDetach the views in zone_shutdown(), not in zone_free()
Ondřej Surý [Tue, 17 Jan 2023 06:18:16 +0000 (07:18 +0100)] 
Detach the views in zone_shutdown(), not in zone_free()

The .view (and possibly .prev_view) would be kept attached to the
removed zone until the zone is fully removed from the memory in
zone_free().  If this process is delayed because server is busy
something else like doing constant `rndc reconfig`, it could take
seconds to detach the view, possibly keeping multiple dead views in the
memory.  This could quickly lead to a massive memory bloat.

Release the views early in the zone_shutdown() call, and don't wait
until the zone is freed.

3 years agoMerge branch '3767-dot-no-alpn-transfer-shutdown-crash' into 'main'
Artem Boldariev [Tue, 17 Jan 2023 18:50:10 +0000 (18:50 +0000)] 
Merge branch '3767-dot-no-alpn-transfer-shutdown-crash' into 'main'

XoT: properly handle the case when checking for ALPN failed

Closes #3767

See merge request isc-projects/bind9!7360

3 years agoModify CHANGES [GL #3767]
Artem Boldariev [Thu, 12 Jan 2023 18:51:08 +0000 (20:51 +0200)] 
Modify CHANGES [GL #3767]

Mention that downloading a zone via TLS- from a server which does not
negotiate "dot" ALPN tag could have crashed BIND on shutdown.

3 years agoXoT: properly handle the case when checking for ALPN failed
Artem Boldariev [Thu, 12 Jan 2023 18:09:51 +0000 (20:09 +0200)] 
XoT: properly handle the case when checking for ALPN failed

During XoT it is important to check for "dot" ALPN tag to be
negotiated (according to the RFC 9103). We were doing that, however, the
situation was not handled properly, leading to non-cancelled zone
transfers that would crash (abort()) BIND on shutdown.

In this particular case 'result' might equal 'ISC_R_SUCCESS'. When
this is the case, the part of the code supposed to handle failures
will not cancel the zone transfer.

This situation cannot happen when BIND is a secondary of other BIND
instance. Only primaries following the RFC not closely enough could
trigger such a behaviour.

3 years agoMerge branch '3804-fix-feature-detection-in-pytests' into 'main'
Tom Krizek [Tue, 17 Jan 2023 13:48:57 +0000 (13:48 +0000)] 
Merge branch '3804-fix-feature-detection-in-pytests' into 'main'

Fix feature detection for pytest markers in tests

Closes #3804

See merge request isc-projects/bind9!7383

3 years agoFix feature detection for pytest markers in tests
Tom Krizek [Tue, 17 Jan 2023 13:18:22 +0000 (14:18 +0100)] 
Fix feature detection for pytest markers in tests

The condition was accidentally reversed during refactoring in
9730ac4c5691c36d58c06deec1762a4831b268c5 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

3 years agoMerge branch 'fanf-time-backwards' into 'main'
Tony Finch [Tue, 17 Jan 2023 09:01:32 +0000 (09:01 +0000)] 
Merge branch 'fanf-time-backwards' into 'main'

Fix a typo in the NS_PER_ macros

See merge request isc-projects/bind9!7380

3 years agoFix a typo in the NS_PER_ macros
Tony Finch [Mon, 16 Jan 2023 20:31:36 +0000 (20:31 +0000)] 
Fix a typo in the NS_PER_ macros

Milliseconds and microseconds were swapped.

3 years agoMerge branch 'feature/main/zt-rwlock.h' into 'main'
Ondřej Surý [Mon, 16 Jan 2023 11:06:48 +0000 (11:06 +0000)] 
Merge branch 'feature/main/zt-rwlock.h' into 'main'

Include isc_rwlocktype_t type definition in zt.h

See merge request isc-projects/bind9!7376

3 years agoInclude isc_rwlocktype_t type definition in zt.h
Petr Menšík [Mon, 16 Jan 2023 10:45:31 +0000 (11:45 +0100)] 
Include isc_rwlocktype_t type definition in zt.h

After changes zt.h uses rwlock type, which is not enforced to be always
defined. Ensure full type definition is ready by including appropriate
header.

3 years agoMerge branch 'tkrizek/system-tests-pytest-prep' into 'main'
Tom Krizek [Mon, 16 Jan 2023 09:13:01 +0000 (09:13 +0000)] 
Merge branch 'tkrizek/system-tests-pytest-prep' into 'main'

Various tweaks of system test framework

See merge request isc-projects/bind9!7347

3 years agoUpdate the TEST_PARALLEL_JOBS value in CI
Tom Krizek [Fri, 6 Jan 2023 14:08:27 +0000 (15:08 +0100)] 
Update the TEST_PARALLEL_JOBS value in CI

The authoritative source for this value is in the project's CI/CD
Variables Setting. The reason to keep it in .gitlab-ci.yaml as well is
to have functional testing in forks without the need to manually specify
this variable in Settings.

The tests have been executed with 4 jobs for some time now. This
"change" only brings .gitlab-ci.yaml file up to date, it doesn't
actually change the number of jobs we currently use to test.

3 years agoTweak dupsigs test output
Tom Krizek [Tue, 3 Jan 2023 10:58:43 +0000 (11:58 +0100)] 
Tweak dupsigs test output

Use a different visual separator, since "====", "----" and "____" is
used by pytest to separate the log output.

3 years agoLook for ifconfig.sh.in in testsock.pl parent dir
Tom Krizek [Mon, 2 Jan 2023 16:54:58 +0000 (17:54 +0100)] 
Look for ifconfig.sh.in in testsock.pl parent dir

Instead of using the current working directory to find the ifconfig.sh
script, look for the ifconfig.sh.in template in the directory where the
testsock.pl script is located. This enables the testsock.pl script to be
called from any working directory.

Using the ifconfig.sh.in template is sufficient, since it contains
the necessary information to be extracted: the max= value (which is
hard-coded in the template).

3 years agoFactor out script to handle system test core dumps
Tom Krizek [Tue, 20 Dec 2022 14:09:48 +0000 (15:09 +0100)] 
Factor out script to handle system test core dumps

Move the core dump detection functionality for system test runs into a
separate script. This enables reuse by the pytest runner. The
functionality remains the same.

3 years agotestcrypto.sh: run in TMPDIR if possible
Tom Krizek [Mon, 19 Dec 2022 16:44:35 +0000 (17:44 +0100)] 
testcrypto.sh: run in TMPDIR if possible

Avoid creating any temporary files in the current workdir.

Additional/changing files in the bin/tests/system directory are
problematic for pytest/xdist collection phase, which assumes the list of
files doesn't change between the collection phase of the main pytest
thread and the subsequent collection phase of the xdist worker threads.

Since the testcrypto.sh is also called during pytest initialization
through conf.sh.common (to detect feature support), this could
occasionally cause a race condition when the list of files would be
different for the main pytest thread and the xdist worker.

3 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.10' into 'main'
Michał Kępień [Fri, 13 Jan 2023 14:47:05 +0000 (14:47 +0000)] 
Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.10' into 'main'

Set up version and release notes for BIND 9.19.10

See merge request isc-projects/bind9!7362

3 years agoSet up release notes for BIND 9.19.10
Michał Kępień [Fri, 13 Jan 2023 14:35:32 +0000 (15:35 +0100)] 
Set up release notes for BIND 9.19.10

3 years agoUpdate BIND version to 9.19.10-dev
Michał Kępień [Fri, 13 Jan 2023 14:35:32 +0000 (15:35 +0100)] 
Update BIND version to 9.19.10-dev

3 years agoUpdate BIND version for release v9.19.9
Michał Kępień [Thu, 12 Jan 2023 21:43:01 +0000 (22:43 +0100)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Michał Kępień [Thu, 12 Jan 2023 21:43:01 +0000 (22:43 +0100)] 
Add a CHANGES marker

3 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.9' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 21:41:52 +0000 (21:41 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.9' into 'security-main'

Prepare documentation for BIND 9.19.9

See merge request isc-private/bind9!492

3 years agoAdd release note for GL #3678
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Add release note for GL #3678

3 years agoReorder release notes
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Reorder release notes

3 years agoTweak and reword release notes
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.9
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Prepare release notes for BIND 9.19.9

3 years agoUpdate documentation for GL #3212
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Update documentation for GL #3212

3 years agoFix a typo in the DNSSEC Guide
Michał Kępień [Thu, 12 Jan 2023 20:39:37 +0000 (21:39 +0100)] 
Fix a typo in the DNSSEC Guide

3 years agoMerge branch '3619-security-serve-stale-client-timeout-crash' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 11:45:50 +0000 (11:45 +0000)] 
Merge branch '3619-security-serve-stale-client-timeout-crash' into 'security-main'

[CVE-2022-3924] Fix the serve-stale crash when recursive clients soft quota is reached

See merge request isc-private/bind9!475

3 years agoAdd CHANGES and release notes for [GL #3619]
Aram Sargsyan [Mon, 14 Nov 2022 12:30:49 +0000 (12:30 +0000)] 
Add CHANGES and release notes for [GL #3619]

3 years agoCancel all fetch events in dns_resolver_cancelfetch()
Aram Sargsyan [Mon, 14 Nov 2022 12:18:06 +0000 (12:18 +0000)] 
Cancel all fetch events in dns_resolver_cancelfetch()

Although 'dns_fetch_t' fetch can have two associated events, one for
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
dns_resolver_cancelfetch() function is designed in a way that it
expects only one existing event, which it must cancel, and when it
happens so that 'stale-answer-client-timeout' is enabled and there
are two events, only one of them is canceled, and it results in an
assertion in dns_resolver_destroyfetch(), when it finds a dangling
event.

Change the logic of dns_resolver_cancelfetch() function so that it
cancels both the events (if they exist), and in the right order.

3 years agoMerge branch '3622-serve-stale-rrsig-fix-security' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 11:25:54 +0000 (11:25 +0000)] 
Merge branch '3622-serve-stale-rrsig-fix-security' into 'security-main'

[CVE-2022-3736] Properly handle stale RRSIG lookups

See merge request isc-private/bind9!470

3 years agoAdd release note for [GL #3622]
Mark Andrews [Fri, 28 Oct 2022 00:31:19 +0000 (11:31 +1100)] 
Add release note for [GL #3622]

3 years agoAdd CHANGES note for [GL #3622]
Mark Andrews [Fri, 28 Oct 2022 00:26:59 +0000 (11:26 +1100)] 
Add CHANGES note for [GL #3622]

3 years agoMove the mapping of SIG and RRSIG to ANY
Mark Andrews [Thu, 27 Oct 2022 02:22:11 +0000 (13:22 +1100)] 
Move the mapping of SIG and RRSIG to ANY

dns_db_findext() asserts if RRSIG is passed to it and
query_lookup_stale() failed to map RRSIG to ANY to prevent this.  To
avoid cases like this in the future, move the mapping of SIG and RRSIG
to ANY for qctx->type to qctx_init().

3 years agoMerge branch '3523-confidential-update-quota' into 'security-main'
Michał Kępień [Thu, 12 Jan 2023 10:56:37 +0000 (10:56 +0000)] 
Merge branch '3523-confidential-update-quota' into 'security-main'

[CVE-2022-3094] apply quotas to updates

See merge request isc-private/bind9!442

3 years agoCHANGES and release notes for [GL #3523]
Evan Hunt [Thu, 1 Sep 2022 23:34:21 +0000 (16:34 -0700)] 
CHANGES and release notes for [GL #3523]

3 years agotest failure conditions
Evan Hunt [Thu, 10 Nov 2022 05:56:16 +0000 (21:56 -0800)] 
test failure conditions

verify that updates are refused when the client is disallowed by
allow-query, and update forwarding is refused when the client is
is disallowed by update-forwarding.

verify that "too many DNS UPDATEs" appears in the log file when too
many simultaneous updates are processing.

3 years agomove update ACL and update-policy checks before quota
Evan Hunt [Wed, 9 Nov 2022 01:32:41 +0000 (17:32 -0800)] 
move update ACL and update-policy checks before quota

check allow-update, update-policy, and allow-update-forwarding before
consuming quota slots, so that unauthorized clients can't fill the
quota.

(this moves the access check before the prerequisite check, which
violates the precise wording of RFC 2136. however, RFC co-author Paul
Vixie has stated that the RFC is mistaken on this point; it should have
said that access checking must happen *no later than* the completion of
prerequisite checks, not that it must happen exactly then.)

3 years agoadd a configuration option for the update quota
Evan Hunt [Thu, 1 Sep 2022 23:22:46 +0000 (16:22 -0700)] 
add a configuration option for the update quota

add an "update-quota" option to configure the update quota.

3 years agoadd an update quota
Evan Hunt [Thu, 1 Sep 2022 23:05:04 +0000 (16:05 -0700)] 
add an update quota

limit the number of simultaneous DNS UPDATE events that can be
processed by adding a quota for update and update forwarding.
this quota currently, arbitrarily, defaults to 100.

also add a statistics counter to record when the update quota
has been exceeded.

3 years agoMerge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Michał Kępień [Wed, 11 Jan 2023 16:48:05 +0000 (16:48 +0000)] 
Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'

Add placeholder entries to CHANGES

See merge request isc-projects/bind9!7356

3 years agoAdd placeholder entries to CHANGES
Michał Kępień [Wed, 11 Jan 2023 16:44:12 +0000 (17:44 +0100)] 
Add placeholder entries to CHANGES

Add placeholders for the following issues:

  - [GL #3523]
  - [GL #3599]
  - [GL #3619]
  - [GL #3622]

3 years agoMerge branch 'aram/dns_fwdtable_addfwd-cleanup-bugfix' into 'main'
Arаm Sаrgsyаn [Wed, 11 Jan 2023 13:19:31 +0000 (13:19 +0000)] 
Merge branch 'aram/dns_fwdtable_addfwd-cleanup-bugfix' into 'main'

Fix dns_fwdtable_addfwd() error path cleanup bug

See merge request isc-projects/bind9!7205

3 years agoUse sizeof(*ptr) for allocating/freeing memory in forward.c
Aram Sargsyan [Mon, 12 Dec 2022 09:20:48 +0000 (09:20 +0000)] 
Use sizeof(*ptr) for allocating/freeing memory in forward.c

As shown in the previous commit, using sizeof(type_t) is a little
bit more error-prone when copy-pasting code, so extracting the
size information from the pointer which is being dealt with seems
like a better alternative.

3 years agoFix dns_fwdtable_addfwd() error path cleanup bug
Aram Sargsyan [Fri, 9 Dec 2022 12:41:38 +0000 (12:41 +0000)] 
Fix dns_fwdtable_addfwd() error path cleanup bug

Free 'sizeof(dns_forwarder_t)' bytes of memory instead of
'sizeof(dns_sockaddr_t)' bytes, because `fwd` is a pointer
to a 'dns_forwarder_t' type structure.

3 years agoMerge branch '3764-adjust-descriptors-for-some-unit-tests' into 'main'
Mark Andrews [Wed, 11 Jan 2023 11:04:07 +0000 (11:04 +0000)] 
Merge branch '3764-adjust-descriptors-for-some-unit-tests' into 'main'

Resolve "Adjust descriptor limit for some unit tests"

Closes #3764

See merge request isc-projects/bind9!7294

3 years agoIncrease the number of available file descriptors
Mark Andrews [Wed, 4 Jan 2023 05:59:47 +0000 (16:59 +1100)] 
Increase the number of available file descriptors

notify_test and query_test run out of descriptors on some platforms.

    % ./notify_test
    [==========] Running 1 test(s).
    [ RUN      ] notify_start
    netmgr/tcp.c:369: REQUIRE(csock->fd >= 0) failed, back trace
    0   libisc-9.19.9-dev.dylib             0x00000001045c5080 default_callback + 72
    1   libisc-9.19.9-dev.dylib             0x00000001045c4ffc isc_assertion_failed + 56
    2   libisc-9.19.9-dev.dylib             0x00000001045b8bcc start_tcp_child + 304
    3   libisc-9.19.9-dev.dylib             0x00000001045b8710 isc_nm_listentcp + 636
    4   libisc-9.19.9-dev.dylib             0x00000001045b3e0c isc_nm_listenstreamdns + 344
    5   libns-9.19.9-dev.dylib              0x0000000104b90630 ns_interface_listentcp + 152
    6   libns-9.19.9-dev.dylib              0x0000000104b8f65c interface_setup + 488
    7   libns-9.19.9-dev.dylib              0x0000000104b8de98 do_scan + 2028
    8   libns-9.19.9-dev.dylib              0x0000000104b8d640 ns_interfacemgr_scan + 212
    9   notify_test                         0x000000010418ddd0 scan_interfaces + 44
    10  libisc-9.19.9-dev.dylib             0x00000001045d5fd8 isc__job_cb + 116
    11  libuv.1.dylib                       0x000000010545afe4 uv__run_idle + 152
    12  libuv.1.dylib                       0x0000000105455cd0 uv_run + 204
    13  libisc-9.19.9-dev.dylib             0x00000001045e1120 loop_run + 460
    14  libisc-9.19.9-dev.dylib             0x00000001045df824 loop_thread + 44
    15  libisc-9.19.9-dev.dylib             0x00000001045df6dc isc_loopmgr_run + 456
    16  notify_test                         0x000000010418b900 run_test_notify_start + 88
    17  libcmocka.0.dylib                   0x00000001054968c0 cmocka_run_one_test_or_fixture + 448
    18  libcmocka.0.dylib                   0x0000000105494ca4 _cmocka_run_group_tests + 848
    19  notify_test                         0x000000010418be60 main + 120
    20  libdyld.dylib                       0x0000000181509430 start + 4
    Abort
    % ./query_test
    [==========] Running 4 test(s).
    [ RUN      ] ns__query_sfcache
    netmgr/tcp.c:369: REQUIRE(csock->fd >= 0) failed, back trace
    0   libisc-9.19.9-dev.dylib             0x000000010294d080 default_callback + 72
    1   libisc-9.19.9-dev.dylib             0x000000010294cffc isc_assertion_failed + 56
    2   libisc-9.19.9-dev.dylib             0x0000000102940bcc start_tcp_child + 304
    3   libisc-9.19.9-dev.dylib             0x0000000102940710 isc_nm_listentcp + 636
    4   libisc-9.19.9-dev.dylib             0x000000010293be0c isc_nm_listenstreamdns + 344
    5   libns-9.19.9-dev.dylib              0x00000001026cc630 ns_interface_listentcp + 152
    6   libns-9.19.9-dev.dylib              0x00000001026cb65c interface_setup + 488
    7   libns-9.19.9-dev.dylib              0x00000001026c9e98 do_scan + 2028
    8   libns-9.19.9-dev.dylib              0x00000001026c9640 ns_interfacemgr_scan + 212
    9   query_test                          0x00000001026a1018 scan_interfaces + 44
    10  libisc-9.19.9-dev.dylib             0x000000010295dfd8 isc__job_cb + 116
    11  libuv.1.dylib                       0x0000000103996fe4 uv__run_idle + 152
    12  libuv.1.dylib                       0x0000000103991cd0 uv_run + 204
    13  libisc-9.19.9-dev.dylib             0x0000000102969120 loop_run + 460
    14  libisc-9.19.9-dev.dylib             0x0000000102967824 loop_thread + 44
    15  libisc-9.19.9-dev.dylib             0x00000001029676dc isc_loopmgr_run + 456
    16  query_test                          0x000000010269cf34 run_test_ns__query_sfcache + 88
    17  libcmocka.0.dylib                   0x00000001028068c0 cmocka_run_one_test_or_fixture + 448
    18  libcmocka.0.dylib                   0x0000000102804ca4 _cmocka_run_group_tests + 848
    19  query_test                          0x000000010269eab8 main + 116
    20  libdyld.dylib                       0x0000000181509430 start + 4
    Abort
    %

expected_creads can exceed the number of file descriptors on some
platforms.

    % ./udp_test
    [==========] Running 18 test(s).
    [ RUN      ] mock_listenudp_uv_udp_open
    [       OK ] mock_listenudp_uv_udp_open
    [ RUN      ] mock_listenudp_uv_udp_bind
    [       OK ] mock_listenudp_uv_udp_bind
    [ RUN      ] mock_listenudp_uv_udp_recv_start
    [       OK ] mock_listenudp_uv_udp_recv_start
    [ RUN      ] mock_udpconnect_uv_udp_open
    [       OK ] mock_udpconnect_uv_udp_open
    [ RUN      ] mock_udpconnect_uv_udp_bind
    [       OK ] mock_udpconnect_uv_udp_bind
    [ RUN      ] mock_udpconnect_uv_udp_connect
    [       OK ] mock_udpconnect_uv_udp_connect
    [ RUN      ] mock_udpconnect_uv_recv_buffer_size
    [       OK ] mock_udpconnect_uv_recv_buffer_size
    [ RUN      ] mock_udpconnect_uv_send_buffer_size
    [       OK ] mock_udpconnect_uv_send_buffer_size
    [ RUN      ] udp_noop
    [       OK ] udp_noop
    [ RUN      ] udp_noresponse
    [       OK ] udp_noresponse
    [ RUN      ] udp_shutdown_connect
    [       OK ] udp_shutdown_connect
    [ RUN      ] udp_shutdown_read
    [       OK ] udp_shutdown_read
    [ RUN      ] udp_cancel_read
    [       OK ] udp_cancel_read
    [ RUN      ] udp_timeout_recovery
    [       OK ] udp_timeout_recovery
    [ RUN      ] udp_double_read
    [       OK ] udp_double_read
    [ RUN      ] udp_recv_one
    [       OK ] udp_recv_one
    [ RUN      ] udp_recv_two
    [       OK ] udp_recv_two
    [ RUN      ] udp_recv_send
    udp__connect_cb(0x0, too many open files, 0x0)
    udp__connect_cb(0x0, too many open files, 0x0)
    udp__connect_cb(0x0, too many open files, 0x0)
    udp__connect_cb(0x0, too many open files, 0x0)
    udp__connect_cb(0x0, too many open files, 0x0)
    udp__connect_cb(0x0, too many open files, 0x0)
    %

3 years agoMerge branch 'ondrej/use-pthread_barrier-if-available' into 'main'
Ondřej Surý [Wed, 11 Jan 2023 09:54:13 +0000 (09:54 +0000)] 
Merge branch 'ondrej/use-pthread_barrier-if-available' into 'main'

Prefer the pthread_barrier implementation over uv_barrier

See merge request isc-projects/bind9!7348

3 years agoPrefer the pthread_barrier implementation over uv_barrier
Ondřej Surý [Wed, 11 Jan 2023 08:28:10 +0000 (09:28 +0100)] 
Prefer the pthread_barrier implementation over uv_barrier

Prefer the pthread_barrier implementation on platforms where it is
available over uv_barrier implementation.  This also solves the problem
with thread sanitizer builds on macOS that doesn't have pthread barrier.

3 years agoMerge branch 'fanf-git-replay-merge-tags' into 'main'
Ondřej Surý [Wed, 11 Jan 2023 08:02:46 +0000 (08:02 +0000)] 
Merge branch 'fanf-git-replay-merge-tags' into 'main'

Auto-tag merge requests created by git-replay-merge

See merge request isc-projects/bind9!7254

3 years agoAuto-tag merge requests created by git-replay-merge
Tony Finch [Tue, 20 Dec 2022 11:38:51 +0000 (11:38 +0000)] 
Auto-tag merge requests created by git-replay-merge

The target branch is added to the title of the MR, and a "Backport"
label is added. If the target branch starts with "v" a version label
is added too.

While I am here, clean up remnants of the old gitlab API (which has
been replaced by push options for our purposes) and improve the
command-line parsing.

3 years agoMerge branch 'ondrej/remove-udp-and-tcp-listen-lock' into 'main'
Ondřej Surý [Wed, 11 Jan 2023 06:51:14 +0000 (06:51 +0000)] 
Merge branch 'ondrej/remove-udp-and-tcp-listen-lock' into 'main'

Get rid of locking during UDP and TCP listen

See merge request isc-projects/bind9!7343

3 years agoGet rid of locking during UDP and TCP listen
Ondřej Surý [Wed, 4 Jan 2023 11:21:00 +0000 (12:21 +0100)] 
Get rid of locking during UDP and TCP listen

We already have a synchronization mechanism when starting the UDP and
TCP listener children - barriers.  Change how we start the first-born
child (tid == 0), so we don't have to race for sock->parent->result and
sock->parent->fd.

3 years agoMerge branch 'ondrej/cleanup-isc_astack-usage-in-netmgr' into 'main'
Ondřej Surý [Tue, 10 Jan 2023 19:53:50 +0000 (19:53 +0000)] 
Merge branch 'ondrej/cleanup-isc_astack-usage-in-netmgr' into 'main'

Convert isc_astack usage in netmgr to mempool and ISC_LIST

See merge request isc-projects/bind9!7300

3 years agoRemove unused isc_astack unit
Ondřej Surý [Wed, 4 Jan 2023 15:06:48 +0000 (16:06 +0100)] 
Remove unused isc_astack unit

The isc_astack unit is now unused, so just remove it.

3 years agoConvert isc_astack usage in netmgr to mempool and ISC_LIST
Ondřej Surý [Wed, 4 Jan 2023 14:57:00 +0000 (15:57 +0100)] 
Convert isc_astack usage in netmgr to mempool and ISC_LIST

Change the per-socket inactive uvreq cache (implemented as isc_astack)
to per-worker memory pool.

Change the per-socket inactive nmhandle cache (implemented as
isc_astack) to unlocked per-socket ISC_LIST.

3 years agoMerge branch 'ondrej/always-track-netmgr-sockets-and-handles' into 'main'
Ondřej Surý [Tue, 10 Jan 2023 19:30:37 +0000 (19:30 +0000)] 
Merge branch 'ondrej/always-track-netmgr-sockets-and-handles' into 'main'

Simplify tracing the reference counting in isc_netmgr

See merge request isc-projects/bind9!7292

3 years agoSimplify tracing the reference counting in isc_netmgr
Ondřej Surý [Tue, 3 Jan 2023 07:27:54 +0000 (08:27 +0100)] 
Simplify tracing the reference counting in isc_netmgr

Always track the per-worker sockets in the .active_sockets field in the
isc__networker_t struct and always track the per-socket handles in the
.active_handles field ian the isc_nmsocket_t struct.

3 years agoMerge branch '3785-openssl-refactoring-19' into 'main'
Ondřej Surý [Tue, 10 Jan 2023 09:39:55 +0000 (09:39 +0000)] 
Merge branch '3785-openssl-refactoring-19' into 'main'

Add CHANGES note for [GL #3785]

Closes #3785

See merge request isc-projects/bind9!7344

3 years agoAdd CHANGES note for [GL #3785]
Ondřej Surý [Tue, 10 Jan 2023 09:07:06 +0000 (10:07 +0100)] 
Add CHANGES note for [GL #3785]

3 years agoMerge branch '3787-siphash-c-105-26-runtime-error-applying-zero-offset-to-null-pointe...
Mark Andrews [Tue, 10 Jan 2023 07:22:37 +0000 (07:22 +0000)] 
Merge branch '3787-siphash-c-105-26-runtime-error-applying-zero-offset-to-null-pointer' into 'main'

Resolve "siphash.c:105:26: runtime error: applying zero offset to null pointer"

Closes #3787

See merge request isc-projects/bind9!7339

3 years agoAccept 'in=NULL' with 'inlen=0' in isc_{half}siphash24
Mark Andrews [Tue, 10 Jan 2023 02:51:49 +0000 (13:51 +1100)] 
Accept 'in=NULL' with 'inlen=0' in isc_{half}siphash24

Arthimetic on NULL pointers is undefined.  Avoid arithmetic operations
when 'in' is NULL and require 'in' to be non-NULL if 'inlen' is not zero.

3 years agoMerge branch '3785-openssl-refactoring-18' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 21:50:15 +0000 (21:50 +0000)] 
Merge branch '3785-openssl-refactoring-18' into 'main'

Resolve "OpenSSL 3 refactoring"

Closes #3785

See merge request isc-projects/bind9!7335

3 years agoIgnore the extra EVP_PKEY_get_bn_param() failures
Ondřej Surý [Mon, 9 Jan 2023 20:50:01 +0000 (21:50 +0100)] 
Ignore the extra EVP_PKEY_get_bn_param() failures

In opensslrsa_components_get(), ignore the extra EVP_PKEY_get_bn_param()
return codes as RSA key might not have all those components.

3 years agoMerge branch '3773-remove-dscp' into 'main'
Evan Hunt [Mon, 9 Jan 2023 21:04:55 +0000 (21:04 +0000)] 
Merge branch '3773-remove-dscp' into 'main'

remove nonfunctional DSCP implementation

Closes #3773

See merge request isc-projects/bind9!7305

3 years agoCHANGES and release note for [GL #3773]
Evan Hunt [Fri, 6 Jan 2023 06:47:39 +0000 (22:47 -0800)] 
CHANGES and release note for [GL #3773]

3 years agoremove nonfunctional DSCP implementation
Evan Hunt [Fri, 6 Jan 2023 06:18:55 +0000 (22:18 -0800)] 
remove nonfunctional DSCP implementation

DSCP has not been fully working since the network manager was
introduced in 9.16, and has been completely broken since 9.18.
This seems to have caused very few difficulties for anyone,
so we have now marked it as obsolete and removed the
implementation.

To ensure that old config files don't fail, the code to parse
dscp key-value pairs is still present, but a warning is logged
that the feature is obsolete and should not be used. Nothing is
done with configured values, and there is no longer any
range checking.

3 years agoMerge branch '3785-openssl-refactoring-17' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 19:32:28 +0000 (19:32 +0000)] 
Merge branch '3785-openssl-refactoring-17' into 'main'

Refactor OpenSSL ECDSA public and private key export

Closes #3785

See merge request isc-projects/bind9!7334

3 years agoRefactor OpenSSL ECDSA private key export
Timo Teräs [Wed, 28 Dec 2022 21:51:57 +0000 (23:51 +0200)] 
Refactor OpenSSL ECDSA private key export

3 years agoMerge branch '3785-openssl-refactoring-16' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 18:56:29 +0000 (18:56 +0000)] 
Merge branch '3785-openssl-refactoring-16' into 'main'

Refactor OpenSSL ECDSA generation to helper functions

Closes #3785

See merge request isc-projects/bind9!7333

3 years agoRefactor OpenSSL ECDSA public key export
Timo Teräs [Wed, 28 Dec 2022 21:33:51 +0000 (23:33 +0200)] 
Refactor OpenSSL ECDSA public key export

3 years agoRefactor OpenSSL ECDSA generation to helper functions
Timo Teräs [Wed, 28 Dec 2022 20:44:23 +0000 (22:44 +0200)] 
Refactor OpenSSL ECDSA generation to helper functions

Reduce the #ifdef cruft by having specific helper functions.

3 years agoMerge branch '3785-openssl-refactoring-15' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 18:52:27 +0000 (18:52 +0000)] 
Merge branch '3785-openssl-refactoring-15' into 'main'

Refactor OpenSSL ECDSA to use pkeypair

Closes #3785

See merge request isc-projects/bind9!7332

3 years agoRefactor OpenSSL ECDSA to use pkeypair
Timo Teräs [Wed, 28 Dec 2022 15:13:41 +0000 (17:13 +0200)] 
Refactor OpenSSL ECDSA to use pkeypair

- Use separate EVP_PKEY for public and private keys
- On private key load, generate public key allowing better consistency
- Support OpenSSL3 providers
- Clean up key construction abstraction
- Various other clean ups

3 years agoMerge branch '3785-openssl-refactoring-14' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 18:33:24 +0000 (18:33 +0000)] 
Merge branch '3785-openssl-refactoring-14' into 'main'

Make OpenSSL keypair comparation a generic helper function

Closes #3785

See merge request isc-projects/bind9!7331

3 years agoMerge branch '3785-openssl-refactoring-13' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 18:31:06 +0000 (18:31 +0000)] 
Merge branch '3785-openssl-refactoring-13' into 'main'

Refactor OpenSSL ECDSA type check to opensslecdsa_valid_key_alg helper

Closes #3785

See merge request isc-projects/bind9!7330

3 years agoMake OpenSSL keypair comparation a generic helper function
Timo Teräs [Wed, 28 Dec 2022 15:11:21 +0000 (17:11 +0200)] 
Make OpenSSL keypair comparation a generic helper function

3 years agoMerge branch '3785-openssl-refactoring-12' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 18:29:56 +0000 (18:29 +0000)] 
Merge branch '3785-openssl-refactoring-12' into 'main'

Implement support for OpenSSL 3 Provider API stored RSA keys

Closes #3785

See merge request isc-projects/bind9!7329

3 years agoRefactor OpenSSL ECDSA type check to opensslecdsa_valid_key_alg helper
Timo Teräs [Wed, 28 Dec 2022 13:37:33 +0000 (15:37 +0200)] 
Refactor OpenSSL ECDSA type check to opensslecdsa_valid_key_alg helper

3 years agoImplement support for OpenSSL 3 Provider API stored RSA keys
Timo Teräs [Mon, 26 Dec 2022 17:42:32 +0000 (19:42 +0200)] 
Implement support for OpenSSL 3 Provider API stored RSA keys

Allows using pkcs11-provider module for PKCS#11 keys

3 years agoMerge branch 'mnowak/abort-on-ubsan-errors' into 'main'
Michal Nowak [Mon, 9 Jan 2023 16:39:24 +0000 (16:39 +0000)] 
Merge branch 'mnowak/abort-on-ubsan-errors' into 'main'

Abort on UBSAN errors

See merge request isc-projects/bind9!6877

3 years agoAbort on UBSAN errors
Michal Nowak [Fri, 7 Oct 2022 08:16:07 +0000 (10:16 +0200)] 
Abort on UBSAN errors

Previously, UBSAN errors might slip undetected.

3 years agoMerge branch '3785-openssl-refactoring-11' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 15:43:09 +0000 (15:43 +0000)] 
Merge branch '3785-openssl-refactoring-11' into 'main'

Make the OpenSSL RSA fromlabel helper a generic one

Closes #3785

See merge request isc-projects/bind9!7326

3 years agoMake the OpenSSL RSA fromlabel helper a generic one
Timo Teräs [Mon, 26 Dec 2022 17:31:26 +0000 (19:31 +0200)] 
Make the OpenSSL RSA fromlabel helper a generic one

3 years agoMerge branch '3785-openssl-refactoring-10' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 15:35:24 +0000 (15:35 +0000)] 
Merge branch '3785-openssl-refactoring-10' into 'main'

Rename the global ENGINE *e to global_engine

Closes #3785

See merge request isc-projects/bind9!7325

3 years agoMerge branch '3785-openssl-refactoring-9' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 15:31:46 +0000 (15:31 +0000)] 
Merge branch '3785-openssl-refactoring-9' into 'main'

Refactor OpenSSL RSA pkey building to use components struct

Closes #3785

See merge request isc-projects/bind9!7322

3 years agoRename the global ENGINE *e to global_engine
Timo Teräs [Mon, 26 Dec 2022 17:17:19 +0000 (19:17 +0200)] 
Rename the global ENGINE *e to global_engine

3 years agoRefactor OpenSSL RSA pkey building to use components struct
Timo Teräs [Mon, 26 Dec 2022 15:36:02 +0000 (17:36 +0200)] 
Refactor OpenSSL RSA pkey building to use components struct

3 years agoMerge branch 'pspacek/aclelementtype_cleanup' into 'main'
Petr Špaček [Mon, 9 Jan 2023 15:06:22 +0000 (15:06 +0000)] 
Merge branch 'pspacek/aclelementtype_cleanup' into 'main'

Remove unused dns_aclelementtype_{ipprefix,any} enum values

See merge request isc-projects/bind9!7295

3 years agoRemove unused dns_aclelementtype_{ipprefix,any} enum values
Petr Špaček [Wed, 4 Jan 2023 10:34:09 +0000 (11:34 +0100)] 
Remove unused dns_aclelementtype_{ipprefix,any} enum values

Seems like they are unused, and all system tests pass when those values
removed.

3 years agoMerge branch '3785-openssl-refactoring-8-cleanup' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 15:02:55 +0000 (15:02 +0000)] 
Merge branch '3785-openssl-refactoring-8-cleanup' into 'main'

BN_free() and BN_clear_free() both accept NULL

Closes #3785

See merge request isc-projects/bind9!7323

3 years agoBN_free() and BN_clear_free() both accept NULL
Ondřej Surý [Mon, 9 Jan 2023 15:00:18 +0000 (16:00 +0100)] 
BN_free() and BN_clear_free() both accept NULL

Remove the extra check in opensslrsa_components_free() as both BN_free()
and BN_clear_free() both accepts NULL as valid argument and do nothing.

3 years agoMerge branch '3785-openssl-refactoring-8' into 'main'
Ondřej Surý [Mon, 9 Jan 2023 14:56:07 +0000 (14:56 +0000)] 
Merge branch '3785-openssl-refactoring-8' into 'main'

Refactor OpenSSL RSA components getting to a helper function

Closes #3785

See merge request isc-projects/bind9!7321

3 years agoRefactor OpenSSL RSA components getting to a helper function
Timo Teräs [Mon, 26 Dec 2022 17:07:18 +0000 (19:07 +0200)] 
Refactor OpenSSL RSA components getting to a helper function

3 years agoMerge branch '3743-unexpected-prohibited-ede' into 'main'
Matthijs Mekking [Mon, 9 Jan 2023 14:40:31 +0000 (14:40 +0000)] 
Merge branch '3743-unexpected-prohibited-ede' into 'main'

Fix unexpected "Prohibited" extended DNS error on allow-recursion mismatch

Closes #3743

See merge request isc-projects/bind9!7223

3 years agoAdd system test for #3743
Matthijs Mekking [Wed, 14 Dec 2022 10:54:19 +0000 (11:54 +0100)] 
Add system test for #3743