]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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 '2237-fix-cross-compilation' into 'v9_16'
Michał Kępień [Mon, 2 Nov 2020 11:31:27 +0000 (11:31 +0000)] 
Merge branch '2237-fix-cross-compilation' into 'v9_16'

Fix cross-compilation

See merge request isc-projects/bind9!4312

5 years agoAdd CHANGES entry
Michał Kępień [Mon, 2 Nov 2020 11:27:55 +0000 (12:27 +0100)] 
Add CHANGES entry

5 years agoFix cross-compilation
Michał Kępień [Mon, 2 Nov 2020 11:27:55 +0000 (12:27 +0100)] 
Fix cross-compilation

Using AC_RUN_IFELSE() in configure.ac breaks cross-compilation:

    configure: error: cannot run test program while cross compiling

Commit 978c7b2e89aa37a7ddfe2f6b6ba12ce73dd04528 caused AC_RUN_IFELSE()
to be used instead of AC_LINK_IFELSE() because the latter had seemingly
been causing the check for --wrap support in the linker to not work as
expected.  However, it later turned out that the problem lied elsewhere:
a minus sign ('-') was missing from the LDFLAGS variable used in the
relevant check [1].

Revert to using AC_LINK_IFELSE() for checking whether the linker
supports the --wrap option in order to make cross-compilation possible
again.

[1] see commit cfa4ea64bc06685f210a4187dcc05cc0aac84851

5 years agoMerge branch 'michal/sync-PLATFORMS-with-PLATFORMS.md' into 'v9_16'
Michał Kępień [Fri, 30 Oct 2020 11:03:47 +0000 (11:03 +0000)] 
Merge branch 'michal/sync-PLATFORMS-with-PLATFORMS.md' into 'v9_16'

Sync PLATFORMS with PLATFORMS.md

See merge request isc-projects/bind9!4339

5 years agoSync PLATFORMS with PLATFORMS.md
Michał Kępień [Fri, 30 Oct 2020 10:50:14 +0000 (11:50 +0100)] 
Sync PLATFORMS with PLATFORMS.md

5 years agoMerge branch 'mnowak/OpenBSD_6.8-v9_16' into 'v9_16'
Michał Kępień [Fri, 30 Oct 2020 10:03:13 +0000 (10:03 +0000)] 
Merge branch 'mnowak/OpenBSD_6.8-v9_16' into 'v9_16'

[v9_16] Update to OpenBSD 6.8

See merge request isc-projects/bind9!4336

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' into 'v9_16'
Michał Kępień [Fri, 30 Oct 2020 08:16:30 +0000 (08:16 +0000)] 
Merge branch '2231-miscellaneous-backtrace-fixes' into 'v9_16'

Miscellaneous backtrace fixes

See merge request isc-projects/bind9!4325

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:142: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.)

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.

5 years agoMerge branch '2228-fix-the-make-depend-check-in-gitlab-ci' into 'v9_16'
Michał Kępień [Fri, 30 Oct 2020 07:55:30 +0000 (07:55 +0000)] 
Merge branch '2228-fix-the-make-depend-check-in-gitlab-ci' into 'v9_16'

Fix the "make depend" check in GitLab CI

See merge request isc-projects/bind9!4316

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.

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.)

5 years agoMerge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey...
Mark Andrews [Thu, 29 Oct 2020 22:44:20 +0000 (22:44 +0000)] 
Merge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey-as-bogus-v9_16' into 'v9_16'

Resolve "Resolver sometimes treats signed, insecure zone with broken DNSKEY as bogus"

See merge request isc-projects/bind9!4332

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_16' into 'v9_16'
Michal Nowak [Thu, 29 Oct 2020 15:52:49 +0000 (15:52 +0000)] 
Merge branch 'mnowak/add-freebsd12.2-v9_16' into 'v9_16'

[v9_16] Update to FreeBSD 12.2

See merge request isc-projects/bind9!4329

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_16' into 'v9_16'
Michal Nowak [Thu, 29 Oct 2020 15:18:42 +0000 (15:18 +0000)] 
Merge branch 'mnowak/add-fedora-33-v9_16' into 'v9_16'

[v9_16] Add Fedora 33

See merge request isc-projects/bind9!4327

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 914be61ff8c5a3e0395acd980486c1b4cd656d20)

5 years agoMerge branch '2227-tcp-connection-closed-fix-v9_16' into 'v9_16'
Ondřej Surý [Thu, 29 Oct 2020 12:51:38 +0000 (12:51 +0000)] 
Merge branch '2227-tcp-connection-closed-fix-v9_16' into 'v9_16'

Resolve "BIND 9.16.8 assertion failure"

See merge request isc-projects/bind9!4324

5 years agoAdd CHANGES and release note for GL #2227
Witold Kręcicki [Tue, 27 Oct 2020 09:09:30 +0000 (10:09 +0100)] 
Add CHANGES and release note for GL #2227

(cherry picked from commit cd3117b747f10f3495da24d55074a94c3f2fe953)

5 years agoProperly handle outer TCP connection closed in TCPDNS.
Witold Kręcicki [Tue, 27 Oct 2020 09:09:30 +0000 (10:09 +0100)] 
Properly handle outer TCP connection closed in TCPDNS.

If the connection is closed while we're processing the request
we might access TCPDNS outerhandle which is already reset. Check
for this condition and call the callback with ISC_R_CANCELED result.

(cherry picked from commit c41ce8e0c94ba9cc6bf18d4bbbcc977af93afbf2)

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

fix a typo in rpz test

See merge request isc-projects/bind9!4321

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 'mnowak/test-coverage-visualization-v9_16' into 'v9_16'
Michal Nowak [Tue, 27 Oct 2020 14:57:36 +0000 (14:57 +0000)] 
Merge branch 'mnowak/test-coverage-visualization-v9_16' into 'v9_16'

Enable Test Coverage Visualization for merge requests

See merge request isc-projects/bind9!4314

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/enhanced-test-portability-v9_16' into 'v9_16'
Michal Nowak [Tue, 27 Oct 2020 14:25:34 +0000 (14:25 +0000)] 
Merge branch 'mnowak/enhanced-test-portability-v9_16' into 'v9_16'

[v9_16] POSIX compatibility fixes to system test

See merge request isc-projects/bind9!4311

5 years agoReplace a seq invocation with a shell loop
Michal Nowak [Tue, 27 Oct 2020 09:30:21 +0000 (10:30 +0100)] 
Replace a seq invocation with a shell loop

seq is not portable.  Use a while loop instead to make the "dnssec"
system test script POSIX-compatible.

(cherry picked from commit c0c4c024c64018aefe655103fcba6f6fa9ec7581)

5 years agoGet rid of bashisms in string comparisons
Michal Nowak [Tue, 27 Oct 2020 09:20:05 +0000 (10:20 +0100)] 
Get rid of bashisms in string comparisons

The double equal sign ('==') is a Bash-specific string comparison
operator.  Ensure the single equal sign ('=') is used in all POSIX shell
scripts in the system test suite in order to retain their portability.

(cherry picked from commit 481dfb96715d383145af15432b3b3b7d81373636)

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

[v9_16] Add "stress" tests to GitLab CI

See merge request isc-projects/bind9!4307

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)

5 years agoMerge branch 'mnowak/openbsd-fix-gdb-in-system-test-v9_16' into 'v9_16'
Michal Nowak [Mon, 26 Oct 2020 15:58:13 +0000 (15:58 +0000)] 
Merge branch 'mnowak/openbsd-fix-gdb-in-system-test-v9_16' into 'v9_16'

[v9_16] Fix system test backtrace generation on OpenBSD

See merge request isc-projects/bind9!4304

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)

5 years agoMerge branch '2226-tsan-error-in-dispatch-c-v9_16' into 'v9_16'
Mark Andrews [Fri, 23 Oct 2020 20:56:48 +0000 (20:56 +0000)] 
Merge branch '2226-tsan-error-in-dispatch-c-v9_16' into 'v9_16'

Hold qid->lock when calling deref_portentry() as

See merge request isc-projects/bind9!4302

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_16' into 'v9_16'
Mark Andrews [Fri, 23 Oct 2020 13:53:25 +0000 (13:53 +0000)] 
Merge branch '2215-dns_zoneflag_noixfr-is-misnamed-v9_16' into 'v9_16'

DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR

See merge request isc-projects/bind9!4300

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 '2221-netmgr-fixes-from-unit-testing-v9_16' into 'v9_16'
Evan Hunt [Thu, 22 Oct 2020 22:53:04 +0000 (22:53 +0000)] 
Merge branch '2221-netmgr-fixes-from-unit-testing-v9_16' into 'v9_16'

Fix the problems found when writing the unit test for netmgr

See merge request isc-projects/bind9!4294

5 years agoCHANGES
Evan Hunt [Thu, 22 Oct 2020 20:38:09 +0000 (13:38 -0700)] 
CHANGES

(cherry picked from commit 58a0e95976f8299187079e196322a20c658e988a)

5 years agoFix the data race when read-writing sock->active by using cmpxchg
Ondřej Surý [Thu, 22 Oct 2020 08:07:56 +0000 (10:07 +0200)] 
Fix the data race when read-writing sock->active by using cmpxchg

(cherry picked from commit 8797e5efd50c3d7ededa152fb8cc6eeb8ace57ef)

5 years agoIgnore and don't log ISC_R_NOTCONNECTED from uv_accept()
Ondřej Surý [Wed, 21 Oct 2020 22:17:03 +0000 (00:17 +0200)] 
Ignore and don't log ISC_R_NOTCONNECTED from uv_accept()

When client disconnects before the connection can be accepted, the named
would log a spurious log message:

    error: Accepting TCP connection failed: socket is not connected

We now ignore the ISC_R_NOTCONNECTED result code and log only other
errors

(cherry picked from commit 5ef71c420fc118b506ad5a16bdb4a21fafdcda9c)

5 years agoFix the isc_nm_closedown() to actually close the pending connections
Ondřej Surý [Wed, 21 Oct 2020 10:52:09 +0000 (12:52 +0200)] 
Fix the isc_nm_closedown() to actually close the pending connections

1. The isc__nm_tcp_send() and isc__nm_tcp_read() was not checking
   whether the socket was still alive and scheduling reads/sends on
   closed socket.

2. The isc_nm_read(), isc_nm_send() and isc_nm_resumeread() have been
   changed to always return the error conditions via the callbacks, so
   they always succeed.  This applies to all protocols (UDP, TCP and
   TCPDNS).

(cherry picked from commit f7c82e406e83f98d3a1fecedc78725b441552092)

5 years agoFix the way tcp_send_direct() is used
Ondřej Surý [Wed, 21 Oct 2020 06:56:21 +0000 (08:56 +0200)] 
Fix the way tcp_send_direct() is used

There were two problems how tcp_send_direct() was used:

1. The tcp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_tcp_send()), but the isc__nm_async_tcpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_tcp_send(), when the TCP send is already in the right
   netthread, it uses tcp_send_direct() to send the TCP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit 6af08d1ca6a105ee8cb6ead64c4fe34b9154d257)

5 years agoDetach the sock->server in uv_close() callback, not before
Ondřej Surý [Tue, 20 Oct 2020 19:03:27 +0000 (21:03 +0200)] 
Detach the sock->server in uv_close() callback, not before

(cherry picked from commit d72bc3eb52ca973556077bb65fea3664315cc469)

5 years agoExplicitly stop reading before closing the nmtcpsocket
Ondřej Surý [Tue, 20 Oct 2020 18:57:19 +0000 (20:57 +0200)] 
Explicitly stop reading before closing the nmtcpsocket

When closing the socket that is actively reading from the stream, the
read_cb() could be called between uv_close() and close callback when the
server socket has been already detached hence using sock->statichandle
after it has been already freed.

(cherry picked from commit 97b33e5bde296feb82c1d8bb703e56c1b224e129)

5 years agoProper handling of socket references in case of TCP conn failure.
Witold Kręcicki [Tue, 20 Oct 2020 14:06:54 +0000 (16:06 +0200)] 
Proper handling of socket references in case of TCP conn failure.

(cherry picked from commit ff0a336d524c249bf144b121b53d1a3fa66a626d)

5 years agoDon't crash if isc_uv_export returns an error in accept_connection.
Witold Kręcicki [Tue, 20 Oct 2020 10:55:58 +0000 (12:55 +0200)] 
Don't crash if isc_uv_export returns an error in accept_connection.

isc_uv_export can return an error - e.g. EMFILE (from dup), handle this
nicely.

(cherry picked from commit ae9a6befa802a10fb08fbe100ee96dd03ecb9787)

5 years agoFix the way udp_send_direct() is used
Ondřej Surý [Tue, 20 Oct 2020 06:07:44 +0000 (08:07 +0200)] 
Fix the way udp_send_direct() is used

There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit afca2e3b2198eb43a97fe6edb3c5a46915389e09)

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

[v9_16] Ensure use of "echo_i" where possible

See merge request isc-projects/bind9!4290

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_16_8-release' into 'v9_16'
Michał Kępień [Thu, 22 Oct 2020 07:16:08 +0000 (07:16 +0000)] 
Merge branch 'v9_16_8-release' into 'v9_16'

Merge 9.16.8 release branch

See merge request isc-projects/bind9!4288

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

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Thu, 22 Oct 2020 07:14:31 +0000 (09:14 +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:14:31 +0000 (09:14 +0200)] 
Bump BIND_BASELINE_VERSION for respdiff tests

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

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.16.8' into 'v9_16_8-release'
Michał Kępień [Tue, 13 Oct 2020 08:17:54 +0000 (08:17 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.16.8' into 'v9_16_8-release'

Prepare release notes for BIND 9.16.8

See merge request isc-private/bind9!217

5 years agoprep 9.16.8
Tinderbox User [Tue, 13 Oct 2020 08:40:06 +0000 (08:40 +0000)] 
prep 9.16.8

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

5 years agoReorder release notes
Michał Kępień [Tue, 13 Oct 2020 08:08:54 +0000 (10:08 +0200)] 
Reorder release notes

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

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

5 years agoMinor ARM formatting tweak
Michał Kępień [Tue, 13 Oct 2020 08:08:54 +0000 (10:08 +0200)] 
Minor ARM formatting tweak

5 years agoMerge branch '1736-stub-zone-foiled-by-minimal-responses-v9_16' into 'v9_16'
Diego dos Santos Fronza [Wed, 21 Oct 2020 17:41:57 +0000 (17:41 +0000)] 
Merge branch '1736-stub-zone-foiled-by-minimal-responses-v9_16' into 'v9_16'

Resolve "stub zone foiled by minimal-responses"

See merge request isc-projects/bind9!4282

5 years agoAdd CHANGES entry
Diego Fronza [Thu, 10 Sep 2020 18:51:46 +0000 (15:51 -0300)] 
Add CHANGES entry

5 years agoAdjusted additional system test (NS, non-root zone)
Diego Fronza [Fri, 2 Oct 2020 15:07:59 +0000 (12:07 -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, 30 Sep 2020 20:22:39 +0000 (17:22 -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 [Thu, 10 Sep 2020 18:09:14 +0000 (15:09 -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 '2208-tcp4recverr-stat-miscount-v9_16' into 'v9_16'
Matthijs Mekking [Wed, 21 Oct 2020 06:34:19 +0000 (06:34 +0000)] 
Merge branch '2208-tcp4recverr-stat-miscount-v9_16' into 'v9_16'

Don't increment network error stats on UV_EOF

See merge request isc-projects/bind9!4277

5 years agoDon't increment network error stats on UV_EOF
Matthijs Mekking [Tue, 20 Oct 2020 08:57:16 +0000 (10:57 +0200)] 
Don't increment network error stats on UV_EOF

When networking statistics was added to the netmgr (in commit
5234a8e00a6ae1df738020f27544594ccb8d5215), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.

(cherry picked from commit 6c5ff9421875a1fcdfb8f03ac01afe292075d8d2)

5 years agoMerge branch '2195-freebsd-dnstap-system-test-failure-v9_16' into 'v9_16'
Diego dos Santos Fronza [Tue, 20 Oct 2020 13:57:41 +0000 (13:57 +0000)] 
Merge branch '2195-freebsd-dnstap-system-test-failure-v9_16' into 'v9_16'

Fix dnstap system test on FreeBSD

See merge request isc-projects/bind9!4275

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_16' into 'v9_16'
Mark Andrews [Thu, 15 Oct 2020 02:14:15 +0000 (02:14 +0000)] 
Merge branch 'marka-fix-not-enough-categories-v9_16' into 'v9_16'

Drop the expected minimum number of buckets to 4.

See merge request isc-projects/bind9!4265

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_16' into 'v9_16'
Mark Andrews [Thu, 15 Oct 2020 01:11:06 +0000 (01:11 +0000)] 
Merge branch 'marka-rrl-mdig-burst-v9_16' into 'v9_16'

Try to improve rrl timing

See merge request isc-projects/bind9!4263

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 '2209-tsan-error-bin-named-controlconf-c-related-v9_16' into 'v9_16'
Mark Andrews [Thu, 15 Oct 2020 00:39:43 +0000 (00:39 +0000)] 
Merge branch '2209-tsan-error-bin-named-controlconf-c-related-v9_16' into 'v9_16'

Complete the isc_nmhandle_detach() in the worker thread.

See merge request isc-projects/bind9!4262

5 years agoComplete the isc_nmhandle_detach() in the worker thread.
Mark Andrews [Mon, 12 Oct 2020 06:51:09 +0000 (17:51 +1100)] 
Complete the isc_nmhandle_detach() in the worker thread.

isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

(cherry picked from commit f95ba8aa2071fa72e3730eeb8ee78ef9454ffa5b)

5 years agoMerge branch 'ondrej/little-socket-fixes-v9_16' into 'v9_16'
Ondřej Surý [Thu, 8 Oct 2020 07:05:58 +0000 (07:05 +0000)] 
Merge branch 'ondrej/little-socket-fixes-v9_16' into 'v9_16'

Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

See merge request isc-projects/bind9!4254

5 years agoClean the last remnant of ISC_PLATFORM_HAVEIPV6 macro
Ondřej Surý [Thu, 8 Oct 2020 06:26:28 +0000 (08:26 +0200)] 
Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

In set_sndbuf() we were using ISC_PLATFORM_HAVEIPV6 macro that doesn't
exist anymore, because we assume that IPv6 support is always available.

(cherry picked from commit 96ac91a18a6e506824c63d10a05e532d584ff5c1)

5 years agoMerge branch 'ondrej/clean-netmgr-callback-locks-v9_16' into 'v9_16'
Ondřej Surý [Thu, 8 Oct 2020 06:50:23 +0000 (06:50 +0000)] 
Merge branch 'ondrej/clean-netmgr-callback-locks-v9_16' into 'v9_16'

Clean netmgr callback locks (v9.16)

See merge request isc-projects/bind9!4252

5 years agoClone the csock in accept_connection(), not in callback
Ondřej Surý [Fri, 18 Sep 2020 10:27:40 +0000 (12:27 +0200)] 
Clone the csock in accept_connection(), not in callback

If we clone the csock (children socket) in TCP accept_connection()
instead of passing the ssock (server socket) to the call back and
cloning it there we unbreak the assumption that every socket is handled
inside it's own worker thread and therefore we can get rid of (at least)
callback locking.

(cherry picked from commit e8b56acb49f65b5143cd3f0d6f5e863df625a4c7)

5 years agoChange the isc__nm_tcpdns_stoplistening() to be asynchronous event
Ondřej Surý [Fri, 2 Oct 2020 07:28:29 +0000 (09:28 +0200)] 
Change the isc__nm_tcpdns_stoplistening() to be asynchronous event

The isc__nm_tcpdns_stoplistening() would call isc__nmsocket_clearcb()
that would clear the .accept_cb from non-netmgr thread.  Change the
tcpdns_stoplistening to enqueue ievent that would get processed in the
right netmgr thread to avoid locking.

(cherry picked from commit d86a74d8a4c1c530baa714bbbad78fba9a4b29ab)

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

Restore the dns_message_reset() call before the dns_dispatch_getnext()

See merge request isc-projects/bind9!4249

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.

(cherry picked from commit 1f63bb15b3ce0984ecf1971c2736477e5c3ac67f)

5 years agoMerge branch 'matthijs-kasp-test-requires-python-v9_16' into 'v9_16'
Michał Kępień [Wed, 7 Oct 2020 20:20:47 +0000 (20:20 +0000)] 
Merge branch 'matthijs-kasp-test-requires-python-v9_16' into 'v9_16'

The kasp system test requires Python

See merge request isc-projects/bind9!4244

5 years agoMerge branch 'he32-test-fix-v9_16' into 'v9_16'
Matthijs Mekking [Wed, 7 Oct 2020 13:30:41 +0000 (13:30 +0000)] 
Merge branch 'he32-test-fix-v9_16' into 'v9_16'

Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4236

5 years agoAvoid a non-standard bashism: use of "==" in "test".
Havard Eidnes [Fri, 2 Oct 2020 12:54:57 +0000 (14:54 +0200)] 
Avoid a non-standard bashism: use of "==" in "test".

(cherry picked from commit 7c3f62082bb0c6776ff560f0aef09ad2dfdf77ea)

5 years agoThe kasp system test requires Python
Matthijs Mekking [Wed, 7 Oct 2020 11:37:13 +0000 (13:37 +0200)] 
The kasp system test requires Python

Only run the "kasp" system test if the path to the Python interpreter is
set.

5 years agoMerge branch 'marka-create_query-fix-REVERSE_INULL-v9_16' into 'v9_16'
Mark Andrews [Tue, 6 Oct 2020 12:56:03 +0000 (12:56 +0000)] 
Merge branch 'marka-create_query-fix-REVERSE_INULL-v9_16' into 'v9_16'

Silence Coverity REVERSE_INULL report

See merge request isc-projects/bind9!4238

5 years agoSilence Coverity REVERSE_INULL report
Mark Andrews [Tue, 6 Oct 2020 06:34:09 +0000 (17:34 +1100)] 
Silence Coverity REVERSE_INULL report

message does not need to be tested to NULL

(cherry picked from commit f0a66cb5aadd741c799f80079a86389d0423c3a3)

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

Resolve "DNS Flag Day 2020"

See merge request isc-projects/bind9!4229

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)

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.

(cherry picked from commit 354a2e102d5b8b0a73c9bcea14a4af7091ed6e31)

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)

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)

5 years agoMerge branch 'marka-run-sh-fixups-v9_16' into 'v9_16'
Mark Andrews [Tue, 6 Oct 2020 06:22:00 +0000 (06:22 +0000)] 
Merge branch 'marka-run-sh-fixups-v9_16' into 'v9_16'

run.sh fixups for v9 16

See merge request isc-projects/bind9!4233