32271 Commits

Author SHA1 Message Date
Ondřej Surý
9a2a819817 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)
v9.17.4
2020-08-10 12:08:09 +02:00
Michał Kępień
94d9ffd4a2 Include fuzz/fuzz.h in source tarballs 2020-08-06 09:10:06 +02:00
Michał Kępień
6707a8558b Update BIND version to 9.17.4 2020-08-06 09:10:06 +02:00
Michał Kępień
8e212e96af Add a CHANGES marker 2020-08-06 09:10:06 +02:00
Michał Kępień
b096a038e3 Update library API versions 2020-08-06 09:10:06 +02:00
Michał Kępień
5ef9233326 Merge branch 'michal/prepare-release-notes-for-bind-9.17.4' into 'security-main'
Prepare release notes for BIND 9.17.4

See merge request isc-private/bind9!186
2020-08-06 06:14:38 +00:00
Michał Kępień
8980d219c7 Reorder release notes 2020-08-05 16:02:38 +02:00
Michał Kępień
e0f394bbc4 Prepare release notes for BIND 9.17.4 2020-08-05 16:02:38 +02:00
Michał Kępień
9d932c6ddc Add release note for #1976 2020-08-05 16:02:38 +02:00
Michał Kępień
23a60ecd15 Add release note for #1619 2020-08-05 16:02:38 +02:00
Michał Kępień
bc212cf163 Tweak and reword release notes 2020-08-05 16:02:38 +02:00
Michał Kępień
76421c885e Tweak and reword recent CHANGES entries 2020-08-05 16:02:38 +02:00
Michał Kępień
18b71e9c25 Merge branch '2055-grant-subdomain-fix' into 'security-main'
[CVE-2020-8624] Fix processing of "update-policy" rules of type "subdomain"

See merge request isc-private/bind9!189
2020-08-05 13:57:57 +00:00
Mark Andrews
4fb94906fa Add CHANGES and release note for GL #2055 2020-08-05 15:54:50 +02:00
Mark Andrews
94bc07cf05 Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
2020-08-05 15:54:50 +02:00
Mark Andrews
9b242cc707 Add a test for update-policy 'subdomain'
The new test checks that 'update-policy subdomain' is properly enforced.
2020-08-05 15:54:50 +02:00
Mark Andrews
952955aa4c Update-policy 'subdomain' was incorrectly treated as 'zonesub'
resulting in names outside the specified subdomain having the wrong
restrictions for the given key.
2020-08-05 15:54:50 +02:00
Michał Kępień
10954a11de Merge branch '2037-confidential-issue' into 'security-main'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used

See merge request isc-private/bind9!187
2020-08-05 13:54:14 +00:00
Ondřej Surý
aaeea046ed Add CHANGES and release note for GL #2037 2020-08-05 15:51:29 +02:00
Ondřej Surý
52733368fd Don't strip the SOFTHSM2_CONF and SLOT environment variables when using ./run.sh 2020-08-05 15:51:29 +02:00
Ondřej Surý
6b7629f323 Fix crash in pk11_numbits() when native-pkcs11 is used
When pk11_numbits() is passed a user provided input that contains all
zeroes (via crafted DNS message), it would crash with assertion
failure.  Fix that by properly handling such input.
2020-08-05 15:51:29 +02:00
Michał Kępień
aa863855f5 Merge branch '2028-unexpectedend-and-tsig' into 'security-main'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries

See merge request isc-private/bind9!185
2020-08-05 13:50:27 +00:00
Mark Andrews
e576baad9d Add CHANGES and release notes for GL #2028 2020-08-05 15:47:14 +02:00
Mark Andrews
70a71de9c9 Always keep a copy of the message
this allows it to be available even when dns_message_parse()
returns a error.
2020-08-05 15:47:14 +02:00
Michał Kępień
57fbc57b2e Merge branch '1997-confidential-issue' into 'security-main'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding

See merge request isc-private/bind9!184
2020-08-05 13:46:23 +00:00
Evan Hunt
a3e42f8599 Add CHANGES and release note for GL #1997 2020-08-05 15:43:52 +02:00
Evan Hunt
51c9ea98a3 permanently disable QNAME minimization in a fetch when forwarding
QNAME minimization is normally disabled when forwarding. if, in the
course of processing a fetch, we switch back to normal recursion at
some point, we can't safely start minimizing because we may have
been left in an inconsistent state.
2020-08-05 15:43:52 +02:00
Michał Kępień
c6a08a727d Merge branch '1996-confidential-issue' into 'security-main'
[CVE-2020-8620] Fix TCP DNS buffer sizes

See merge request isc-private/bind9!181
2020-08-05 13:31:59 +00:00
Ondřej Surý
f2b41e11b4 Add CHANGES and release note for GL #1996 2020-08-05 12:57:23 +02:00
Evan Hunt
38264b6a4d Use different allocators for UDP and TCP
Each worker has a receive buffer with space for 20 DNS messages of up
to 2^16 bytes each, and the allocator function passed to uv_read_start()
or uv_udp_recv_start() will reserve a portion of it for use by sockets.
UDP can use recvmmsg() and so it needs that entire space, but TCP reads
one message at a time.

This commit introduces separate allocator functions for TCP and UDP
setting different buffer size limits, so that libuv will provide the
correct buffer sizes to each of them.
2020-08-05 12:57:23 +02:00
Michał Kępień
f0fa6f0245 Merge branch 'michal/remove-arm64-jobs-from-gitlab-ci' into 'main'
Remove arm64 jobs from GitLab CI

See merge request isc-projects/bind9!3920
2020-08-05 10:07:20 +00:00
Michał Kępień
49f245f7c0 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.
2020-08-05 12:04:59 +02:00
Michał Kępień
72786a27c7 Merge branch '2065-set-max-cache-size-in-the-geoip2-system-test' into 'main'
Set "max-cache-size" in the "geoip2" system test

Closes #2065

See merge request isc-projects/bind9!3919
2020-08-05 09:07:52 +00:00
Michał Kępień
4292d5bdfe 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 e24bc324b4 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.
2020-08-05 10:38:06 +02:00
Michał Kępień
550b82e27b Merge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still-has-the-pre-9-3-0-explanation' into 'main'
Resolve "BIND ARM incorrectly documents the processing of forwarders (still has the pre 9.3.0 explanation)"

Closes #2030

See merge request isc-projects/bind9!3881
2020-08-04 19:44:27 +00:00
Suzanne Goldlust
30e126ad02 Update description of forwarding behavior in ARM 2020-08-04 21:39:31 +02:00
Michał Kępień
500527b4da Merge branch 'michal/add-placeholder-for-1475' into 'main'
Add placeholder for #1475

See merge request isc-projects/bind9!3916
2020-08-04 13:49:37 +00:00
Michał Kępień
232297142d Add placeholder for #1475 2020-08-04 15:46:34 +02:00
Mark Andrews
dc8fe44224 Merge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR' into 'main'
Map DNS_R_BADTSIG to FORMERR

See merge request isc-projects/bind9!3877
2020-08-04 13:02:24 +00:00
Mark Andrews
88ff6b846c Check rcode is FORMERR 2020-08-04 12:20:37 +00:00
Mark Andrews
20488d6ad3 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.
2020-08-04 12:20:37 +00:00
Matthijs Mekking
bf760383e8 Merge branch 'ondrej/serve-stale-improvements' into 'main'
Serve-stale improvements

Closes #1712 and #1829

See merge request isc-projects/bind9!3872
2020-08-04 12:17:57 +00:00
Ondřej Surý
dd62275152 Add CHANGES and release notes for GL #1712 and GL #1829 2020-08-04 10:51:09 +02:00
Ondřej Surý
abc2ab9223 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.
2020-08-04 10:50:31 +02:00
Ondřej Surý
6ffa2ddae0 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".
2020-08-04 10:50:31 +02:00
Ondřej Surý
ce53db34d6 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.
2020-08-04 10:50:31 +02:00
Mark Andrews
f2040a0039 Merge branch '2026-readme-md-typo' into 'main'
Resolve "README.md -- typo"

Closes #2026

See merge request isc-projects/bind9!3912
2020-08-04 02:23:54 +00:00
Mark Andrews
532bf267af Fixup typo in 'xcode-select --install' 2020-08-04 12:19:15 +10:00
Michał Kępień
4b6113379a Merge branch 'michal/restore-placeholder-entry-at-sequence-number-5481' into 'main'
Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3910
2020-08-03 20:13:12 +00:00
Michał Kępień
029e32c01a Restore placeholder entry at sequence number 5481 2020-08-03 22:09:47 +02:00