]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoMerge branch '2244-nta-related-crash-after-reconfiguring-views-v9_11' into 'v9_11'
Mark Andrews [Tue, 3 Nov 2020 13:25:00 +0000 (13:25 +0000)] 
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

5 years agoAdd CHANGES for [GL #2244]
Mark Andrews [Tue, 3 Nov 2020 00:30:05 +0000 (11:30 +1100)] 
Add CHANGES for [GL #2244]

(cherry picked from commit 2ef0f252a8a6baecdff61d927d4583e6da879f30)

5 years agoCall nta_detach() before dns_view_weakdetach() so view is available.
Mark Andrews [Tue, 3 Nov 2020 00:25:55 +0000 (11:25 +1100)] 
Call nta_detach() before dns_view_weakdetach() so view is available.

(cherry picked from commit ea956976d1e89f49570a4690fbad377e4f607c77)

5 years agoMerge branch 'mnowak/OpenBSD_6.8-v9_11' into 'v9_11'
Michał Kępień [Fri, 30 Oct 2020 10:23:50 +0000 (10:23 +0000)] 
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

5 years agoUpdate to OpenBSD 6.8
Michal Nowak [Mon, 19 Oct 2020 07:45:47 +0000 (09:45 +0200)] 
Update to OpenBSD 6.8

(cherry picked from commit 773649f413192ce974f49aa625fd7525674fa09b)

5 years agoMerge branch '2231-miscellaneous-backtrace-fixes-v9_11' into 'v9_11'
Michał Kępień [Fri, 30 Oct 2020 08:59:39 +0000 (08:59 +0000)] 
Merge branch '2231-miscellaneous-backtrace-fixes-v9_11' into 'v9_11'

[v9_11] Miscellaneous backtrace fixes

See merge request isc-projects/bind9!4335

5 years agoFix getrbp()
Michał Kępień [Fri, 30 Oct 2020 08:12:50 +0000 (09:12 +0100)] 
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 923c443389b1d3b8d904c5bfe71f2bb1c8f5454e)

5 years agoCheck for _Unwind_Backtrace() support
Michał Kępień [Fri, 30 Oct 2020 08:12:50 +0000 (09:12 +0100)] 
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 10d705579189c6f4363bc2a85a0b559a6fbcb264)

5 years agoMerge branch '2228-fix-the-make-depend-check-in-gitlab-ci-v9_11' into 'v9_11'
Michał Kępień [Fri, 30 Oct 2020 08:02:35 +0000 (08:02 +0000)] 
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

5 years agoDo not test "make depend" for out-of-tree builds
Michał Kępień [Fri, 30 Oct 2020 07:49:16 +0000 (08:49 +0100)] 
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 1b5a8a914c15488d85977bd3e2ea8af1090f2343)

5 years agoFix the "make depend" check in GitLab CI
Michał Kępień [Fri, 30 Oct 2020 07:49:16 +0000 (08:49 +0100)] 
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 0ab099ca09bc026f92a836a17648032d617a420e)

5 years agoMerge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey...
Mark Andrews [Thu, 29 Oct 2020 22:26:02 +0000 (22:26 +0000)] 
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

5 years agoAdd CHANGES note for [GL #2236]
Mark Andrews [Wed, 28 Oct 2020 01:09:06 +0000 (12:09 +1100)] 
Add CHANGES note for [GL #2236]

(cherry picked from commit decf117eb6c34c51481e9a5fa1abef66e19054eb)

5 years agoCheck that a zone in the process of being signed resolves
Mark Andrews [Wed, 28 Oct 2020 05:40:36 +0000 (16:40 +1100)] 
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 d7840f4b9323938903024f9d3094c99bc9519156)

5 years agoHandle DNS_R_NCACHENXRRSET in fetch_callback_{dnskey,validator}()
Mark Andrews [Wed, 28 Oct 2020 00:58:38 +0000 (11:58 +1100)] 
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 718e597def1daaae7edf9b151f6b24e0acc5c87a)

5 years agoMerge branch 'mnowak/add-freebsd12.2-v9_11' into 'v9_11'
Michal Nowak [Thu, 29 Oct 2020 15:42:58 +0000 (15:42 +0000)] 
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

5 years agoUpdate to FreeBSD 12.2
Michal Nowak [Thu, 29 Oct 2020 09:19:50 +0000 (10:19 +0100)] 
Update to FreeBSD 12.2

(cherry picked from commit 11ab0528d9de3d046defa26833735a75e2916de7)

5 years agoMerge branch 'mnowak/add-fedora-33-v9_11' into 'v9_11'
Michal Nowak [Thu, 29 Oct 2020 15:19:20 +0000 (15:19 +0000)] 
Merge branch 'mnowak/add-fedora-33-v9_11' into 'v9_11'

[v9_11] Add Fedora 33

See merge request isc-projects/bind9!4328

5 years agoAdd Fedora 33
Michal Nowak [Mon, 19 Oct 2020 07:43:25 +0000 (09:43 +0200)] 
Add Fedora 33

(cherry picked from commit 91e28d1fb4907329370862055d57ad58d3b69c39)

5 years agoMerge branch 'each-rpz-test-typo-v9_11' into 'v9_11'
Evan Hunt [Thu, 29 Oct 2020 06:04:27 +0000 (06:04 +0000)] 
Merge branch 'each-rpz-test-typo-v9_11' into 'v9_11'

fix a typo in rpz test

See merge request isc-projects/bind9!4322

5 years agofix a typo in rpz test
Evan Hunt [Thu, 29 Oct 2020 01:01:49 +0000 (18:01 -0700)] 
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 78af071c11d21e2ce18ae2af0b384548c65a47e0)

5 years agoMerge branch '1764-address-make-depend-issues-v9_11' into 'v9_11'
Michał Kępień [Wed, 28 Oct 2020 10:02:09 +0000 (10:02 +0000)] 
Merge branch '1764-address-make-depend-issues-v9_11' into 'v9_11'

address 'make depend' issues

See merge request isc-projects/bind9!4317

5 years agoaddress 'make depend' issues
Mark Andrews [Fri, 17 Apr 2020 03:19:05 +0000 (13:19 +1000)] 
address 'make depend' issues

(cherry picked from commit 06fa0d7b4ed65b269e4b4fa3190914238bc7772f)

5 years agoMerge branch 'mnowak/test-coverage-visualization-v9_11' into 'v9_11'
Michal Nowak [Tue, 27 Oct 2020 15:56:05 +0000 (15:56 +0000)] 
Merge branch 'mnowak/test-coverage-visualization-v9_11' into 'v9_11'

[v9_11] Enable Test Coverage Visualization for merge requests

See merge request isc-projects/bind9!4315

5 years agoEnable Test Coverage Visualization for merge requests
Michal Nowak [Thu, 22 Oct 2020 07:36:17 +0000 (09:36 +0200)] 
Enable Test Coverage Visualization for merge requests

This feature allows GitLab to visualize test coverage information in the
file diff view of merge requests.

This commit makes the gcov CI job depend on the following chain of jobs:

    gcc:buster:amd64 → unit:gcc:buster:amd64 → system:gcc:buster:amd64

The reason for running the last two jobs above sequentially rather than
in parallel is that both of them create *.gcda files (containing
coverage data) in the same locations.  While some way of merging these
files from different job artifact archives could probably be designed
with the help of additional tools, the simplest thing to do is not to
run unit test and system test jobs in parallel, carrying *.gcda files
over between jobs as gcov knows how to append coverage data to existing
*.gcda files.

Also note that test coverage will not be visualized if any of the jobs
in the above dependency chain fails (because the gcov job will not be
run).

(cherry picked from commit 2dabf328c406036e012a9b0b30ed952785565d51)

5 years agoMerge branch 'mnowak/add-stress-test-to-CI-v9_11' into 'v9_11'
Michal Nowak [Mon, 26 Oct 2020 17:19:04 +0000 (17:19 +0000)] 
Merge branch 'mnowak/add-stress-test-to-CI-v9_11' into 'v9_11'

[v9_11] Add "stress" tests to GitLab CI

See merge request isc-projects/bind9!4308

5 years agoAdd "stress" tests to GitLab CI
Michal Nowak [Tue, 16 Jun 2020 12:19:41 +0000 (14:19 +0200)] 
Add "stress" tests to GitLab CI

Run "stress" tests for scheduled pipelines and pipelines created for
tags.  These tests were previously only performed manually (as part of
pre-release testing of each new BIND version).  Their purpose is to
detect memory leaks and potential performance issues.

As the run time of each "stress" test itself is set to 1 hour, set the
GitLab CI job timeout to 2 hours in order to account for the extra time
needed to set the test up and gather its results.

(cherry picked from commit 39305411e85fb4423b6b8248d4c69a9003cd16e8)
(cherry picked from commit 06f721fdc521423869e467d0f2416a9cdd3d947f)

5 years agoMerge branch 'mnowak/openbsd-fix-gdb-in-system-test-v9_11' into 'v9_11'
Michal Nowak [Mon, 26 Oct 2020 17:00:40 +0000 (17:00 +0000)] 
Merge branch 'mnowak/openbsd-fix-gdb-in-system-test-v9_11' into 'v9_11'

[v9_11] Fix system test backtrace generation on OpenBSD

See merge request isc-projects/bind9!4305

5 years agoFix system test backtrace generation on OpenBSD
Michal Nowak [Mon, 19 Oct 2020 11:33:32 +0000 (13:33 +0200)] 
Fix system test backtrace generation on OpenBSD

On Linux core dump contains absolute path to crashed binary

    Core was generated by `/home/newman/isc/ws/bind9/bin/named/.libs/lt-named -D glue-ns1 -X named.lock -m'.

However, on OpenBSD there's only a basename

    Core was generated by `named'.

This commit adds support for the latter, retains the former.

(cherry picked from commit f0b13873a3efd873c4b070fc2a0fedcbf7a9dc31)
(cherry picked from commit 659feff9630c6894069815c14a29c6928c24ab0d)

5 years agoMerge branch '1736-stub-zone-foiled-by-minimal-responses-v9_11' into 'v9_11'
Diego dos Santos Fronza [Mon, 26 Oct 2020 15:17:28 +0000 (15:17 +0000)] 
Merge branch '1736-stub-zone-foiled-by-minimal-responses-v9_11' into 'v9_11'

Resolve "stub zone foiled by minimal-responses"

See merge request isc-projects/bind9!4284

5 years agoUpdate copyrights
Diego Fronza [Thu, 22 Oct 2020 15:27:35 +0000 (12:27 -0300)] 
Update copyrights

5 years agoAdd CHANGES entry
Diego Fronza [Wed, 21 Oct 2020 19:51:30 +0000 (16:51 -0300)] 
Add CHANGES entry

5 years agoAdjusted additional system test (NS, non-root zone)
Diego Fronza [Wed, 21 Oct 2020 19:49:25 +0000 (16:49 -0300)] 
Adjusted additional system test (NS, non-root zone)

After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.

5 years agoAdded test for the proposed fix
Diego Fronza [Thu, 10 Sep 2020 18:33:15 +0000 (15:33 -0300)] 
Added test for the proposed fix

This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.

5 years agoAlways return address records in additional section for NS queries
Diego Fronza [Wed, 21 Oct 2020 19:47:11 +0000 (16:47 -0300)] 
Always return address records in additional section for NS queries

5 years agoFix transfer of glue records in stub zones if master has minimal-responses set
Diego Fronza [Wed, 21 Oct 2020 19:37:59 +0000 (16:37 -0300)] 
Fix transfer of glue records in stub zones if master has minimal-responses set

Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.

5 years agoMerge branch '2226-tsan-error-in-dispatch-c-v9_11' into 'v9_11'
Mark Andrews [Fri, 23 Oct 2020 21:39:06 +0000 (21:39 +0000)] 
Merge branch '2226-tsan-error-in-dispatch-c-v9_11' into 'v9_11'

Hold qid->lock when calling deref_portentry() as

See merge request isc-projects/bind9!4303

5 years agoHold qid->lock when calling deref_portentry() as
Mark Andrews [Thu, 22 Oct 2020 05:13:06 +0000 (16:13 +1100)] 
Hold qid->lock when calling deref_portentry() as

socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>

(cherry picked from commit 5c253c416d0bc0cce7606667c6703f44a98e9494)

5 years agoMerge branch '2215-dns_zoneflag_noixfr-is-misnamed-v9_11' into 'v9_11'
Mark Andrews [Fri, 23 Oct 2020 13:59:48 +0000 (13:59 +0000)] 
Merge branch '2215-dns_zoneflag_noixfr-is-misnamed-v9_11' into 'v9_11'

DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR

See merge request isc-projects/bind9!4301

5 years agoDNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR
Mark Andrews [Thu, 22 Oct 2020 04:03:59 +0000 (15:03 +1100)] 
DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR

(cherry picked from commit 3a044444bd5dcb0d3e3ba03fcfba8860ba5a1516)

5 years agoMerge branch 'michal/test-a-disable-atomic-build-in-gitlab-ci' into 'v9_11'
Michał Kępień [Thu, 22 Oct 2020 13:08:48 +0000 (13:08 +0000)] 
Merge branch 'michal/test-a-disable-atomic-build-in-gitlab-ci' into 'v9_11'

Test a --disable-atomic build in GitLab CI

See merge request isc-projects/bind9!4280

5 years agoTest a --disable-atomic build in GitLab CI
Michał Kępień [Thu, 22 Oct 2020 13:03:31 +0000 (15:03 +0200)] 
Test a --disable-atomic build in GitLab CI

Extend GitLab CI with build and test jobs utilizing the --disable-atomic
configure switch as it is used to work around broken atomics support in
certain build toolchains.

5 years agoMerge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests-v9_11' into...
Michal Nowak [Thu, 22 Oct 2020 10:50:33 +0000 (10:50 +0000)] 
Merge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests-v9_11' into 'v9_11'

[v9_11] Ensure use of "echo_i" where possible

See merge request isc-projects/bind9!4291

5 years agoEnsure use of "echo_i" where possible
Michal Nowak [Thu, 15 Oct 2020 14:27:30 +0000 (16:27 +0200)] 
Ensure use of "echo_i" where possible

In many instances 'echo "I:' construct was used where echo_i function
should have been.

5 years agoMerge branch 'v9_11_24-release' into 'v9_11'
Michał Kępień [Thu, 22 Oct 2020 07:29:52 +0000 (07:29 +0000)] 
Merge branch 'v9_11_24-release' into 'v9_11'

Merge 9.11.24 release branch

See merge request isc-projects/bind9!4289

5 years agoSet up release notes for BIND 9.11.25
Michał Kępień [Thu, 22 Oct 2020 07:27:36 +0000 (09:27 +0200)] 
Set up release notes for BIND 9.11.25

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Thu, 22 Oct 2020 07:27:36 +0000 (09:27 +0200)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoBump BIND_BASELINE_VERSION for respdiff tests
Michał Kępień [Thu, 22 Oct 2020 07:27:36 +0000 (09:27 +0200)] 
Bump BIND_BASELINE_VERSION for respdiff tests

5 years agoMerge branch 'prep-release' into v9_11_24-release
Tinderbox User [Tue, 13 Oct 2020 11:00:08 +0000 (11:00 +0000)] 
Merge branch 'prep-release' into v9_11_24-release

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.11.24' into 'v9_11_24-release'
Michał Kępień [Tue, 13 Oct 2020 10:33:25 +0000 (10:33 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.11.24' into 'v9_11_24-release'

Prepare release notes for BIND 9.11.24

See merge request isc-private/bind9!218

5 years agoprep 9.11.24
Tinderbox User [Tue, 13 Oct 2020 10:59:30 +0000 (10:59 +0000)] 
prep 9.11.24

5 years agoPrepare release notes for BIND 9.11.24
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Prepare release notes for BIND 9.11.24

5 years agoTweak and reword release notes
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMerge branch '2195-freebsd-dnstap-system-test-failure-v9_11' into 'v9_11'
Diego dos Santos Fronza [Tue, 20 Oct 2020 14:32:48 +0000 (14:32 +0000)] 
Merge branch '2195-freebsd-dnstap-system-test-failure-v9_11' into 'v9_11'

Fix dnstap system test on FreeBSD

See merge request isc-projects/bind9!4276

5 years agoFix dnstap system test on FreeBSD
Diego Fronza [Thu, 1 Oct 2020 17:04:05 +0000 (14:04 -0300)] 
Fix dnstap system test on FreeBSD

This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.

5 years agoMerge branch 'marka-fix-not-enough-categories-v9_11' into 'v9_11'
Mark Andrews [Thu, 15 Oct 2020 01:57:54 +0000 (01:57 +0000)] 
Merge branch 'marka-fix-not-enough-categories-v9_11' into 'v9_11'

Drop the expected minimum number of buckets to 4.

See merge request isc-projects/bind9!4266

5 years agoDrop the expected minimum number of buckets to 4.
Mark Andrews [Fri, 2 Oct 2020 02:27:54 +0000 (12:27 +1000)] 
Drop the expected minimum number of buckets to 4.

The previous value of 5 produced too many false errors.

(cherry picked from commit 0abb49034e3fe7a04a8065602490724b6ff920b7)

5 years agoMerge branch 'marka-rrl-mdig-burst-v9_11' into 'v9_11'
Mark Andrews [Thu, 15 Oct 2020 01:15:48 +0000 (01:15 +0000)] 
Merge branch 'marka-rrl-mdig-burst-v9_11' into 'v9_11'

Try to improve rrl timing

See merge request isc-projects/bind9!4264

5 years agoTry to improve rrl timing
Mark Andrews [Wed, 16 Sep 2020 02:40:52 +0000 (12:40 +1000)] 
Try to improve rrl timing

Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

(cherry picked from commit 92cdc7b6c7eec674fa03e7f87854cd5528c37f48)

5 years agoMerge branch '2204-investigate-pipeline-system-test-failure-2' into 'v9_11'
Mark Andrews [Thu, 8 Oct 2020 05:21:27 +0000 (05:21 +0000)] 
Merge branch '2204-investigate-pipeline-system-test-failure-2' into 'v9_11'

Resolve "Investigate pipeline system test failure"

See merge request isc-projects/bind9!4248

5 years agoRestore the dns_message_reset() call before the dns_dispatch_getnext()
Mark Andrews [Wed, 7 Oct 2020 23:55:35 +0000 (10:55 +1100)] 
Restore the dns_message_reset() call before the dns_dispatch_getnext()

This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.

5 years agoMerge branch 'mnowak/bring_--rpz-log-qtype-qclass_back' into 'v9_11'
Mark Andrews [Wed, 7 Oct 2020 20:10:10 +0000 (20:10 +0000)] 
Merge branch 'mnowak/bring_--rpz-log-qtype-qclass_back' into 'v9_11'

Bring back --rpz-log-qtype-qclass feature-test option

See merge request isc-projects/bind9!4243

5 years agoBring back --rpz-log-qtype-qclass feature-test option
Michal Nowak [Wed, 7 Oct 2020 09:24:16 +0000 (11:24 +0200)] 
Bring back --rpz-log-qtype-qclass feature-test option

It was unintentionally removed during a backport.

5 years agoMerge branch 'wpk/fix-isc-assertions-c-error-v9_11' into 'v9_11'
Michal Nowak [Wed, 7 Oct 2020 09:12:16 +0000 (09:12 +0000)] 
Merge branch 'wpk/fix-isc-assertions-c-error-v9_11' into 'v9_11'

[v9_11] Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

See merge request isc-projects/bind9!4242

5 years agoFix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c
Witold Kręcicki [Wed, 6 May 2020 09:25:30 +0000 (11:25 +0200)] 
Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

(cherry picked from commit f4260dc0c53436b005662b168b2addde91b65033)

5 years agoMerge branch '2183-dns-flag-day-2020-v9_11' into 'v9_11'
Ondřej Surý [Tue, 6 Oct 2020 12:22:09 +0000 (12:22 +0000)] 
Merge branch '2183-dns-flag-day-2020-v9_11' into 'v9_11'

Resolve "DNS Flag Day 2020"

See merge request isc-projects/bind9!4230

5 years agoAdd text describing the changes done in the MR in more detail
Ondřej Surý [Wed, 30 Sep 2020 16:38:32 +0000 (18:38 +0200)] 
Add text describing the changes done in the MR in more detail

(cherry picked from commit 096d41b4e266c003cc3e6234c864f0a7d15145ab)
(cherry picked from commit 469286e8eb24ebd6227e65b18eb4c30e13a58877)

5 years agoAdjust legacy tests for default 1232 EDNS Buffer Size
Ondřej Surý [Mon, 5 Oct 2020 16:17:49 +0000 (18:17 +0200)] 
Adjust legacy tests for default 1232 EDNS Buffer Size

* legacy test was just expecting default server EDNS buffer size to be 4096,
  the test needed the adjustment to reset the buffer sizes back to 4096.

5 years agoAdjust digdelv tests for default 1232 EDNS Buffer Size
Ondřej Surý [Wed, 23 Sep 2020 14:36:44 +0000 (16:36 +0200)] 
Adjust digdelv tests for default 1232 EDNS Buffer Size

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

(cherry picked from commit f1556f8c4126eced7cf71de3dfc007dbd9940c4a)
(cherry picked from commit 6b303721f1ee472dc8ab2d1df03191a98d4e4e5e)

5 years agoChange the default ENDS buffer size to 1232 for DNS Flag Day 2020
Ondřej Surý [Wed, 23 Sep 2020 12:47:26 +0000 (14:47 +0200)] 
Change the default ENDS buffer size to 1232 for DNS Flag Day 2020

The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the minimal
required changes by changing the defaults for `edns-udp-size`,
`max-udp-size` and `nocookie-udp-size` to `1232` (the value picked by
DNS Flag Day 2020).

(cherry picked from commit bb990030d344dafe40a62fe5ed2741de28b8ca66)
(cherry picked from commit df06773f9a73e4a4bb0b5e7f4bd8e40394e64032)

5 years agoMerge branch '2139-rrset-order-fixes-and-cleanups-v9_11' into 'v9_11'
Michał Kępień [Fri, 2 Oct 2020 08:12:59 +0000 (08:12 +0000)] 
Merge branch '2139-rrset-order-fixes-and-cleanups-v9_11' into 'v9_11'

[v9_11] "rrset-order" fixes and cleanups

See merge request isc-projects/bind9!4221

5 years agoAdd CHANGES entry
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add CHANGES entry

(cherry picked from commit 27c815a220a1b18756cc643f3ec1c16635fedda2)

5 years agoRework "rrset-order" documentation
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Rework "rrset-order" documentation

Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.

(cherry picked from commit 2ac04dc9305438f424a3a11c540d505e44db013e)

5 years agoMerge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime-v9_11' into...
Mark Andrews [Thu, 1 Oct 2020 13:23:56 +0000 (13:23 +0000)] 
Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime-v9_11' into 'v9_11'

Resolve "Allow task_test subtests to be selected at runtime."

See merge request isc-projects/bind9!4210

5 years agoAdd the ability select individual tests to rdata_test
Mark Andrews [Fri, 11 Sep 2020 04:17:36 +0000 (14:17 +1000)] 
Add the ability select individual tests to rdata_test

(cherry picked from commit 6293682020472e66a92094b57475a6b13ca1fa77)

5 years agoAdd the ability to print out the list of test names (-l)
Mark Andrews [Tue, 8 Sep 2020 00:38:24 +0000 (10:38 +1000)] 
Add the ability to print out the list of test names (-l)

(cherry picked from commit a9c337471767b75861557c93b4fd7fff66227de0)

5 years agoAdd the ability to select tests to run
Mark Andrews [Wed, 2 Sep 2020 08:22:21 +0000 (18:22 +1000)] 
Add the ability to select tests to run

task_test [-t <test_name>]

(cherry picked from commit 76837484e7d6f9a70c8217f9bd7f5aa1784fe353)

5 years agoMerge branch '2124-fix-assertion-failure-in-dns-message-v9_11' into 'v9_11'
Ondřej Surý [Wed, 30 Sep 2020 12:40:37 +0000 (12:40 +0000)] 
Merge branch '2124-fix-assertion-failure-in-dns-message-v9_11' into 'v9_11'

Resolve "Bind 9.16.6 Assertion failure message.c:4733: REQUIRE(msg->state == (-1)) failed"

See merge request isc-projects/bind9!4200

5 years agoAdd CHANGES and release note for GL #2124
Ondřej Surý [Fri, 25 Sep 2020 10:51:39 +0000 (12:51 +0200)] 
Add CHANGES and release note for GL #2124

5 years agoProperly handling dns_message_t shared references
Diego Fronza [Mon, 21 Sep 2020 20:44:29 +0000 (17:44 -0300)] 
Properly handling dns_message_t shared references

This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a
fetchctx and the dns_message_t object held by the query may be being
used by some external module, e.g. validator, even after the query may
have been destroyed, propery handling of the references to the message
were added in this commit to avoid accessing an already destroyed
object.

Specifically, in resquery_response(), a reference to the message is
attached at the beginning of the function and detached at the end, since
a possible call to fctx_cancelquery() would release the dns_message_t
object, and in the next lines of code a call to add_bad() would require
a valid pointer to the same object.

In valcreate() a new reference is attached to the message object, this
ensures that if the corresponding query object is destroyed before the
validator attempts to access it, no invalid pointer access occurs.

In validated() we have to attach a new reference to the message, since
we destroy the validator object at the beginning of the function, and we
need access to the message in the next lines of the same function.

5 years agoFix invalid dns message state in resolver's logic
Diego Fronza [Mon, 21 Sep 2020 20:32:39 +0000 (17:32 -0300)] 
Fix invalid dns message state in resolver's logic

The assertion failure REQUIRE(msg->state == DNS_SECTION_ANY),
caused by calling dns_message_setclass within function resquery_response()
in resolver.c, was happening due to wrong management of dns message_t
objects used to process responses to the queries issued by the resolver.

Before the fix, a resolver's fetch context (fetchctx_t) would hold
a pointer to the message, this same reference would then be used over all
the attempts to resolve the query, trying next server, etc... for this to work
the message object would have it's state reset between each iteration, marking
it as ready for a new processing.

The problem arose in a scenario with many different forwarders configured,
managing the state of the dns_message_t object was lacking better
synchronization, which have led it to a invalid dns_message_t state in
resquery_response().

Instead of adding unnecessarily complex code to synchronize the object,
the dns_message_t object was moved from fetchctx_t structure to the
query structure, where it better belongs to, since each query will produce
a response, this way whenever a new query is created an associated
dns_messate_t is also created.

This commit deals mainly with moving the dns_message_t object from fetchctx_t
to the query structure.

5 years agoRefactored dns_message_t for using attach/detach semantics
Diego Fronza [Mon, 21 Sep 2020 19:16:15 +0000 (16:16 -0300)] 
Refactored dns_message_t for using attach/detach semantics

This commit will be used as a base for the next code updates in order
to have a better control of dns_message_t objects' lifetime.

5 years agoMerge branch 'michal/disable-openssl-hashing-when-using-native-pkcs11' into 'v9_11'
Michał Kępień [Mon, 28 Sep 2020 07:31:38 +0000 (07:31 +0000)] 
Merge branch 'michal/disable-openssl-hashing-when-using-native-pkcs11' into 'v9_11'

Disable OpenSSL hashing when using native PKCS#11

See merge request isc-projects/bind9!4178

5 years agoDisable OpenSSL hashing when using native PKCS#11
Michał Kępień [Mon, 28 Sep 2020 07:30:00 +0000 (09:30 +0200)] 
Disable OpenSSL hashing when using native PKCS#11

When building with "--enable-native-pkcs11 --with-openssl", OpenSSL
support is automatically disabled in favor of native PKCS#11:

    checking for OpenSSL library... use of native PKCS11 instead

However, adding "--enable-openssl-hash" to the above two switches causes
the build to fail:

    checking for OpenSSL library... use of native PKCS11 instead
    disabled because of native PKCS11
    checking for using OpenSSL for hash functions... configure: error: No OpenSSL for hash functions

In other words, "--with-openssl" and "--enable-openssl-hash" are not
behaving consistently when used together with "--enable-native-pkcs11".

Fix by automatically disabling OpenSSL hashing support when native
PKCS#11 support is enabled.

5 years agoMerge branch '2177-make-native-pkcs11-require-dlopen-support-v9_11' into 'v9_11'
Michał Kępień [Mon, 28 Sep 2020 07:29:08 +0000 (07:29 +0000)] 
Merge branch '2177-make-native-pkcs11-require-dlopen-support-v9_11' into 'v9_11'

[v9_11] Make native PKCS#11 require dlopen() support

See merge request isc-projects/bind9!4190

5 years agoMake native PKCS#11 require dlopen() support
Michał Kępień [Mon, 28 Sep 2020 07:21:59 +0000 (09:21 +0200)] 
Make native PKCS#11 require dlopen() support

PKCS#11 support in BIND requires dlopen() support from the operating
system and thus building with "--enable-native-pkcs11 --without-dlopen"
should not be possible.  Add an Autoconf check which enforces that
constraint.  Adjust the pairwise testing model accordingly.

(cherry picked from commit 187dca9cf7e3b7473352a7bd416abbc5c6f64cd4)

5 years agoMerge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst-v9_11' into 'v9_11'
Mark Andrews [Thu, 24 Sep 2020 03:16:23 +0000 (03:16 +0000)] 
Merge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst-v9_11' into 'v9_11'

Add RFC8906 to list in doc/arm/general.rst

See merge request isc-projects/bind9!4183

5 years agoAdd RFC8906 to list in doc/arm/general.rst
Suzanne Goldlust [Wed, 23 Sep 2020 19:34:42 +0000 (19:34 +0000)] 
Add RFC8906 to list in doc/arm/general.rst

(cherry picked from commit 4c36b6bdf04391bddcd69def47ad96c24b17c8b0)

5 years agoMerge branch '2126-cycles-in-lock-order-graphs-v9-11' into 'v9_11'
Mark Andrews [Wed, 23 Sep 2020 01:05:14 +0000 (01:05 +0000)] 
Merge branch '2126-cycles-in-lock-order-graphs-v9-11' into 'v9_11'

Resolve "Cycles in lock order graphs [v9.11]"

See merge request isc-projects/bind9!4094

5 years agoAddress lock order reversals when shutting down a view.
Mark Andrews [Mon, 7 Sep 2020 03:21:10 +0000 (13:21 +1000)] 
Address lock order reversals when shutting down a view.

Release view->lock before calling dns_resolver_shutdown,
dns_adb_shutdown, and dns_requestmgr_shutdown.

5 years agoMerge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread...
Mark Andrews [Tue, 22 Sep 2020 13:51:06 +0000 (13:51 +0000)] 
Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2-v9_11' into 'v9_11'

Break lock order loop by sending TAT in an event

See merge request isc-projects/bind9!4166

5 years agoBreak lock order loop by sending TAT in an event
Mark Andrews [Tue, 22 Sep 2020 05:22:34 +0000 (15:22 +1000)] 
Break lock order loop by sending TAT in an event

The dotat() function has been changed to send the TAT
query asynchronously, so there's no lock order loop
because we initialize the data first and then we schedule
the TAT send to happen asynchronously.

This breaks following lock-order loops:

zone->lock (dns_zone_setviewcommit) while holding view->lock
(dns_view_setviewcommit)

keytable->lock (dns_keytable_find) while holding zone->lock
(zone_asyncload)

view->lock (dns_view_findzonecut) while holding keytable->lock
(dns_keytable_forall)

(cherry picked from commit 3c4b68af7c0cd8213bcae92faee3bf2a7e9284d1)

5 years agoMerge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread...
Mark Andrews [Tue, 22 Sep 2020 12:52:51 +0000 (12:52 +0000)] 
Merge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock-v9_11' into 'v9_11'

Address lock-order-inversion

See merge request isc-projects/bind9!4164

5 years agoAddress lock-order-inversion
Mark Andrews [Tue, 22 Sep 2020 06:24:06 +0000 (16:24 +1000)] 
Address lock-order-inversion

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_wrlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:52:4
    #2 zone_postload lib/dns/zone.c:5101:2
    #3 receive_secure_db lib/dns/zone.c:16206:11
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 receive_secure_db lib/dns/zone.c:16204:2
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 get_raw_serial lib/dns/zone.c:2518:2
    #2 zone_gotwritehandle lib/dns/zone.c:2559:4
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

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

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock

(cherry picked from commit 1090876693470eedf69211d0fe71ba2c88160f45)

5 years agoMerge branch 'mnowak/pairwise-configure-testing-v9_11' into 'v9_11'
Michał Kępień [Tue, 22 Sep 2020 10:08:44 +0000 (10:08 +0000)] 
Merge branch 'mnowak/pairwise-configure-testing-v9_11' into 'v9_11'

[v9_11] Add pairwise testing

See merge request isc-projects/bind9!4162

5 years agoAdd pairwise testing
Michal Nowak [Wed, 1 Jul 2020 08:29:36 +0000 (10:29 +0200)] 
Add pairwise testing

Pairwise testing is a test case generation technique based on the
observation that most faults are caused by interactions of at most two
factors.  For BIND, its configure options can be thought of as such
factors.

Process BIND configure options into a model that is subsequently
processed by the PICT tool in order to find an effective test vector.
That test vector is then used for configuring and building BIND using
various combinations of configure options.

(cherry picked from commit 420986bf187ed2a33321d5af362732184426f439)

5 years agoMerge branch '2166-bind-9-16-7-trap-divide-error-v9_11' into 'v9_11'
Ondřej Surý [Mon, 21 Sep 2020 09:10:59 +0000 (09:10 +0000)] 
Merge branch '2166-bind-9-16-7-trap-divide-error-v9_11' into 'v9_11'

Resolve "bind 9.16.7 trap divide error"

See merge request isc-projects/bind9!4153

5 years agoAdd CHANGES and release note for GL #2166
Ondřej Surý [Thu, 17 Sep 2020 12:47:16 +0000 (14:47 +0200)] 
Add CHANGES and release note for GL #2166

(cherry picked from commit 2869ca1401a45d610354e81e6773d4666001a974)

5 years agoHandle the errors from sysconf() call in isc_meminfo_totalphys()
Ondřej Surý [Thu, 17 Sep 2020 12:37:24 +0000 (14:37 +0200)] 
Handle the errors from sysconf() call in isc_meminfo_totalphys()

isc_meminfo_totalphys() would return invalid memory size when sysconf()
call would fail, because ((size_t)-1 * -1) is very large number.

(cherry picked from commit 79ca724d46918387fba6b2dc484d67390bcbbd56)