Commit Graph

38074 Commits

Author SHA1 Message Date
Arаm Sаrgsyаn
1a0b36d8a2 Merge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'
Refactor isc_nm_xfr_allowed()

Closes #3808

See merge request isc-projects/bind9!7395
2023-01-19 11:21:19 +00:00
Aram Sargsyan
5a1707aa8d Add a CHANGES note for [GL #3808] 2023-01-19 10:24:36 +00:00
Aram Sargsyan
41dc48bfd7 Refactor isc_nm_xfr_allowed()
Return 'isc_result_t' type value instead of 'bool' to indicate
the actual failure. Rename the function to something not suggesting
a boolean type result. Make changes in the places where the API
function is being used to check for the result code instead of
a boolean value.
2023-01-19 10:24:08 +00:00
Matthijs Mekking
b0b6b47696 Merge branch '3783-parental-ds-requests-need-rd-bit-set' into 'main'
Set RD=1 on DS requests to parental-agents

Closes #3783

See merge request isc-projects/bind9!7361
2023-01-19 10:20:35 +00:00
Matthijs Mekking
dbbacd910f Add CHANGES and release note for GL #3783
News worthy.
2023-01-19 10:19:43 +00:00
Matthijs Mekking
e34722ed43 Set RD bit on checkds requests
It is allowed to point parental-agents to a resolver. Therefore, the
RD bit should be set on requests.

Upon receiving a DS response, ensure that the message has either the
AA or the RA bit set.
2023-01-19 10:19:43 +00:00
Matthijs Mekking
0b9a9f9955 Add checkds test case with resolver parental-agent
Add a test case for a server that uses a resolver as an parental-agent.

We need two root servers, ns1 and ns10, one that delegates to the
'checkds' tld with the DS published (ns2), and one that delegates to
the 'checkds' tld with the DS removed (ns5). Both root zones are
being setup in the 'ns1/setup.sh' script.

We also need two resolvers, ns3 and ns8, that use different root hints
(one uses ns1 address as a hint, the other uses ns10).

Then add the checks to test_checkds.py is similar to the existing tests.

Update 'types' because for zones that have the DS withdrawn (or to be
withdrawn), the CDS and CDNSKEY records should not be published and
thus should not be in the NSEC bitmap.
2023-01-19 10:19:43 +00:00
Ondřej Surý
e54215e048 Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inversion' into 'main'
Detach the zone views outside of the zone lock

Closes #3801

See merge request isc-projects/bind9!7402
2023-01-19 09:21:18 +00:00
Ondřej Surý
978a0ef84c Detach the zone views outside of the zone lock
Detaching the views in the zone_shutdown() could lead to
lock-order-inversion between adb->namelocks[bucket], adb->lock,
view->lock and zone->lock.  Detach the views outside of the section that
zone-locked.
2023-01-19 09:21:10 +00:00
Ondřej Surý
5c7c1182c0 Merge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply' into 'main'
Add python3-ply for ./configure to succeed on BIND 9.16 branch

See merge request isc-projects/bind9!7405
2023-01-19 09:11:56 +00:00
Ondřej Surý
0622d11366 Add python3-ply to GitHub CodeQL configuration
BIND 9.16 needs Python and PLY packages for configure to succeed.
Unless we want to tweak the build script to exclude python, we need to
add python3-ply package to the CodeQL configuration.
2023-01-19 10:03:37 +01:00
Ondřej Surý
d8f98cec48 Merge branch 'ondrej/replace-lgtm-with-codeql' into 'main'
Add CodeQL GitHub Action

See merge request isc-projects/bind9!7393
2023-01-19 08:45:07 +00:00
Ondřej Surý
77abe612a1 Add CodeQL GitHub Action
Replace the decommissioned LGTM service with CodeQL GitHub action.
2023-01-19 09:43:32 +01:00
Ondřej Surý
bb60d6ab6d Merge branch '3795-speed-up-EVP_DigestInit_ex-fixup' into 'main'
Use thread_local EVP_MD in isc_iterated_hash()

Closes #3795

See merge request isc-projects/bind9!7401
2023-01-18 23:32:06 +00:00
Ondřej Surý
5abbcdadaf Use thread_local EVP_MD in isc_iterated_hash()
Cherry-pick small fixup commit from 9.18/9.16 branches needed for
thread-safety.  This fixup commit is not needed for 9.19+ because of
reworked application setup, but it decouples isc_iterated_hash and
isc_md units and keeps all the branches in sync.
2023-01-18 23:33:43 +01:00
Ondřej Surý
35e2842d00 Merge branch '3795-speed-up-EVP_DigestInit_ex' into 'main'
Avoid implicit algorithm fetch for OpenSSL EVP_MD family

See merge request isc-projects/bind9!7375
2023-01-18 19:24:29 +00:00
Ondřej Surý
401294cf60 Add CHANGES and release note for [GL #3795] 2023-01-18 19:36:26 +01:00
Ondřej Surý
f3753d591f Use thread_local EVP_MD_CTX in isc_iterated_hash()
As this code is on hot path (NSEC3) this introduces an additional
optimization of the EVP_MD API - instead of calling EVP_MD_CTX_new() on
every call to isc_iterated_hash(), we create two thread_local objects
for each thread - a basectx and mdctx, initialize basectx once and then
use EVP_MD_CTX_copy_ex() to flip the initialized state into mdctx.  This
saves us couple more valuable microseconds from the isc_iterated_hash()
call.
2023-01-18 19:36:21 +01:00
Ondřej Surý
25db8d0103 Use OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
If the OpenSSL SHA1_{Init,Update,Final} API is still available, use it.
The API has been deprecated in OpenSSL 3.0, but it is significantly
faster than EVP_MD API, so make an exception here and keep using it
until we can't.
2023-01-18 19:36:17 +01:00
Ondřej Surý
36654df732 Use OpenSSL EVP_MD API directly in isc_iterated_hash()
Instead of going through another layer, use OpenSSL EVP_MD API directly
in the isc_iterated_hash() implementation.  This shaves off couple of
microseconds in the microbenchmark.
2023-01-18 18:32:57 +01:00
Ondřej Surý
e6bfb8e456 Avoid implicit algorithm fetch for OpenSSL EVP_MD family
The implicit algorithm fetch causes a lock contention and significant
slowdown for small input buffers.  For more details, see:

https://github.com/openssl/openssl/issues/19612

Instead of using EVP_DigestInit_ex() initialize empty MD_CTX objects for
each algorithm and use EVP_MD_CTX_copy_ex() to initialize MD_CTX from a
static copy.  Additionally avoid implicit algorithm fetching by using
EVP_MD_fetch() for OpenSSL 3.0.
2023-01-18 18:32:57 +01:00
Ondřej Surý
cfbe01c62f Add microbenchmark for isc_iterated_hash()
Add microbenchmark for isc_iterated_hash() to measure the speed of NSEC3
per second.
2023-01-18 18:32:57 +01:00
Ondřej Surý
05b60f9cd8 Merge branch 'ondrej/openssl3-no-deprecated' into 'main'
Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1

See merge request isc-projects/bind9!7394
2023-01-18 17:18:09 +00:00
Ondřej Surý
61ad7a59e0 Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1
Add a CI job where we explicitly disable any use of OpenSSL functions
that have been deprecated in OpenSSL 3.x.
2023-01-18 11:13:19 +01:00
Evan Hunt
680fdce937 Merge branch 'each-remove-reserved-dispatches' into 'main'
remove dead code for reserved dispatches

See merge request isc-projects/bind9!7391
2023-01-18 02:53:40 +00:00
Evan Hunt
d79a3823ad remove dead code for reserved dispatches
named formerly reserved a set of dispatch objects for use when
sending requests from user-specified source ports. this objects
are no longer used and have been removed.
2023-01-17 18:23:52 -08:00
Evan Hunt
1070f1f56a Merge branch '3781-deprecate-source-port' into 'main'
mark "port" as deprecated for source address options

Closes #3781

See merge request isc-projects/bind9!7307
2023-01-18 01:51:43 +00:00
Evan Hunt
22d1951aa6 CHANGES and release note for [GL #3781] 2023-01-17 17:29:43 -08:00
Matthijs Mekking
531914e660 Test deprecate source port configuration
Add 'port' token to deprecated.conf. Also add options
'use-v4-udp-ports', 'use-v6-udp-ports', 'avoid-v4-udp-ports',
and 'avoid-v6-udp-ports'.

All of these should trigger warnings (except when deprecation warnings
are being ignored).
2023-01-17 17:29:31 -08:00
Evan Hunt
470ccbc8ed mark "port" as deprecated for source address options
Deprecate the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Also deprecate use-{v4,v6}-udp-ports and avoid-{v4,v6}udp-ports.
2023-01-17 17:29:21 -08:00
Evan Hunt
175ee6b22e Merge branch '3789-remove-dscp' into 'main'
fully remove DSCP

Closes #3789

See merge request isc-projects/bind9!7338
2023-01-18 00:47:24 +00:00
Evan Hunt
d6768d6000 CHANGES and release note revision for [GL #3789] 2023-01-17 16:18:21 -08:00
Evan Hunt
287722ac12 fully remove DSCP
The "dscp" option is now marked as "ancient" and it is a configuration
error to use it or to configure DSCP values for any source-address
option.
2023-01-17 16:18:21 -08:00
Ondřej Surý
71f13b9ad9 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
2023-01-17 21:47:14 +00:00
Ondřej Surý
b049e329ef Add CHANGES and release note for [GL #3801] 2023-01-17 21:48:30 +01:00
Ondřej Surý
7e8b53720d 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.
2023-01-17 21:48:30 +01:00
Ondřej Surý
13bb821280 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.
2023-01-17 21:48:30 +01:00
Artem Boldariev
42ab66b971 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
2023-01-17 18:50:10 +00:00
Artem Boldariev
16fa692b56 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.
2023-01-17 19:00:19 +02:00
Artem Boldariev
34a1aab1cb 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.
2023-01-17 19:00:19 +02:00
Tom Krizek
9c32089fa9 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
2023-01-17 13:48:57 +00:00
Tom Krizek
473cb530f4 Fix feature detection for pytest markers in tests
The condition was accidentally reversed during refactoring in
9730ac4c56 . 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.
2023-01-17 14:18:22 +01:00
Tony Finch
2b89ef56a8 Merge branch 'fanf-time-backwards' into 'main'
Fix a typo in the NS_PER_ macros

See merge request isc-projects/bind9!7380
2023-01-17 09:01:32 +00:00
Tony Finch
290899661d Fix a typo in the NS_PER_ macros
Milliseconds and microseconds were swapped.
2023-01-16 20:33:57 +00:00
Ondřej Surý
d7bcdf8bd6 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
2023-01-16 11:06:48 +00:00
Petr Menšík
395d6fca26 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.
2023-01-16 11:45:31 +01:00
Tom Krizek
0bc0cabaa1 Merge branch 'tkrizek/system-tests-pytest-prep' into 'main'
Various tweaks of system test framework

See merge request isc-projects/bind9!7347
2023-01-16 09:13:01 +00:00
Tom Krizek
03d7b45d81 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.
2023-01-13 17:01:30 +01:00
Tom Krizek
9593ff9347 Tweak dupsigs test output
Use a different visual separator, since "====", "----" and "____" is
used by pytest to separate the log output.
2023-01-13 17:01:30 +01:00
Tom Krizek
e24d3b21d0 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).
2023-01-13 17:01:30 +01:00