]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoMerge branch '4322-hashmap-iterator-can-iterate-twice-the-same-item-if-deleting-items...
Ondřej Surý [Tue, 19 Sep 2023 09:51:24 +0000 (09:51 +0000)] 
Merge branch '4322-hashmap-iterator-can-iterate-twice-the-same-item-if-deleting-items-via-delcurrent_next' into 'main'

Resolve "hashmap iterator can iterate twice the same item if deleting items via delcurrent_next"

Closes #4322

See merge request isc-projects/bind9!8309

2 years agoAdd CHANGES note for [GL #3422]
Mark Andrews [Tue, 19 Sep 2023 01:49:47 +0000 (11:49 +1000)] 
Add CHANGES note for [GL #3422]

2 years agoAdd assertion failure when adding to hashmap when iterating
Ondřej Surý [Sat, 16 Sep 2023 06:32:54 +0000 (08:32 +0200)] 
Add assertion failure when adding to hashmap when iterating

When iterating the table, we can't add new nodes to the hashmap because
we can't assure that we are not adding the new node before the iterator.

This also applies to rehashing - which might be triggered by both
isc_hashmap_add() and isc_hashmap_delete(), but not
isc_hashmap_iter_delcurrent_next().

2 years agoFix hashmap iteration
Mark Andrews [Tue, 19 Sep 2023 01:42:03 +0000 (11:42 +1000)] 
Fix hashmap iteration

When isc_hashmap_iter_delcurrent_next calls hashmap_delete_node
nodes from the front of the table could be added to the end of
the table resulting in them being returned twice.  Detect when
this is happening and prevent those nodes being returned twice
buy reducing the effective size of the table by one each time
it happens.

2 years agoMerge branch '4314-dns_ncache_current-fails-to-set-covered-correctly' into 'main'
Mark Andrews [Mon, 18 Sep 2023 05:42:05 +0000 (05:42 +0000)] 
Merge branch '4314-dns_ncache_current-fails-to-set-covered-correctly' into 'main'

Resolve "dns_ncache_current fails to set covered correctly"

Closes #4314

See merge request isc-projects/bind9!8300

2 years agoAdd a CHANGES note for [GL #4314]
Mark Andrews [Wed, 13 Sep 2023 01:22:30 +0000 (11:22 +1000)] 
Add a CHANGES note for [GL #4314]

2 years agoCheck RRSIG covered type in negative cache entry
Mark Andrews [Fri, 15 Sep 2023 04:27:31 +0000 (14:27 +1000)] 
Check RRSIG covered type in negative cache entry

The covered type previously displayed as TYPE0 when it should
have reflected the records that was actually covered.

2 years agoCorrectly set the value of covered in dns_ncache_current
Mark Andrews [Wed, 13 Sep 2023 00:59:39 +0000 (10:59 +1000)] 
Correctly set the value of covered in dns_ncache_current

Fix the type and rdclass being passed to dns_rdata_tostruct so
that rrsig.covered is correctly set.

2 years agoMerge branch 'ondrej/use-cds_lfht-for-dns_dispatch' into 'main'
Ondřej Surý [Sat, 16 Sep 2023 06:35:49 +0000 (06:35 +0000)] 
Merge branch 'ondrej/use-cds_lfht-for-dns_dispatch' into 'main'

Rewrite the QID lookup table to cds_lfht

See merge request isc-projects/bind9!8304

2 years agoAdd CHANGES note for [GL !8304]
Ondřej Surý [Fri, 15 Sep 2023 15:26:35 +0000 (17:26 +0200)] 
Add CHANGES note for [GL !8304]

2 years agoCleanup unused .localport member of dns_dispatch_t and some macros
Ondřej Surý [Fri, 15 Sep 2023 13:59:28 +0000 (15:59 +0200)] 
Cleanup unused .localport member of dns_dispatch_t and some macros

The .localport member of dns_dispatch_t structure was unused, clean it
up.  Cleanup unused and/or redundant macros.

2 years agoReplace the linked list of TCP dispatches with hash table
Ondřej Surý [Fri, 15 Sep 2023 12:38:02 +0000 (14:38 +0200)] 
Replace the linked list of TCP dispatches with hash table

Reusing TCP connections with dns_dispatch_gettcp() used linear linked
list to lookup existing outgoing TCP connections that could be reused.
Replace the linked list with per-loop cds_lfht hashtable to speedup the
lookups.  We use cds_lfht because it allows non-unique node insertion
that we need to check for dispatches in different connection states.

2 years agoMake dns_dispatch bound to threads
Ondřej Surý [Fri, 15 Sep 2023 09:36:28 +0000 (11:36 +0200)] 
Make dns_dispatch bound to threads

Instead of high number of dispatches (4 * named_g_udpdisp)[1], make the
dispatches bound to threads and make dns_dispatchset_t create a dispatch
for each thread (event loop).

This required couple of other changes:

1. The dns_dispatch_createudp() must be called on loop, so the isc_tid()
   is already initialized - changes to nsupdate and mdig were required.

2. The dns_requestmgr had only a single dispatch per v4 and v6.  Instead
   of using single dispatch, use dns_dispatchset_t for each protocol -
   this is same as dns_resolver.

2 years agoRewrite the QID lookup table to cds_lfht
Ondřej Surý [Thu, 14 Sep 2023 16:01:39 +0000 (18:01 +0200)] 
Rewrite the QID lookup table to cds_lfht

Looking up unique message ID in the dns_dispatch has been using custom
hash tables.  Rewrite the custom hashtable to use cds_lfht API, removing
one extra lock in the cold-cache resolver hot path.

2 years agoMerge branch 'ondrej-improve-isc_hashmap' into 'main'
Ondřej Surý [Sat, 16 Sep 2023 05:25:54 +0000 (05:25 +0000)] 
Merge branch 'ondrej-improve-isc_hashmap' into 'main'

Refactor isc_hashmap to accept custom match function

See merge request isc-projects/bind9!8289

2 years agoRefactor isc_hashmap to accept custom match function
Ondřej Surý [Mon, 28 Aug 2023 08:08:59 +0000 (10:08 +0200)] 
Refactor isc_hashmap to accept custom match function

Refactor isc_hashmap to allow custom matching functions.  This allows us
to have better tailored keys that don't require fixed uint8_t arrays,
but can be composed of more fields from the stored data structure.

2 years agoMerge branch 'aram/danger-ignore-length-warn-for-fixups' into 'main'
Arаm Sаrgsyаn [Thu, 14 Sep 2023 10:37:51 +0000 (10:37 +0000)] 
Merge branch 'aram/danger-ignore-length-warn-for-fixups' into 'main'

Don't warn about subject line length for the fixup commits (CI)

See merge request isc-projects/bind9!8282

2 years agoDon't warn about subject line length for the fixup commits
Aram Sargsyan [Wed, 6 Sep 2023 09:52:12 +0000 (09:52 +0000)] 
Don't warn about subject line length for the fixup commits

The fixup commits' subject line has a prefix which has its own
length, so warning about the exceeding length is not accurate.
Given that the fixup commits can not be merged, because they
cause a danger failure, it's safe to ignore the length check
for them.

2 years agoMerge branch '608-add-option-to-apply-dns64-rules-to-address-being-used-for-lookups...
Mark Andrews [Wed, 13 Sep 2023 05:31:34 +0000 (05:31 +0000)] 
Merge branch '608-add-option-to-apply-dns64-rules-to-address-being-used-for-lookups' into 'main'

Resolve "Add option to apply dns64 rules to address being used for lookups."

Closes #608

See merge request isc-projects/bind9!2166

2 years agoAdd CHANGES for [GL #608]
Mark Andrews [Wed, 18 May 2022 13:26:06 +0000 (23:26 +1000)] 
Add CHANGES for [GL #608]

2 years agoDocument resolver-use-dns64
Mark Andrews [Tue, 27 Sep 2022 05:35:51 +0000 (15:35 +1000)] 
Document resolver-use-dns64

2 years agoIO::Socket::INET6 has been replaced by IO::Socket::IP
Mark Andrews [Tue, 27 Sep 2022 05:18:25 +0000 (15:18 +1000)] 
IO::Socket::INET6 has been replaced by IO::Socket::IP

IO::Socket::INET6 is no longer being maintained and its functionality
has been replaced by IO::Socket::IP.

2 years agoTest resolver-use-dns64
Mark Andrews [Tue, 6 Aug 2019 07:28:02 +0000 (17:28 +1000)] 
Test resolver-use-dns64

Test resolver-use-dns64 by simulating a connection to an IPv4-only
server through a NAT64.

This test uses EXTRAPORT1 rather than PORT for DNS traffic exchanged
between ns3 and ns4. Both servers also listen on PORT on their IPv4
addresses to support server startup testing in start.pl.

2 years agoConfigure 'mapped' IPv4 address
Mark Andrews [Tue, 6 Aug 2019 06:35:28 +0000 (16:35 +1000)] 
Configure 'mapped' IPv4 address

Add a mapped IPv4 address, fd92:7065:b8e:fffe::10.53.0.4, to
ifconfig.sh for dns64 testing.

2 years agoAdd the ability to use DNS64 internally
Mark Andrews [Sun, 21 Jul 2019 16:26:39 +0000 (02:26 +1000)] 
Add the ability to use DNS64 internally

Add a configuration option, resolver-use-dns64, which when true
will cause named to map IPv4 address to IPv6 addresses using the
view's DNS64 mapping rules when making iterative queries.

2 years agoMerge branch '4306-add-incremental-isc_siphash' into 'main'
Ondřej Surý [Tue, 12 Sep 2023 14:21:40 +0000 (14:21 +0000)] 
Merge branch '4306-add-incremental-isc_siphash' into 'main'

Implement incremental version of SipHash 2-4 and HalfSipHash 2-4

Closes #4306

See merge request isc-projects/bind9!8288

2 years agoMerge branch 'ondrej/make-dns_name-mostly-header-only' into 'main'
Ondřej Surý [Tue, 12 Sep 2023 14:20:25 +0000 (14:20 +0000)] 
Merge branch 'ondrej/make-dns_name-mostly-header-only' into 'main'

Cleanup the dns_name macros

See merge request isc-projects/bind9!8297

2 years agoAdd CHANGES note for [GL #4306]
Ondřej Surý [Fri, 8 Sep 2023 15:56:23 +0000 (17:56 +0200)] 
Add CHANGES note for [GL #4306]

2 years agoImplement incremental version of isc_hash32 and isc_hash64
Ondřej Surý [Fri, 8 Sep 2023 15:48:45 +0000 (17:48 +0200)] 
Implement incremental version of isc_hash32 and isc_hash64

Add support for incremental hashing to the isc_hash unit, both 32-bit
and 64-bit incremental hashing is now supported.

This is commit second in series adding incremental hashing to libisc.

2 years agoImplement incremental version of SipHash 2-4 and HalfSipHash 2-4
Ondřej Surý [Fri, 8 Sep 2023 15:22:05 +0000 (17:22 +0200)] 
Implement incremental version of SipHash 2-4 and HalfSipHash 2-4

When inserting items into hashtables (hashmaps), we might have a
fragmented key (as an example we might want to hash DNS name + class +
type).  We either need to construct continuous key in the memory and
then hash it en bloc, or incremental hashing is required.

This incremental version of SipHash 2-4 algorithm is the first building
block.

As SipHash 2-4 is often used in the hot paths, I've turned the
implementation into header-only version in the process.

2 years agoCleanup the dns_name macros
Ondřej Surý [Mon, 11 Sep 2023 06:23:52 +0000 (08:23 +0200)] 
Cleanup the dns_name macros

1. Replace the "high-performance" macros that were only used if
   DNS_NAME_USEINLINE was defined before including <dns/name.h> with
   inline header functions with assertion checks and thus use them
   everywhere.

2. Replace the old struct initializers with C99 designated initializers
   for better understanding what is happening in these macros.

2 years agoMerge branch 'tkrizek/ci-test-binaries-compilation' into 'main'
Tom Krizek [Tue, 12 Sep 2023 08:22:50 +0000 (08:22 +0000)] 
Merge branch 'tkrizek/ci-test-binaries-compilation' into 'main'

ci: omit explicit command to compile test binaries

See merge request isc-projects/bind9!8287

2 years agoci: omit explicit command to compile test binaries
Tom Krizek [Fri, 8 Sep 2023 13:44:28 +0000 (15:44 +0200)] 
ci: omit explicit command to compile test binaries

The command to compile test binaries is no longer needed, as these are
now compiled as part of the default make target.

Related !8189

2 years agoMerge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.18' into 'main'
Michal Nowak [Tue, 12 Sep 2023 07:35:00 +0000 (07:35 +0000)] 
Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.18' into 'main'

Set up version and release notes for BIND 9.19.18

See merge request isc-projects/bind9!8291

2 years agoSet up release notes for BIND 9.19.18
Michal Nowak [Tue, 12 Sep 2023 06:11:52 +0000 (08:11 +0200)] 
Set up release notes for BIND 9.19.18

2 years agoUpdate BIND version to 9.19.18-dev
Michal Nowak [Tue, 12 Sep 2023 06:11:52 +0000 (08:11 +0200)] 
Update BIND version to 9.19.18-dev

2 years agoMerge branch '4242-placeholder' into 'main'
Michal Nowak [Thu, 7 Sep 2023 08:21:45 +0000 (08:21 +0000)] 
Merge branch '4242-placeholder' into 'main'

Add CHANGES placeholder for [GL #4242]

Closes #4242

See merge request isc-projects/bind9!8284

2 years agoAdd CHANGES placeholder for [GL #4242]
Michal Nowak [Wed, 6 Sep 2023 14:07:42 +0000 (16:07 +0200)] 
Add CHANGES placeholder for [GL #4242]

2 years agoMerge branch '4152-placeholder' into 'main'
Michal Nowak [Thu, 7 Sep 2023 08:18:01 +0000 (08:18 +0000)] 
Merge branch '4152-placeholder' into 'main'

Add CHANGES placeholder for [GL #4152]

See merge request isc-projects/bind9!8283

2 years agoAdd CHANGES placeholder for [GL #4152]
Michal Nowak [Wed, 6 Sep 2023 14:03:42 +0000 (16:03 +0200)] 
Add CHANGES placeholder for [GL #4152]

2 years agoMerge branch '4290-raise-log-level-to-isc_log_error-on-formerr-in-xfrin-c' into ...
Mark Andrews [Wed, 6 Sep 2023 09:13:23 +0000 (09:13 +0000)] 
Merge branch '4290-raise-log-level-to-isc_log_error-on-formerr-in-xfrin-c' into 'main'

Resolve "raise log level to ISC_LOG_NOTICE on FORMERR in xfrin.c"

Closes #4290

See merge request isc-projects/bind9!8262

2 years agoAdd a CHANGES note for [GL #4290]
Mark Andrews [Fri, 1 Sep 2023 00:26:45 +0000 (10:26 +1000)] 
Add a CHANGES note for [GL #4290]

2 years agoAdjust level of log messages when transferring in a zone
Mark Andrews [Fri, 1 Sep 2023 00:17:00 +0000 (10:17 +1000)] 
Adjust level of log messages when transferring in a zone

This raises the log level of messages treated as FORMERR to NOTICE
when transfering in a zone.  This also adds a missing log message
for TYPE0 and meta types received during a zone transfer.

2 years agoMerge branch '4291-check-dig-exit-status' into 'main'
Mark Andrews [Wed, 6 Sep 2023 01:32:21 +0000 (01:32 +0000)] 
Merge branch '4291-check-dig-exit-status' into 'main'

Resolve "RNDC system test failed to run to completion"

Closes #4291

See merge request isc-projects/bind9!8264

2 years agoCheck dig's exist status
Mark Andrews [Mon, 4 Sep 2023 05:16:42 +0000 (15:16 +1000)] 
Check dig's exist status

2 years agoMerge branch '4292-uncleared-libcrypto-error-crypto-evp-evp_fetch-c-373-inner_evp_gen...
Mark Andrews [Wed, 6 Sep 2023 01:02:52 +0000 (01:02 +0000)] 
Merge branch '4292-uncleared-libcrypto-error-crypto-evp-evp_fetch-c-373-inner_evp_generic_fetch' into 'main'

Resolve "Uncleared libcrypto error: crypto/evp/evp_fetch.c:373 inner_evp_generic_fetch"

Closes #4292

See merge request isc-projects/bind9!8274

2 years agoCall ERR_clear_error on EVP_MD_fetch or EVP_##alg error
Mark Andrews [Tue, 5 Sep 2023 07:53:04 +0000 (17:53 +1000)] 
Call ERR_clear_error on EVP_MD_fetch or EVP_##alg error

2 years agoMerge branch '4214-uaf-in-validator-logging' into 'main'
Mark Andrews [Tue, 5 Sep 2023 23:51:25 +0000 (23:51 +0000)] 
Merge branch '4214-uaf-in-validator-logging' into 'main'

Resolve "UAF in validator logging"

Closes #4214

See merge request isc-projects/bind9!8269

2 years agoAdd CHANGES for [GL #4214]
Mark Andrews [Mon, 4 Sep 2023 23:50:16 +0000 (09:50 +1000)] 
Add CHANGES for [GL #4214]

2 years agoRestore dns_validator_destroy and fetchctx_detach call order
Mark Andrews [Mon, 4 Sep 2023 23:46:05 +0000 (09:46 +1000)] 
Restore dns_validator_destroy and fetchctx_detach call order

7a78a85b moved the destruction of the validator from near the start
validated to the end.  This reversed the order of dns_validator_destroy
and fetchctx_detach.  Restore the order so that val->name remains
valid for the lifetime of the validator.

2 years agoMerge branch 'mnowak/statschannel-system-test-is-too-verbose' into 'main'
Ondřej Surý [Tue, 5 Sep 2023 17:05:29 +0000 (17:05 +0000)] 
Merge branch 'mnowak/statschannel-system-test-is-too-verbose' into 'main'

Disable command tracing in statschannel system test

See merge request isc-projects/bind9!8277

2 years agoDisable command tracing in statschannel system test
Michal Nowak [Tue, 5 Sep 2023 16:52:15 +0000 (18:52 +0200)] 
Disable command tracing in statschannel system test

Command tracing was added recently via
26e10e8fb51d5f101cfdc319794f2650084153c3 and makes the system test too
verbose.

2 years agoMerge branch '4296-ignore-jemalloc-versions-before-4.0.0' into 'main'
Ondřej Surý [Tue, 5 Sep 2023 16:54:55 +0000 (16:54 +0000)] 
Merge branch '4296-ignore-jemalloc-versions-before-4.0.0' into 'main'

Ignore jemalloc versions before 4.0.0

Closes #4296

See merge request isc-projects/bind9!8273

2 years agoAdd CHANGES and release note for [GL #4296]
Ondřej Surý [Tue, 5 Sep 2023 12:38:55 +0000 (14:38 +0200)] 
Add CHANGES and release note for [GL #4296]

2 years agoSynchronize used library versions reporting functions
Aram Sargsyan [Tue, 5 Sep 2023 15:41:42 +0000 (15:41 +0000)] 
Synchronize used library versions reporting functions

There are libraries which are reported in printversion(), but not
reported in setup(). Synchronize the functions, so that the log
file could have the same information as reported by the 'named -V'
command execution.

2 years agoPrint the used jemalloc version in autoconf and named -V output
Ondřej Surý [Tue, 5 Sep 2023 12:58:15 +0000 (14:58 +0200)] 
Print the used jemalloc version in autoconf and named -V output

The autoconf and named -V now prints used version of jemalloc.  This
doesn't work with system supplied jemalloc, so in it prints `system`
instead in the autoconf and nothing in named -V output.

2 years agoIgnore jemalloc versions before 4.0.0
Ondřej Surý [Tue, 5 Sep 2023 12:32:26 +0000 (14:32 +0200)] 
Ignore jemalloc versions before 4.0.0

We now depend on explicitly creating memory arenas and disabling tcache
on those, and these features are not available with jemalloc < 4.
Instead of working around these issues, make the jemalloc >= 4.0.0 hard
requirement by looking for sdallocx() symbol that's only available from
that version.

The jemalloc < 4 was only used by RHEL 7 which is not supported since
BIND 9.19+.

2 years agoMerge branch '4255-placeholder' into 'main'
Michal Nowak [Tue, 5 Sep 2023 16:08:07 +0000 (16:08 +0000)] 
Merge branch '4255-placeholder' into 'main'

Add CHANGES placeholder for [GL #4255]

See merge request isc-projects/bind9!8275

2 years agoAdd CHANGES placeholder for [GL #4255]
Michal Nowak [Tue, 5 Sep 2023 15:57:18 +0000 (17:57 +0200)] 
Add CHANGES placeholder for [GL #4255]

2 years agoMerge branch '4038-specialised-arena-per-worker' into 'main'
Ondřej Surý [Tue, 5 Sep 2023 08:23:42 +0000 (08:23 +0000)] 
Merge branch '4038-specialised-arena-per-worker' into 'main'

Make it possible to create memory contexts backed by jemalloc arenas

Closes #4038

See merge request isc-projects/bind9!8270

2 years agoAdd CHANGES and release note for [GL #4038]
Artem Boldariev [Mon, 14 Aug 2023 13:17:54 +0000 (16:17 +0300)] 
Add CHANGES and release note for [GL #4038]

Mention that send buffer allocations/deallocations are now routed
through dedicated memory arenas.

2 years agoAllocate DNS send buffers using dedicated per-worker memory arenas
Artem Boldariev [Thu, 10 Aug 2023 20:08:25 +0000 (23:08 +0300)] 
Allocate DNS send buffers using dedicated per-worker memory arenas

This commit ensures that memory allocations related to DNS send
buffers are routed through dedicated per-worker memory arenas in order
to decrease memory usage on high load caused by TCP-based DNS
transports.

We do that by following jemalloc developers suggestions:

https://github.com/jemalloc/jemalloc/issues/2483#issuecomment-1639019699
https://github.com/jemalloc/jemalloc/issues/2483#issuecomment-1698173849

2 years agoAdd ability to set per jemalloc arena dirty and muzzy decay values
Artem Boldariev [Fri, 11 Aug 2023 11:25:40 +0000 (14:25 +0300)] 
Add ability to set per jemalloc arena dirty and muzzy decay values

This commit adds couple of functions to change "dirty_decay_ms" and
"muzzy_decay_ms" settings on arenas associated with memory contexts.

2 years agoMake it possible to create memory contexts backed by jemalloc arenas
Artem Boldariev [Thu, 10 Aug 2023 14:02:43 +0000 (17:02 +0300)] 
Make it possible to create memory contexts backed by jemalloc arenas

This commit extends the internal memory management middleware code in
BIND so that memory contexts backed by dedicated jemalloc arenas can
be created. A new function (isc_mem_create_arena()) is added for that.

Moreover, it extends the existing code so that specialised memory
contexts can be created easily, should we need that functionality for
other future purposes. We have achieved that by passing the flags to
the underlying jemalloc-related calls. See the above
isc_mem_create_arena(), which can serve as an example of this.

Having this opens up possibilities for creating memory contexts tuned
for specific needs.

2 years agoMerge branch '4263-deprecate-dnssec-must-be-secure-feature' into 'main'
Ondřej Surý [Mon, 4 Sep 2023 13:14:48 +0000 (13:14 +0000)] 
Merge branch '4263-deprecate-dnssec-must-be-secure-feature' into 'main'

Deprecate 'dnssec-must-be-secure' option

See merge request isc-projects/bind9!8267

2 years agoAdd CHANGES and release note for [GL #4263]
Ondřej Surý [Mon, 4 Sep 2023 11:11:49 +0000 (13:11 +0200)] 
Add CHANGES and release note for [GL #4263]

2 years agoDeprecate 'dnssec-must-be-secure' option
Ondřej Surý [Mon, 4 Sep 2023 11:08:48 +0000 (13:08 +0200)] 
Deprecate 'dnssec-must-be-secure' option

The dnssec-must-be-secure feature was added in the early days of BIND 9
and DNSSEC and it makes sense only as a debugging feature.

Remove the feature to simplify the code.

2 years agoMerge branch 'michal/reorganize-vulnerability-docs' into 'main'
Michał Kępień [Mon, 4 Sep 2023 09:56:54 +0000 (09:56 +0000)] 
Merge branch 'michal/reorganize-vulnerability-docs' into 'main'

Move security-related information to SECURITY.md

See merge request isc-projects/bind9!8257

2 years agoMove security-related information to SECURITY.md
Michał Kępień [Mon, 4 Sep 2023 09:54:57 +0000 (11:54 +0200)] 
Move security-related information to SECURITY.md

To follow current best practices, create a short SECURITY.md file in the
root of the repository that contains information about the project's
security policy and guidelines for reporting potential security issues.
Replace the relevant bits of text in other files with references to the
new SECURITY.md file, so that the relevant information only needs to be
maintained in one place.

Replace all occurrences of the generic security-officer@isc.org email
with a dedicated address for reporting BIND 9 security issues,
bind-security@isc.org.

2 years agoMerge branch 'each-cleanup-rbt' into 'main'
Ondřej Surý [Mon, 4 Sep 2023 09:07:32 +0000 (09:07 +0000)] 
Merge branch 'each-cleanup-rbt' into 'main'

replace RBT usage throughout named

See merge request isc-projects/bind9!8213

2 years agoCHANGES for [GL !8213]
Evan Hunt [Thu, 17 Aug 2023 16:37:23 +0000 (09:37 -0700)] 
CHANGES for [GL !8213]

2 years agounconditionally create view and resolver nametrees
Evan Hunt [Thu, 24 Aug 2023 20:47:19 +0000 (13:47 -0700)] 
unconditionally create view and resolver nametrees

instead of allowing a NULL nametree in dns_nametree_covered(),
require nametree to exist, and ensure that the nametrees defined
for view and resolver objects are always created.

2 years agouse a count nametree for synthfromdnssec
Evan Hunt [Thu, 17 Aug 2023 07:45:38 +0000 (00:45 -0700)] 
use a count nametree for synthfromdnssec

use the count semantics for dns_nametree to support view->sfd.

2 years agoadd a 'foundname' argument to dns_nametree_covered()
Evan Hunt [Thu, 17 Aug 2023 06:51:56 +0000 (23:51 -0700)] 
add a 'foundname' argument to dns_nametree_covered()

when checking whether a name is covered, the ancestor name that
was found can be set into a name object passed in.

2 years agoadd semantics to name trees to support counters
Evan Hunt [Thu, 17 Aug 2023 06:26:50 +0000 (23:26 -0700)] 
add semantics to name trees to support counters

name trees can now also hold trees of counters. each time a name
dns_nametree_add() is called with a given name, the counter for that
name is incremented; the name is not deleted until dns_nametree_delete()
is called the same number of times.

this is meant to be used for synth-from-dnssec, which is incremented for
each key defined at a name, and decremented when a key is removed, the
name must continue to exist until the number of keys has reached zero.

2 years agouse bitfield name trees for disable-algorithms and disable-ds-digests
Evan Hunt [Thu, 17 Aug 2023 05:08:46 +0000 (22:08 -0700)] 
use bitfield name trees for disable-algorithms and disable-ds-digests

switch disable-algorithms and disable-ds-digests to use
bitfield-type name trees, replacing the RBT-based bftree.

2 years agoadd semantics to dns_nametree to support bitfields
Evan Hunt [Thu, 17 Aug 2023 02:59:50 +0000 (19:59 -0700)] 
add semantics to dns_nametree to support bitfields

name trees can now hold either boolean values or bit fields. the
type is selected when the name tree is created.

the behavior of dns_nametree_add() differs slightly beteween the types:
in a boolean tree adding an existing name will return ISC_R_EXISTS,
but in a bitfield tree it simply sets the specified bit in the bitfield
and returns ISC_R_SUCCESS.

2 years agorefactor disable_algorithm and disable_ds_digest to use one data structure
Evan Hunt [Tue, 15 Aug 2023 22:30:12 +0000 (15:30 -0700)] 
refactor disable_algorithm and disable_ds_digest to use one data structure

the functions for disabling DNSSEC signing algorithms and DS digest
algorithms in resolver.c had a lot of duplicated code.

this commit adds functions to implement a "bitfield tree", which is
(currently) an RBT in which the node data contains arbitrary-sized
bitfields to indicate whether a value has been added at the given
node or not. (it can be changed to a QP trie later.)

it also replaces the functions dns_resolver_disable_algorithm(),
dns_resolver_algorithm_supported(), dns_resolver_disable_ds_digest()
and dns_resolver_ds_digest_supported() with simple wrappers that call
the new functions.

2 years agouse dns_nametree in place of RBTs
Evan Hunt [Wed, 16 Aug 2023 20:28:36 +0000 (13:28 -0700)] 
use dns_nametree in place of RBTs

replace the use of RBTs for deny-answer-aliases, the exclude
lists for deny-answer-aliases and deny-answer-addresses, and
dnssec-must-be-secure, with name trees.

2 years agoadd dns_nametree structure for policy match lookups
Evan Hunt [Wed, 16 Aug 2023 19:08:53 +0000 (12:08 -0700)] 
add dns_nametree structure for policy match lookups

this is a QP trie of boolean values to indicate whether a name is
included in or excluded from some policy. this can be used for
synth-from-dnssec, deny-answer-aliases, etc.

2 years agoreplace RBTs with hashmaps in dns_transport
Evan Hunt [Wed, 16 Aug 2023 04:04:54 +0000 (21:04 -0700)] 
replace RBTs with hashmaps in dns_transport

as dns_transport_find() is only concerned with finding an exact
match on the specified name it doesn't need to use a tree data
structure internally, we can replace the RBTs with hash tables.

2 years agoMerge branch '4159-openssl-error-queue-not-cleaned' into 'main'
Mark Andrews [Fri, 1 Sep 2023 03:08:20 +0000 (03:08 +0000)] 
Merge branch '4159-openssl-error-queue-not-cleaned' into 'main'

Resolve "OpenSSL error queue not cleaned"

Closes #4159

See merge request isc-projects/bind9!8233

2 years agoAdd release note for [GL #4159]
Mark Andrews [Wed, 28 Jun 2023 02:01:58 +0000 (12:01 +1000)] 
Add release note for [GL #4159]

2 years agoAdd CHANGES note for [GL #4159]
Mark Andrews [Wed, 28 Jun 2023 01:58:22 +0000 (11:58 +1000)] 
Add CHANGES note for [GL #4159]

2 years agoDetect uncleared libcrypto errors in rdata processing
Mark Andrews [Wed, 28 Jun 2023 06:28:57 +0000 (16:28 +1000)] 
Detect uncleared libcrypto errors in rdata processing

If libcrypto errors are not cleared slow memory leaks occur which
are not detected at shutdown.

2 years agoStyle fix
Mark Andrews [Thu, 20 Jul 2023 03:31:16 +0000 (13:31 +1000)] 
Style fix

2 years agoCheck that buf is large enough
Mark Andrews [Tue, 11 Jul 2023 07:57:25 +0000 (17:57 +1000)] 
Check that buf is large enough

2 years agoTake ownership of pointer before freeing
Mark Andrews [Thu, 20 Jul 2023 03:10:29 +0000 (13:10 +1000)] 
Take ownership of pointer before freeing

2 years agoAddress potential memory leak in dst__openssl_fromlabel
Mark Andrews [Tue, 11 Jul 2023 08:40:10 +0000 (18:40 +1000)] 
Address potential memory leak in dst__openssl_fromlabel

2 years agoAdd missing "Design by Contract" REQUIREs
Mark Andrews [Wed, 30 Aug 2023 05:31:34 +0000 (15:31 +1000)] 
Add missing "Design by Contract" REQUIREs

2 years agoFree evp_md_ctx and pkey at exit
Mark Andrews [Wed, 30 Aug 2023 02:01:32 +0000 (12:01 +1000)] 
Free evp_md_ctx and pkey at exit

2 years agoClear OpenSSL error stack when exiting
Mark Andrews [Thu, 31 Aug 2023 01:03:38 +0000 (11:03 +1000)] 
Clear OpenSSL error stack when exiting

2 years agoClear OpenSSL errors on TSL error paths
Mark Andrews [Thu, 20 Jul 2023 03:32:50 +0000 (13:32 +1000)] 
Clear OpenSSL errors on TSL error paths

2 years agoClear OpenSSL errors on context creation failures
Mark Andrews [Wed, 19 Jul 2023 07:24:34 +0000 (17:24 +1000)] 
Clear OpenSSL errors on context creation failures

2 years agoClear OpenSSL errors on SHA failures
Mark Andrews [Thu, 13 Jul 2023 04:41:00 +0000 (14:41 +1000)] 
Clear OpenSSL errors on SHA failures

2 years agoClear OpenSSL errors on OSSL_PROVIDER_load failures
Mark Andrews [Thu, 13 Jul 2023 03:24:10 +0000 (13:24 +1000)] 
Clear OpenSSL errors on OSSL_PROVIDER_load failures

2 years agoClear OpenSSL errors on engine errors
Mark Andrews [Tue, 11 Jul 2023 07:59:13 +0000 (17:59 +1000)] 
Clear OpenSSL errors on engine errors

2 years agoClear OpenSSL errors on EVP failures
Mark Andrews [Tue, 11 Jul 2023 04:10:49 +0000 (14:10 +1000)] 
Clear OpenSSL errors on EVP failures

2 years agoClear OpenSSL errors on EVP_PKEY_new failures
Mark Andrews [Tue, 11 Jul 2023 03:25:47 +0000 (13:25 +1000)] 
Clear OpenSSL errors on EVP_PKEY_new failures

2 years agoClear OpenSSL errors on EC_KEY_get0_private_key failures
Mark Andrews [Thu, 31 Aug 2023 00:57:43 +0000 (10:57 +1000)] 
Clear OpenSSL errors on EC_KEY_get0_private_key failures