Commit Graph
29103 Commits
Author SHA1 Message Date
Michał Kępień fa989e4236 Use proper cmocka macros for pointer checks
Make sure pointer checks in unit tests use cmocka assertion macros
dedicated for use with pointers instead of those dedicated for use with
integers or booleans.

(cherry picked from commit f440600126)
2020-11-26 13:15:28 +01:00
Michał Kępień 5da3f59953 Merge branch 'v9_11_25-release' into 'v9_11'
[v9_11] Merge 9.11.25 release branch

See merge request isc-projects/bind9!4428
2020-11-26 11:39:33 +00:00
Michał Kępień 43bc51d502 Set up release notes for BIND 9.11.26 2020-11-26 12:37:08 +01:00
Michał Kępień 4776e3b27c Bump BIND_BASELINE_VERSION for ABI checks 2020-11-26 12:37:08 +01:00
Tinderbox UserandMichał Kępień 855c2689cb Merge branch 'prep-release' into v9_11_25-release 2020-11-26 12:33:58 +01:00
Michał Kępień 694c355ed6 Merge branch 'michal/prepare-release-notes-for-bind-9.11.25' into 'v9_11_25-release'
Prepare release notes for BIND 9.11.25

See merge request isc-private/bind9!222
2020-11-26 12:33:58 +01:00
Tinderbox UserandMichał Kępień 66faf3215c prep 9.11.25 2020-11-26 12:33:58 +01:00
Michał Kępień 588579f172 Prepare release notes for BIND 9.11.25 2020-11-26 12:33:58 +01:00
Michał Kępień 913a469182 Add release note for GL #2244 2020-11-26 12:33:58 +01:00
Michał Kępień cbcc61cf22 Add release note for GL #2236 2020-11-26 12:33:58 +01:00
Michał Kępień d07cb06823 Add release note for GL #1736 2020-11-26 12:33:58 +01:00
Michał Kępień 81b900cb86 Tweak and reword recent CHANGES entries 2020-11-26 12:33:58 +01:00
Michał Kępień f9a991b1a3 Merge branch 'michal/fix-cppcheck-2.2-issues-v9_11' into 'v9_11'
[v9_11] Fix cppcheck 2.2 issues

See merge request isc-projects/bind9!4414
2020-11-25 12:59:43 +00:00
Mark AndrewsandMichał Kępień c5fff690ad Remove now redundant check for state != NULL
(cherry picked from commit ee135d8946)
2020-11-25 13:42:12 +01:00
Michał Kępień 47c206f386 Silence cppcheck 2.2 false positive in udp_recv()
cppcheck 2.2 reports the following false positive:

    lib/dns/dispatch.c:1220:14: warning: Either the condition 'resp==NULL' is redundant or there is possible null pointer dereference: resp. [nullPointerRedundantCheck]
     if (disp != resp->disp) {
                 ^
    lib/dns/dispatch.c:1191:11: note: Assuming that condition 'resp==NULL' is not redundant
     if (resp == NULL) {
              ^
    lib/dns/dispatch.c:1220:14: note: Null pointer dereference
     if (disp != resp->disp) {
                 ^

Apparently this version of cppcheck gets confused about conditional
"goto" statements because line 1220 can never be reached if 'resp' is
NULL.

Move a code block to prevent the above false positive from being
reported without affecting the processing logic.

(cherry picked from commit 0b6216d1c7)
2020-11-25 13:42:12 +01:00
Michał Kępień 5055fc7385 Remove cppcheck 2.0 false positive workarounds
The cppcheck bug which commit 41b4af5d20
works around was fixed in cppcheck 2.2.  Drop the relevant hack from the
definition of the cppcheck GitLab CI job.

(cherry picked from commit f06dfe0397)
2020-11-25 13:42:12 +01:00
Michał Kępień 06f8ce0ac7 Merge branch 'michal/enable-stress-tests-to-be-run-on-demand-v9_11' into 'v9_11'
[v9_11] Enable "stress" tests to be run on demand

See merge request isc-projects/bind9!4409
2020-11-23 10:56:31 +00:00
Michał Kępień 7408ab8d1e Enable "stress" tests to be run on demand
The "stress" test can be run in different ways, depending on:

  - the tested scenario (authoritative, recursive),
  - the operating system used (Linux, FreeBSD),
  - the architecture used (amd64, arm64).

Currently, all supported "stress" test variants are automatically
launched for all scheduled pipelines and for pipelines started for tags;
there is no possibility of running these tests on demand, which could be
useful in certain circumstances.

Employ the "only:variables" key to enable fine-grained control over the
list of "stress" test jobs to be run for a given pipeline.  Three CI
variables are used to specify the list of "stress" test jobs to create:

  - BIND_STRESS_TEST_MODE: specifies the test mode to use; must be
    explicitly set in order for any "stress" test job to be created;
    allowed values are: "authoritative", "recursive",

  - BIND_STRESS_TEST_OS: specifies the operating system to run the test
    on; allowed values are: "linux", "freebsd"; defaults to "linux", may
    be overridden at pipeline creation time,

  - BIND_STRESS_TEST_ARCH: specifies the architecture to run the test
    on; allowed values are: "amd64", "arm64"; defaults to "amd64", may
    be overridden at pipeline creation time.

Since case-insensitive regular expressions are used for determining
which jobs to run, every variable described above may contain multiple
values.  For example, setting the BIND_STRESS_TEST_MODE variable to
"authoritative,recursive" will cause the "stress" test to be run in both
supported scenarios (either on the default OS/architecture combination,
i.e. Linux/amd64, or, if the relevant variables are explicitly
specified, the requested OS/architecture combinations).

(cherry picked from commit f23094223e)
2020-11-23 11:54:45 +01:00
Mark Andrews 646b831f04 Merge branch '2211-tsan-error-previous_closest_nsec-dns_rbt_findnode-vs-subtractrdataset-v9_11' into 'v9_11'
Address TSAN error between dns_rbt_findnode() and subtractrdataset().

See merge request isc-projects/bind9!4385
2020-11-10 22:37:47 +00:00
Mark Andrews 62158e1882 Address TSAN error between dns_rbt_findnode() and subtractrdataset().
Having dns_rbt_findnode() in previous_closest_nsec() check of
node->data is a optimisation that triggers a TSAN error with
subtractrdataset().  find_closest_nsec() still needs to check if
the NSEC record are active or not and look for a earlier NSEC records
if it isn't.  Set DNS_RBTFIND_EMPTYDATA so node->data isn't referenced
without the node lock being held.

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: read M1, read M2):
    #0 dns_rbt_findnode lib/dns/rbt.c:1708
    #1 previous_closest_nsec lib/dns/rbtdb.c:3760
    #2 find_closest_nsec lib/dns/rbtdb.c:3942
    #3 zone_find lib/dns/rbtdb.c:4091
    #4 dns_db_findext lib/dns/db.c:536
    #5 query_lookup lib/ns/query.c:5582
    #6 ns__query_start lib/ns/query.c:5505
    #7 query_setup lib/ns/query.c:5229
    #8 ns_query_start lib/ns/query.c:11380
    #9 ns__client_request lib/ns/client.c:2166
    #10 processbuffer netmgr/tcpdns.c:230
    #11 dnslisten_readcb netmgr/tcpdns.c:309
    #12 read_cb netmgr/tcp.c:832
    #13 <null> <null>
    #14 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M3):
    #0 subtractrdataset lib/dns/rbtdb.c:7133
    #1 dns_db_subtractrdataset lib/dns/db.c:742
    #2 diff_apply lib/dns/diff.c:368
    #3 dns_diff_apply lib/dns/diff.c:459
    #4 do_one_tuple lib/dns/update.c:247
    #5 update_one_rr lib/dns/update.c:275
    #6 delete_if_action lib/dns/update.c:689
    #7 foreach_rr lib/dns/update.c:471
    #8 delete_if lib/dns/update.c:716
    #9 dns_update_signaturesinc lib/dns/update.c:1948
    #10 receive_secure_serial lib/dns/zone.c:15637
    #11 dispatch lib/isc/task.c:1152
    #12 run lib/isc/task.c:1344
    #13 <null> <null>

    Location is heap block of size 130 at 0x000000000028 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 create_node lib/dns/rbt.c:2239
    #9 dns_rbt_addnode lib/dns/rbt.c:1202
    #10 dns_rbtdb_create lib/dns/rbtdb.c:8668
    #11 dns_db_create lib/dns/db.c:118
    #12 receive_secure_db lib/dns/zone.c:16154
    #13 dispatch lib/isc/task.c:1152
    #14 run lib/isc/task.c:1344
    #15 <null> <null>

    Mutex M1 (0x000000000040) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8527
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M2 (0x000000000044) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M3 (0x000000000046) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/rbt.c:1708 in dns_rbt_findnode

(cherry picked from commit 244f84a84b)
2020-11-11 08:25:55 +11:00
Michal Nowak a231e1e535 Merge branch 'mnowak/test-with-DDEBUG-v9_11' into 'v9_11'
[v9_11] Enable debug build on Tumbleweed in CI

See merge request isc-projects/bind9!4372
2020-11-10 16:31:25 +00:00
Michal Nowak c35170217d Enable debug build on Tumbleweed in CI
(cherry picked from commit 59a09b5db8)
(cherry picked from commit 271e6e3b6bc2697d3ed17e767cf9ffd650fcb9c6)
2020-11-10 17:30:35 +01:00
Michal Nowak e2e374d7ca Merge branch 'he32-test-fix-v9_11' into 'v9_11'
[v9_11] Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4380
2020-11-10 13:15:06 +00:00
Havard EidnesandMichal Nowak e73d2f6bbe Avoid a non-standard bashism: use of "==" in "test".
(cherry picked from commit 1f83daa4ac)
2020-11-10 14:13:57 +01:00
Mark Andrews f86f910486 Merge branch '2259-zone_namerd_tostr-called-w-o-lock-being-held-v9_11' into 'v9_11'
Lock zone before calling zone_namerd_tostr()

See merge request isc-projects/bind9!4378
2020-11-10 06:57:52 +00:00
Mark Andrews b2bccc68a5 Lock zone before calling zone_namerd_tostr()
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 inline_raw lib/dns/zone.c:1375
    #1 zone_namerd_tostr lib/dns/zone.c:15316
    #2 dns_zone_name lib/dns/zone.c:15391
    #3 xfrin_log lib/dns/xfrin.c:1605
    #4 xfrin_destroy lib/dns/xfrin.c:1477
    #5 dns_xfrin_detach lib/dns/xfrin.c:739
    #6 xfrin_connect_done lib/dns/xfrin.c:970
    #7 tcpdnsconnect_cb netmgr/tcpdns.c:786
    #8 tcp_connect_cb netmgr/tcp.c:292
    #9 <null> <null>
    #10 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M1):
    #0 zone_shutdown lib/dns/zone.c:14462
    #1 dispatch lib/isc/task.c:1152
    #2 run lib/isc/task.c:1344
    #3 <null> <null>

    Location is heap block of size 2769 at 0x000000000013 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 dns_zone_create lib/dns/zone.c:984
    #9 configure_zone bin/named/server.c:6502
    #10 do_addzone bin/named/server.c:13391
    #11 named_server_changezone bin/named/server.c:13788
    #12 named_control_docommand bin/named/control.c:207
    #13 control_command bin/named/controlconf.c:392
    #14 dispatch lib/isc/task.c:1152
    #15 run lib/isc/task.c:1344
    #16 <null> <null>

(cherry picked from commit 84f43903da)
2020-11-10 17:16:43 +11:00
Michał Kępień 5ce19734b9 Merge branch 'michal/miscellaneous-windows-tweaks-v9_11' into 'v9_11'
[v9_11] Miscellaneous Windows tweaks

See merge request isc-projects/bind9!4361
2020-11-05 14:13:44 +00:00
Michał Kępień 6dd6da17e4 Use "image" key in Windows GitLab CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key for
determining the Windows Docker image to use for a given CI job.  Update
.gitlab-ci.yml to reflect that change.

(cherry picked from commit 004ca913f2)
2020-11-05 15:09:13 +01:00
Mark Andrews 840995bdbd Merge branch '2244-nta-related-crash-after-reconfiguring-views-v9_11' into 'v9_11'
Resolve "NTA-related crash after reconfiguring views"

See merge request isc-projects/bind9!4353
2020-11-03 13:25:00 +00:00
Mark Andrews 9bc7076906 Add CHANGES for [GL #2244]
(cherry picked from commit 2ef0f252a8)
2020-11-03 23:50:43 +11:00
Mark Andrews ee53b9558f Call nta_detach() before dns_view_weakdetach() so view is available.
(cherry picked from commit ea956976d1)
2020-11-03 23:50:19 +11:00
Michał Kępień 11c7cc84e5 Merge branch 'mnowak/OpenBSD_6.8-v9_11' into 'v9_11'
[v9_11] Update to OpenBSD 6.8

See merge request isc-projects/bind9!4337
2020-10-30 10:23:50 +00:00
Michal NowakandMichał Kępień 9379beb21e Update to OpenBSD 6.8
(cherry picked from commit 773649f413)
2020-10-30 11:03:58 +01:00
Michał Kępień 27d1b5f3da Merge branch '2231-miscellaneous-backtrace-fixes-v9_11' into 'v9_11'
[v9_11] Miscellaneous backtrace fixes

See merge request isc-projects/bind9!4335
2020-10-30 08:59:39 +00:00
Michał Kępień 7f13c427a9 Fix getrbp()
The following compiler warning is emitted for the BACKTRACE_X86STACK
part of lib/isc/backtrace.c:

    backtrace.c: In function ‘getrbp’:
    backtrace.c:139:1: warning: no return statement in function returning non-void [-Wreturn-type]

While getrbp() stores the value of the RBP register in the RAX register
and thus does attempt to return a value, this is not enough for an
optimizing compiler to always produce the expected result.  With -O2,
the following machine code may be generated in isc_backtrace_gettrace():

    0x00007ffff7b0ff7a <+10>:	mov    %rbp,%rax
    0x00007ffff7b0ff7d <+13>:	mov    $0x17,%eax
    0x00007ffff7b0ff82 <+18>:	retq

The above is equivalent to:

    sp = (void **)getrbp();
    return (ISC_R_NOTFOUND);

and results in the backtrace never getting printed.

Fix by using an intermediate variable.  With this change in place, the
machine code generated with -O2 becomes something like:

    0x00007ffff7af5638 <+24>:	mov    $0x17,%eax
    0x00007ffff7af563d <+29>:	mov    %rbp,%rdx
    0x00007ffff7af5640 <+32>:	test   %rdx,%rdx
    0x00007ffff7af5643 <+35>:	je     0x7ffff7af56bd <isc_backtrace_gettrace+157>
    ...
    0x00007ffff7af56bd <+157>:	retq

(Note that this method of grabbing a stack trace is finicky anyway
because in order for RBP to be relied upon, -fno-omit-stack-frame must
be present among CFLAGS.)

(cherry picked from commit 923c443389)
2020-10-30 09:42:24 +01:00
Michał Kępień a51cde6ceb Check for _Unwind_Backtrace() support
Some operating systems (e.g. Linux, FreeBSD) provide the
_Unwind_Backtrace() function in libgcc_s.so, which is automatically
linked into any binary using the functions provided by that library.  On
OpenBSD, though, _Unwind_Backtrace() is provided by libc++abi.so, which
is not automatically linked into binaries produced by the stock system C
compiler.

Meanwhile, lib/isc/backtrace.c assumes that any GNU-compatible toolchain
allows _Unwind_Backtrace() to be used without any extra provisions in
the build system.  This causes build failures on OpenBSD (and possibly
other systems).

Instead of making assumptions, actually check for _Unwind_Backtrace()
support in the toolchain if the backtrace() function is unavailable.

(cherry picked from commit 10d7055791)
2020-10-30 09:42:24 +01:00
Michał Kępień c5d38c7a83 Merge branch '2228-fix-the-make-depend-check-in-gitlab-ci-v9_11' into 'v9_11'
[v9_11] Fix the "make depend" check in GitLab CI

See merge request isc-projects/bind9!4334
2020-10-30 08:02:35 +00:00
Michał Kępień e10eb5783b Do not test "make depend" for out-of-tree builds
The make/mkdep script does not understand the concept of generated
source files (like lib/dns/dnstap.pb-c.c), which prevents it from
working correctly for out-of-tree builds.  As "make depend" is not
required for building BIND and the "depend" make target was removed
altogether in the development branch, just prevent the "make depend"
check from being performed for out-of-tree builds in GitLab CI instead
of trying to add support for handling generated source files to
make/mkdep.

(cherry picked from commit 1b5a8a914c)
2020-10-30 08:53:46 +01:00
Michał Kępień f1045036cd Fix the "make depend" check in GitLab CI
"make depend" prints errors to stderr, not to stdout.  This means that
the check for "make depend" errors currently used in the definition of
every build job in GitLab CI could never fail.  Fix that check by
redirecting stderr to stdout.  Also employ tee to prevent the output of
"make depend" from being hidden in the job log.  (While using tee hides
the exit code of "make depend" itself, the next line still checks for
errors anyway.)

(cherry picked from commit 0ab099ca09)
2020-10-30 08:53:46 +01:00
Mark Andrews 8243534f4c Merge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey-as-bogus-v9_11' into 'v9_11'
Resolve "Resolver sometimes treats signed, insecure zone with broken DNSKEY as bogus"

See merge request isc-projects/bind9!4333
2020-10-29 22:26:02 +00:00
Mark Andrews 1b8b355ec5 Add CHANGES note for [GL #2236]
(cherry picked from commit decf117eb6)
2020-10-30 09:08:44 +11:00
Mark Andrews 8d2e091d46 Check that a zone in the process of being signed resolves
ans10 simulates a local anycast server which has both signed and
unsigned instances of a zone.  'A' queries get answered from the
signed instance.  Everything else gets answered from the unsigned
instance.  The resulting answer should be insecure.

(cherry picked from commit d7840f4b93)
2020-10-30 08:25:34 +11:00
Mark Andrews 4a4605fbef Handle DNS_R_NCACHENXRRSET in fetch_callback_{dnskey,validator}()
DNS_R_NCACHENXRRSET can be return when zones are in transition state
from being unsigned to signed and signed to unsigned.  The validation
should be resumed and should result in a insecure answer.

(cherry picked from commit 718e597def)
2020-10-30 08:25:03 +11:00
Michal Nowak 85fba4e36b Merge branch 'mnowak/add-freebsd12.2-v9_11' into 'v9_11'
[v9_11] Update to FreeBSD 12.2

See merge request isc-projects/bind9!4330
2020-10-29 15:42:58 +00:00
Michal Nowak 13a934df0b Update to FreeBSD 12.2
(cherry picked from commit 11ab0528d9)
2020-10-29 16:23:56 +01:00
Michal Nowak 70a241ce4c Merge branch 'mnowak/add-fedora-33-v9_11' into 'v9_11'
[v9_11] Add Fedora 33

See merge request isc-projects/bind9!4328
2020-10-29 15:19:20 +00:00
Michal Nowak 00326163ef Add Fedora 33
(cherry picked from commit 91e28d1fb4)
2020-10-29 15:56:35 +01:00
Evan Hunt c86849badd Merge branch 'each-rpz-test-typo-v9_11' into 'v9_11'
fix a typo in rpz test

See merge request isc-projects/bind9!4322
2020-10-29 06:04:27 +00:00
Evan Hunt c94559480e fix a typo in rpz test
"tcp-only" was not being tested correctly in the RPZ system test
because the option to the "digcmd" function that causes queries to
be sent via TCP was misspelled in one case, and was being interpreted
as a query name.

the "ckresult" function has also been changed to be case sensitive
for consistency with "digcmd".

(cherry picked from commit 78af071c11)
2020-10-28 22:42:37 -07:00
Michał Kępień 124b3e6f77 Merge branch '1764-address-make-depend-issues-v9_11' into 'v9_11'
address 'make depend' issues

See merge request isc-projects/bind9!4317
2020-10-28 10:02:09 +00:00