Commit Graph
27469 Commits
Author SHA1 Message Date
Tinderbox UserandOndřej Surý 7c6b5f2eaa prep 9.11.6-P1
(cherry picked from commit 6195f229b6)
2019-04-25 15:55:59 +02:00
Ondřej Surý aaee75288a Merge branch '999-tcp-client-crash-v9_11-locks' into 'v9_11'
Replace atomic operations in bin/named/client.c with isc_refcount reference counting

See merge request isc-projects/bind9!1864
2019-04-25 09:54:09 -04:00
Ondřej Surý ef49780d30 Replace atomic operations in bin/named/client.c with isc_refcount reference counting 2019-04-25 15:40:06 +02:00
Ondřej Surý 581ae79528 Merge branch '615-tcp-client-crash-v9_11-v9_11_6_patch-v9_11' into 'v9_11'
Resolve "tcp-clients mostly ineffective"

See merge request isc-projects/bind9!1863
2019-04-25 09:38:41 -04:00
Evan HuntandOndřej Surý b96a3a0c79 CHANGES, release note
(cherry picked from commit 5e18ad05f4)
2019-04-25 15:05:12 +02:00
Evan HuntandOndřej Surý 59434b987e restore allowance for tcp-clients < interfaces
in the "refactor tcpquota and pipeline refs" commit, the counting
of active interfaces was tightened in such a way that named could
fail to listen on an interface if there were more interfaces than
tcp-clients. when checking the quota to start accepting on an
interface, if the number of active clients was above zero, then
it was presumed that some other client was able to handle accepting
new connections. this, however, ignored the fact that the current client
could be included in that count, so if the quota was already exceeded
before all the interfaces were listening, some interfaces would never
listen.

we now check whether the current client has been marked active; if so,
then the number of active clients on the interface must be greater
than 1, not 0.

(cherry picked from commit 0b4e2cd4c3192ba88569dd344f542a8cc43742b5)
(cherry picked from commit d01023aaac)
2019-04-25 15:04:26 +02:00
Evan HuntandOndřej Surý c47ccf630f refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota
- if the TCP quota has been exceeded but there are no clients listening
  for new connections on the interface, we can now force attachment to the
  quota using isc_quota_force(), instead of carrying on with the quota not
  attached.
- the TCP client quota is now referenced via a reference-counted
  'ns_tcpconn' object, one of which is created whenever a client begins
  listening for new connections, and attached to by members of that
  client's pipeline group. when the last reference to the tcpconn
  object is detached, it is freed and the TCP quota slot is released.
- reduce code duplication by adding mark_tcp_active() function.
- convert counters to atomic.

(cherry picked from commit 7e8222378ca24f1302a0c1c638565050ab04681b)
(cherry picked from commit 4939451275722bfda490ea86ca13e84f6bc71e46)
(cherry picked from commit 13f7c918b8)
2019-04-25 15:04:26 +02:00
Evan HuntandOndřej Surý 2ab8a085b3 better tcpquota accounting and client mortality checks
- ensure that tcpactive is cleaned up correctly when accept() fails.
- set 'client->tcpattached' when the client is attached to the tcpquota.
  carry this value on to new clients sharing the same pipeline group.
  don't call isc_quota_detach() on the tcpquota unless tcpattached is
  set.  this way clients that were allowed to accept TCP connections
  despite being over quota (and therefore, were never attached to the
  quota) will not inadvertently detach from it and mess up the
  accounting.
- simplify the code for tcpquota disconnection by using a new function
  tcpquota_disconnect().
- before deciding whether to reject a new connection due to quota
  exhaustion, check to see whether there are at least two active
  clients. previously, this was "at least one", but that could be
  insufficient if there was one other client in READING state (waiting
  for messages on an open connection) but none in READY (listening
  for new connections).
- before deciding whether a TCP client object can to go inactive, we
  must ensure there are enough other clients to maintain service
  afterward -- both accepting new connections and reading/processing new
  queries.  A TCP client can't shut down unless at least one
  client is accepting new connections and (in the case of pipelined
  clients) at least one additional client is waiting to read.

(cherry picked from commit c7394738b2445c16f728a88394864dd61baad900)
(cherry picked from commit e965d5f11d3d0f6d59704e614fceca2093cb1856)
(cherry picked from commit 87d4311614)
2019-04-25 15:04:26 +02:00
Michał KępieńandOndřej Surý 366b4e1ede use reference counter for pipeline groups (v3)
Track pipeline groups using a shared reference counter
instead of a linked list.

(cherry picked from commit 513afd33eb17d5dc41a3f0d2d38204ef8c5f6f91)
(cherry picked from commit 9446629b73)
2019-04-25 15:04:25 +02:00
Witold KręcickiandOndřej Surý 719f604e3f tcp-clients could still be exceeded (v2)
the TCP client quota could still be ineffective under some
circumstances.  this change:

- improves quota accounting to ensure that TCP clients are
  properly limited, while still guaranteeing that at least one client
  is always available to serve TCP connections on each interface.
- uses more descriptive names and removes one (ntcptarget) that
  was no longer needed
- adds comments

(cherry picked from commit 924651f1d5e605cd186d03f4f7340bcc54d77cc2)
(cherry picked from commit 55a7a458e3)
2019-04-25 15:04:25 +02:00
Witold KręcickiandOndřej Surý ec2d50da8d fix enforcement of tcp-clients (v1)
tcp-clients settings could be exceeded in some cases by
creating more and more active TCP clients that are over
the set quota limit, which in the end could lead to a
DoS attack by e.g. exhaustion of file descriptors.

If TCP client we're closing went over the quota (so it's
not attached to a quota) mark it as mortal - so that it
will be destroyed and not set up to listen for new
connections - unless it's the last client for a specific
interface.

(cherry picked from commit f97131d21b97381cef72b971b157345c1f9b4115)
(cherry picked from commit 9689ffc485)
2019-04-25 15:04:25 +02:00
Matthijs Mekking f7f3b0cd8c Merge branch 'matthijs-fix-dnssec-test-intermittent-failure-kskonly-v9_11' into 'v9_11'
Fix dnssec test intermittent failure related to kskonly bugfix

See merge request isc-projects/bind9!1858
2019-04-24 03:54:42 -04:00
Matthijs Mekking 3c9a7ffac8 Wait for correct log message in dnssec/tests.sh
In 9.11 there are some log messages not existing, but the tests
rely on.  Adjust the grep call that gives confidence the rollover
step has occurred.
2019-04-24 09:41:22 +02:00
Matthijs Mekking 9c77cd8306 Harden grep key ID calls
Key IDs may accidentally match dig output that is not the key ID (for
example the RRSIG inception or expiration time, the query ID, ...).
Search for key ID + signer name should prevent that, as that is what
only should occur in the RRSIG record, and signer name always follows
the key ID.

(cherry picked from commit 83473b9758)
2019-04-24 09:41:22 +02:00
Matthijs Mekking d8de28610d Remove sleeps
Remove sleep calls from test, rely on wait_for_log().  Make
wait_for_log() and dnssec_loadkeys_on() fail the test if the
appropriate log line is not found.

Slightly adjust the echo_i() lines to print only the key ID (not the
key name).

(cherry picked from commit 67f0635f3c)
2019-04-24 09:41:22 +02:00
Mark Andrews 216752e3b2 Merge branch '995-dlz_open_driver-fix-build-failure-without-dlfcn-h-v9_11' into 'v9_11'
Resolve "dlz_open_driver: fix build failure without dlfcn.h"

See merge request isc-projects/bind9!1855
2019-04-23 21:02:25 -04:00
Mark Andrews 29525f639f add CHANGES
(cherry picked from commit 19e4098139)
2019-04-24 09:31:51 +10:00
Mark Andrews 4ab8411c4c conditionally include <dlfcn.h>
(cherry picked from commit eee8084734)
2019-04-24 09:31:20 +10:00
Michał Kępień 22e81bdc82 Merge branch 'michal/minor-nsupdate-system-test-tweaks-v9_11' into 'v9_11'
[v9_11] Minor "nsupdate" system test tweaks

See merge request isc-projects/bind9!1849
2019-04-23 09:20:07 -04:00
Michał Kępień 4e2cc911d2 Wait more than 1 second for NSEC3 chain changes
One second may not be enough for an NSEC3 chain change triggered by an
UPDATE message to complete.  Wait up to 10 seconds when checking whether
a given NSEC3 chain change is complete in the "nsupdate" system test.

(cherry picked from commit f8746cddbc)
2019-04-23 14:59:30 +02:00
Michał Kępień 5d8147fa70 Remove redundant sleeps
In the "nsupdate" system test, do not sleep before checking results of
changes which are expected to be processed synchronously, i.e. before
nsupdate returns.

(cherry picked from commit 1c8e5ea333)
2019-04-23 14:59:29 +02:00
Mark Andrews fc9b7cea99 Merge branch '962-bind-just-disables-gssapi-support-if-no-gssapi-krb5-headers-found-v9_11' into 'v9_11'
Resolve "Bind just disables GSSAPI support if no GSSAPI/KRB5 headers found"

See merge request isc-projects/bind9!1843
2019-04-22 23:15:15 -04:00
Mark Andrews e55a19c8f0 make 'configure --with-gssapi=yes' fatal if support is not found
(cherry picked from commit e420078c63)
2019-04-23 13:01:17 +10:00
Mark Andrews 6d39087183 Merge branch 'incorrect-use-of-bool-v9_11' into 'v9_11'
using 0 instead of false

See merge request isc-projects/bind9!1840
2019-04-22 21:58:46 -04:00
Mark Andrews ac77f8df02 using 0 instead of false
(cherry picked from commit da7f683abf)
2019-04-23 11:46:12 +10:00
Michał Kępień 2dee058987 Merge branch 'michal/win32-system-test-fixes-v9_11' into 'v9_11'
[v9_11] Miscellaneous Windows system test fixes

See merge request isc-projects/bind9!1835
2019-04-19 05:52:17 -04:00
Michał Kępień f78f6439b7 Update interface lists in ifconfig scripts
Make bin/tests/system/ifconfig.bat also configure addresses ending with
9 and 10, so that the script is in sync with its Unix counterpart.

Update comments listing the interfaces created by ifconfig.{bat,sh} so
that they do not include addresses whose last octet is zero (since an
address like 10.53.1.0/24 is not a valid host address and thus the
aforementioned scripts do not even attempt configuring them).

(cherry picked from commit b6c1cdfffe)
2019-04-19 11:30:32 +02:00
Michał Kępień 4f992ab35f Fix the "dnssec" system test on Windows
On Windows, the bin/tests/system/dnssec/signer/example.db.signed file
contains carriage return characters at the end of each line.  Remove
them before passing the aforementioned file to the awk script extracting
key IDs so that the latter can work properly.

(cherry picked from commit e4280ed9f5)
2019-04-19 11:30:27 +02:00
Michał Kępień d9688b58c8 Do not wait for lock file cleanup on Windows
As signals are currently not handled by named on Windows, instances
terminated using signals are not able to perform a clean shutdown, which
involves e.g. removing the lock file.  Thus, waiting for a given
instance's lock file to be removed beforing assuming it is shut down
is pointless on Windows, so do not even attempt it.

(cherry picked from commit 761ba4514f)
2019-04-19 11:29:44 +02:00
Michał Kępień 0aec955235 Merge branch '979-win32-remove-lock-file-upon-shutdown-v9_11' into 'v9_11'
[v9_11] win32: remove lock file upon shutdown

See merge request isc-projects/bind9!1833
2019-04-19 05:20:32 -04:00
Michał Kępień 48ddc78fb2 Add CHANGES entry
5214.	[bug]		win32: named now removes its lock file upon shutdown.
			[GL #979]

(cherry picked from commit e048436805)
2019-04-19 11:00:47 +02:00
Michał Kępień 8e18f02626 win32: remove lock file upon shutdown
Upon named shutdown, the lock file should not just be unlocked but also
removed.

(cherry picked from commit c506077da5)
2019-04-19 11:00:46 +02:00
Michał Kępień 2adc28712d Merge branch '978-win32-fix-service-state-reported-during-shutdown-v9_11' into 'v9_11'
[v9_11] win32: fix service state reported during shutdown

See merge request isc-projects/bind9!1831
2019-04-19 04:19:36 -04:00
Michał Kępień 89c8fed449 Add CHANGES entry
5213.	[bug]		win32: Eliminated a race which allowed named.exe running
			as a service to be killed prematurely during shutdown.
			[GL #978]

(cherry picked from commit e7332343ed)
2019-04-19 09:54:20 +02:00
Michał Kępień d6b8c7da4b win32: fix service state reported during shutdown
When a Windows service receives a request to stop, it should not set its
state to SERVICE_STOPPED until it is completely shut down as doing that
allows the operating system to kill that service prematurely, which in
the case of named may e.g. prevent the PID file and/or the lock file
from being cleaned up.

Set service state to SERVICE_STOP_PENDING when named begins its shutdown
and only report the SERVICE_STOPPED state immediately before exiting.

(cherry picked from commit 964749dfdb)
2019-04-19 09:54:06 +02:00
Matthijs Mekking 00e59acab4 Merge branch '757-unsupported-algorithms-v9_11' into 'v9_11'
Resolve "Investigate and fix what happens when managed-key algorithm is not supported"

See merge request isc-projects/bind9!1825
2019-04-19 03:14:15 -04:00
Matthijs Mekking b053cd4acc Update copyrights 2019-04-19 08:45:12 +02:00
Matthijs Mekking 93f33cdd0f Add documentation
(cherry picked from commit a67dac5d21)
2019-04-19 08:45:12 +02:00
Matthijs Mekking d07f643557 DLV tests unsupported/disabled algorithms
This tests both the cases when the DLV trust anchor is of an
unsupported or disabled algorithm, as well as if the DLV zone
contains a key with an unsupported or disabled algorithm.

(cherry picked from commit 3b7c849a3f)
2019-04-19 08:45:12 +02:00
Matthijs Mekking a97061c939 Ignore unsupported trust anchors
(cherry picked from commit 1d45ad8f39)

Some adaptations were made to make the code compile and tests pass.
2019-04-19 08:45:12 +02:00
Matthijs Mekking 469ef284b3 Add inline test related to unsupported algorithms
(cherry picked from commit 924fdad0e5)
2019-04-18 15:12:04 +02:00
Matthijs Mekking 8cef3952b6 System tests for tools and unsupported algorithms
(cherry picked from commit dfcf9bb0ed)
2019-04-18 15:12:04 +02:00
Ondřej Surý 48fccbf23b Merge branch '989-check-for-typeof-extension-v9_11' into 'v9_11'
(v9_11) Use uintmax_t instead of typeof(x) in the ISC_ALIGN macro on non-GNUC systems

See merge request isc-projects/bind9!1828
2019-04-18 07:34:19 -04:00
Ondřej Surý de4fe3ed32 On non-GNUC systems, use uintmax_t in the ISC_ALIGN macro
(cherry picked from commit 2e40cc94dc)
2019-04-18 13:18:10 +02:00
Ondřej Surý 7123a4703b Merge branch 'ondrej/text-files-dont-need-copyright-v9_11' into 'v9_11'
(v9_11) Simple text files don't need copyright header

See merge request isc-projects/bind9!1823
2019-04-18 03:26:23 -04:00
Ondřej Surý c76c0f4489 Simple text files with docs on build or design don't really need copyright on their own
(cherry picked from commit 1877139a32)
2019-04-18 08:59:43 +02:00
Ondřej Surý c266d181b9 Merge branch 'ondrej/refactor-DNS_RDATASET_FIXED-code-flow-v9_11' into 'v9_11'
(v9_11) Refactor the DNS_RDATASET_FIXED code to use macros instead of ifdefs

See merge request isc-projects/bind9!1818
2019-04-17 05:50:25 -04:00
Ondřej Surý 376800b2ad Refactor the DNS_RDATASET_FIXED code to use constants instead of ifdefs
(cherry picked from commit 4edbb773a1)
2019-04-17 11:34:49 +02:00
Matthijs Mekking f5b60bb8d7 Merge branch '763-matthijs-active-zsk-but-ksk-only-v9_11' into 'v9_11'
Don't sign DNSKEY RRset with ZSK if KSK is offline

See merge request isc-projects/bind9!1797
2019-04-12 10:21:15 -04:00
Matthijs Mekking ce3d35d950 Fix dnssec test
The following changes were needed:

* Remove dnskey-sig-validity option (added in 9.12)
* Replace rndccmd, dig_with_opts with export variables
* Remove tests for CDNSKEY and CDS (in 9.11 always signed with ZSK)
2019-04-12 15:57:31 +02:00