Commit Graph

31227 Commits

Author SHA1 Message Date
Evan Hunt
a288dee81e 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.

(cherry picked from commit 32da119ed8)
2020-04-01 01:32:55 -07:00
Mark Andrews
4e32fd130f Merge branch 'marka-empty-release-notes-v9_16' into 'v9_16'
add empty release notes for 9.16.2

See merge request isc-projects/bind9!3314
2020-03-31 07:07:20 +00:00
Mark Andrews
657ad6de31 add empty release notes for 9.16.2
(cherry picked from commit 503e2dff64)
2020-03-31 17:12:03 +11:00
Witold Krecicki
df93653818 Merge branch '1700-proper-tcp-resuming-v9_16' into 'v9_16'
Deactivate the handle before sending the async close callback.

See merge request isc-projects/bind9!3310
2020-03-30 12:57:50 +00:00
Witold Kręcicki
3274650123 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.
2020-03-30 10:54:12 +00:00
Witold Krecicki
52ae7bf603 Merge branch 'wpk/quota-callback-v9_16' into 'v9_16'
Add a quota attach function with a callback, some code cleanups.

See merge request isc-projects/bind9!3309
2020-03-30 10:30:23 +00:00
Witold Kręcicki
7ab77d009d 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.

(cherry picked from commit d151a10f30)
2020-03-30 10:29:33 +02:00
Mark Andrews
a5ec7f9c83 Merge branch '1678-bind-fails-to-build-with-mysql-support-against-mysql8-mysql-connector-8-v9_16' into 'v9_16'
Resolve "BIND fails to build with MYSQL support against mysql8/mysql-connector-8"

See merge request isc-projects/bind9!3305
2020-03-26 23:21:58 +00:00
Ondřej Surý
2f3272ef86 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.

(cherry picked from commit 715b7a7cec)
2020-03-27 09:05:46 +11:00
Mark Andrews
3387fa03e4 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.

(cherry picked from commit c6d5d5c88f)
2020-03-27 09:05:46 +11:00
Mark Andrews
5f6b54927e remove unused variable
(cherry picked from commit 7af9883b48)
2020-03-27 09:05:46 +11:00
Michał Kępień
4bade7774a Merge branch 'michal/misc-gitlab-ci-yml-cleanups-v9_16' into 'v9_16'
[v9_16] Miscellaneous .gitlab-ci.yml cleanups

See merge request isc-projects/bind9!3300
2020-03-26 10:43:11 +00:00
Michał Kępień
7910702fec Remove unused YAML anchors
Some YAML anchors defined in .gitlab-ci.yml are not subsequently used.
Remove them to prevent confusion.

(cherry picked from commit 3d121ede6c)
2020-03-26 11:41:55 +01:00
Michał Kępień
688b759ed0 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.

(cherry picked from commit 3d264dbe81)
2020-03-26 11:41:55 +01:00
Michał Kępień
89ef138ba6 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.

(cherry picked from commit 0c898084cd)
2020-03-26 11:41:55 +01:00
Michał Kępień
6044f6d73d 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.

(cherry picked from commit 84463f33bf)
2020-03-26 11:41:55 +01:00
Michał Kępień
536704c749 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.

(cherry picked from commit 6ebce9425e)
2020-03-26 11:41:55 +01:00
Michał Kępień
873cefc8c9 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.

(cherry picked from commit a9aa295f1f)
2020-03-26 11:41:54 +01:00
Michał Kępień
0c726127f7 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.

(cherry picked from commit 8ef01c7b50)
2020-03-26 11:41:54 +01:00
Michał Kępień
b358cf30b2 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.

(cherry picked from commit 6325c0993a)
2020-03-26 11:41:54 +01:00
Ondřej Surý
f24de93e80 Merge branch '1679-fix-the-tv_nsec_check-v9_16' into 'v9_16'
Fix the tv_nsec check in isc_stdtime_get() (v9.16)

See merge request isc-projects/bind9!3293
2020-03-25 22:00:24 +00:00
Ondřej Surý
e017574b74 Correct the typecast of .tv_sec in isc_stdtime_get() 2020-03-25 22:10:10 +01:00
Ondřej Surý
2bb2a10ba4 Fix the tv_nsec check in isc_stdtime_get()
(cherry picked from commit 0d06a62dd1)
2020-03-25 21:19:55 +01:00
Ondřej Surý
7e79134ec0 Merge branch 'ondrej/no-clang-on-debian-sid-v9_16' into 'v9_16'
Rewrite .gitlab-ci.yml to have 'base_image' and other GitLab CI improvements (v9.16)

See merge request isc-projects/bind9!3288
2020-03-25 17:29:25 +00:00
Ondřej Surý
71c5f29573 Replace clang:stretch:amd64 build with clang:buster:amd64 build (+ add missing system test)
(cherry picked from commit 281531d82b)
2020-03-25 18:12:39 +01:00
Ondřej Surý
691c8f6828 Replace bear with compiledb and drop MAKE_COMMAND because we don't need it
(cherry picked from commit ec72d1100d)
2020-03-25 18:12:38 +01:00
Ondřej Surý
591732e64c 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

(cherry picked from commit 5f5721aa11)
2020-03-25 18:12:38 +01:00
Ondřej Surý
206d3841df Merge branch 'ondrej/scan-build-10-fixes-v9_16' into 'v9_16'
Ondrej/scan build 10 fixes v9 16

See merge request isc-projects/bind9!3286
2020-03-25 17:10:21 +00:00
Ondřej Surý
0fdc09efb6 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

(cherry picked from commit ddd0d356e5)
2020-03-25 18:06:29 +01:00
Ondřej Surý
230d250b3d 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.

(cherry picked from commit 262f087bcf)
2020-03-25 18:06:29 +01:00
Ondřej Surý
0db685ed43 Merge branch 'ondrej/remove-debian-jessie-from-gitlab-ci-v9_16' into 'v9_16'
Remove Debian 8 ("Jessie") from the GitLab CI

See merge request isc-projects/bind9!3282
2020-03-25 06:03:45 +00:00
Ondřej Surý
ed3dd7d67e 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.

(cherry picked from commit 75f46cc3d1)
2020-03-24 14:51:33 +01:00
Mark Andrews
c04d7c28bb Merge branch '1698-converting-isc_log-to-rwlock-broke-windows-v9_16' into 'v9_16'
Used to the correct unlock type (read)

See merge request isc-projects/bind9!3277
2020-03-24 05:04:28 +00:00
Mark Andrews
0b13677f7f Used to the correct unlock type (read)
(cherry picked from commit b7dbfd14d8)
2020-03-24 15:44:06 +11:00
Ondřej Surý
6aebc6c207 Merge branch '4-gitlab-ci.yml-improvement-v9_16' into 'v9_16'
Improve GitLab CI configuration [v9.16]

See merge request isc-projects/bind9!3259
2020-03-20 15:13:43 +00:00
Ondřej Surý
b1475b1ffd 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.

(cherry picked from commit de1a637a69)
2020-03-20 16:07:11 +01:00
Ondřej Surý
a872f0270a 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.

(cherry picked from commit 99f9e2c53e)
2020-03-20 16:07:11 +01:00
Ondřej Surý
7a296c60e1 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).

(cherry picked from commit 66ba808c1b)
2020-03-20 16:07:11 +01:00
Michal Nowak
8d46aba685 Merge branch 'mnowak/abi-tracker-helper-v9.17.0-v9_16' into 'v9_16'
[v9_16] Bump BIND baseline version for abi-check

See merge request isc-projects/bind9!3270
2020-03-20 12:12:26 +00:00
Michal Nowak
5fae0df7ee Bump BIND baseline version for abi-check
(cherry picked from commit 3730d59bf9)
2020-03-20 13:10:41 +01:00
Matthijs Mekking
3a13a96169 Merge branch 'v9_16_1-release' into 'v9_16'
Apply 9.16.1 release branch

See merge request isc-projects/bind9!3263
2020-03-20 11:29:29 +00:00
Tinderbox User
ecfea36b72 Update changes after QA review 2020-03-20 11:47:02 +01:00
Tinderbox User
d2c4cfcf1f regen v9_16 2020-03-20 11:47:02 +01:00
Tinderbox User
aed7d77c97 prep 9.16.1
Updated version and CHANGES files with new release number.

Check the API files:
- lib/bind9/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/dns/api:
  Function dns_acl_match changed, struct dns_badcache changed,
  function dns_badcache_add changed, function dns_clent_startupdate
  changed, struct dns_compress changed, struct dns_resolver changed,
  rwlock size changed. This means a LIBINTERFACE increment.
- lib/irs/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/isc/api:
  The structs isc__networker and isc_nmsocket changed. This means
  increment LIBINTERFACE.  The functions isc_uv_export and
  isc_uv_import are removed, so LIBAGE must beq zero.
- lib/isccc/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/isccfg/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/ns/api:
  Function ns_clientmgr_create, ns_interfacemgr_create, and
  structs ns_clientmgr, ns_interface, ns_interfacemgr changed:
  increment LIBINTERFACE.

No need to update README or release notes.

Updated CHANGES: Add GitLab MR reference to entry 5357. Remove
merge conflict gone wrong ("max-ixfr-ratio" is not in 9.16).

Add /util/check-make-install.in to .gitattributes.
2020-03-20 11:47:01 +01:00
Michal Nowak
2bddcc9e2b Merge branch 'mnowak/unit-test-debugging-enhancements-v9_16' into 'v9_16'
[v9_16] Enhance unit test debugging

See merge request isc-projects/bind9!3267
2020-03-20 10:37:43 +00:00
Michal Nowak
94fa27e43f 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.

(cherry picked from commit 8fad74e0e5)
2020-03-20 10:55:09 +01:00
Ondřej Surý
509a06f7b0 Merge branch '1679-remove-workaround-for-systems-with-broken-gettimeofday-system-calls-v9_16' into 'v9_16'
Use clock_gettime() instead of gettimeofday() for isc_stdtime function

See merge request isc-projects/bind9!3258
2020-03-20 09:46:54 +00:00
Ondřej Surý
0345dac44c Use clock_gettime() instead of gettimeofday() for isc_stdtime function
This also removes Solaris 2.8 broken gettimeofday() workaround

(cherry picked from commit e691b89a9a)
2020-03-19 10:17:26 +01:00
Ondřej Surý
2de447b088 Merge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock-v9_16' into 'v9_16'
Use isc_rwlock to lock .logconfig member of isc_log_t

See merge request isc-projects/bind9!3256
2020-03-18 12:48:13 +00:00
Ondřej Surý
11a6ac594a 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.

(cherry picked from commit 4d58856ff7)
2020-03-18 13:25:28 +01:00