]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoEmbed algorithm in key tag counter
Matthijs Mekking [Thu, 2 Apr 2020 09:59:35 +0000 (11:59 +0200)] 
Embed algorithm in key tag counter

Key tags are not unique across algorithms.

6 years agoGroup the keyid with the counters
Matthijs Mekking [Thu, 2 Apr 2020 08:50:16 +0000 (10:50 +0200)] 
Group the keyid with the counters

Rather than group key ids together, group key id with its
corresponding counters. This should make growing / shrinking easier
than having keyids then counters.

6 years agoAdd test for many keys
Matthijs Mekking [Thu, 26 Mar 2020 15:13:55 +0000 (16:13 +0100)] 
Add test for many keys

Add a statschannel test case for DNSSEC sign metrics that has more
keys than there are allocated stats counters for.  This will produce
gibberish, but at least it should not crash.

6 years agoRedesign dnssec sign statistics
Matthijs Mekking [Thu, 26 Mar 2020 15:02:36 +0000 (16:02 +0100)] 
Redesign dnssec sign statistics

The first attempt to add DNSSEC sign statistics was naive: for each
zone we allocated 64K counters, twice.  In reality each zone has at
most four keys, so the new approach only has room for four keys per
zone. If after a rollover more keys have signed the zone, existing
keys are rotated out.

The DNSSEC sign statistics has three counters per key, so twelve
counters per zone. First counter is actually a key id, so it is
clear what key contributed to the metrics.  The second counter
tracks the number of generated signatures, and the third tracks
how many of those are refreshes.

This means that in the zone structure we no longer need two separate
references to DNSSEC sign metrics: both the resign and refresh stats
are kept in a single dns_stats structure.

Incrementing dnssecsignstats:

Whenever a dnssecsignstat is incremented, we look up the key id
to see if we already are counting metrics for this key.  If so,
we update the corresponding operation counter (resign or
refresh).

If the key is new, store the value in a new counter and increment
corresponding counter.

If all slots are full, we rotate the keys and overwrite the last
slot with the new key.

Dumping dnssecsignstats:

Dumping dnssecsignstats is no longer a simple wrapper around
isc_stats_dump, but uses the same principle.  The difference is that
rather than dumping the index (key tag) and counter, we have to look
up the corresponding counter.

6 years agoMerge branch '1706-dnssec-policy-migration' into 'master'
Matthijs Mekking [Fri, 3 Apr 2020 06:54:46 +0000 (06:54 +0000)] 
Merge branch '1706-dnssec-policy-migration' into 'master'

Resolve "Changing from auto-dnssec maintain to dnssec-policy x immediately deletes existing keys"

Closes #1706

See merge request isc-projects/bind9!3322

6 years agoTest migration to dnssec-policy, change algorithm
Matthijs Mekking [Thu, 2 Apr 2020 07:05:12 +0000 (09:05 +0200)] 
Test migration to dnssec-policy, change algorithm

Add a test to ensure migration from 'auto-dnssec maintain;' to
dnssec-policy works even if the algorithm is changed.  The existing
keys should not be removed immediately, but their goal should be
changed to become hidden, and the new keys with the different
algorithm should be introduced immediately.

6 years agoOnly initialize goal on active keys
Matthijs Mekking [Wed, 1 Apr 2020 14:35:06 +0000 (16:35 +0200)] 
Only initialize goal on active keys

If we initialize goals on all keys, superfluous keys that match
the policy all desire to be active.  For example, there are six
keys available for a policy that needs just two, we only want to
set the goal state to OMNIPRESENT on two keys, not six.

6 years agoUpdate documentation with !1706 fix
Matthijs Mekking [Wed, 1 Apr 2020 12:35:22 +0000 (14:35 +0200)] 
Update documentation with !1706 fix

6 years agoTest migration to dnssec-policy, retire old keys
Matthijs Mekking [Wed, 1 Apr 2020 12:29:49 +0000 (14:29 +0200)] 
Test migration to dnssec-policy, retire old keys

Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly.  Earlier commit deals with migration where existing keys
match the policy.  This commit deals with migration where existing
keys do not match the policy.  In that case, named must not
immediately delete the existing keys, but gracefully roll to the
dnssec-policy.

However, named did remove the existing keys immediately.  This is
because the legacy key states were initialized badly.  Because
those keys had their states initialized to HIDDEN or RUMOURED, the
keymgr decides that they can be removed (because only when the key
has its states in OMNIPRESENT it can be used safely).

The original thought to initialize key states to HIDDEN (and
RUMOURED to deal with existing keys) was to ensure that those keys
will go through the required propagation time before the keymgr
decides they can be used safely.  However, those keys are already
in the zone for a long time and making the key states represent
otherwise is dangerous: keys may be pulled out of the zone while
in fact they are required to establish the chain of trust.

Fix initializing key states for existing keys by looking more closely
at the time metadata.  Add TTL and propagation delays to the time
metadata and see if the DNSSEC records have been propagated.
Initialize the state to OMNIPRESENT if so, otherwise initialize to
RUMOURED.  If the time metadata is in the future, or does not exist,
keep initializing the state to HIDDEN.

The added test makes sure that new keys matching the policy are
introduced, but existing keys are kept in the zone until the new
keys have been propagated.

6 years agoTweak kasp system test
Matthijs Mekking [Wed, 1 Apr 2020 12:09:55 +0000 (14:09 +0200)] 
Tweak kasp system test

A few kasp system test tweaks to improve test failure debugging and
deal with tests related to migration to dnssec-policy.

1. When clearing a key, set lifetime to "none".  If "none", skip
   expect no lifetime set in the state file.  Legacy keys that
   are migrated but don't match the dnssec-policy will not have a
   lifetime.

2. The kasp system test prints which key id and file it is checking.
   Log explicitly if we are checking the id or a file.

3. Add quotes around "ID" when setting the key id, for consistency.

4. Fix a typo (non -> none).

5. Print which key ids are found, this way it is easier to see what
   KEY[1-4] failed to match one of the key files.

6 years agoFix and test migration to dnssec-policy
Matthijs Mekking [Fri, 27 Mar 2020 09:28:22 +0000 (10:28 +0100)] 
Fix and test migration to dnssec-policy

Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly. Several adjustments in the keymgr are required to get it right:

- Set published time on keys when we calculate prepublication time.
  This is not strictly necessary, but it is weird to have an active
  key without the published time set.

- Initalize key states also before matching keys. Determine the
  target state by looking at existing time metadata: If the time
  data is set and is in the past, it is a hint that the key and
  its corresponding records have been published in the zone already,
  and the state is initialized to RUMOURED. Otherwise, initialize it
  as HIDDEN. This fixes migration to dnssec-policy from existing
  keys.

- Initialize key goal on keys that match key policy to OMNIPRESENT.
  These may be existing legacy keys that are being migrated.

- A key that has its goal to OMNIPRESENT *or* an active key can
  match a kasp key.  The code was changed with CHANGE 5354 that
  was a bugfix to prevent creating new KSK keys for zones in the
  initial stage of signing.  However, this caused problems for
  restarts when rollovers are in progress, because an outroducing
  key can still be an active key.

The test for this introduces a new KEY property 'legacy'.  This is
used to skip tests related to .state files.

6 years agoMerge branch '1717-rwlock-contention-in-isc_log_wouldlog-api-performance-impact'...
Ondřej Surý [Fri, 3 Apr 2020 05:01:33 +0000 (05:01 +0000)] 
Merge branch '1717-rwlock-contention-in-isc_log_wouldlog-api-performance-impact' into 'master'

Reduce rwlock contention in isc_log_wouldlog()

Closes #1717

See merge request isc-projects/bind9!3321

6 years agoReduce rwlock contention in isc_log_wouldlog()
Ondřej Surý [Wed, 1 Apr 2020 09:50:32 +0000 (11:50 +0200)] 
Reduce rwlock contention in isc_log_wouldlog()

The rwlock introduced to protect the .logconfig member of isc_log_t
structure caused a significant performance drop because of the rwlock
contention.  It was also found, that the debug_level member of said
structure was not protected from concurrent read/writes.

The .dynamic and .highest_level members of isc_logconfig_t structure
were actually just cached values pulled from the assigned channels.

We introduced an even higher cache level for .dynamic and .highest_level
members directly into the isc_log_t structure, so we don't have to
access the .logconfig member in the isc_log_wouldlog() function.

6 years agoMerge branch '1447-incremental-rpz-update' into 'master'
Evan Hunt [Wed, 1 Apr 2020 03:38:31 +0000 (03:38 +0000)] 
Merge branch '1447-incremental-rpz-update' into 'master'

incrementally clean up old RPZ records during updates

Closes #1447

See merge request isc-projects/bind9!3318

6 years agoCHANGES and release note
Evan Hunt [Tue, 31 Mar 2020 23:26:14 +0000 (16:26 -0700)] 
CHANGES and release note

6 years agoincrementally clean up old RPZ records during updates
Evan Hunt [Tue, 31 Mar 2020 22:04:20 +0000 (15:04 -0700)] 
incrementally clean up old RPZ records during updates

After an RPZ zone is updated via zone transfer, the RPZ summary
database is updated, inserting the newly added names in the policy
zone and deleting the newly removed ones. The first part of this
was quantized so it would not run too long and starve other tasks
during large updates, but the second part was not quantized, so
that an update in which a large number of records were deleted
could cause named to become briefly unresponsive.

6 years agoMerge branch 'marka-empty-release-notes' into 'master'
Mark Andrews [Tue, 31 Mar 2020 03:31:38 +0000 (03:31 +0000)] 
Merge branch 'marka-empty-release-notes' into 'master'

add empty release notes for 9.17.1

See merge request isc-projects/bind9!3313

6 years agoadd empty release notes for 9.17.1
Mark Andrews [Tue, 31 Mar 2020 03:09:38 +0000 (14:09 +1100)] 
add empty release notes for 9.17.1

6 years agoMerge branch '1700-proper-tcp-resuming' into 'master'
Witold Krecicki [Mon, 30 Mar 2020 10:27:01 +0000 (10:27 +0000)] 
Merge branch '1700-proper-tcp-resuming' into 'master'

Deactivate the handle before sending the async close callback.

Closes #1700

See merge request isc-projects/bind9!3303

6 years agoDeactivate the handle before sending the async close callback.
Witold Kręcicki [Thu, 26 Mar 2020 13:25:06 +0000 (14:25 +0100)] 
Deactivate the handle before sending the async close callback.

We could have a race between handle closing and processing async
callback. Deactivate the handle before issuing the callback - we
have the socket referenced anyway so it's not a problem.

6 years agoMerge branch 'wpk/quota-callback' into 'master'
Witold Krecicki [Mon, 30 Mar 2020 08:17:31 +0000 (08:17 +0000)] 
Merge branch 'wpk/quota-callback' into 'master'

isc_quota_attach_cb - quota attach function with a callback.

See merge request isc-projects/bind9!3280

6 years agoAdd a quota attach function with a callback, some code cleanups.
Witold Kręcicki [Tue, 24 Mar 2020 10:42:16 +0000 (11:42 +0100)] 
Add a quota attach function with a callback, some code cleanups.

We introduce a isc_quota_attach_cb function - if ISC_R_QUOTA is returned
at the time the function is called, then a callback will be called when
there's quota available (with quota already attached). The callbacks are
organized as a LIFO queue in the quota structure.
It's needed for TCP client quota -  with old networking code we had one
single place where tcp clients quota was processed so we could resume
accepting when the we had spare slots, but it's gone with netmgr - now
we need to notify the listener/accepter that there's quota available so
that it can resume accepting.

Remove unused isc_quota_force() function.

The isc_quote_reserve and isc_quota_release were used only internally
from the quota.c and the tests.  We should not expose API we are not
using.

6 years agoMerge branch '1678-bind-fails-to-build-with-mysql-support-against-mysql8-mysql-connec...
Mark Andrews [Thu, 26 Mar 2020 22:03:11 +0000 (22:03 +0000)] 
Merge branch '1678-bind-fails-to-build-with-mysql-support-against-mysql8-mysql-connector-8' into 'master'

Resolve "BIND fails to build with MYSQL support against mysql8/mysql-connector-8"

Closes #1678

See merge request isc-projects/bind9!3235

6 years agoUse compound literals in mysql_options() call
Ondřej Surý [Wed, 18 Mar 2020 15:15:43 +0000 (16:15 +0100)] 
Use compound literals in mysql_options() call

Makes use of compound literals instead of using extra my_bool
variable just to hold "true/1" value.

6 years agoTypedef my_bool if missing.
Mark Andrews [Mon, 16 Mar 2020 05:44:51 +0000 (16:44 +1100)] 
Typedef my_bool if missing.

ORACLE MySQL 8.0 has dropped the my_bool type, so we need to reinstate
it back when compiling with that version or higher.  MariaDB is still
keeping the my_bool type.  The numbering between the two (MariaDB 5.x
jumped to MariaDB 10.x) doesn't make the life of the developer easy.

6 years agoremove unused variable
Mark Andrews [Mon, 16 Mar 2020 05:36:27 +0000 (16:36 +1100)] 
remove unused variable

6 years agoMerge branch 'michal/misc-gitlab-ci-yml-cleanups' into 'master'
Michał Kępień [Thu, 26 Mar 2020 10:40:13 +0000 (10:40 +0000)] 
Merge branch 'michal/misc-gitlab-ci-yml-cleanups' into 'master'

Miscellaneous .gitlab-ci.yml cleanups

See merge request isc-projects/bind9!3298

6 years agoRemove unused YAML anchors
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Remove unused YAML anchors

Some YAML anchors defined in .gitlab-ci.yml are not subsequently used.
Remove them to prevent confusion.

6 years agoDo not install compiledb in cppcheck job
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Do not install compiledb in cppcheck job

compiledb is already included in the Docker image used by the cppcheck
job.  Do not attempt installing it again.

6 years agoInclude compiler name in all build/test job names
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Include compiler name in all build/test job names

Most build/test job names already contain a "clang", "gcc", or "msvc"
prefix which indicates the compiler used for a given job.  Apply that
naming convention to all build/test job names.

6 years agoRefactor TSAN unit test job definitions
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Refactor TSAN unit test job definitions

Multiple YAML keys have identical values for both TSAN unit test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN unit test job definitions to reduce code duplication.

6 years agoRun "kyua report-html" for TSAN unit test jobs
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Run "kyua report-html" for TSAN unit test jobs

Definitions of jobs running unit tests under TSAN contain an
"after_script" YAML key.  Since the "unit_test_job" anchor is included
in those job definitions before "after_script" is defined, the
job-specific value of that key overrides the one defined in the included
anchor.  This prevents "kyua report-html" from being run for TSAN unit
test jobs.  Moving the invocation of "kyua report-html" to the "script"
key in the "unit_test_job" anchor is not acceptable as it would cause
the exit code of that command to determine the result of all unit test
jobs and we need that to be the exit code of "make unit".  Instead, add
"kyua report-html" invocations to the "after_script" key of TSAN unit
test job definitions to address the problem without affecting other job
definitions.

6 years agoRefactor TSAN system test job definitions
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Refactor TSAN system test job definitions

Multiple YAML keys have identical values for both TSAN system test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN system test job definitions to reduce code duplication.

6 years agoDrop "before_script" key from TSAN job definitions
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Drop "before_script" key from TSAN job definitions

Both "system_test_job" and "unit_test_job" YAML anchors contain a
"before_script" key.  TSAN job definitions first specify their own value
of the "before_script" key and then include the aforementioned YAML
anchors, which results in the value of the "before_script" key being
overridden with the value specified by the included anchor.  Given this,
remove "before_script" definitions specific to TSAN jobs as they serve
no practical purpose.

6 years agoDefine TSAN options in a global variable
Michał Kępień [Thu, 26 Mar 2020 10:03:52 +0000 (11:03 +0100)] 
Define TSAN options in a global variable

All assignments for the TSAN_OPTIONS variable are identical across the
entire .gitlab-ci.yml file.  Define a global TSAN_OPTIONS_COMMON
variable and use it in job definitions to reduce code duplication.

6 years agoMerge branch '1679-fix-the-typecase-to-isc_stdtime_get' into 'master'
Ondřej Surý [Wed, 25 Mar 2020 21:31:34 +0000 (21:31 +0000)] 
Merge branch '1679-fix-the-typecase-to-isc_stdtime_get' into 'master'

Correct the typecast of .tv_sec in isc_stdtime_get()

Closes #1679

See merge request isc-projects/bind9!3294

6 years agoCorrect the typecast of .tv_sec in isc_stdtime_get()
Ondřej Surý [Wed, 25 Mar 2020 21:08:50 +0000 (22:08 +0100)] 
Correct the typecast of .tv_sec in isc_stdtime_get()

6 years agoMerge branch '1679-fix-the-tv_nsec_check' into 'master'
Ondřej Surý [Wed, 25 Mar 2020 19:28:59 +0000 (19:28 +0000)] 
Merge branch '1679-fix-the-tv_nsec_check' into 'master'

Fix the tv_nsec check in isc_stdtime_get()

Closes #1679

See merge request isc-projects/bind9!3292

6 years agoFix the tv_nsec check in isc_stdtime_get()
Ondřej Surý [Wed, 25 Mar 2020 18:06:50 +0000 (19:06 +0100)] 
Fix the tv_nsec check in isc_stdtime_get()

6 years agoMerge branch 'ondrej/no-clang-on-debian-sid' into 'master'
Ondřej Surý [Wed, 25 Mar 2020 17:05:27 +0000 (17:05 +0000)] 
Merge branch 'ondrej/no-clang-on-debian-sid' into 'master'

Rewrite .gitlab-ci.yml to have 'base_image' and other GitLab CI improvements

See merge request isc-projects/bind9!3279

6 years agoReplace clang:stretch:amd64 build with clang:buster:amd64 build (+ add missing system...
Ondřej Surý [Wed, 25 Mar 2020 15:31:59 +0000 (16:31 +0100)] 
Replace clang:stretch:amd64 build with clang:buster:amd64 build (+ add missing system test)

6 years agoReplace bear with compiledb and drop MAKE_COMMAND because we don't need it
Ondřej Surý [Mon, 23 Mar 2020 10:48:24 +0000 (11:48 +0100)] 
Replace bear with compiledb and drop MAKE_COMMAND because we don't need it

6 years agoAdjust the GitLab CI jobs to match the new images
Ondřej Surý [Tue, 24 Mar 2020 08:43:45 +0000 (09:43 +0100)] 
Adjust the GitLab CI jobs to match the new images

The custom builds (oot, asan, tsan) were mostly built using Debian sid
amd64 image.  The problem was that this image broke too easily, because
it's Debian "unstable" after all.

This commit introduces "base_image" that should be most stable with
extra bits on top (clang, coccinelle, cppcheck, ...).  Currently, that
would be Debian buster amd64.

Other changes introduced by this commit:

* Change the default clang version to 10
* Run both ASAN and TSAN with both gcc and clang compilers
* Remove Clang Debian stretch i386 job

6 years agoMerge branch 'ondrej/scan-build-10-fixes' into 'master'
Ondřej Surý [Wed, 25 Mar 2020 17:02:55 +0000 (17:02 +0000)] 
Merge branch 'ondrej/scan-build-10-fixes' into 'master'

Fix new warnings reported by scan-build from LLVM/Clang 10

See merge request isc-projects/bind9!3285

6 years agoFix 'Dereference of null pointer' from scan-build-10
Ondřej Surý [Wed, 25 Mar 2020 16:25:45 +0000 (17:25 +0100)] 
Fix 'Dereference of null pointer' from scan-build-10

These are mostly false positives, the clang-analyzer FAQ[1] specifies
why and how to fix it:

> The reason the analyzer often thinks that a pointer can be null is
> because the preceding code checked compared it against null. So if you
> are absolutely sure that it cannot be null, remove the preceding check
> and, preferably, add an assertion as well.

The 4 warnings reported are:

dnssec-cds.c:781:4: warning: Access to field 'base' results in a dereference of a null pointer (loaded from variable 'buf')
                        isc_buffer_availableregion(buf, &r);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:996:36: note: expanded from macro 'isc_buffer_availableregion'
                                   ^
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:821:16: note: expanded from macro 'ISC__BUFFER_AVAILABLEREGION'
                (_r)->base = isc_buffer_used(_b);              \
                             ^~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:152:29: note: expanded from macro 'isc_buffer_used'
        ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
                                   ^~~~~~~~~
1 warning generated.

--

byname_test.c:308:34: warning: Access to field 'fwdtable' results in a dereference of a null pointer (loaded from variable 'view')
                RUNTIME_CHECK(dns_fwdtable_add(view->fwdtable, dns_rootname,
                                               ^~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/util.h:318:52: note: expanded from macro 'RUNTIME_CHECK'
                                                   ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/error.h:50:21: note: expanded from macro 'ISC_ERROR_RUNTIMECHECK'
        ((void)(ISC_LIKELY(cond) ||  \
                           ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/likely.h:23:43: note: expanded from macro 'ISC_LIKELY'
                                            ^
1 warning generated.

--

./rndc.c:255:6: warning: Dereference of null pointer (loaded from variable 'host')
        if (*host == '/') {
            ^~~~~
1 warning generated.

--

./main.c:1254:9: warning: Access to field 'sctx' results in a dereference of a null pointer (loaded from variable 'named_g_server')
        sctx = named_g_server->sctx;
               ^~~~~~~~~~~~~~~~~~~~
1 warning generated.

References:
1. https://clang-analyzer.llvm.org/faq.html#null_pointer

6 years agoFix 'Dead nested assignment's from scan-build-10
Ondřej Surý [Wed, 25 Mar 2020 16:00:07 +0000 (17:00 +0100)] 
Fix 'Dead nested assignment's from scan-build-10

The 3 warnings reported are:

os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
        if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

--

rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
        return (zbits &= x);
                ^        ~
1 warning generated.

--

openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
        while ((err = ERR_get_error()) != 0) {
                ^     ~~~~~~~~~~~~~~~
1 warning generated.

6 years agoMerge branch 'wpk/tcpdns-refactoring' into 'master'
Witold Krecicki [Tue, 24 Mar 2020 20:57:21 +0000 (20:57 +0000)] 
Merge branch 'wpk/tcpdns-refactoring' into 'master'

netmgr refactoring: use generic functions when operating on sockets.

See merge request isc-projects/bind9!3269

6 years agonetmgr refactoring: use generic functions when operating on sockets.
Witold Kręcicki [Fri, 20 Mar 2020 10:55:10 +0000 (11:55 +0100)] 
netmgr refactoring: use generic functions when operating on sockets.

tcpdns used transport-specific functions to operate on the outer socket.
Use generic ones instead, and select the proper call in netmgr.c.
Make the missing functions (e.g. isc_nm_read) generic and add type-specific
calls (isc__nm_tcp_read). This is the preparation for netmgr TLS layer.

6 years agoMerge branch 'ondrej/remove-debian-jessie-from-gitlab-ci' into 'master'
Ondřej Surý [Tue, 24 Mar 2020 13:50:41 +0000 (13:50 +0000)] 
Merge branch 'ondrej/remove-debian-jessie-from-gitlab-ci' into 'master'

Remove Debian 8 ("jessie") from the GitLab CI

See merge request isc-projects/bind9!3281

6 years agoRemove Debian 8 ("Jessie") from the GitLab CI
Ondřej Surý [Tue, 24 Mar 2020 12:56:29 +0000 (13:56 +0100)] 
Remove Debian 8 ("Jessie") from the GitLab CI

There are several reason why remove Debian 8 from the CI:

* Debian 8 ("jessie") has been superseded by Debian 9 ("stretch").
* Regular security support updates have been discontinued as of
  June 17th, 2018.
* Jessie LTS is supported from 17th June 2018 to June 30, 2020.

In other words, it's no longer officially supported by Debian security
team, but by the volunteer/paid contributor composed LTS team.  And the
release will be discontinued in three months from now.  We can use the
freed CI resources to bring new platforms or just to make the jobs run a
bit faster.

6 years agoMerge branch 'michal/update-release-checklist' into 'master'
Michał Kępień [Tue, 24 Mar 2020 08:56:20 +0000 (08:56 +0000)] 
Merge branch 'michal/update-release-checklist' into 'master'

Update release checklist (BIND_BASELINE_VERSION)

See merge request isc-projects/bind9!3278

6 years agoUpdate release checklist (BIND_BASELINE_VERSION)
Michał Kępień [Tue, 24 Mar 2020 06:36:24 +0000 (07:36 +0100)] 
Update release checklist (BIND_BASELINE_VERSION)

The reference BIND version used in the ABI check CI job is not
determined automatically - it needs to be updated after each BIND
release.  Reflect that fact in the release checklist to make sure the
ABI check CI job is always comparing current code with the latest BIND
release on a given branch.

6 years agoMerge branch '1698-converting-isc_log-to-rwlock-broke-windows' into 'master'
Mark Andrews [Tue, 24 Mar 2020 04:22:43 +0000 (04:22 +0000)] 
Merge branch '1698-converting-isc_log-to-rwlock-broke-windows' into 'master'

Resolve "Converting isc_log to RWLOCK broke Windows"

Closes #1698

See merge request isc-projects/bind9!3276

6 years agoUsed to the correct unlock type (read)
Mark Andrews [Tue, 24 Mar 2020 03:50:31 +0000 (14:50 +1100)] 
Used to the correct unlock type (read)

6 years agoMerge branch 'mnowak/abi-tracker-helper-v9.17.0' into 'master'
Michal Nowak [Fri, 20 Mar 2020 12:08:23 +0000 (12:08 +0000)] 
Merge branch 'mnowak/abi-tracker-helper-v9.17.0' into 'master'

Bump BIND baseline version for abi-check

See merge request isc-projects/bind9!3202

6 years agoBump BIND baseline version for abi-check
Michal Nowak [Tue, 10 Mar 2020 08:49:25 +0000 (09:49 +0100)] 
Bump BIND baseline version for abi-check

6 years agoMerge branch 'v9_17_0-release' into 'master'
Matthijs Mekking [Fri, 20 Mar 2020 10:22:12 +0000 (10:22 +0000)] 
Merge branch 'v9_17_0-release' into 'master'

Apply 9.17.0 release branch

See merge request isc-projects/bind9!3262

6 years agoFix README related to --with-tuning
Tinderbox User [Thu, 12 Mar 2020 12:27:13 +0000 (12:27 +0000)] 
Fix README related to --with-tuning

6 years agoregen master
Tinderbox User [Thu, 12 Mar 2020 10:25:49 +0000 (10:25 +0000)] 
regen master

6 years agoFix resonse typo in release notes
Tinderbox User [Thu, 12 Mar 2020 09:25:20 +0000 (09:25 +0000)] 
Fix resonse typo in release notes

6 years agoregen master
Tinderbox User [Thu, 12 Mar 2020 09:17:01 +0000 (09:17 +0000)] 
regen master

6 years agoprep 9.17.0
Tinderbox User [Thu, 12 Mar 2020 09:08:46 +0000 (09:08 +0000)] 
prep 9.17.0

The files configure.ac and version are already up to date.

Updated CHANGES with 9.17.0 release line.

Fixed CHANGES by adding GitLab reference to entry 5357 and fix
grammar mistakes.

Add missing /util/check-make-install.in to .gitattributes.

The lib/*/api are already updated to match the new ranges.

I listed two new features under BIND 9.17 features that to me
seemed noteworthy.

The release notes look good to me.

6 years agoMerge branch 'mnowak/unit-test-debugging-enhancements' into 'master'
Michal Nowak [Fri, 20 Mar 2020 09:40:16 +0000 (09:40 +0000)] 
Merge branch 'mnowak/unit-test-debugging-enhancements' into 'master'

Enhance unit test debugging

See merge request isc-projects/bind9!2990

6 years agoEnhance unit test debugging
Michal Nowak [Wed, 29 Jan 2020 14:56:44 +0000 (15:56 +0100)] 
Enhance unit test debugging

When unit test fails, core file is created. Kyua's 'debug' command can
run GDB on it and provide backtrace. Unfortunately Kyua is picky about
location of these core files we opt to use custom Kyua fork and copy
core files from Kyua working directory to source tree and make it
available in GitLab.

6 years agoMerge branch '4-fix-the-last-three-system-tests-parallel-run' into 'master'
Ondřej Surý [Thu, 19 Mar 2020 17:23:53 +0000 (17:23 +0000)] 
Merge branch '4-fix-the-last-three-system-tests-parallel-run' into 'master'

Convert the last three system tests (ecdsa, eddsa and tkey) to use dynamic ports

See merge request isc-projects/bind9!3257

6 years agoFix the tkey system test to allow parallel run
Ondřej Surý [Wed, 18 Mar 2020 14:33:52 +0000 (15:33 +0100)] 
Fix the tkey system test to allow parallel run

The tkey test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.

6 years agoFix the eddsa system test to allow parallel run
Ondřej Surý [Wed, 18 Mar 2020 14:30:56 +0000 (15:30 +0100)] 
Fix the eddsa system test to allow parallel run

The eddsa test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.

6 years agoFix the ecdsa system test to allow parallel run
Ondřej Surý [Wed, 18 Mar 2020 14:24:15 +0000 (15:24 +0100)] 
Fix the ecdsa system test to allow parallel run

The ecdsa test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.

6 years agoMerge branch '1679-remove-workaround-for-systems-with-broken-gettimeofday-system...
Ondřej Surý [Thu, 19 Mar 2020 08:34:49 +0000 (08:34 +0000)] 
Merge branch '1679-remove-workaround-for-systems-with-broken-gettimeofday-system-calls' into 'master'

Remove Solaris 2.8 broken gettimeofday() workaround

Closes #1679

See merge request isc-projects/bind9!3238

6 years agoUse clock_gettime() instead of gettimeofday() for isc_stdtime function
Ondřej Surý [Mon, 16 Mar 2020 08:58:30 +0000 (09:58 +0100)] 
Use clock_gettime() instead of gettimeofday() for isc_stdtime function

This also removes Solaris 2.8 broken gettimeofday() workaround

6 years agoMerge branch '4-gitlab-ci.yml-improvement' into 'master'
Ondřej Surý [Wed, 18 Mar 2020 11:51:59 +0000 (11:51 +0000)] 
Merge branch '4-gitlab-ci.yml-improvement' into 'master'

Improve GitLab CI configuration

See merge request isc-projects/bind9!3254

6 years agoRename MAKE environment variable to MAKE_COMMAND
Ondřej Surý [Tue, 7 Aug 2018 14:46:53 +0000 (16:46 +0200)] 
Rename MAKE environment variable to MAKE_COMMAND

The environment variable MAKE has been replaced with MAKE_COMMAND,
because overriding MAKE variable also changed the definition of the MAKE
inside the Makefiles, and we want only a single wrapper around the whole
build process.

Previously, setting `MAKE` to `bear make` meant that `bear make` would
be run at every nested make invocation, which messed up the upcoming
automake transition as compile_commands.json would be generated in every
subdirectory instead of just having one central file at the top of the
build tree.

6 years agoRemove cppcheck arm64 job
Ondřej Surý [Tue, 7 Aug 2018 14:46:53 +0000 (16:46 +0200)] 
Remove cppcheck arm64 job

All *:sid:amd64 jobs were errorneously copied to *:sid:arm64 including
the extra cppcheck run.  Remove the extra definitions from arm64 jobs.

6 years agoReplace dependencies+needs with needs+artifacts in GitLabCI config
Ondřej Surý [Tue, 7 Aug 2018 14:46:53 +0000 (16:46 +0200)] 
Replace dependencies+needs with needs+artifacts in GitLabCI config

All jobs now use solely the newer needs configuration to declare
dependencies between jobs:

    needs:
      - job: <foo>
        artifacts: true

instead of combination of dependencies and needs which is deprecated.
This change completely unbundles the stages (alas the stages still needs
to stay because the job graph has to stay acyclic between the stages).

6 years agoMerge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock' into 'master'
Ondřej Surý [Wed, 18 Mar 2020 11:50:39 +0000 (11:50 +0000)] 
Merge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock' into 'master'

Use isc_rwlock to lock .logconfig member of isc_log_t

Closes #1675

See merge request isc-projects/bind9!3229

6 years agoUse isc_rwlock to lock .logconfig member of isc_log_t
Ondřej Surý [Fri, 13 Mar 2020 14:16:14 +0000 (15:16 +0100)] 
Use isc_rwlock to lock .logconfig member of isc_log_t

In isc_log_woudlog() the .logconfig member of isc_log_t structure was
accessed unlocked on the merit that there could be just a race when
.logconfig would be NULL, so the message would not be logged.  This
turned not to be true, as there's also data race deeper.  The accessed
isc_logconfig_t object could be in the middle of destruction, so the
pointer would be still non-NULL, but the structure members could point
to a chunk of memory no longer belonging to the object.  Since we are
only accessing integer types (the log level), this would never lead to
a crash, it leads to memory access to memory area no longer belonging to
the object and this a) wrong, b) raises a red flag in thread-safety tools.

6 years agoMerge branch 'marka-memget-cannot-fail-logging' into 'master'
Ondřej Surý [Wed, 18 Mar 2020 10:34:28 +0000 (10:34 +0000)] 
Merge branch 'marka-memget-cannot-fail-logging' into 'master'

Cleanup logging API now that isc_mem_get cannot fail.

See merge request isc-projects/bind9!3252

6 years agoRefactor the isc_log API so it cannot fail on memory failures
Mark Andrews [Wed, 18 Mar 2020 03:17:55 +0000 (14:17 +1100)] 
Refactor the isc_log API so it cannot fail on memory failures

The isc_mem API now crashes on memory allocation failure, and this is
the next commit in series to cleanup the code that could fail before,
but cannot fail now, e.g. isc_result_t return type has been changed to
void for the isc_log API functions that could only return ISC_R_SUCCESS.

6 years agoMerge branch 'each-lgtm-fixes' into 'master'
Evan Hunt [Tue, 17 Mar 2020 22:18:10 +0000 (22:18 +0000)] 
Merge branch 'each-lgtm-fixes' into 'master'

fix LGTM warnings

See merge request isc-projects/bind9!3200

6 years agoAdd C11 localtime_r and gmtime_r shims for Windows
Ondřej Surý [Fri, 13 Mar 2020 07:38:37 +0000 (08:38 +0100)] 
Add C11 localtime_r and gmtime_r shims for Windows

On Windows, C11 localtime_r() and gmtime_r() functions are not
available.  While localtime() and gmtime() functions are already thread
safe because they use Thread Local Storage, it's quite ugly to #ifdef
around every localtime_r() and gmtime_r() usage to make the usage also
thread-safe on POSIX platforms.

The commit adds wrappers around Windows localtime_s() and gmtime_s()
functions.

NOTE: The implementation of localtime_s and gmtime_s in Microsoft CRT
are incompatible with the C standard since it has reversed parameter
order and errno_t return type.

6 years agosilence a warning about unsafe snprintf() call
Evan Hunt [Tue, 10 Mar 2020 03:51:21 +0000 (20:51 -0700)] 
silence a warning about unsafe snprintf() call

6 years agoclean up dead code
Evan Hunt [Tue, 10 Mar 2020 03:01:29 +0000 (20:01 -0700)] 
clean up dead code

removed an if statement that always evaluated to false

6 years agoreplace unsafe ctime() and gmtime() function calls
Evan Hunt [Tue, 10 Mar 2020 01:52:33 +0000 (18:52 -0700)] 
replace unsafe ctime() and gmtime() function calls

This silences LGTM warnings that these functions are not thread-safe.

6 years agoremove or comment empty conditional branches
Evan Hunt [Tue, 10 Mar 2020 01:23:13 +0000 (18:23 -0700)] 
remove or comment empty conditional branches

some empty conditional branches which contained a semicolon were
"fixed" by clang-format to contain nothing. add comments to prevent this.

6 years agoMerge branch '1684-timer-test-build' into 'master'
Evan Hunt [Tue, 17 Mar 2020 20:10:02 +0000 (20:10 +0000)] 
Merge branch '1684-timer-test-build' into 'master'

fix a pointer-to-int cast error

Closes #1684

See merge request isc-projects/bind9!3246

6 years agofix a pointer-to-int cast error
Evan Hunt [Tue, 17 Mar 2020 18:18:36 +0000 (11:18 -0700)] 
fix a pointer-to-int cast error

6 years agoMerge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc...
Ondřej Surý [Tue, 17 Mar 2020 15:00:56 +0000 (15:00 +0000)] 
Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/md.h' into 'master'

Make isc_md API to not leak OpenSSL symbols

Closes #1672

See merge request isc-projects/bind9!3218

6 years agoStop leaking OpenSSL types and defines in the isc/md.h
Ondřej Surý [Thu, 12 Mar 2020 09:20:37 +0000 (10:20 +0100)] 
Stop leaking OpenSSL types and defines in the isc/md.h

The <isc/md.h> header directly included <openssl/evp.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.

While making the isc_md_type_t type opaque, the API using the data type
was changed to use the pointer to isc_md_type_t instead of using the
type directly.

6 years agoMerge branch '1682-dighost-c-idn_output_filter-has-off-by-one-error' into 'master'
Mark Andrews [Tue, 17 Mar 2020 04:43:46 +0000 (04:43 +0000)] 
Merge branch '1682-dighost-c-idn_output_filter-has-off-by-one-error' into 'master'

Resolve "dighost.c: idn_output_filter has off by one error"

Closes #1682

See merge request isc-projects/bind9!3243

6 years agoaddress off by one error in idn_output_filter
Mark Andrews [Tue, 17 Mar 2020 02:56:30 +0000 (13:56 +1100)] 
address off by one error in idn_output_filter

6 years agoMerge branch '1138-from-bugs-43718-extend-nsip-wait-recurse-or-add-nsdname-wait-recur...
Diego dos Santos Fronza [Mon, 16 Mar 2020 18:50:53 +0000 (18:50 +0000)] 
Merge branch '1138-from-bugs-43718-extend-nsip-wait-recurse-or-add-nsdname-wait-recurse' into 'master'

Resolve "From Bugs (#43718) : extend nsip-wait-recurse or add nsdname-wait-recurse"

Closes #1138

See merge request isc-projects/bind9!3134

6 years agoAdd CHANGES and release note
Diego Fronza [Wed, 11 Mar 2020 19:32:47 +0000 (16:32 -0300)] 
Add CHANGES and release note

6 years agoAdded nsdname-wait-recurse documentation to ARM
Diego Fronza [Wed, 11 Mar 2020 19:58:36 +0000 (16:58 -0300)] 
Added nsdname-wait-recurse documentation to ARM

6 years agoincidental fix: dnsrps test was failing
Evan Hunt [Thu, 12 Mar 2020 07:28:26 +0000 (00:28 -0700)] 
incidental fix: dnsrps test was failing

the test for logging of invalid prefixes doesn't work when running
with dnsrps; disable it in that case.

6 years agoAdded test for nsdname-wait-recurse option
Diego Fronza [Mon, 2 Mar 2020 18:16:34 +0000 (15:16 -0300)] 
Added test for nsdname-wait-recurse option

6 years agoAdded RPZ configuration option "nsdname-wait-recurse"
Diego Fronza [Mon, 2 Mar 2020 17:52:10 +0000 (14:52 -0300)] 
Added RPZ configuration option "nsdname-wait-recurse"

This new option was added to fill a gap in RPZ configuration
options.

It was possible to instruct BIND wheter NSIP rewritting rules would
apply or not, as long as the required data was already in cache or not,
respectively, by means of the option nsip-wait-recurse.

A value of yes (default) could incur a little processing cost, since
BIND would need to recurse to find NS addresses in case they were not in
the cache.

This behavior could be changed by setting nsip-wait-recurse value to no,
in which case BIND would promptly return some error code if the NS IP addresses
data were not in cache, then BIND would start a recursive query
in background, so future similar requests would have the required data
(NS IPs) in cache, allowing BIND to apply NSIP rules accordingly.

A similar feature wasn't available for NSDNAME triggers, so this commit
adds the option nsdname-wait-recurse to fill this gap, as it was
expected by couple BIND users.

6 years agoMerge branch 'michal/update-gitlab-ci-to-freebsd-12.1' into 'master'
Michał Kępień [Mon, 16 Mar 2020 10:33:31 +0000 (10:33 +0000)] 
Merge branch 'michal/update-gitlab-ci-to-freebsd-12.1' into 'master'

Update GitLab CI to FreeBSD 12.1

See merge request isc-projects/bind9!3180

6 years agoMove FreeBSD CI jobs to libvirt-based executors
Michał Kępień [Mon, 16 Mar 2020 10:32:46 +0000 (11:32 +0100)] 
Move FreeBSD CI jobs to libvirt-based executors

To get rid of the currently used FreeBSD-specific executor, move FreeBSD
CI jobs to libvirt-based executors.  Make the necessary tag and variable
adjustments.

6 years agoUpdate GitLab CI to FreeBSD 12.1
Michał Kępień [Mon, 16 Mar 2020 10:32:46 +0000 (11:32 +0100)] 
Update GitLab CI to FreeBSD 12.1

Since FreeBSD 12.1 is the current FreeBSD 12.x release, replace FreeBSD
12.0 GitLab CI jobs with their up-to-date counterparts.

6 years agoMerge branch '4-convert-lmdb-check-to-macro' into 'master'
Ondřej Surý [Mon, 16 Mar 2020 09:44:49 +0000 (09:44 +0000)] 
Merge branch '4-convert-lmdb-check-to-macro' into 'master'

Add AX_LIB_LMDB macro

See merge request isc-projects/bind9!3205