Commit graph

2530 commits

Author SHA1 Message Date
Michal Nowak
ec278d628d
Add --enable-option-checking=fatal to ./configure in CI
The --enable-option-checking=fatal option prevents ./configure from
proceeding when an unknown option is used in the ./configure step in CI.
This change will avoid adding unsupported ./configure options or options
with typo or typo in pairwise testing "# [pairwise: ...]" marker.

(cherry picked from commit 4295c82e45)
2021-02-12 14:16:26 +01:00
Matthijs Mekking
1a32cf543b Update copyrights for [#1810]
(cherry picked from commit 51827ddcd3)
2021-02-09 16:06:50 +01:00
Michal Nowak
7aa33bf5e4
Add README.md file to rsabigexponent system test
This README.md describes why is bigkey needed.

(cherry picked from commit a247f24dfa)
2021-01-29 15:54:07 +01:00
Mark Andrews
0dd5483cb0 Detect overly long CHANGES lines
(cherry picked from commit b1ecab6383)
2021-01-28 15:08:09 +11:00
Ondřej Surý
0e25af628c Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1608 (as an example) the library
will now be named libisc-9.16.10.so.

(cherry picked from commit c605d75ea5)
2021-01-25 15:28:09 +01:00
Michał Kępień
22bec45f9c Add the ISC DNSSEC Guide as a BIND 9 ARM appendix
Add the ISC DNSSEC Guide to the BIND 9 ARM in order to include the
former in every BIND release.

(cherry picked from commit f96e6a1e1d)
2021-01-08 13:53:52 +01:00
Mark Andrews
4222429b28 update for 2021 2021-01-04 15:14:44 +11:00
Matthijs Mekking
ba75744331 Add test for cpu affinity
Add a test to check BIND 9 honors CPU affinity mask. This requires
some changes to the start script, to construct the named command.

(cherry picked from commit f1a097964c)
2020-12-23 09:25:48 +11:00
Ondřej Surý
7b9c8b9781 Refactor netmgr and add more unit tests
This is a part of the works that intends to make the netmgr stable,
testable, maintainable and tested.  It contains a numerous changes to
the netmgr code and unfortunately, it was not possible to split this
into smaller chunks as the work here needs to be committed as a complete
works.

NOTE: There's a quite a lot of duplicated code between udp.c, tcp.c and
tcpdns.c and it should be a subject to refactoring in the future.

The changes that are included in this commit are listed here
(extensively, but not exclusively):

* The netmgr_test unit test was split into individual tests (udp_test,
  tcp_test, tcpdns_test and newly added tcp_quota_test)

* The udp_test and tcp_test has been extended to allow programatic
  failures from the libuv API.  Unfortunately, we can't use cmocka
  mock() and will_return(), so we emulate the behaviour with #define and
  including the netmgr/{udp,tcp}.c source file directly.

* The netievents that we put on the nm queue have variable number of
  members, out of these the isc_nmsocket_t and isc_nmhandle_t always
  needs to be attached before enqueueing the netievent_<foo> and
  detached after we have called the isc_nm_async_<foo> to ensure that
  the socket (handle) doesn't disappear between scheduling the event and
  actually executing the event.

* Cancelling the in-flight TCP connection using libuv requires to call
  uv_close() on the original uv_tcp_t handle which just breaks too many
  assumptions we have in the netmgr code.  Instead of using uv_timer for
  TCP connection timeouts, we use platform specific socket option.

* Fix the synchronization between {nm,async}_{listentcp,tcpconnect}

  When isc_nm_listentcp() or isc_nm_tcpconnect() is called it was
  waiting for socket to either end up with error (that path was fine) or
  to be listening or connected using condition variable and mutex.

  Several things could happen:

    0. everything is ok

    1. the waiting thread would miss the SIGNAL() - because the enqueued
       event would be processed faster than we could start WAIT()ing.
       In case the operation would end up with error, it would be ok, as
       the error variable would be unchanged.

    2. the waiting thread miss the sock->{connected,listening} = `true`
       would be set to `false` in the tcp_{listen,connect}close_cb() as
       the connection would be so short lived that the socket would be
       closed before we could even start WAIT()ing

* The tcpdns has been converted to using libuv directly.  Previously,
  the tcpdns protocol used tcp protocol from netmgr, this proved to be
  very complicated to understand, fix and make changes to.  The new
  tcpdns protocol is modeled in a similar way how tcp netmgr protocol.
  Closes: #2194, #2283, #2318, #2266, #2034, #1920

* The tcp and tcpdns is now not using isc_uv_import/isc_uv_export to
  pass accepted TCP sockets between netthreads, but instead (similar to
  UDP) uses per netthread uv_loop listener.  This greatly reduces the
  complexity as the socket is always run in the associated nm and uv
  loops, and we are also not touching the libuv internals.

  There's an unfortunate side effect though, the new code requires
  support for load-balanced sockets from the operating system for both
  UDP and TCP (see #2137).  If the operating system doesn't support the
  load balanced sockets (either SO_REUSEPORT on Linux or SO_REUSEPORT_LB
  on FreeBSD 12+), the number of netthreads is limited to 1.

* The netmgr has now two debugging #ifdefs:

  1. Already existing NETMGR_TRACE prints any dangling nmsockets and
     nmhandles before triggering assertion failure.  This options would
     reduce performance when enabled, but in theory, it could be enabled
     on low-performance systems.

  2. New NETMGR_TRACE_VERBOSE option has been added that enables
     extensive netmgr logging that allows the software engineer to
     precisely track any attach/detach operations on the nmsockets and
     nmhandles.  This is not suitable for any kind of production
     machine, only for debugging.

* The tlsdns netmgr protocol has been split from the tcpdns and it still
  uses the old method of stacking the netmgr boxes on top of each other.
  We will have to refactor the tlsdns netmgr protocol to use the same
  approach - build the stack using only libuv and openssl.

* Limit but not assert the tcp buffer size in tcp_alloc_cb
  Closes: #2061

(cherry picked from commit 634bdfb16d)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
4a854da141 netmgr: server-side TLS support
Add server-side TLS support to netmgr - that includes moving some of the
isc_nm_ functions from tcp.c to a wrapper in netmgr.c calling a proper
tcp or tls function, and a new isc_nm_listentls() function.

Add DoT support to tcpdns - isc_nm_listentlsdns().

(cherry picked from commit b2ee0e9dc3)
2020-12-09 10:46:16 +01:00
Ondřej Surý
fcfb3e77bb Remove the requirement for the release notes to have copyright
The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.

(cherry picked from commit cb30d9892d)
2020-12-09 10:50:15 +01:00
Mark Andrews
2898f530cd Check that missing cookies are handled
(cherry picked from commit bd9155590e)
2020-11-27 08:44:00 +11:00
Matthijs Mekking
2f0b924ce6 Add NSEC3PARAM unit test, refactor zone.c
Add unit test to ensure the right NSEC3PARAM event is scheduled in
'dns_zone_setnsec3param()'.  To avoid scheduling and managing actual
tasks, split up the 'dns_zone_setnsec3param()' function in two parts:

1. 'dns__zone_lookup_nsec3param()' that will check if the requested
   NSEC3 parameters already exist, and if a new salt needs to be
   generated.

2. The actual scheduling of the new NSEC3PARAM event (if needed).

(cherry picked from commit 64db30942d)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
008e84e965 Support for NSEC3 in dnssec-policy
Implement support for NSEC3 in dnssec-policy.  Store the configuration
in kasp objects. When configuring a zone, call 'dns_zone_setnsec3param'
to queue an nsec3param event. This will ensure that any previous
chains will be removed and a chain according to the dnssec-policy is
created.

Add tests for dnssec-policy zones that uses the new 'nsec3param'
option, as well as changing to new values, changing to NSEC, and
changing from NSEC.

(cherry picked from commit 114af58ee2)
2020-11-26 14:15:02 +00:00
Michał Kępień
ce18f66336 Set up release notes for BIND 9.16.10 2020-11-26 12:30:25 +01:00
Michał Kępień
259bcc5cc2 Prepare release notes for BIND 9.16.9 2020-11-26 12:25:53 +01:00
Mark Andrews
939e735e2c Check that a zone in the process of being signed resolves
ans10 simulates a local anycast server which has both signed and
unsigned instances of a zone.  'A' queries get answered from the
signed instance.  Everything else gets answered from the unsigned
instance.  The resulting answer should be insecure.

(cherry picked from commit d7840f4b93)
2020-10-30 09:19:12 +11:00
Michał Kępień
09b9dffd46 Set up release notes for BIND 9.16.9 2020-10-22 09:14:31 +02:00
Michał Kępień
a38a76d455 Prepare release notes for BIND 9.16.8 2020-10-22 09:09:07 +02:00
Matthijs Mekking
5d3c4baad0 The kasp system test requires Python
Only run the "kasp" system test if the path to the Python interpreter is
set.
2020-10-07 14:14:14 +02:00
Matthijs Mekking
0e07dbe263 Test migration to dnssec-policy with views
This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.

(cherry picked from commit 621093fe69)
2020-10-02 10:18:52 +02:00
Mark Andrews
6583a9437f Add the ability to select tests to run
task_test [-t <test_name>]

(cherry picked from commit 76837484e7)
2020-10-01 22:57:43 +10:00
Michał Kępień
e05e5d7c12 Clean up use of function wrapping
Currently, building BIND using "--without-dlopen" universally breaks
building unit tests which employ the --wrap linker option (because the
replacement functions are put in a shared library and building shared
objects requires "--with-dlopen").  Fix by moving the overridden symbol,
isc_nmhandle_unref(), to lib/ns/tests/nstest.c and dropping
lib/ns/tests/wrap.c altogether.  This makes lib/ns/tests/Makefile.in
simpler and prevents --without-dlopen from messing with the process of
building unit tests.

Remove parts of configure.ac which are made redundant by the above
changes.

Put the replacement definition of isc_nmhandle_unref() inside an #ifdef
block, so that the build does not break for non-libtool builds (see
below).

These changes allow the broadest possible set of build variants to work
while also simplifying the build process:

  - for libtool builds, overriding isc_nmhandle_unref() is done by
    placing that symbol directly in lib/ns/tests/nstest.c and relying on
    the dynamic linker to perform symbol resolution in the expected way
    when the test binary is run,

  - for non-libtool builds, overriding isc_nmhandle_unref() is done
    using the --wrap linker option (the libtool approach cannot be used
    in this case as multiple strong symbols with the same name cannot
    coexist in the same binary),

  - the "--without-dlopen" option no longer affects building unit tests.
2020-09-28 09:16:48 +02:00
Michal Nowak
2ee405d753 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 420986bf18)
2020-09-22 11:39:08 +02:00
Michał Kępień
b027f992a0 Set up release notes for BIND 9.16.8 2020-09-16 22:55:35 +02:00
Michał Kępień
4cebadfc3f Prepare release notes for BIND 9.16.7 2020-09-16 22:50:38 +02:00
Evan Hunt
df698d73f4 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Evan Hunt
5627f0c512 fix a typo in copyright headers, and change "http" to "https"
(cherry picked from commit 481a7aae44)
2020-09-14 16:47:50 -07:00
Ondřej Surý
9d3c6785b5 Add PoC for assertion failure on large TCP DNS messages
(cherry picked from commit 2c796bb9c8)
2020-08-31 13:38:17 +02:00
Evan Hunt
544ea41224 test whether DS chasing works correctly when forwarding
(cherry picked from commit dd8db89525)
2020-08-31 12:00:13 +02:00
Ondřej Surý
f195c192a6 Add PoC system test for pk11_numbits() assertion
(cherry picked from commit a69433ba40)
2020-08-31 10:58:56 +02:00
Mark Andrews
6acd6ae943 check that a malformed truncated response to a TSIG query is handled
(cherry picked from commit 8bbf3eb5f3)
2020-08-31 08:35:30 +02:00
Mark Andrews
dd5be2940c add missing copyright entry 2020-08-25 10:01:28 +10:00
Michał Kępień
dc8ecaad5d Prepare release notes for BIND 9.16.6 2020-08-06 09:19:25 +02:00
Mark Andrews
20bc6aefff Check rcode is FORMERR
(cherry picked from commit 88ff6b846c)
2020-08-04 23:04:34 +10:00
Michal Nowak
0f319908f0
Remove cross-test dependency on ckdnsrps.sh 2020-07-30 16:25:23 +02:00
Michał Kępień
0fbe13bc65 Set up release notes for BIND 9.16.6 2020-07-15 23:19:58 +02:00
Michał Kępień
a67bdd4d1d Prepare release notes for BIND 9.16.5 2020-07-15 23:10:17 +02:00
Ondřej Surý
b9b1366bf0 Add prereq.sh script to the shutdown system test
The shutdown test requires python, pytest and dnspython.
2020-07-03 08:54:01 +02:00
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
Michał Kępień
4712aa7330 Set up release notes for BIND 9.16.5 2020-06-18 10:33:50 +02:00
Michał Kępień
40b3591eea Prepare release notes for BIND 9.16.4 2020-06-18 10:25:05 +02:00
Ondřej Surý
ad0ab84835 Remove libdns section in ARM
When we made BIND 9 libraries private to BIND 9, we forgot to remove the
libdns section on "export" libraries from the ARM.

(cherry picked from commit 3637c466c9)
2020-06-04 11:00:16 +02:00
Michał Kępień
b594b1c95f Add Danger Python to GitLab CI
Certain rules of the BIND development process are not codified anywhere
and/or are used inconsistently.  In an attempt to improve this
situation, add a GitLab CI job which uses Danger Python to add comments
to merge requests when certain expectations are not met.  Two categories
of feedback are used, only one of which - fail() - causes the GitLab CI
job to fail.  Exclude dangerfile.py from Python QA checks as the way the
contents of that file are evaluated triggers a lot of Flake8 and PyLint
warnings.

(cherry picked from commit 36bb45a8b6)
2020-06-01 13:45:35 +02:00
Suzanne Goldlust
d56c44579e Grammar, clarity, and content fixes in reference.rst
Also converted logging-categories.rst from a table to text and adjusted
the util/check-categories.sh script.

(cherry picked from commit 1e067c4d0b)
2020-06-01 09:58:29 +02:00
Evan Hunt
714b559902 fix doxygen build 2020-06-01 09:58:29 +02:00
Evan Hunt
93bdf74804 clean up doc checks
- Update util/check-categories.sh for logging-categories.rst, call from CI
- remove xmllint of .html files
2020-06-01 09:58:29 +02:00
Evan Hunt
5a855f6754 convert release notes to RST 2020-06-01 09:58:25 +02:00
Evan Hunt
b580eb2fb3 add support for building sphinx documentation 2020-06-01 09:54:46 +02:00
Ondřej Surý
58e20fa746 Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.

(cherry picked from commit 9fb6d11abb)
2020-06-01 09:54:45 +02:00