Commit Graph

31756 Commits

Author SHA1 Message Date
Diego Fronza
004849fd36 Added test for the fix
This test ensures that named will correctly shutdown
when receiving multiple control connections after processing
of either "rncd stop" or "kill -SIGTERM" commands.

Before the fix, named was crashing due to a race condition happening
between two threads, one running shutdown logic in named/server.c
and other handling control logic in controlconf.c.

This test tries to reproduce the above scenario by issuing multiple
queries to a target named instance, issuing either rndc stop or kill
-SIGTERM command to the same named instance, then starting multiple rndc
status connections to ensure it is not crashing anymore.

(cherry picked from commit 042e509753)
2020-07-01 12:52:51 +02:00
Ondřej Surý
7c0fb5e492 Don't continue opening a new rndc connection if we are shutting down
Due to lack of synchronization, whenever named was being requested to
stop using rndc, controlconf.c module could be trying to access an already
released pointer through named_g_server->interfacemgr in a separate
thread.

The race could only be triggered if named was being shutdown and more
rndc connections were ocurring at the same time.

This fix correctly checks if the server is shutting down before opening
a new rndc connection.

(cherry picked from commit be6cc53ec2)
2020-07-01 12:52:51 +02:00
Ondřej Surý
1e4ac3a94c Merge branch 'ondrej/update-rndc.conf-manpage-v9_16' into 'v9_16'
Commit the regenerated rndc.conf.5in manual page

See merge request isc-projects/bind9!3779
2020-07-01 10:21:34 +00:00
Ondřej Surý
4d65685cc3 Commit the regenerated rndc.conf.5in manual page
(cherry picked from commit c5b63e14bc)
2020-07-01 12:21:16 +02:00
Matthijs Mekking
99b9c82cec Merge branch '1612-rndc-dnssec-status-v9_16' into 'v9_16'
Resolve "Get current state of DNSSEC keys (kasp) via rndc"

See merge request isc-projects/bind9!3771
2020-07-01 10:14:53 +00:00
Matthijs Mekking
9f5a43808f Fix linking problem for #1612
When a library is examined, an object file within it can be left out
of the link if it does not provide symbols that the symbol table
needs.  Introducing `isc_stdtime_tostring` caused a build failure for
`update_test` because it now requires `libisc.a(stdtime.o)` and that
also exports the `isc_stdtime_get` symbol, meaning we have a
multiple definition error.

Add a local version of `isc_stdtime_tostring`, so that the linker
will not search for it in available object files.
2020-07-01 10:55:30 +02:00
Matthijs Mekking
2d9b282d77 Update notes, changes for #1612
(cherry picked from commit e273b95a8b)
2020-07-01 09:58:25 +02:00
Matthijs Mekking
f1b3686cd2 Output rndc dnssec -status
Implement the 'rndc dnssec -status' command that will output
some information about the key states, such as which policy is
used for the zone, what keys are in use, and when rollover is
scheduled.

Add loose testing in the kasp system test, the actual times are
already tested via key file inspection.

(cherry picked from commit 19ce9ec1d4)
2020-07-01 09:57:44 +02:00
Matthijs Mekking
34a9c3f6c9 Implement dummy 'rndc dnssec -status' command
Add the code and documentation required to provide DNSSEC signing
status through rndc.  This does not yet show any useful information,
just provide the command that will output some dummy string.

(cherry picked from commit e1ba1bea7c)
2020-07-01 09:57:44 +02:00
Matthijs Mekking
7915327aac Move dst key printtime in separate function
I'd like to use the same functionality (pretty print the datetime
of keytime metadata) in the 'rndc dnssec -status' command.  So it is
better that this logic is done in a separate function.

Since the stdtime.c code have differernt files for unix and win32,
I think the "#ifdef WIN32" define can be dropped.

(cherry picked from commit 9e03f8e8fe)
2020-07-01 09:57:44 +02:00
Evan Hunt
f20bc90a72 Merge branch '1936-blackhole-fix-v9_16' into 'v9_16'
Resolve "blackhole ACL broken"

See merge request isc-projects/bind9!3776
2020-07-01 06:53:39 +00:00
Evan Hunt
7a8e132c74 CHANGES, release note
(cherry picked from commit 08401e38c1)
2020-06-30 21:10:31 -07:00
Evan Hunt
952461b6af restore "blackhole" functionality
the blackhole ACL was accidentally disabled with respect to client
queries during the netmgr conversion.

in order to make this work for TCP, it was necessary to add a return
code to the accept callback functions passed to isc_nm_listentcp() and
isc_nm_listentcpdns().

(cherry picked from commit 23c7373d68)
2020-06-30 21:10:31 -07:00
Evan Hunt
6b00e5f5a0 update the acl system test to include a blackhole test case
this ACL was previously untested, which allowed a regression to
go undetected.

(cherry picked from commit e3ee138098)
2020-06-30 19:41:42 -07:00
Mark Andrews
490016ebf1 Merge branch 'marka-silence-pyyaml-warning' into 'v9_16'
Silence PyYAML warning

See merge request isc-projects/bind9!3769
2020-06-30 01:39:16 +00:00
Michał Kępień
62f631f798 Silence PyYAML warning
Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):
2020-06-30 11:19:47 +10:00
Mark Andrews
02643b5ab1 Merge branch 'marka-define-top-srcdir' into 'v9_16'
define TOP_SRCDIR

See merge request isc-projects/bind9!3768
2020-06-30 00:12:15 +00:00
Mark Andrews
089df5f8ef Add TOP_SRCDIR to conf.sh.in and conf.sh.win32 2020-06-29 23:50:45 +00:00
Mark Andrews
79d99b6022 Merge branch 'u/fanf2/dnstap-roll-v9_16' into 'v9_16'
U/fanf2/dnstap roll v9 16

See merge request isc-projects/bind9!3754
2020-06-29 23:21:29 +00:00
Mark Andrews
3a12c2de74 Add Release Note for [GL !3728]
(cherry picked from commit 81d15bc967)
2020-06-29 22:30:02 +00:00
Mark Andrews
6822909470 Add CHANGES for [GL !3728]
(cherry picked from commit ce776e79ed)
2020-06-29 22:30:01 +00:00
Mark Andrews
bf205b00c3 Check that 'rndc dnstap -roll <value>' works
(cherry picked from commit a289a57c7f)
2020-06-29 22:30:01 +00:00
Tony Finch
b7f7b8128e Fix rndc dnstap -roll N
The `rndc` argument was always overridden by the static configuration,
because the logic for handling the number of dnstap files to retain
was both backwards and a bit redundant.

(cherry picked from commit 7c07129a51)
2020-06-29 22:30:01 +00:00
Ondřej Surý
7579386567 Merge branch 'ondrej/fix-manpages-in-rtd-v9_16' into 'v9_16'
Fix the manpages TOC in the BIND 9 ARM (v9.16)

See merge request isc-projects/bind9!3766
2020-06-29 17:43:55 +00:00
Ondřej Surý
9d876eccd3 Fix miscellaneous little bugs in RST formatting
(cherry picked from commit b51d10608e)
2020-06-29 19:41:52 +02:00
Ondřej Surý
7196a64fdf Add missing rndc.conf header that was breaking manpages section
The rndc.conf main header was missing the header markup and that was
breaking the TOC for all manpages in the ARM because sphinx-build
incorrectly remembered the markup for subheader to be ~~~~ instead of
----.

(cherry picked from commit 5c56a0ddbc)
2020-06-29 19:41:15 +02:00
Michał Kępień
41ca96103c Merge branch 'mnowak/add-new-releases-v9_16' into 'v9_16'
[v9_16] Add Ubuntu 20.04, Fedora 32, Alpine 3.12, OpenBSD 6.7, and FreeBSD 11.4

See merge request isc-projects/bind9!3762
2020-06-29 11:06:15 +00:00
Michał Kępień
0af1ca9659 Fix build-time GSSAPI detection on Tumbleweed
The "krb5-devel" package on openSUSE Tumbleweed installs the
"krb5-config" binary into a custom prefix, which prevents BIND's
"configure" script from autodetecting it.  Fix by specifying the path to
the "krb5-config" binary using --with-gssapi.

(cherry picked from commit 1be15f5900)
2020-06-29 12:44:56 +02:00
Michal Nowak
9703b967d1 Update FreeBSD 11 to 11.4
(cherry picked from commit 18f97b9af2)
2020-06-29 12:44:17 +02:00
Michal Nowak
988057c22d Update to Alpine Linux 3.12
(cherry picked from commit eff79ab20c)
2020-06-29 12:44:17 +02:00
Michal Nowak
6c1ff7c5e5 Update to OpenBSD 6.7
(cherry picked from commit 374660fd37)
2020-06-29 12:44:17 +02:00
Michal Nowak
d5e6d5c28e Drop Bionic
(cherry picked from commit 27c8bc1750)
2020-06-29 12:44:17 +02:00
Michal Nowak
e0751c74d5 Add Ubuntu 20.04 Focal Fossa, update Fedora to 32
(cherry picked from commit c3e259a8c9)
2020-06-29 12:44:16 +02:00
Michał Kępień
83df6d1334 Merge branch '1977-address-compilation-warnings-on-freebsd-11.4' into 'v9_16'
Address compilation warnings on FreeBSD 11.4

See merge request isc-projects/bind9!3760
2020-06-29 10:05:56 +00:00
Michał Kępień
be35b872fd Address compilation warnings on FreeBSD 11.4
With Clang 10.0.0 on FreeBSD 11.4, compiling lib/dns/spnego.c triggers
the following warnings:

    spnego.c:361:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:366:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:371:12: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                            return (GSS_S_DEFECTIVE_TOKEN);
                                    ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:376:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:380:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    5 errors generated.

Address by replacing all instances of the GSS_S_DEFECTIVE_TOKEN constant
with a boolean value.  Invert the values returned by cmp_gss_type() so
that its only call site reads more naturally in the context of the
comment preceding it.
2020-06-29 12:03:01 +02:00
Matthijs Mekking
55e2b57a14 Merge branch '1876-kasp-test-wait-for-reconfig-v9_16' into 'v9_16'
Resolve "kasp: algnum migration test does not wait long enough."

See merge request isc-projects/bind9!3761
2020-06-29 07:43:42 +00:00
Matthijs Mekking
7eed00502f kasp tests: fix wait for reconfig done
The wait until zones are signed after rndc reconfig is broken
because the zones are already signed before the reconfig.  Fix
by having a different way to ensure the signing of the zone is
complete.  This does require a call to the "wait_for_done_signing"
function after each "check_keys" call after the ns6 reconfig.

The "wait_for_done_signing" looks for a (newly added) debug log
message that named will output if it is done signing with a certain
key.

(cherry picked from commit a47192ed5b)
2020-06-29 08:09:40 +02:00
Matthijs Mekking
60752f8092 kasp tests: Replace while loops with retry_quiet
(cherry picked from commit cf76d839ae)
2020-06-29 08:09:32 +02:00
Evan Hunt
0a6c7ab2a9 Merge branch '1938-fix-udp-race' into 'v9_16'
Resolve "Repeated bind 9.16.3 assert error in libuv (attempting restart after an earlier/different crash)"

See merge request isc-projects/bind9!3722
2020-06-26 09:05:37 +00:00
Witold Kręcicki
2be35bd2bc CHANGES 2020-06-26 01:44:10 -07:00
Witold Kręcicki
4582ef3bb2 Fix a shutdown race in netmgr udp.
We need to mark the socket as inactive early (and synchronously)
in the stoplistening process - otherwise we might destroy the
callback argument before actually stopping listening, and call
the callback on a bad memory.
2020-06-26 01:44:03 -07:00
Evan Hunt
4ea84740e6 Merge branch '1947-fix-tcpdns-race' into 'v9_16'
Resolve "Segmentation fault in recursive stress test"

See merge request isc-projects/bind9!3721
2020-06-26 08:40:27 +00:00
Witold Kręcicki
bb629b9b16 CHANGES 2020-06-26 01:18:31 -07:00
Witold Kręcicki
97e44fa3df Make netmgr tcpdns send calls asynchronous.
isc__nm_tcpdns_send() was not asynchronous and accessed socket
internal fields in an unsafe manner, which could lead to a race
condition and subsequent crash. Fix it by moving the whole tcpdns
processing to a proper netmgr thread.
2020-06-26 01:18:27 -07:00
Evan Hunt
d761cd576b Merge branch '1952-yaml-ipv6-v9_16' into 'v9_16'
append "0" to IPv6 addresses ending in "::" when printing YAML

See merge request isc-projects/bind9!3752
2020-06-26 02:31:09 +00:00
Evan Hunt
f171017570 append "0" to IPv6 addresses ending in "::" when printing YAML
such addresses broke some YAML parsers.

(cherry picked from commit a8baf79e33)
2020-06-25 18:57:06 -07:00
Mark Andrews
4e33f6b338 Merge branch '1689-bind-stops-dnskey-lookup-in-get_dst_key-when-a-key-with-unsupported-algorithm-is-found-first-v9_16' into 'v9_16'
Resolve "BIND stops DNSKEY lookup in get_dst_key() when a key with unsupported algorithm is found first"

See merge request isc-projects/bind9!3748
2020-06-25 14:11:08 +00:00
Matthijs Mekking
6d91799388 Add todo in dnssec system test for [GL #1689]
Add a note why we don't have a test case for the issue.

It is tricky to write a good test case for this if our tools are
not allowed to create signatures for unsupported algorithms.

(cherry picked from commit c6345fffe9)
2020-06-25 22:44:19 +10:00
Mark Andrews
3e3afeb31e Add Release Note for [GL #1689]
(cherry picked from commit e195d4608a)
2020-06-25 22:44:17 +10:00
Mark Andrews
fd05589e66 Add CHANGES for [GL #1689]
(cherry picked from commit b733bd6555)
2020-06-25 22:43:25 +10:00