Commit Graph

31922 Commits

Author SHA1 Message Date
Michal Nowak
571b73260c Merge branch 'mnowak/fix-core-dumps-were-found-line-v9_16' into 'v9_16'
[v9_16] Make sure .txt files are not identified as crashed test

See merge request isc-projects/bind9!3947
2020-08-12 10:54:50 +00:00
Michal Nowak
01119ac4f9 Make sure .txt files are not identified as crashed test
Previously .txt files with full backtrace may be identified as a
crashed test:

    I:Core dumps were found for the following system tests:
    I:	 core.19948-backtrace.txt
    I:   shutdown

Now .txt files are removed from the list.

Change 'run.sh.in' to match the core matching pattern in
'testsummary.sh'.

(cherry picked from commit c2dcd95966)
2020-08-12 09:52:07 +02:00
Mark Andrews
174c588958 Merge branch '2045-readline-rltypedefs-h-35-22-error-this-function-declaration-is-not-a-prototype-on-netbsd-9-v9_16' into 'v9_16'
Resolve "readline/rltypedefs.h:35:22: error: this function declaration is not a prototype on NetBSD 9"

See merge request isc-projects/bind9!3945
2020-08-12 00:21:56 +00:00
Mark Andrews
cbcb265a5b Ensure rl_message() gets prototype.
(cherry picked from commit fd126553d4)
2020-08-12 09:40:39 +10:00
Mark Andrews
ea4457be88 Stop deprecated functions being defined
(cherry picked from commit 1532a34658)
2020-08-12 09:40:39 +10:00
Michal Nowak
291b565c0e Merge branch 'mnowak/run-tarball-tests-in-schedule-v9_16' into 'v9_16'
[v9_16] Run unit and system tarball tests on schedules

See merge request isc-projects/bind9!3943
2020-08-11 15:02:41 +00:00
Michal Nowak
f57684c6a3 Run unit and system tarball tests on schedules
To prevent problems with unit and system tarball tests being revealed
during release process, run these tests on schedules.

(cherry picked from commit 439fe9bc3c)
2020-08-11 17:00:41 +02:00
Mark Andrews
6761143221 Merge branch '2067-nta-related-crash-in-checkbogus-after-an-rndc-reload-v9_16' into 'v9_16'
Address use after free between view, resolver and nta.

See merge request isc-projects/bind9!3940
2020-08-11 02:17:44 +00:00
Mark Andrews
f3b25f1ffb Address use after free between view, resolver and nta.
Hold a weak reference to the view so that it can't go away while
nta is performing its lookups.  Cancel nta timers once all external
references to the view have gone to prevent them triggering new work.

(cherry picked from commit 0b2555e8cf)
2020-08-11 11:55:44 +10:00
Evan Hunt
7dd51f8d57 Merge branch 'each-fix-typo-v9_16' into 'v9_16'
fix typo

See merge request isc-projects/bind9!3939
2020-08-10 19:43:21 +00:00
Evan Hunt
a69b8e9b85 fix ARM typo 2020-08-10 12:39:18 -07:00
Michał Kępień
b8dcd6eb65 Merge branch '1775-pick-smaller-default-rbt-hash-table-size-v9_16' into 'v9_16'
Reduce the default rbt hashtable size to 16 entries (4 bits) (v9.16)

See merge request isc-projects/bind9!3936
2020-08-10 09:29:18 +00:00
Ondřej Surý
f0ccc17f30 Reduce the default RBT hash table size to 16 entries (4 bits)
The hash table rework MRs (!3865, !3871) increased the default RBT hash
table size from 64 to 65,536 entries (for 64-bit architectures, that is
512 bytes before vs. 524,288 bytes after).  This works fine for RBTs
used for cache databases, but since three separate RBT databases are
created for every zone loaded (RRs, NSEC, NSEC3), memory usage would
skyrocket when BIND 9 is used as an authoritative DNS server with many
zones.

The default RBT hash table size before the rework was 64 entries, this
commit reduces it to 16 entries because our educated guess is that most
zones are just couple of entries (SOA, NS, A, AAAA, MX) and rehashing
small hash tables is actually cheap.  The rework we did in the previous
MRs tries to avoid growing the hash tables for big-to-huge caches where
growing the hash table comes at a price because the whole cache needs to
be locked.

(cherry picked from commit 1e043a011b)
2020-08-10 10:32:26 +02:00
Mark Andrews
de1b12e8db Merge branch '2068-spnego-c-1430-2-error-len-may-be-used-uninitialized-in-this-function-on-arm' into 'v9_16'
Resolve "spnego.c:1430:2: error: ‘len’ may be used uninitialized in this function on ARM"

See merge request isc-projects/bind9!3929
2020-08-08 06:45:16 +00:00
Mark Andrews
8a4dd25562 Silence 'may be used uninitialized' 2020-08-08 16:12:12 +10:00
Matthijs Mekking
f9d392b4e0 Merge branch '1613-rndc-dnssec-checkds-v9_16' into 'v9_16'
Resolve "Signal DS submitting via rndc"

See merge request isc-projects/bind9!3931
2020-08-07 13:32:40 +00:00
Matthijs Mekking
624f1b9531 rndc dnssec -checkds set algorithm
In the rare case that you have multiple keys acting as KSK and that
have the same keytag, you can now set the algorithm when calling
'-checkds'.

(cherry picked from commit 46fcd927e7)
2020-08-07 13:34:10 +02:00
Matthijs Mekking
06bc3f2210 Add notes for #1613 (rndc dnssec -checkds)
This is a new feature that should be mentioned in the notes.

(cherry picked from commit e4c82fc7ae)
2020-08-07 13:33:59 +02:00
Matthijs Mekking
ad0752bc22 Test 'rndc dnssec -checkds' on multiple zones
Make sure the 'checkds' command correctly sets the right key timing
metadata and also make sure that it rejects setting the key timing
metadata if there are multiple keys with the KSK role and no key
identifier is provided.

(cherry picked from commit a43bb41909)
2020-08-07 13:30:59 +02:00
Matthijs Mekking
4892006a92 Make 'parent-registration-delay' obsolete
With the introduction of 'checkds', the 'parent-registration-delay'
option becomes obsolete.

(cherry picked from commit a25f49f153)
2020-08-07 13:30:50 +02:00
Matthijs Mekking
0475646ebb Adjust kasp tests to use 'checkds'
With 'checkds' replacing 'parent-registration-delay', the kasp
test needs the expected times to be adjusted. Also the system test
needs to call 'rndc dnssec -checkds' to progress the rollovers.

Since we pretend that the KSK is active as soon as the DS is
submitted (and parent registration delay is no longer applicable)
we can simplify the 'csk_rollover_predecessor_keytimes' function
to take only one "addtime" parameter.

This commit also slightly changes the 'check_dnssecstatus' function,
passing the zone as a parameter.

(cherry picked from commit 38cb43bc86)
2020-08-07 13:30:40 +02:00
Matthijs Mekking
5dcf56f216 Fix time printing in key files
Don't strip off the final character when printing times in key files.

With the introduction of 'rndc dnssec -status' we introduced
'isc_stdtime_tostring()'. This changed in behavior such that it was no
longer needed to strip of the final '\n' of the string format
datetime. However, in 'printtime()' it still stripped the final
character.

(cherry picked from commit e3eb55fd1c)
2020-08-07 13:30:30 +02:00
Matthijs Mekking
81d0c63ecb Implement 'rndc dnssec -checkds'
Add a new 'rndc' command 'dnssec -checkds' that allows the user to
signal named that a new DS record has been seen published in the
parent, or that an existing DS record has been withdrawn from the
parent.

Upon the 'checkds' request, 'named' will write out the new state for
the key, updating the 'DSPublish' or 'DSRemoved' timing metadata.

This replaces the "parent-registration-delay" configuration option,
this was unreliable because it was purely time based (if the user
did not actually submit the new DS to the parent for example, this
could result in an invalid DNSSEC state).

Because we cannot rely on the parent registration delay for state
transition, we need to replace it with a different guard. Instead,
if a key wants its DS state to be moved to RUMOURED, the "DSPublish"
time must be set and must not be in the future. If a key wants its
DS state to be moved to UNRETENTIVE, the "DSRemoved" time must be set
and must not be in the future.

By default, with '-checkds' you set the time that the DS has been
published or withdrawn to now, but you can set a different time with
'-when'. If there is only one KSK for the zone, that key has its
DS state moved to RUMOURED. If there are multiple keys for the zone,
specify the right key with '-key'.

(cherry picked from commit 04d8fc0143)
2020-08-07 13:30:19 +02:00
Michał Kępień
c01e643715 Merge branch 'michal/remove-arm64-jobs-from-gitlab-ci-v9_16' into 'v9_16'
[v9_16] Remove arm64 jobs from GitLab CI

See merge request isc-projects/bind9!3922
2020-08-05 10:09:29 +00:00
Michał Kępień
3ab00a11eb Remove arm64 jobs from GitLab CI
The only arm64 runner we have at our disposal is suffering from
intermittent connectivity issues which make it unusable for extended
periods of time.  Remove arm64 jobs from GitLab CI until we manage to
set up an arm64 runner with more reliable connectivity.

(cherry picked from commit 49f245f7c0)
2020-08-05 12:07:37 +02:00
Michał Kępień
2798a4443d Merge branch '2065-set-max-cache-size-in-the-geoip2-system-test-v9_16' into 'v9_16'
[v9_16] Set "max-cache-size" in the "geoip2" system test

See merge request isc-projects/bind9!3921
2020-08-05 09:43:19 +00:00
Michał Kępień
fec4664ab0 Set "max-cache-size" in the "geoip2" system test
The named configuration files used in the "geoip2" system test cause a
rather large number of views (6-8) to be set up in each tested named
instance.  Each view has its own cache.

Commit aa72c31422 caused the RBT hash
table to be pre-allocated to a size derived from "max-cache-size", so
that it never needs to be rehashed.  The size of that hash table is not
expected to be significant enough to cause memory use issues in typical
conditions even for large "max-cache-size" settings.

However, these two factors combined can cause memory exhaustion issues
in GitLab CI, where we run multiple "instances" of the test suite in
parallel on the same runner, each test suite executes multiple system
tests concurrently, and each system test may potentially start multiple
named instances at the same time.  In practice, this problem currently
only seems to be affecting the "geoip2" system test, which is failing
intermittently due to named instances used by that test getting killed
by oom-killer.

Prevent the "geoip2" system test from failing intermittently by setting
"max-cache-size" in named configuration files used in that test to a low
value in order to keep memory usage at bay even with a large number of
views configured.

(cherry picked from commit 4292d5bdfe)
2020-08-05 11:08:24 +02:00
Matthijs Mekking
71cd1a1d5c Merge branch 'ondrej-serve-stale-improvements-v9_16' into 'v9_16'
Serve stale improvements (9.16)

See merge request isc-projects/bind9!3913
2020-08-05 08:16:10 +00:00
Matthijs Mekking
f3103660d0 keyword 'primaries' is unknown in 9.16
In 9.17 we introduced 'primaries' as a synonym for 'masters' in the
configuration file. This synonym has not been backported so change
the serve-stale test to make use of the 'masters' keyword.
2020-08-05 09:09:16 +02:00
Matthijs Mekking
c92de6cb44 stale-cache-enable is enabled by default
Because this is a backport, the option should default to keep the
serve-stale caching enabled.
2020-08-05 09:09:16 +02:00
Ondřej Surý
f3a7ee87ef Add CHANGES and release notes for GL #1712 and GL #1829
(cherry picked from commit dd62275152)
2020-08-05 09:09:16 +02:00
Ondřej Surý
c4e6ade0e5 Add tests with stale-cache-disabled into serve-stale system test
Add a fifth named (ns5) that runs with `stale-cache-enable no;` and
check that there are no stale records in the cache.

(cherry picked from commit abc2ab9223)
2020-08-05 09:09:16 +02:00
Ondřej Surý
f9711481ad Expire the 0 TTL RRSet quickly rather using them for serve-stale
When a received RRSet has TTL 0, they would be preserved for
serve-stale (default `max-stale-cache` is 12 hours) rather than expiring
them quickly from the cache database.

This commit makes sure the RRSet didn't have TTL 0 before marking the
entry in the database as "stale".

(cherry picked from commit 6ffa2ddae0)
2020-08-05 09:09:16 +02:00
Ondřej Surý
b48e9ab201 Add stale-cache-enable option and disable serve-stable by default
The current serve-stale implementation in BIND 9 stores all received
records in the cache for a max-stale-ttl interval (default 12 hours).

This allows DNS operators to turn the serve-stale answers in an event of
large authoritative DNS outage.  The caching of the stale answers needs
to be enabled before the outage happens or the feature would be
otherwise useless.

The negative consequence of the default setting is the inevitable
cache-bloat that happens for every and each DNS operator running named.

In this MR, a new configuration option `stale-cache-enable` is
introduced that allows the operators to selectively enable or disable
the serve-stale feature of BIND 9 based on their decision.

The newly introduced option has been disabled by default,
e.g. serve-stale is disabled in the default configuration and has to be
enabled if required.

(cherry picked from commit ce53db34d6)
2020-08-05 09:09:16 +02:00
Michał Kępień
b1792f2ec5 Merge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still-has-the-pre-9-3-0-explanation-v9_16' into 'v9_16'
[v9_16] Update description of forwarding behavior in ARM

See merge request isc-projects/bind9!3917
2020-08-04 19:50:56 +00:00
Suzanne Goldlust
2d530d259a Update description of forwarding behavior in ARM
(cherry picked from commit 30e126ad02)
2020-08-04 21:42:32 +02:00
Mark Andrews
702c840e93 Merge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR-v9_16' into 'v9_16'
Marka dns r badtsig map to formerr v9 16

See merge request isc-projects/bind9!3914
2020-08-04 13:30:51 +00:00
Mark Andrews
20bc6aefff Check rcode is FORMERR
(cherry picked from commit 88ff6b846c)
2020-08-04 23:04:34 +10:00
Mark Andrews
2dc26ebdb6 Map DNS_R_BADTSIG to FORMERR
Now that the log message has been printed set the result code to
DNS_R_FORMERR.  We don't do this via dns_result_torcode() as we
don't want upstream errors to produce FORMERR if that processing
end with DNS_R_BADTSIG.

(cherry picked from commit 20488d6ad3)
2020-08-04 23:04:34 +10:00
Diego dos Santos Fronza
535d27ffc5 Merge branch '1719-observed-stats-underflow-in-multiple-stats-v9_16' into 'v9_16'
Resolve "Observed stats underflow in multiple stats"

See merge request isc-projects/bind9!3866
2020-08-03 23:20:43 +00:00
Diego Fronza
e1561f0eb2 Add CHANGES and release note for #1719 2020-08-03 19:18:04 -03:00
Diego Fronza
fca1000ee9 Fix ns_statscounter_recursclients underflow
The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857
2020-08-03 19:18:04 -03:00
Michał Kępień
7519821f16 Merge branch 'michal/restore-placeholder-entry-at-sequence-number-5481-v9_16' into 'v9_16'
[v9_16] Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3911
2020-08-03 20:15:19 +00:00
Michał Kępień
b917e9eb20 Restore placeholder entry at sequence number 5481
(cherry picked from commit 029e32c01a)
2020-08-03 22:14:11 +02:00
Ondřej Surý
5f8ecfb918 Merge branch '2038-use-freebind-when-bind-fails-v9_16' into 'v9_16'
Resolve "Bind not handling interfaces changes correctly when listen-on-v6  any  specified"

See merge request isc-projects/bind9!3907
2020-07-31 15:55:53 +00:00
Witold Kręcicki
95fb38619b Add CHANGES and release note for GL #2038
(cherry picked from commit 94eda43ab2)
2020-07-31 13:33:24 +02:00
Witold Kręcicki
a12076cc52 netmgr: retry binding with IP_FREEBIND when EADDRNOTAVAIL is returned.
When a new IPv6 interface/address appears it's first in a tentative
state - in which we cannot bind to it, yet it's already being reported
by the route socket. Because of that BIND9 is unable to listen on any
newly detected IPv6 addresses. Fix it by setting IP_FREEBIND option (or
equivalent option on other OSes) and then retrying bind() call.

(cherry picked from commit a0f7d28967)
2020-07-31 13:33:06 +02:00
Michał Kępień
23021385d5 Merge branch 'michal/only-run-system-tests-as-root-in-developer-mode-v9_16' into 'v9_16'
[v9_16] Only run system tests as root in developer mode

See merge request isc-projects/bind9!3897
2020-07-31 05:47:20 +00:00
Michał Kępień
e734651fbd Only run system tests as root in developer mode
Running system tests with root privileges is potentially dangerous.
Only allow it when explicitly requested (by building with
--enable-developer).

(cherry picked from commit 3ef106f69d)
2020-07-31 07:46:27 +02:00
Mark Andrews
3d606d902f Merge branch '1456-always-check-return-from-isc_refcount_decrement-v9_16' into 'v9_16'
Always check the return from isc_refcount_decrement.

See merge request isc-projects/bind9!3901
2020-07-31 03:32:51 +00:00