]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoProperly name ADB hashmap and named log memory contexts
Ondřej Surý [Mon, 30 Jan 2023 08:49:35 +0000 (09:49 +0100)] 
Properly name ADB hashmap and named log memory contexts

The ADB hashmaps are stored in extra memory contexts, so the hash
tables are excluded from the overmem accounting.  The new memory
context was unnamed, give it a proper name.

Same thing has happened with extra memory context used for named
global log context - give the extra memory context a proper name.

3 years agoMerge branch '3822-rndc-dnssec-checkds-force-ds-state' into 'main' 7446/head
Matthijs Mekking [Fri, 27 Jan 2023 15:07:33 +0000 (15:07 +0000)] 
Merge branch '3822-rndc-dnssec-checkds-force-ds-state' into 'main'

Force set DS state after 'rndc dnssec -checkds'

Closes #3822

See merge request isc-projects/bind9!7423

3 years agoAdd CHANGES for #3822
Matthijs Mekking [Wed, 25 Jan 2023 15:43:13 +0000 (16:43 +0100)] 
Add CHANGES for #3822

3 years agoForce set DS state after 'rndc dnssec -checkds'
Matthijs Mekking [Wed, 25 Jan 2023 15:36:48 +0000 (16:36 +0100)] 
Force set DS state after 'rndc dnssec -checkds'

Set the DS state after issuing 'rndc dnssec -checkds'. If the DS
was published, it should go in RUMOURED state, regardless whether it
is already safe to do so according to the state machine.

Leaving it in HIDDEN (or if it was magically already in OMNIPRESENT or
UNRETENTIVE) would allow for easy shoot in the foot situations.

Similar, if the DS was withdrawn, the state should be set to
UNRETENTIVE. Leaving it in OMNIPRESENT (or RUMOURED/HIDDEN)
would also allow for easy shoot in the foot situations.

3 years agoMerge branch 'tkrizek/danger-improvements' into 'main'
Tom Krizek [Fri, 27 Jan 2023 13:47:51 +0000 (13:47 +0000)] 
Merge branch 'tkrizek/danger-improvements' into 'main'

danger: refine existing rules

See merge request isc-projects/bind9!7428

3 years agodanger: relax rules for single-line commits
Tom Krizek [Thu, 26 Jan 2023 12:04:40 +0000 (13:04 +0100)] 
danger: relax rules for single-line commits

The following are not also accepted as single-line commits without
generating warnings:
- CHANGES/release note may appear in the beginning of the commit message
- Release note may be capitalized
- Allow commits with "GL #" (e.g. Update documentation for [GL #XXXX])

3 years agodanger: update CHANGES rule to work with -S edition
Tom Krizek [Thu, 26 Jan 2023 12:03:12 +0000 (13:03 +0100)] 
danger: update CHANGES rule to work with -S edition

When updating the -S edition, the CHANGES.SE file is modified. Make sure
danger accepts that.

3 years agoMerge branch 'michal/rework-the-security-incident-handling-checklist' into 'main'
Michał Kępień [Fri, 27 Jan 2023 13:10:23 +0000 (13:10 +0000)] 
Merge branch 'michal/rework-the-security-incident-handling-checklist' into 'main'

Rework the Security Incident Handling Checklist

See merge request isc-projects/bind9!6980

3 years agoUpdate release checklist
Michał Kępień [Fri, 27 Jan 2023 13:10:09 +0000 (14:10 +0100)] 
Update release checklist

Update the release checklist to incorporate some minor tweaks that we
have been applying manually for the past few months as a result of
release process evolution.

3 years agoRework the Security Incident Handling Checklist
Michał Kępień [Fri, 27 Jan 2023 13:10:09 +0000 (14:10 +0100)] 
Rework the Security Incident Handling Checklist

Rework the Security Incident Handling Checklist so that it does not only
contain the SWENG-side steps for handling a security incident, but also
all the other steps required by ISC procedures.

3 years agoMerge branch 'michal/extend-artifact-lifetime-for-release-related-jobs' into 'main'
Michał Kępień [Fri, 27 Jan 2023 12:29:06 +0000 (12:29 +0000)] 
Merge branch 'michal/extend-artifact-lifetime-for-release-related-jobs' into 'main'

Extend artifact lifetime for release-related jobs

See merge request isc-projects/bind9!7432

3 years agoExtend artifact lifetime for release-related jobs
Michał Kępień [Fri, 27 Jan 2023 12:25:30 +0000 (13:25 +0100)] 
Extend artifact lifetime for release-related jobs

Artifacts of the "stress" jobs in GitLab CI are used for generating the
QA summary for a given set of releases.  It happened in the past that
these artifacts were purged before the QA summary was prepared,
unnecessarily prolonging the release process.  A complete set of
artifacts from all such jobs for a single pipeline should be less than 1
GB in size, so extend their lifetime from one day to one week as a more
reasonable compromise between availability and disk space usage.  (Note:
these jobs are also run in scheduled pipelines, but that is expected to
be acceptable in the context of artifact lifetime.)

Artifacts of the "release" jobs in GitLab CI are what we eventually
publish on the FTP server.  It happened in the past that these artifacts
were purged before we copied them to their destination, unnecessarily
prolonging the release process, even though we usually press the "Keep"
button for the "release" jobs manually to keep them around indefinitely
(as they are the source of what we publish in other places).  Since
there is only one "release" job per tag pipeline and its artifacts only
take up tens of megabytes of space, keep the artifacts of the "release"
jobs around indefinitely by default.

3 years agoMerge branch '3824-teach-danger-about-amend' into 'main'
Mark Andrews [Fri, 27 Jan 2023 11:39:12 +0000 (11:39 +0000)] 
Merge branch '3824-teach-danger-about-amend' into 'main'

Resolve "Teach danger about amend!"

Closes #3824

See merge request isc-projects/bind9!7430

3 years agoTeach danger about amend
Mark Andrews [Fri, 27 Jan 2023 01:43:45 +0000 (12:43 +1100)] 
Teach danger about amend

commit --fixup=amend:<hash> produces a subject starting with amend!
by default.  Have danger look for this to ensure that it is squashed
before merging.

3 years agoMerge branch 'mnowak/pkgdiff' into 'main'
Michal Nowak [Thu, 26 Jan 2023 13:05:14 +0000 (13:05 +0000)] 
Merge branch 'mnowak/pkgdiff' into 'main'

Add release tarball comparison script

See merge request isc-projects/bind9!7419

3 years agoAdd release tarball comparison script
Michal Nowak [Mon, 23 Jan 2023 19:29:00 +0000 (20:29 +0100)] 
Add release tarball comparison script

The util/release-tarball-comparison.sh script compares a release-ready
BIND 9 tarball to a temporary BIND 9 tarball created from the same
signed Git tag to ensure that their content does not differ
(significantly).

3 years agoMerge tag 'v9_19_9'
Michał Kępień [Wed, 25 Jan 2023 20:16:00 +0000 (21:16 +0100)] 
Merge tag 'v9_19_9'

BIND 9.19.9

3 years agoMerge branch 'tt-improve-rsa-extraction' into 'main'
Ondřej Surý [Wed, 25 Jan 2023 19:29:23 +0000 (19:29 +0000)] 
Merge branch 'tt-improve-rsa-extraction' into 'main'

Improve OpenSSL RSA key extraction

See merge request isc-projects/bind9!7424

3 years agoImprove OpenSSL RSA key extraction
Timo Teräs [Wed, 25 Jan 2023 18:56:41 +0000 (20:56 +0200)] 
Improve OpenSSL RSA key extraction

Add check for extracting the public 'n' component on OpenSSL 3.0
path. This is mandatory component, and it's presence is checked
already on the other code path.

Also document the reason why private key component getting errors
are ignored.

3 years agoMerge branch '3718-reduce-the-memory-statistics' into 'main'
Ondřej Surý [Tue, 24 Jan 2023 17:57:21 +0000 (17:57 +0000)] 
Merge branch '3718-reduce-the-memory-statistics' into 'main'

Reduce the memory statistics to a bare minimum

Closes #3718

See merge request isc-projects/bind9!7412

3 years agoAdd CHANGES and release note for [GL #3718]
Ondřej Surý [Thu, 19 Jan 2023 16:14:31 +0000 (17:14 +0100)] 
Add CHANGES and release note for [GL #3718]

3 years agoRemove BlockSize from bind9.xsl
Ondřej Surý [Thu, 19 Jan 2023 16:06:17 +0000 (17:06 +0100)] 
Remove BlockSize from bind9.xsl

The BlockSize counter doesn't exist anymore (for some time now).

3 years agoRestore Malloced memory counter as InUse alias + little cleanups
Ondřej Surý [Thu, 19 Jan 2023 15:57:18 +0000 (16:57 +0100)] 
Restore Malloced memory counter as InUse alias + little cleanups

This restores the Malloced memory counter and it's now always equal to
InUse counter.  This is only for backwards compatibility reason and
there is no separate counter.

The commit also cleanups little things like structure with a single
item (summary.inuse), and shuts up a wrong cppcheck warning (the
notorious NULL check after assignment).

3 years agoRemove ContextSize memory counter
Ondřej Surý [Thu, 19 Jan 2023 11:23:04 +0000 (12:23 +0100)] 
Remove ContextSize memory counter

Again, this was an internal allocator counter, now it's useless.

3 years agoMake the all inuse memory counter atomic operations relaxed
Ondřej Surý [Thu, 19 Jan 2023 11:10:28 +0000 (12:10 +0100)] 
Make the all inuse memory counter atomic operations relaxed

Instead of enforcing stronger synchronization between threads, make all
the atomic operations relaxed.  We are not really interested in exact
numbers at all times - the single place where we need the exact number
is when the memory context is being destroyed.  Even when there's a
overmem counter, we don't care about exact ordering or exact number.

3 years agoCleanup the ptr argument from mem_putstats()
Ondřej Surý [Thu, 19 Jan 2023 11:05:44 +0000 (12:05 +0100)] 
Cleanup the ptr argument from mem_putstats()

The ptr argument was unneeded and unused.

3 years agoRemove the Lost memory counter
Ondřej Surý [Thu, 19 Jan 2023 11:02:17 +0000 (12:02 +0100)] 
Remove the Lost memory counter

The Lost memory counter would count the memory "lost" by external
libraries.  There's really no such thing as `named` require the memory
contexts to be clean on destroy.

3 years agoRemove stats buckets memory counters
Ondřej Surý [Thu, 19 Jan 2023 11:00:04 +0000 (12:00 +0100)] 
Remove stats buckets memory counters

The stats buckets were again more useful for internal allocator, because
we would see the individual "block" caches where the allocations would
fall into.  Remove the stats buckets, and if needed, we can pull more
detailed statistics out of the jemalloc.

3 years agoRemove the 'totalgets' memory counter
Ondřej Surý [Thu, 19 Jan 2023 10:55:00 +0000 (11:55 +0100)] 
Remove the 'totalgets' memory counter

The totalgets falls into the same category as other "total" and "max"
numbers - it's just a big number with no meaning to end user.

3 years agoRemove the total memory counter
Ondřej Surý [Thu, 19 Jan 2023 10:50:39 +0000 (11:50 +0100)] 
Remove the total memory counter

The total memory counter had again little or no meaning when we removed
the internal memory allocator.  It was just a monotonic counter that
would count add the allocation sizes but never subtracted anything, so
it would be just a "big number".

3 years agoRemove maxinuse memory counter
Ondřej Surý [Thu, 19 Jan 2023 10:46:47 +0000 (11:46 +0100)] 
Remove maxinuse memory counter

The maxinuse memory counter indicated the highest amount of
memory allocated in the past. Checking and updating this high-
water mark value every time memory was allocated had an impact
on server performance, so it has been removed. Memory size can
be monitored more efficiently via an external tool logging RSS.

3 years agoRemove malloced and maxmalloced memory counter
Ondřej Surý [Thu, 19 Jan 2023 10:41:34 +0000 (11:41 +0100)] 
Remove malloced and maxmalloced memory counter

The malloced and maxmalloced memory counters were mostly useless since
we removed the internal allocator blocks - it would only differ from
inuse by the memory context size itself.

3 years agoMake {increment,decrement}_malloced() return void
Ondřej Surý [Thu, 19 Jan 2023 10:37:00 +0000 (11:37 +0100)] 
Make {increment,decrement}_malloced() return void

The return value was only used in a single place and only for
decrement_malloced() and we can easily replace that with atomic_load().

3 years agoMerge branch 'artem-cookie-use-reuseport-socket-option-in-python-mock-server' into...
Artem Boldariev [Tue, 24 Jan 2023 14:07:03 +0000 (14:07 +0000)] 
Merge branch 'artem-cookie-use-reuseport-socket-option-in-python-mock-server' into 'main'

Use SO_REUSEADDR for "ans9" mock server in "cookie" test

See merge request isc-projects/bind9!7418

3 years agoUse SO_REUSEADDR for "ans9" mock server in "cookie" system test
Artem Boldariev [Mon, 23 Jan 2023 20:03:48 +0000 (22:03 +0200)] 
Use SO_REUSEADDR for "ans9" mock server in "cookie" system test

This commit ensures that it is possible to run the 'cookie' test
multiple times in a row.

3 years agoMerge branch '3797-part1-zone-task-refactoring' into 'main'
Evan Hunt [Mon, 23 Jan 2023 21:06:49 +0000 (21:06 +0000)] 
Merge branch '3797-part1-zone-task-refactoring' into 'main'

refactor zone.c to use loop callbacks

See merge request isc-projects/bind9!7365

3 years agoEnforce receive_secure_serial() and setnsec3param() serialization
Ondřej Surý [Mon, 23 Jan 2023 12:40:19 +0000 (13:40 +0100)] 
Enforce receive_secure_serial() and setnsec3param() serialization

Both receive_secure_serial() and setnsec3param() run on the same zone
loop, therefore they are serialized.  Remove the mechanism to enqueue
the nsec3param and secure serial updates in case one of them is
running (as they can not) and replace it with sanity check.

3 years agoReplace the dns_io_t mechanism with offloaded threads
Ondřej Surý [Mon, 23 Jan 2023 11:13:43 +0000 (12:13 +0100)] 
Replace the dns_io_t mechanism with offloaded threads

Previously, the zone loading and dumping was effectively serialized by
the dns_io_t mechanism.  In theory, more IO operations could be run in
parallel, but the zone manager .iolimit was set to 1 and never increased
as dns_zonemgr_setiolimit() was never ever called.

As the dns_master asynchronous load and dump was already offloaded to
non-worker threads with isc_work mechanism, drop the whole dns_io_t
and just rely on the isc_work to do the load and dump scheduling.

3 years agorefactor inline signing processing to use loop callbacks
Evan Hunt [Wed, 26 Oct 2022 05:26:25 +0000 (22:26 -0700)] 
refactor inline signing processing to use loop callbacks

receive_secure_serial() and receive_secure_db() now use
loop callbacks instead of task events.

3 years agorefactor setnsec3param() to use loop callbacks
Evan Hunt [Wed, 26 Oct 2022 04:32:04 +0000 (21:32 -0700)] 
refactor setnsec3param() to use loop callbacks

dynamic nsec3param update processing now uses loop callbacks
instead of task events.

3 years agorefactor asynchronous zone functions to use loop callbacks
Evan Hunt [Tue, 25 Oct 2022 22:23:54 +0000 (15:23 -0700)] 
refactor asynchronous zone functions to use loop callbacks

Use loopmgr callbacks for:
- dns_zone_keydone() (also added missing documentation)
- dns_zone_setserial()
- zmgr_start_xfrin_ifquota()

3 years agorefactor dns_io to use loop callbacks
Evan Hunt [Tue, 25 Oct 2022 22:06:50 +0000 (15:06 -0700)] 
refactor dns_io to use loop callbacks

The zonemgr_getio() system now uses loopmgr callbacks instead of
task events. As zone->loadtasks is now no longer used, it has been
removed.

3 years agoMerge branch '3793-fix-serialized-signing-in-dnssec-signzone' into 'main'
Ondřej Surý [Sun, 22 Jan 2023 20:52:10 +0000 (20:52 +0000)] 
Merge branch '3793-fix-serialized-signing-in-dnssec-signzone' into 'main'

Refactor dnssec-signzone to use loop callbacks

Closes #3793

See merge request isc-projects/bind9!7359

3 years agoAllow interrupting dnssec-signzone during signing
Ondřej Surý [Thu, 12 Jan 2023 20:44:31 +0000 (21:44 +0100)] 
Allow interrupting dnssec-signzone during signing

The signal handler in the isc_loop would wait for all the work to finish
before interrupting the signing.  Add teardown handlers via
isc_loopmgr_teardown() to signal the assignwork() it should stop signing
and bail-out early.

NOTE: The dnssec-signzone binary still can't be interrupted during zone
loading, zone cleaning, nsec(3) chain generation or zone writing.  This
might get addressed in the future if it becomes a problem.

3 years agoDump the signed zone in the text format at the end of dnssec-signzone
Ondřej Surý [Thu, 12 Jan 2023 15:36:43 +0000 (16:36 +0100)] 
Dump the signed zone in the text format at the end of dnssec-signzone

Instead of dumping the signed zone contents node by node during the
signing, dump the entire zone at the end.  This was already done for the
raw zone format, but it shows that the IO is better utilized when the
zone dump is done in one single write rather than in small chunks.

A side effect of dumping node by node was that all names were printed
relative to the zone origin rather than being grouped under different
$ORIGINs as would normally be the case when dumping a zone. Also, state
was not maintained from one node to the next regarding whether the CLASS
has already been printed, so it was always included with the first
record of each node.

Since dnssec-signzone uses the dns_master_style_explicittl text format
style, and is the only application that does so, we can revise that
style and add a new DNS_STYLEFLAG_CLASS_PERNAME flag to get the output
back to what it was before this change.

3 years agoRefactor dnssec-signzone to use loop callbacks
Evan Hunt [Thu, 27 Oct 2022 03:10:08 +0000 (20:10 -0700)] 
Refactor dnssec-signzone to use loop callbacks

Use isc_job_run() instead of isc_task_send() for dnssec-signzone
worker threads.

Also fix the issue where the additional assignwork() would be run only
from the main thread effectively serializing all the signing.

3 years agoMerge branch 'each-cleanup-netmgr-trace' into 'main'
Evan Hunt [Fri, 20 Jan 2023 21:12:49 +0000 (21:12 +0000)] 
Merge branch 'each-cleanup-netmgr-trace' into 'main'

complete change of NETMGR_TRACE to ISC_NETMGR_TRACE

See merge request isc-projects/bind9!7390

3 years agocomplete change of NETMGR_TRACE to ISC_NETMGR_TRACE
Evan Hunt [Tue, 17 Jan 2023 21:58:10 +0000 (13:58 -0800)] 
complete change of NETMGR_TRACE to ISC_NETMGR_TRACE

some references to the old ifdef were still in place.

3 years agoMerge branch '3726-query-forward-dot' into 'main'
Arаm Sаrgsyаn [Fri, 20 Jan 2023 15:24:40 +0000 (15:24 +0000)] 
Merge branch '3726-query-forward-dot' into 'main'

Resolve "Forward queries via DoT"

Closes #3726

See merge request isc-projects/bind9!7199

3 years agoAdd CHANGES and release notes for [GL #3726]
Aram Sargsyan [Thu, 8 Dec 2022 13:02:41 +0000 (13:02 +0000)] 
Add CHANGES and release notes for [GL #3726]

3 years agoFix nsupdate system test CA certificate signing validity days
Aram Sargsyan [Thu, 8 Dec 2022 12:34:33 +0000 (12:34 +0000)] 
Fix nsupdate system test CA certificate signing validity days

The validity default days value of 1 was used for debugging and
left as such accidentally.

Use 10950 days, as used elsewhere (for example, in doth test CA).

This does not affect anything, the value will be effective when
generating new test certificates in the future.

3 years agoTest query forwarding to DoT-enabled upstream servers
Aram Sargsyan [Thu, 8 Dec 2022 10:29:15 +0000 (10:29 +0000)] 
Test query forwarding to DoT-enabled upstream servers

Change the 'forward' system test to enable DoT on ns2 server,
and test that forwarding from ns4 to the DoT-enabled ns2 works.

In order to test different scenarios, create a test CA (based on
similar CAs for 'doth' and 'nsupdate' system tests), and test
both insecure (no certificate validation) and secure (also with
mutual TLS) TLS configurations, as well as a configuration with an
expired certificate.

3 years agoResolver query forwarding to DoT-enabled upstream servers
Aram Sargsyan [Thu, 8 Dec 2022 14:18:22 +0000 (14:18 +0000)] 
Resolver query forwarding to DoT-enabled upstream servers

Implement TLS transport usage in the resolver.

Use the configured TLS transport for the forwarders in the resolver.

3 years agoLoad and validate the configured TLS transport for forwarders
Aram Sargsyan [Thu, 8 Dec 2022 14:17:24 +0000 (14:17 +0000)] 
Load and validate the configured TLS transport for forwarders

Add support for loading and validating the 'tls' parameter from
the forwarders' configuration.

This prepares ground for adding support to forward queries to
DoT-enabled upstream servers.

3 years agoAdd 'tls' configuration support for the 'forwarders' option
Aram Sargsyan [Thu, 8 Dec 2022 10:57:37 +0000 (10:57 +0000)] 
Add 'tls' configuration support for the 'forwarders' option

A 'tls' statement can be specified both for individual addresses
and for the whole list (as a default value when an individual
address doesn't have its own 'tls' set), just as it was done
before for the 'port' value.

Create a new function 'print_rawqstring()' to print a string residing
in a 'isc_textregion_t' type parameter.

Create a new function 'copy_string()' to copy a string from a
'cfg_obj_t' object into a 'isc_textregion_t'.

3 years agoMerge branch 'marka-mock-openbsd' into 'main'
Mark Andrews [Fri, 20 Jan 2023 13:53:16 +0000 (13:53 +0000)] 
Merge branch 'marka-mock-openbsd' into 'main'

Enable mock tests for OpenBSD

See merge request isc-projects/bind9!7309

3 years agoRemove conditional around mock tests for OpenBSD
Mark Andrews [Sun, 8 Jan 2023 22:27:42 +0000 (09:27 +1100)] 
Remove conditional around mock tests for OpenBSD

We now use multiple barriers.

3 years agoMerge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'
Mark Andrews [Fri, 20 Jan 2023 13:29:19 +0000 (13:29 +0000)] 
Merge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'

Resolve "MacOS address in use not handled gracefully"

Closes #3800

See merge request isc-projects/bind9!7381

3 years agoAdd CHANGES note for [GL #3800]
Mark Andrews [Tue, 17 Jan 2023 06:40:36 +0000 (17:40 +1100)] 
Add CHANGES note for [GL #3800]

3 years agoUse INSIST rather then REQUIRE to meet DBC usage rules
Mark Andrews [Tue, 17 Jan 2023 06:31:40 +0000 (17:31 +1100)] 
Use INSIST rather then REQUIRE to meet DBC usage rules

3 years agoisc_nm_listentcp: treat socket failures gracefully
Mark Andrews [Tue, 17 Jan 2023 06:47:32 +0000 (17:47 +1100)] 
isc_nm_listentcp: treat socket failures gracefully

The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.

3 years agoisc_nm_listenudp: treat socket failures gracefully
Mark Andrews [Tue, 17 Jan 2023 06:25:25 +0000 (17:25 +1100)] 
isc_nm_listenudp: treat socket failures gracefully

The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.

3 years agoMerge branch 'artem-fix-building-on-dragonflybsd' into 'main'
Artem Boldariev [Thu, 19 Jan 2023 22:55:45 +0000 (22:55 +0000)] 
Merge branch 'artem-fix-building-on-dragonflybsd' into 'main'

Fix building BIND on DragonFly BSD

Closes #3796

See merge request isc-projects/bind9!7379

3 years agoFix building BIND on DragonFly BSD (on both older an newer versions)
Artem Boldariev [Mon, 16 Jan 2023 16:31:08 +0000 (18:31 +0200)] 
Fix building BIND on DragonFly BSD (on both older an newer versions)

This commit ensures that BIND and supplementary tools still can be
built on newer versions of DragonFly BSD. It used to be the case, but
somewhere between versions 6.2 and 6.4 the OS developers rearranged
headers and moved some function definitions around.

Before that the fact that it worked was more like a coincidence, this
time we, at least, looked at the related man pages included with the
OS.

No in depth testing has been done on this OS as we do not really
support this platform - so it is more like a goodwill act. We can,
however, use this platform for testing purposes, too. Also, we know
that the OS users do use BIND, as it is included in its ports
directory.

Building with './configure' and './configure --without-jemalloc' have
been fixed and are known to work at the time the commit is made.

3 years agoMerge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields' into 'main'
Mark Andrews [Thu, 19 Jan 2023 13:24:32 +0000 (13:24 +0000)] 
Merge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields' into 'main'

Add missing lock when setting node->wild

Closes #3799

See merge request isc-projects/bind9!7392

3 years agoAdd CHANGES for [GL #3799]
Mark Andrews [Wed, 18 Jan 2023 05:00:11 +0000 (16:00 +1100)] 
Add CHANGES for [GL #3799]

3 years agoAdd missing node lock when setting node->wild in rbtdb.c
Mark Andrews [Wed, 18 Jan 2023 04:54:42 +0000 (15:54 +1100)] 
Add missing node lock when setting node->wild in rbtdb.c

The write node lock needs to be held when setting node->wild in
add_wildcard_magic except when being called from loading_addrdataset
which is used to load the zone without locking during its initial
load.

3 years agoMerge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'
Arаm Sаrgsyаn [Thu, 19 Jan 2023 11:21:19 +0000 (11:21 +0000)] 
Merge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'

Refactor isc_nm_xfr_allowed()

Closes #3808

See merge request isc-projects/bind9!7395

3 years agoAdd a CHANGES note for [GL #3808]
Aram Sargsyan [Wed, 18 Jan 2023 11:09:31 +0000 (11:09 +0000)] 
Add a CHANGES note for [GL #3808]

3 years agoRefactor isc_nm_xfr_allowed()
Aram Sargsyan [Wed, 18 Jan 2023 10:36:34 +0000 (10:36 +0000)] 
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.

3 years agoMerge branch '3783-parental-ds-requests-need-rd-bit-set' into 'main'
Matthijs Mekking [Thu, 19 Jan 2023 10:20:35 +0000 (10:20 +0000)] 
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

3 years agoAdd CHANGES and release note for GL #3783
Matthijs Mekking [Fri, 13 Jan 2023 13:50:27 +0000 (14:50 +0100)] 
Add CHANGES and release note for GL #3783

News worthy.

3 years agoSet RD bit on checkds requests
Matthijs Mekking [Fri, 13 Jan 2023 13:20:53 +0000 (14:20 +0100)] 
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.

3 years agoAdd checkds test case with resolver parental-agent
Matthijs Mekking [Fri, 13 Jan 2023 13:13:59 +0000 (14:13 +0100)] 
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.

3 years agoMerge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inver...
Ondřej Surý [Thu, 19 Jan 2023 09:21:18 +0000 (09:21 +0000)] 
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

3 years agoDetach the zone views outside of the zone lock
Ondřej Surý [Thu, 19 Jan 2023 08:14:53 +0000 (09:14 +0100)] 
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.

3 years agoMerge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply' into 'main'
Ondřej Surý [Thu, 19 Jan 2023 09:11:56 +0000 (09:11 +0000)] 
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

3 years agoAdd python3-ply to GitHub CodeQL configuration
Ondřej Surý [Thu, 19 Jan 2023 09:00:42 +0000 (10:00 +0100)] 
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.

3 years agoMerge branch 'ondrej/replace-lgtm-with-codeql' into 'main'
Ondřej Surý [Thu, 19 Jan 2023 08:45:07 +0000 (08:45 +0000)] 
Merge branch 'ondrej/replace-lgtm-with-codeql' into 'main'

Add CodeQL GitHub Action

See merge request isc-projects/bind9!7393

3 years agoAdd CodeQL GitHub Action
Ondřej Surý [Tue, 17 Jan 2023 23:15:58 +0000 (00:15 +0100)] 
Add CodeQL GitHub Action

Replace the decommissioned LGTM service with CodeQL GitHub action.

3 years agoMerge branch '3795-speed-up-EVP_DigestInit_ex-fixup' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 23:32:06 +0000 (23:32 +0000)] 
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

3 years agoUse thread_local EVP_MD in isc_iterated_hash()
Ondřej Surý [Wed, 18 Jan 2023 21:38:27 +0000 (22:38 +0100)] 
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.

3 years agoMerge branch '3795-speed-up-EVP_DigestInit_ex' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 19:24:29 +0000 (19:24 +0000)] 
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

3 years agoAdd CHANGES and release note for [GL #3795]
Ondřej Surý [Mon, 16 Jan 2023 09:09:35 +0000 (10:09 +0100)] 
Add CHANGES and release note for [GL #3795]

3 years agoUse thread_local EVP_MD_CTX in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 10:12:06 +0000 (11:12 +0100)] 
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.

3 years agoUse OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 11:56:53 +0000 (12:56 +0100)] 
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.

3 years agoUse OpenSSL EVP_MD API directly in isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 10:12:06 +0000 (11:12 +0100)] 
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.

3 years agoAvoid implicit algorithm fetch for OpenSSL EVP_MD family
Ondřej Surý [Mon, 16 Jan 2023 08:16:35 +0000 (09:16 +0100)] 
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.

3 years agoAdd microbenchmark for isc_iterated_hash()
Ondřej Surý [Mon, 16 Jan 2023 09:54:22 +0000 (10:54 +0100)] 
Add microbenchmark for isc_iterated_hash()

Add microbenchmark for isc_iterated_hash() to measure the speed of NSEC3
per second.

3 years agoMerge branch 'ondrej/openssl3-no-deprecated' into 'main'
Ondřej Surý [Wed, 18 Jan 2023 17:18:09 +0000 (17:18 +0000)] 
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

3 years agoEnable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1
Ondřej Surý [Wed, 18 Jan 2023 10:10:30 +0000 (11:10 +0100)] 
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.

3 years agoMerge branch 'each-remove-reserved-dispatches' into 'main'
Evan Hunt [Wed, 18 Jan 2023 02:53:40 +0000 (02:53 +0000)] 
Merge branch 'each-remove-reserved-dispatches' into 'main'

remove dead code for reserved dispatches

See merge request isc-projects/bind9!7391

3 years agoremove dead code for reserved dispatches
Evan Hunt [Wed, 11 Jan 2023 21:41:48 +0000 (13:41 -0800)] 
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.

3 years agoMerge branch '3781-deprecate-source-port' into 'main'
Evan Hunt [Wed, 18 Jan 2023 01:51:43 +0000 (01:51 +0000)] 
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

3 years agoCHANGES and release note for [GL #3781]
Evan Hunt [Sat, 7 Jan 2023 01:30:07 +0000 (17:30 -0800)] 
CHANGES and release note for [GL #3781]

3 years agoTest deprecate source port configuration
Matthijs Mekking [Wed, 11 Jan 2023 10:10:05 +0000 (11:10 +0100)] 
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).

3 years agomark "port" as deprecated for source address options
Evan Hunt [Sat, 7 Jan 2023 01:01:06 +0000 (17:01 -0800)] 
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.

3 years agoMerge branch '3789-remove-dscp' into 'main'
Evan Hunt [Wed, 18 Jan 2023 00:47:24 +0000 (00:47 +0000)] 
Merge branch '3789-remove-dscp' into 'main'

fully remove DSCP

Closes #3789

See merge request isc-projects/bind9!7338

3 years agoCHANGES and release note revision for [GL #3789]
Evan Hunt [Tue, 10 Jan 2023 00:59:47 +0000 (16:59 -0800)] 
CHANGES and release note revision for [GL #3789]

3 years agofully remove DSCP
Evan Hunt [Tue, 10 Jan 2023 00:57:41 +0000 (16:57 -0800)] 
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.