2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00
Commit Graph

32171 Commits

Author SHA1 Message Date
Mark Andrews
78db46d746 Check walking the hip rendezvous servers.
Also fixes extraneous white space at end of record when
there are no rendezvous servers.
2020-07-24 04:15:56 +00:00
Mark Andrews
e31bcac441 Merge branch 'marka-add-fallthrough' into 'main'
Add fallthrough and braces

See merge request isc-projects/bind9!3884
2020-07-24 04:15:03 +00:00
Mark Andrews
70c060120f Add fallthrough and braces 2020-07-24 13:49:56 +10:00
Mark Andrews
1ba814a28c Merge branch 'feature/master/unix-cleanup' into 'main'
Remove few lines in unix socket handling

See merge request isc-projects/bind9!2687
2020-07-24 03:02:07 +00:00
Petr Menšík
72d81c4768 Remove few lines in unix socket handling
Reuse the same checks two times, make difference minimal.
2020-07-24 12:59:38 +10:00
Mark Andrews
cc1b77a0c7 Merge branch 'dstlib-failure-abort' into 'main'
Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3876
2020-07-23 00:46:12 +00:00
Petr Menšík
c5e7152cf0 Prevent crash on dst initialization failure
server might be created, but not yet fully initialized, when fatal
function is called. Check both server and task before attaching
exclusive task.
2020-07-23 00:31:52 +00:00
Michal Nowak
064e314df7 Merge branch '1727-drop-use-of-featuretest-have-dlopen' into 'main'
Drop feature test for dlopen()

Closes #1727

See merge request isc-projects/bind9!3625
2020-07-21 09:24:38 +00:00
Michal Nowak
2064e01cd0 Drop feature test for dlopen()
With libtool being mandatory from 9.17 on, so is dlopen() (via libltdl).
2020-07-21 11:22:13 +02:00
Ondřej Surý
451ed397f0 Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries' into 'main'
Fix the rbt hashtable and grow it when setting max-cache-size

Closes #1775

See merge request isc-projects/bind9!3865
2020-07-21 08:38:26 +00:00
Ondřej Surý
2b4f0f03f5 Add CHANGES and release note for #1775 2020-07-21 08:44:26 +02:00
Ondřej Surý
a9182c89a6 Change the dns_name hashing to use 32-bit values
Change the dns_hash_name() and dns_hash_fullname() functions to use
isc_hash32() as the maximum hashtable size in rbt is 0..UINT32_MAX
large.
2020-07-21 08:44:26 +02:00
Ondřej Surý
f59fd49fd8 Add isc_hash32() and rename isc_hash_function() to isc_hash64()
As the names suggest the original isc_hash64 function returns 64-bit
long hash values and the isc_hash32() returns 32-bit values.
2020-07-21 08:44:26 +02:00
Ondřej Surý
344d66aaff Add HalfSipHash 2-4 reference implementation
The HalfSipHash implementation has 32-bit keys and returns 32-bit
value.
2020-07-21 08:44:26 +02:00
Ondřej Surý
21d751dfc7 Remove OpenSSL based SipHash 2-4 implementation
Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, so until we fix the code
to reuse the OpenSSL contexts and keys we'll use our own implementation of
siphash instead of trying to integrate with OpenSSL.
2020-07-21 08:44:26 +02:00
Ondřej Surý
e24bc324b4 Fix the rbt hashtable and grow it when setting max-cache-size
There were several problems with rbt hashtable implementation:

1. Our internal hashing function returns uint64_t value, but it was
   silently truncated to unsigned int in dns_name_hash() and
   dns_name_fullhash() functions.  As the SipHash 2-4 higher bits are
   more random, we need to use the upper half of the return value.

2. The hashtable implementation in rbt.c was using modulo to pick the
   slot number for the hash table.  This has several problems because
   modulo is: a) slow, b) oblivious to patterns in the input data.  This
   could lead to very uneven distribution of the hashed data in the
   hashtable.  Combined with the single-linked lists we use, it could
   really hog-down the lookup and removal of the nodes from the rbt
   tree[a].  The Fibonacci Hashing is much better fit for the hashtable
   function here.  For longer description, read "Fibonacci Hashing: The
   Optimization that the World Forgot"[b] or just look at the Linux
   kernel.  Also this will make Diego very happy :).

3. The hashtable would rehash every time the number of nodes in the rbt
   tree would exceed 3 * (hashtable size).  The overcommit will make the
   uneven distribution in the hashtable even worse, but the main problem
   lies in the rehashing - every time the database grows beyond the
   limit, each subsequent rehashing will be much slower.  The mitigation
   here is letting the rbt know how big the cache can grown and
   pre-allocate the hashtable to be big enough to actually never need to
   rehash.  This will consume more memory at the start, but since the
   size of the hashtable is capped to `1 << 32` (e.g. 4 mio entries), it
   will only consume maximum of 32GB of memory for hashtable in the
   worst case (and max-cache-size would need to be set to more than
   4TB).  Calling the dns_db_adjusthashsize() will also cap the maximum
   size of the hashtable to the pre-computed number of bits, so it won't
   try to consume more gigabytes of memory than available for the
   database.

   FIXME: What is the average size of the rbt node that gets hashed?  I
   chose the pagesize (4k) as initial value to precompute the size of
   the hashtable, but the value is based on feeling and not any real
   data.

For future work, there are more places where we use result of the hash
value modulo some small number and that would benefit from Fibonacci
Hashing to get better distribution.

Notes:
a. A doubly linked list should be used here to speedup the removal of
   the entries from the hashtable.
b. https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/
2020-07-21 08:44:26 +02:00
Michal Nowak
9dcf229634 Merge branch 'mnowak/try-harder-to-analyze-cores' into 'main'
Rationalize backtrace logging, fail on core file presence

See merge request isc-projects/bind9!3867
2020-07-20 08:13:37 +00:00
Michal Nowak
1b13123c45 Check tests for core files regardless of test status
Failed test should be checked for core files et al. and have
backtrace generated.
2020-07-17 10:04:59 +02:00
Michal Nowak
05c13e50d3 Rationalize backtrace logging
GDB backtrace generated via "thread apply all bt full" is too long for
standard output, lets save them to .txt file among other log files.
2020-07-17 10:04:04 +02:00
Michal Nowak
b232e8585a Ensure various test issues are treated as failures
Make sure bin/tests/system/run.sh returns a non-zero exit code if any of
the following happens:

  - the test being run produces a core dump,
  - assertion failures are found in the test's logs,
  - ThreadSanitizer reports are found after the test completes,
  - the servers started by the test fail to shut down cleanly.

This change is necessary to always fail a test in such cases (before the
migration to Automake, test failures were determined based on the
presence of "R:<test-name>:FAIL" lines in the test suite output and thus
it was not necessary for bin/tests/system/run.sh to return a non-zero
exit code).
2020-07-17 10:00:21 +02:00
Michał Kępień
f27c0c3257 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!3864
2020-07-16 09:31:09 +00:00
Michał Kępień
4fa2dfe72e Update release checklist
Add an item to the release checklist to make sure confidential issues
assigned to the relevant milestone are made public after the BIND
versions addressing them are released.
2020-07-16 11:28:09 +02:00
Evan Hunt
b4cdd00fa3 Merge branch '2022-stats-netmgr' into 'main'
Resolve "use netmgr for statschannel"

Closes #2022

See merge request isc-projects/bind9!3847
2020-07-16 06:04:21 +00:00
Evan Hunt
efa5639934 CHANGES, release note 2020-07-15 22:35:07 -07:00
Evan Hunt
69c1ee1ce9 rewrite statschannel to use netmgr
modify isc_httpd to use the network manager instead of the
isc_socket API.

also cleaned up bin/named/statschannel.c to use CHECK.
2020-07-15 22:35:07 -07:00
Michał Kępień
d8e6b32a18 Merge branch 'v9_17_3-release' into 'main'
Merge 9.17.3 release branch

See merge request isc-projects/bind9!3860
2020-07-15 21:09:46 +00:00
Michał Kępień
2b2e97a815 Set up release notes for BIND 9.17.4 2020-07-15 23:06:25 +02:00
Michał Kępień
02de51d957 Bump BIND_BASELINE_VERSION for ABI checks 2020-07-15 23:06:25 +02:00
Michał Kępień
49c62f3e8e Fix "make dist" 2020-07-15 22:54:13 +02:00
Michał Kępień
fc6d0a932b Update BIND version to 9.17.3 2020-07-15 22:54:13 +02:00
Michał Kępień
28d32ca7da Add a CHANGES marker 2020-07-15 22:54:13 +02:00
Michał Kępień
97a2733ef9 Update library API versions 2020-07-15 22:54:13 +02:00
Michał Kępień
3e74f894d4 Merge branch 'michal/prepare-release-notes-for-bind-9.17.3' into v9_17_3-release 2020-07-15 22:51:33 +02:00
Michał Kępień
fba5ce8a75 Reorder release notes 2020-07-15 22:51:33 +02:00
Michał Kępień
af35a186d0 Add release note for #1958 2020-07-15 22:51:33 +02:00
Michał Kępień
eedbd6ecf5 Add release note for #1938 2020-07-15 22:51:33 +02:00
Michał Kępień
41a79d068c Add release note for #1937 2020-07-15 22:51:33 +02:00
Michał Kępień
e9a869f51e Tweak and reword release notes 2020-07-15 22:51:33 +02:00
Michał Kępień
aa1d6a46ab Prepare release notes for BIND 9.17.3 2020-07-15 22:51:32 +02:00
Michał Kępień
267794244f Tweak and reword recent CHANGES entries 2020-07-15 22:50:16 +02:00
Matthijs Mekking
f8ef2c0439 Merge branch '2006-coverity-checked-return-keymgr' into 'main'
Fix Coverity keymgr reports

Closes #2006

See merge request isc-projects/bind9!3808
2020-07-14 15:46:56 +00:00
Matthijs Mekking
e645d2ef1e Check return value of dst_key_getbool()
Fix Coverity CHECKED_RETURN reports for dst_key_getbool().  In most
cases we do not really care about its return value, but it is prudent
to check it.

In one case, where a dst_key_getbool() error should be treated
identically as success, cast the return value to void and add a relevant
comment.
2020-07-14 12:53:54 +00:00
Michał Kępień
df72c52239 Merge branch 'michal/use-image-key-in-qemu-based-ci-job-templates' into 'main'
Use "image" key in QEMU-based CI job templates

See merge request isc-projects/bind9!3855
2020-07-14 08:24:42 +00:00
Michał Kępień
72201badf0 Use "image" key in QEMU-based CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key
instead of the job name for determining the QCOW2 image to use for a
given CI job.  Update .gitlab-ci.yml to reflect that change.
2020-07-14 09:58:04 +02:00
Mark Andrews
c53bfb30e8 Merge branch 'u/fanf2/fix-signing' into 'main'
Fix re-signing when `sig-validity-interval` has two arguments

See merge request isc-projects/bind9!3735
2020-07-14 02:07:28 +00:00
Mark Andrews
3ff60b881f Add release note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews
f4fbca6e16 Add CHANGES note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews
11ecf7901b Add regression test for [GL !3735]
Check that resign interval is actually in days rather than hours
by checking that RRSIGs are all within the allowed day range.
2020-07-14 10:59:59 +10:00
Tony Finch
030674b2a3 Fix re-signing when sig-validity-interval has two arguments
Since October 2019 I have had complaints from `dnssec-cds` reporting
that the signatures on some of my test zones had expired. These were
zones signed by BIND 9.15 or 9.17, with a DNSKEY TTL of 24h and
`sig-validity-interval 10 8`.

This is the same setup we have used for our production zones since
2015, which is intended to re-sign the zones every 2 days, keeping
at least 8 days signature validity. The SOA expire interval is 7
days, so even in the presence of zone transfer problems, no-one
should ever see expired signatures. (These timers are a bit too
tight to be completely correct, because I should have increased
the expiry timers when I increased the DNSKEY TTLs from 1h to 24h.
But that should only matter when zone transfers are broken, which
was not the case for the error reports that led to this patch.)

For example, this morning my test zone contained:

        dev.dns.cam.ac.uk. 86400 IN RRSIG DNSKEY 13 5 86400 (
                                20200701221418 20200621213022 ...)

But one of my resolvers had cached:

        dev.dns.cam.ac.uk. 21424 IN RRSIG DNSKEY 13 5 86400 (
                                20200622063022 20200612061136 ...)

This TTL was captured at 20200622105807 so the resolver cached the
RRset 64976 seconds previously (18h02m56s), at 20200621165511
only about 12h before expiry.

The other symptom of this error was incorrect `resign` times in
the output from `rndc zonestatus`.

For example, I have configured a test zone

        zone fast.dotat.at {
                file "../u/z/fast.dotat.at";
                type primary;
                auto-dnssec maintain;
                sig-validity-interval 500 499;
        };

The zone is reset to a minimal zone containing only SOA and NS
records, and when `named` starts it loads and signs the zone. After
that, `rndc zonestatus` reports:

        next resign node: fast.dotat.at/NS
        next resign time: Fri, 28 May 2021 12:48:47 GMT

The resign time should be within the next 24h, but instead it is
near the signature expiry time, which the RRSIG(NS) says is
20210618074847. (Note 499 hours is a bit more than 20 days.)
May/June 2021 is less than 500 days from now because expiry time
jitter is applied to the NS records.

Using this test I bisected this bug to 09990672d which contained a
mistake leading to the resigning interval always being calculated in
hours, when days are expected.

This bug only occurs for configurations that use the two-argument form
of `sig-validity-interval`.
2020-07-14 10:57:43 +10:00
Mark Andrews
2ac2d83265 Merge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoindex-undefined-on-illumos' into 'main'
Resolve "netscope.c:23:50: error: unused parameter 'addr' when HAVE_IF_NAMETOINDEX undefined on illumos"

Closes #1994

See merge request isc-projects/bind9!3829
2020-07-14 00:51:22 +00:00