2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00
Commit Graph

30796 Commits

Author SHA1 Message Date
Mark Andrews
fcb6dbcdd7 make header->count atomic 2019-11-19 17:29:20 +11:00
Ondřej Surý
eba576dddf Merge branch 'ondrej/dont-call-dns_adb_endupdfetch-for-TCP-queries' into 'master'
lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries

See merge request isc-projects/bind9!2580
2019-11-18 19:47:53 +00:00
Ondřej Surý
a5189eefa5 lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP.  This messages the quota counting in adb.c.
2019-11-19 02:53:56 +08:00
Ondřej Surý
55d82ced78 Merge branch 'ondrej/switch-coccinelle-job-to-buster' into 'master'
Switch coccinelle job to buster

See merge request isc-projects/bind9!2582
2019-11-18 17:58:54 +00:00
Ondřej Surý
0946db13de Installing coccinelle on Debian sid is broken, switch to Debian buster 2019-11-19 01:54:20 +08:00
Ondřej Surý
c17bc7387c Merge branch '1368-threadsanitizer-can-t-handle-more-than-64-mutexes' into 'master'
lib/dns/adb.c:

Closes #1368

See merge request isc-projects/bind9!2579
2019-11-18 07:30:35 +00:00
Witold Kręcicki
7d93371581 lib/dns/adb.c: don't use more than 64 lock simultaneously when run under TSAN
- TSAN can't handle more than 64 locks in one thread, lock ADB bucket-by-bucket
   in TSAN mode. This means that the dump won't be consistent but it's good
   enough for testing

 - Use proper order when unlocking adb->namelocks and adb->entrylocks when
   dumping ADB.
2019-11-18 06:51:30 +01:00
Tinderbox User
fa2f16db89 Merge branch 'prep-release' into security-master v9.15.6 2019-11-17 18:59:41 -08:00
Evan Hunt
a48814906f Merge branch 'security-client-connection-limit' into security-master 2019-11-17 18:59:41 -08:00
Tinderbox User
767a2aef43 prep 9.15.6 2019-11-17 18:59:41 -08:00
Evan Hunt
7c54199fe1 CHANGES, release note. 2019-11-17 18:59:40 -08:00
Evan Hunt
73cafd9d57 clean up comments 2019-11-17 18:59:40 -08:00
Witold Kręcicki
70f80a3ec7 fix a problem with the mem_test unit test
isc_mem_traceflag_test messes with stdout/stderr, which can cause
problems with subsequent tests (no output, libuv problems).  Moving that
test case to the end ensures there are no side effects.
2019-11-17 18:59:40 -08:00
Witold Kręcicki
62a8405fa2 netmgr: close uv_loop properly
close the uv_handle for the worker async channel, and call
uv_loop_close() on shutdown to ensure that the event loop's
internal resources are properly freed.
2019-11-17 18:59:40 -08:00
Witold Kręcicki
6718a4ef8b ensure isc_queue_t is aligned to double-cacheline size 2019-11-17 18:59:40 -08:00
Evan Hunt
123ee350dc place a limit on pipelined queries that can be processed simultaneously
when the TCPDNS_CLIENTS_PER_CONN limit has been exceeded for a TCP
DNS connection, switch to sequential mode to ensure that memory cannot
be exhausted by too many simultaneous queries.
2019-11-17 18:59:39 -08:00
Evan Hunt
20bb812148 Merge branch 'each-ds-anchor-mirror-zones' into 'master'
add support for DS trust anchors in mirror zone verification

See merge request isc-projects/bind9!2576
2019-11-18 02:59:08 +00:00
Evan Hunt
0f9d8eb7b5 add support for DS trust anchors in mirror zone verification 2019-11-17 17:44:17 -08:00
Evan Hunt
c5b6f21515 Merge branch '1119-make-lib/ns-thread-sanitizer-clean' into 'master'
Make lib/ns Thread Sanitizer clean

See merge request isc-projects/bind9!2366
2019-11-18 01:43:06 +00:00
Ondřej Surý
e95af30b23 Make lib/ns Thread Sanitizer clean 2019-11-17 17:42:41 -08:00
Evan Hunt
dad10c0fd0 Merge branch '1119-tsan-lib/dns/tests/zt_test.c' into 'master'
Use atomic_bool for variables shared among threads to make zt_test.c thread-safe

See merge request isc-projects/bind9!2361
2019-11-18 01:40:59 +00:00
Ondřej Surý
7b9084d45d Use atomic_bool for variables shared among threads to make zt_test.c thread-safe 2019-11-18 08:39:12 +08:00
Ondřej Surý
6858ef9adc Merge branch '1119-tsan-lib/isc/tests/socket_test.c' into 'master'
Change the shared completion->done variable to atomic_bool in socket_test.c

See merge request isc-projects/bind9!2362
2019-11-17 14:55:24 +00:00
Ondřej Surý
23964dbbbc Change the shared completion->done variable to atomic_bool in socket_test.c 2019-11-17 09:38:36 +08:00
Ondřej Surý
76d1e95f4e Merge branch '1313-master-failing-to-build-on-macos-high-sierra' into 'master'
Resolve "master failing to build on MacOS High Sierra"

Closes #1313

See merge request isc-projects/bind9!2562
2019-11-16 05:22:05 +00:00
Mark Andrews
00605058b4 conditionally test based on USE_LIBTOOL or LD_WRAP 2019-11-16 11:46:06 +08:00
Mark Andrews
c7b20f3c40 specify the install name when building libwrap 2019-11-16 11:21:41 +08:00
Mark Andrews
b88faee181 MacOS portability
-Wl,-z,interpose is not supported.
-Wl,rpath=<path> is not supported use -Wl,rpath,<path> instead.
Use @SO@ for loadable extension.
Use -L <path> -l libwrap instead of libwrap.sa.
2019-11-16 11:21:41 +08:00
Evan Hunt
ac65f56774 Merge branch '622-ds-anchor' into 'master'
support "initial-ds" in managed-keys

Closes #622

See merge request isc-projects/bind9!1762
2019-11-16 02:32:12 +00:00
Evan Hunt
d97e628f81 CHANGES, release notes 2019-11-15 15:47:57 -08:00
Evan Hunt
c29ccae2a6 Document initial-ds and static-ds keywords 2019-11-15 15:47:57 -08:00
Evan Hunt
54a682ea50 use DS style trust anchors in all system tests
this adds functions in conf.sh.common to create DS-style trust anchor
files. those functions are then used to create nearly all of the trust
anchors in the system tests.

there are a few exceptions:
 - some tests in dnssec and mkeys rely on detection of unsupported
   algorithms, which only works with key-style trust anchors, so those
   are used for those tests in particular.
 - the mirror test had a problem with the use of a CSK without a
   SEP bit, which still needs addressing

in the future, some of these tests should be changed back to using
traditional trust anchors, so that both types will be exercised going
forward.
2019-11-15 15:47:57 -08:00
Evan Hunt
342cc9b168 add support for DS trust anchors in delv 2019-11-15 15:47:57 -08:00
Evan Hunt
edafbf1c0f fix root key sentinel code to send the correct key ID for DS trust anchors 2019-11-15 15:47:57 -08:00
Evan Hunt
8aaee26548 add validator support for static DS-style trust anchors 2019-11-15 15:47:56 -08:00
Evan Hunt
4d3ed3f4ea refactor create_keydata
use empty placeholder KEYDATA records for all trust anchors, not just
DS-style trust anchors.

this revealed a pre-existing bug: keyfetch_done() skips keys without
the SEP bit when populating the managed-keys zone. consequently, if a
zone only has a single ZSK which is configured as trust anchor and no
KSKs, then no KEYDATA record is ever written to the managed-keys zone
when keys are refreshed.

that was how the root server in the dnssec system test was configured.
however, previously, the KEYDATA was created when the key was
initialized; this prevented us from noticing the bug until now.

configuring a ZSK as an RFC 5011 trust anchor is not forbidden by the
spec, but it is highly unusual and not well defined.  so for the time
being, I have modified the system test to generate both a KSK and ZSK
for the root zone, enabling the test to pass.

we should consider adding code to detect this condition and allow keys
without the SEP bit to be used as trust anchors if no key with the SEP
bit is available, or at minimum, log a warning.
2019-11-15 15:47:56 -08:00
Evan Hunt
a8f89e9a9f use DS-style trust anchor to verify 5011 key refresh query
note: this also needs further refactoring.

- when initializing RFC 5011 for a name, we populate the managed-keys
  zone with KEYDATA records derived from the initial-key trust anchors.

  however, with initial-ds trust anchors, there is no key. but the
  managed-keys zone still must have a KEYDATA record for the name,
  otherwise zone_refreshkeys() won't refresh that key. so, for
  initial-ds trust anchors, we now add an empty KEYDATA record and set
  the key refresh timer so that the real keys will be looked up as soon
  as possible.

- when a key refresh query is done, we verify it against the
  trust anchor; this is done in two ways, one with the DS RRset
  set up during configuration if present, or with the keys linked
  from each keynode in the list if not.  because there are two different
  verification methods, the loop structure is overly complex and should
  be simplified.

- the keyfetch_done() and sync_keyzone() functions are both too long
  and should be broken into smaller functions.
2019-11-15 15:47:56 -08:00
Evan Hunt
854af5a353 allow DS trust anchors to be set in keytable
note: this is a frankensteinian kluge which needs further refactoring.

the keytable started as an RBT where the node->data points to a list of
dns_keynode structures, each of which points to a single dst_key.
later it was modified so that the list could instead point to a single
"null" keynode structure, which does not reference a key; this means
a trust anchor has been configured but the RFC 5011 refresh failed.

in this branch it is further updated to allow the first keynode in
the list to point to an rdatalist of DS-style trust anchors.  these will
be used by the validator to populate 'val->dsset' when validating a zone
key.

a DS style trust anchor can be updated as a result of RFC 5011
processing to contain DST keys instead; this results in the DS list
being freed.  the reverse is not possible; attempting to add a DS-style
trust anchor if a key-style trust anchor is already in place results
in an error.

later, this should be refactored to use rdatalists for both DS-style
and key-style trust anchors, but we're keeping the existing code for
old-style trust anchors for now.
2019-11-15 15:47:56 -08:00
Evan Hunt
1a8348e2b4 disallow use of DS- and key-style trust anchors for the same name 2019-11-15 15:47:41 -08:00
Evan Hunt
feba480527 read DS trust anchors in named.conf
(but they aren't used for anything yet)
2019-11-15 15:47:17 -08:00
Evan Hunt
3fede8a7e9 add "static-ds" and "initial-ds" keywords to config parser 2019-11-15 15:47:17 -08:00
Evan Hunt
ac0d3c21c6 add a global function to match a DS rdata to a DNSKEY 2019-11-15 15:47:17 -08:00
Evan Hunt
f75328b178 Merge branch '622-validator-refactoring' into 'master'
preliminary validator refactoring

See merge request isc-projects/bind9!2346
2019-11-15 23:46:36 +00:00
Evan Hunt
11cd9d86e4 CHANGES, release note 2019-11-15 14:26:08 -08:00
Evan Hunt
692c879e3c remove unneeded members from dns_validator
- val->keynode and val->seensig were set but never used.
- val->nearest, val->soaset, val->soaname, val->nsecset and val->nsec3set
  were never used at all.
2019-11-15 14:26:08 -08:00
Evan Hunt
3a4334636b simplify validate_dnskey and seek_ds
- pull out the code that checks whether a key was signed by a trust
  anchor into a separate function, anchor_signed().
- pull out the code that looks up a DS while validating a zone key
  into a separate function, get_dsset().
- check in create_validator() whether the sigrdataset is bound, so that
  we can always pass in &val->fsigrdataset during an insecurity proof;
  this will allow a reduction of code duplication.
2019-11-15 14:26:08 -08:00
Evan Hunt
9119dc25fe continue renaming functions for clarity
- also simplified some calls: don't pass siginfo where val->siginfo
  is sufficient, don't INSIST where returning false is sufficient.
- also added header comments to several local functions.
2019-11-15 14:26:07 -08:00
Evan Hunt
22aa668b7d convert if to switch in get_key 2019-11-15 14:26:07 -08:00
Evan Hunt
9150688efd rename fetch/validator callback functions for consistency and clarity 2019-11-15 14:26:07 -08:00
Evan Hunt
edc9c79c9c reorder switch in validatezonekey to similar order as seek_ds 2019-11-15 14:26:07 -08:00