Compare commits

..

3994 Commits

Author SHA1 Message Date
Tom Krizek
edc1615077 Merge branch 'prep-release' into v9_16_36-release 2022-12-12 15:43:23 +01:00
Tom Krizek
fe86c38f6c prep 9.16.36 2022-12-12 14:18:17 +01:00
Tom Krizek
ca10ac2811 Merge branch 'tkrizek/prepare-documentation-for-bind-9.16.36' into 'v9_16_36-release'
Prepare documentation for BIND 9.16.36

See merge request isc-private/bind9!489
2022-12-12 12:57:25 +00:00
Michał Kępień
d5a58400de Reorder release notes 2022-12-12 13:05:36 +01:00
Michał Kępień
c29739744e Tweak and reword release notes 2022-12-12 13:05:36 +01:00
Michał Kępień
2ff2ce0307 Prepare release notes for BIND 9.16.36 2022-12-12 13:05:36 +01:00
Ondřej Surý
9a61c53c71 Merge branch '3731-attach-keyfileio-to-zone-v9_16' into 'v9_16'
Implement proper reference counting for dns_keyfileio_t [v9.16]

See merge request isc-projects/bind9!7208
2022-12-09 14:53:51 +00:00
Ondřej Surý
075c7f7562 Implement proper reference counting for dns_keyfileio_t
Instead of relying on hash table search when using the keys, implement a
proper reference counting in dns_keyfileio_t objects, and attach/detach
the objects to the zone.

(cherry picked from commit 79115a0c3b)
2022-12-09 15:20:11 +01:00
Ondřej Surý
5b16afa378 Merge branch '3724-fix-doc-man-dig-v9_16' into 'v9_16'
Update the doc/man/dig.1in

See merge request isc-projects/bind9!7195
2022-12-08 10:20:07 +00:00
Ondřej Surý
a5fd5482af Update the doc/man/dig.1in
The MR !7187 forgot to update the precompiled doc/man/dig.1in.  Update
the file.
2022-12-08 10:20:03 +00:00
Ondřej Surý
d10351e4d1 Merge branch '3727-fix-off-by-one-reference-counting-in-zonemgr_keymgmt_delete-v9_16' into 'v9_16'
Release unused key file IO lock objects [v9.16]

See merge request isc-projects/bind9!7192
2022-12-08 09:57:28 +00:00
Ondřej Surý
1cb66e1b58 Add CHANGES and release note for [GL #3727]
(cherry picked from commit 56a997b0b5)
2022-12-08 10:32:59 +01:00
Ondřej Surý
98fca774b6 Release unused key file IO lock objects
Due to off-by-one error in zonemgr_keymgmt_delete, unused key file IO
lock objects were never freed and they were kept until the server
shutdown.  Adjust the returned value by -1 to accomodate the fact that
the atomic_fetch_*() functions return the value before the operation and
not current value after the operation.

(cherry picked from commit fb1acd6736)
2022-12-08 10:32:59 +01:00
Tom Krizek
f723643bdb Merge branch 'tkrizek/revert-3678-serve-stale-servfail-v9_16' into 'v9_16'
Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_16' into 'v9_16'"

See merge request isc-projects/bind9!7185
2022-12-08 09:32:22 +00:00
Tom Krizek
da42fa7622 Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_16' into 'v9_16'"
This reverts commit b2a4447af8, reversing
changes made to 8924f92956.

It also removes release note 6038, since the fix is reverted.
2022-12-08 10:23:40 +01:00
Mark Andrews
b386e272b7 Merge branch '3613-redo-dumping-expired-rdatasets-v9_16' into 'v9_16'
Resolve "TTL issue with resolver's cached and expired results for qtype ANY queries" [v9_16]

See merge request isc-projects/bind9!7189
2022-12-08 00:49:45 +00:00
Mark Andrews
ba020b3225 Add CHANGES note for [GL #3613]
(cherry picked from commit 485e968087)
2022-12-08 11:20:35 +11:00
Mark Andrews
ea03c3d25c Remove different zero TTL handling for rdataset iterator
Zero TTL handling does not need to be different for 'rdatasetiter_first'
and 'rdatasetiter_next' and it interacts badly with 'bind_rdatadataset'
which makes different determinations.

(cherry picked from commit 1a39328feb)
2022-12-08 11:20:35 +11:00
Mark Andrews
a3bc62e4cd Add dns_db_allrdatasets options
'DNS_DB_STALEOK' returns stale rdatasets as well as current rdatasets.

'DNS_DB_EXPIREDOK' returns expired rdatasets as well as current
rdatasets. This option is currently only set when DNS_DB_STALEOK is
also set.

(cherry picked from commit 85048ddeee)
2022-12-08 11:20:35 +11:00
Mark Andrews
4f3327cd41 Extend dns_db_allrdatasets to control interation results
Add an options parameter to control what rdatasets are returned when
iteratating over the node.  Specific modes will be added later.

(cherry picked from commit 7695c36a5d)
2022-12-08 11:20:35 +11:00
Mark Andrews
8b6a30f59d Properly select active rdatasets when iterating across node
Active rdatasets where not being properly selected in rdatasetiter_first
and rdatasetiter_next.

(cherry picked from commit 3bdab2d111)
2022-12-08 10:47:23 +11:00
Mark Andrews
91504c1f6e Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-08 10:46:20 +11:00
Mark Andrews
a85260fc19 Revert "Fix rndc dumpdb -expired for stuck cache contents"
This reverts commit f8d866c6ef.

(cherry picked from commit 90249e4aa5)
2022-12-08 10:46:18 +11:00
Mark Andrews
756495a826 Merge branch '3724-update-dig-tcp-documentation-v9_16' into 'v9_16'
Add reference to +tcp for +ignore [v9_16]

See merge request isc-projects/bind9!7187
2022-12-07 23:14:17 +00:00
Mark Andrews
45b4446ade Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:34:35 +11:00
Ondřej Surý
df4a162203 Merge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test-v9_16' into 'v9_16'
Fix missing zone_check() call in checkds test [v9.16]

See merge request isc-projects/bind9!7181
2022-12-07 18:46:36 +00:00
Ondřej Surý
a6847fa678 Fix missing zone_check() call in checkds test
The bad2-dswithdrawn.checkds tests were missing call to the
zone_checks() contributing to intermittent timing failures of the
checkds system test.

(cherry picked from commit 718831bfcc)
2022-12-07 19:32:01 +01:00
Ondřej Surý
afcb25dc60 Merge branch '3183-send-shutdown-to-ns_client-on-shutdown-v9_16' into 'v9_16'
Propagate the shutdown event to the recursing ns_client(s) [v9.16]

See merge request isc-projects/bind9!7029
2022-12-07 18:28:10 +00:00
Ondřej Surý
cfa06c29e1 Add CHANGES and release notes for [GL #3183]
(cherry picked from commit d3f1639c16e7777a52d66c2dccd8b43a08a0750b)
2022-12-07 18:10:14 +01:00
Ondřej Surý
72724b258c Propagate the shutdown event to the recursing ns_client(s)
Send the ns_query_cancel() on the recursing clients when we initiate the
named shutdown for faster shutdown.

When we are shutting down the resolver, we cancel all the outstanding
fetches, and the ISC_R_CANCEL events doesn't propagate to the ns_client
callback.

In the future, the better solution how to fix this would be to look at
the shutdown paths and let them all propagate from bottom (loopmgr) to
top (f.e. ns_client).

(cherry picked from commit d861d403bb9a7912e29a06aba6caf6d502839f1b)
2022-12-07 18:09:40 +01:00
Matthijs Mekking
925b50e3e6 Merge branch 'matthijs-document-ns-minimal-responses-v9_16' into 'v9_16'
[v9_16] Document NS queries are excempt from minimal-responses

See merge request isc-projects/bind9!7177
2022-12-07 11:39:57 +00:00
Matthijs Mekking
e1924126c0 Document NS queries are excempt from minimal-responses
Also document that DNSKEY, DS, CDNSKEY, and CDS never do additional
section processing.

(cherry picked from commit f7b477f6ea)
2022-12-07 12:10:06 +01:00
Michal Nowak
d246a2bbe5 Merge branch 'mnowak/asan-tsan-respdiff-jobs-v9_16' into 'v9_16'
[v9_16] Add ASAN- and TSAN-enabled respdiff jobs

See merge request isc-projects/bind9!7174
2022-12-07 10:18:08 +00:00
Michal Nowak
ca5e6ea008 Add ASAN- and TSAN-enabled respdiff jobs
Neither of the new CI jobs can reliably pass at the moment; hence they
are defined with "allow_failure: true" until issues in the code base are
resolved.

(cherry picked from commit 4f23de554c)
2022-12-07 10:42:28 +01:00
Michal Nowak
35ea9b6ee3 Extract TSAN parsing code
(cherry picked from commit 9856296666)
2022-12-07 10:42:13 +01:00
Mark Andrews
bde0d92643 Merge branch '3683-use-after-free-in-catalog-zone-processing-v9_16' into 'v9_16'
Resolve "use after free in catalog zone processing" [v9_16]

See merge request isc-projects/bind9!7171
2022-12-07 02:16:47 +00:00
Mark Andrews
e882c1f801 Add release note for [GL #3683]
(cherry picked from commit 9843da3423)
2022-12-07 12:55:42 +11:00
Mark Andrews
10926434f8 Add CHANGES note for [GL #3683]
(cherry picked from commit 72402e1710)
2022-12-07 12:55:42 +11:00
Mark Andrews
627a1e1f43 Check that restored catalog zone works
Using a restored catalog zone excercised a use-after-free bug.
The test checks that the use-after-free bug is gone and is just
a reasonable behaviour check in its own right.

(cherry picked from commit bca84c8601)
2022-12-07 12:55:42 +11:00
Mark Andrews
f9845df6d6 Add missing DbC magic checks
Checking for value != NULL is not sufficient to detect use after
free errors.

(cherry picked from commit b1086a5561)
2022-12-07 09:47:39 +11:00
Mark Andrews
dd73306509 Call dns_db_updatenotify_unregister earlier
dns_db_updatenotify_unregister needed to be called earlier to ensure
that listener->onupdate_arg always points to a valid object.  The
existing lazy cleanup in rbtdb_free did not ensure that.

(cherry picked from commit 35839e91d8)
2022-12-07 09:47:37 +11:00
Mark Andrews
ffeda92cd8 Suppress duplicate dns_db_updatenotify_register registrations
Duplicate dns_db_updatenotify_register registrations need to be
suppressed to ensure that dns_db_updatenotify_unregister is successful.

(cherry picked from commit f13e71e551)
2022-12-07 09:46:50 +11:00
Arаm Sаrgsyаn
b2a4447af8 Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_16' into 'v9_16'
[v9_16] Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

See merge request isc-projects/bind9!7167
2022-12-06 15:01:55 +00:00
Michał Kępień
148608c7b2 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba1 causes Clang Static
Analyzer to flag a potential NULL dereference in query_nxdomain():

    query.c:9394:26: warning: Dereference of null pointer [core.NullDereference]
            if (!qctx->nxrewrite || qctx->rpz_st->m.rpz->addsoa) {
                                    ^~~~~~~~~~~~~~~~~~~
    1 warning generated.

The warning above is for qctx->rpz_st potentially being a NULL pointer
when query_nxdomain() is called from query_resume().  This is a false
positive because none of the database lookup result codes currently
causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN)
can be returned by a database lookup following a recursive resolution
attempt.  Add a NULL check nevertheless in order to future-proof the
code and silence Clang Static Analyzer.

(cherry picked from commit 07592d1315)
2022-12-06 13:51:30 +00:00
Aram Sargsyan
c09bcdca75 Add a CHANGES note for [GL #3678]
(cherry picked from commit 5b5f3a0ea7)
2022-12-06 13:51:19 +00:00
Matthijs Mekking
e6e13c3e62 Consider non-stale data when in serve-stale mode
With 'stale-answer-enable yes;' and 'stale-answer-client-timeout off;',
consider the following situation:

A CNAME record and its target record are in the cache, then the CNAME
record expires, but the target record is still valid.

When a new query for the CNAME record arrives, and the query fails,
the stale record is used, and then the query "restarts" to follow
the CNAME target. The problem is that the query's multiple stale
options (like DNS_DBFIND_STALEOK) are not reset, so 'query_lookup()'
treats the restarted query as a lookup following a failed lookup,
and returns a SERVFAIL answer when there is no stale data found in the
cache, even if there is valid non-stale data there available.

With this change, query_lookup() now considers non-stale data in the
cache in the first place, and returns it if it is available.

(cherry picked from commit 86a80e723f)
2022-12-06 13:51:07 +00:00
Aram Sargsyan
8fcb333622 Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 21faf44ef7)
2022-12-06 13:50:54 +00:00
Michal Nowak
8924f92956 Merge branch '3310-build-contrib-in-ci-v9_16' into 'v9_16'
[v9_16] Build contrib in CI & associated fixes

See merge request isc-projects/bind9!7114
2022-12-05 16:36:02 +00:00
Michal Nowak
2428add7ee Help gcovr find contrib files
(cherry picked from commit 445a90fb78)
2022-12-05 16:00:35 +01:00
Michal Nowak
db231bd31f Add install target for Perl DLZ module
Perl DLZ module Makefile lacked "install" target, add it as we want to
test DLZ module installation in the CI.

(cherry picked from commit 35e44978b5)
2022-12-05 16:00:35 +01:00
Michal Nowak
7581afef4c Disable compound-token-split-by-macro warning with Clang
Perl DLZ module compilation with Clang produces the following warning:

    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                         ^~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/perl.h:666:29: note: expanded from macro 'STMT_START'
    #   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                                  ^
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: note: '{' token is here
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                    ^

(cherry picked from commit 69b7e4362d)
2022-12-05 16:00:35 +01:00
Michal Nowak
8f2f5c426e Build contrib dlz modules in the CI
(cherry picked from commit 4a4a91b012)
2022-12-05 16:00:35 +01:00
Michal Nowak
3999497118 Fix statement may fall through warnings in dlz_ldap_dynamic.c
dlz_ldap_dynamic.c: In function ‘dlz_create’:
    dlz_ldap_dynamic.c:971:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      971 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:974:9: note: here
      974 |         case 11:
          |         ^~~~
    dlz_ldap_dynamic.c:976:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      976 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:979:9: note: here
      979 |         case 10:
          |         ^~~~
    dlz_ldap_dynamic.c:980:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      980 |                 if (strlen(argv[9]) > 0) {
          |                    ^
    dlz_ldap_dynamic.c:987:9: note: here
      987 |         case 9:
          |         ^~~~

(cherry picked from commit 99912ed2f7)
2022-12-05 16:00:35 +01:00
Michal Nowak
55f2040853 Fix compilation warnings in dlz_wildcard_dynamic.c
dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:227:14: warning: variable ‘origin’ set but not used [-Wunused-but-set-variable]
      227 |         bool origin = true;
          |              ^~~~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:252:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      252 |                 cd->record = "@";
          |                            ^
    dlz_wildcard_dynamic.c: In function ‘dlz_authority’:
    dlz_wildcard_dynamic.c:328:22: warning: unused variable ‘origin’ [-Wunused-variable]
      328 |                 bool origin;
          |                      ^~~~~~
    dlz_wildcard_dynamic.c:312:25: warning: unused variable ‘name’ [-Wunused-variable]
      312 |         const char *p, *name = "@";
          |                         ^~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_create’:
    dlz_wildcard_dynamic.c:441:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      441 |         for (i = 4; i < argc; i += 4) {
          |                       ^

(cherry picked from commit 76c8c58d54)
2022-12-05 16:00:35 +01:00
Michal Nowak
079aeb16d2 Fix compilation warnings in dlz_sqlite3_dynamic.c
dlz_sqlite3_dynamic.c: In function ‘dlz_sqlite3_fetch_row’:
    dlz_sqlite3_dynamic.c:447:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                               ^
    dlz_sqlite3_dynamic.c:447:50: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                                                  ^

(cherry picked from commit 60f68dc0d6)
2022-12-05 16:00:35 +01:00
Michal Nowak
93c518c7a5 Fix warnings in dlz_mysqldyn_mod.c
dlz_mysqldyn_mod.c: In function ‘dlz_findzonedb’:
    dlz_mysqldyn_mod.c:1079:73: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1079 | dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
          |                                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c:1080:34: warning: unused parameter ‘clientinfo’ [-Wunused-parameter]
     1080 |                dns_clientinfo_t *clientinfo) {
          |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    dlz_mysqldyn_mod.c: In function ‘dlz_lookup’:
    dlz_mysqldyn_mod.c:1111:63: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1111 |            dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
          |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c: In function ‘build_query’:
    dlz_mysqldyn_mod.c:465:19: warning: pointer ‘item’ used after ‘free’ [-Wuse-after-free]
      465 |              item = DLZ_LIST_NEXT(item, link))
    dlz_mysqldyn_mod.c:470:17: note: call to ‘free’ here
      470 |                 free(item);
          |                 ^~~~~~~~~~

(cherry picked from commit 587ea10567)
2022-12-05 16:00:35 +01:00
Michal Nowak
3d6551e461 Fix compilation warnings in dlz_perl_driver.c
dlz_perl_driver.c: In function ‘dlz_version’:
    dlz_perl_driver.c:116:27: warning: unused parameter ‘flags’ [-Wunused-parameter]
      116 | dlz_version(unsigned int *flags) {
          |             ~~~~~~~~~~~~~~^~~~~
    In file included from /usr/lib64/perl5/CORE/perl.h:5685,
                     from dlz_perl_driver.c:33:
    dlz_perl_driver.c: In function ‘dlz_allnodes’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:151:17: note: in expansion of macro ‘POPs’
      151 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_allowzonexfr’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:251:17: note: in expansion of macro ‘POPs’
      251 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_findzonedb’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:328:17: note: in expansion of macro ‘POPs’
      328 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_lookup’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:407:17: note: in expansion of macro ‘POPs’
      407 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:472:1: error: no previous prototype for ‘missing_perl_method’ [-Werror=missing-prototypes]
      472 | missing_perl_method(const char *perl_class_name, PerlInterpreter *my_perl)
          | ^~~~~~~~~~~~~~~~~~~
    dlz_perl_driver.c: In function ‘missing_perl_method’:
    dlz_perl_driver.c:485:9: error: ISO C90 forbids array ‘full_name’ whose size cannot be evaluated [-Werror=vla]
      485 |         char full_name[BUF_LEN];
          |         ^~~~
    dlz_perl_driver.c: In function ‘dlz_create’:
    dlz_perl_driver.c:613:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      613 |         if (missing_method_name = missing_perl_method(perl_class_name, my_perl))
          |             ^~~~~~~~~~~~~~~~~~~
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:657:17: note: in expansion of macro ‘POPs’
      657 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:502:15: warning: unused variable ‘init_args’ [-Wunused-variable]
      502 |         char *init_args[] = { NULL, NULL };
          |               ^~~~~~~~~

(cherry picked from commit be928dbba2)
2022-12-05 16:00:34 +01:00
Tom Krizek
d1176395ac Merge branch 'tkrizek/system-tests-prereqs-v9_16' into 'v9_16'
Unify system test feature detection and add missing prerequisites [v9_16]

See merge request isc-projects/bind9!7157
2022-12-02 11:34:56 +00:00
Tom Krizek
76d88b7f04 Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 11:09:28 +01:00
Tom Krizek
7ff5b01d3c Use feature-test feature detection in pytests
Avoid using the environment variables for feature detection and use the
feature-test utility instead.

Remove the obsolete environment variables from conf.sh, since they're no
longer used anywhere.

(cherry picked from commit 9730ac4c56)
2022-12-02 11:05:46 +01:00
Tom Krizek
0b31a7c54c Use feature-test to detect feature support in system tests
Previously, there were two different ways to detect feature support.
Either through an environment variable set by configure in conf.sh, or
using the feature-test utility.

It is more simple and consistent to have only one way of detecting the
feature support. Using the feature-test utility seems superior the the
environment variables set by configure.

(cherry picked from commit d24fb1122e)
2022-12-02 10:56:54 +01:00
Tom Krizek
1054ad0164 Add missing options to feature-test utility
(cherry picked from commit e22d27da71)
2022-12-02 10:54:49 +01:00
Michał Kępień
e0ce67531b Merge branch 'matthijs/update-serve-stale-test-messages-to-include-rrtype-v9_16' into 'v9_16'
[v9_16] Update serve-stale test messages to include RRtype

See merge request isc-projects/bind9!7147
2022-11-30 13:59:49 +00:00
Matthijs Mekking
8e629cc169 Update serve-stale test messages to include RRtype
(cherry picked from commit 45f7a15785)
2022-11-30 14:30:58 +01:00
Michał Kępień
939ebf8cf2 Merge branch '3707-dont-log-final-reference-detached-on-LOG_INFO-v9_16' into 'v9_16'
Don't log "final reference detached" on INFO level [v9.16]

See merge request isc-projects/bind9!7144
2022-11-30 13:27:45 +00:00
Ondřej Surý
86b43888b3 Add CHANGES and release note for [GL #3707]
(cherry picked from commit 116d1b94a9)
2022-11-30 11:51:51 +01:00
Ondřej Surý
bf093e814c Don't log "final reference detached" on INFO level
The "final reference detached" message was meant to be DEBUG(1), but was
instead kept at INFO level.  Move it to the DEBUG(1) logging level, so
it's not printed under normal operations.

(cherry picked from commit 1816244725)
2022-11-30 11:51:29 +01:00
Michal Nowak
dcdb4aa917 Merge branch 'mnowak/llvm-15-v9_16' into 'v9_16'
[v9_16] Update clang to version 15

See merge request isc-projects/bind9!7134
2022-11-29 11:26:02 +00:00
Michal Nowak
771fed4a14 Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00
Michal Nowak
6ef2fd08e0 Update clang to version 15
(cherry picked from commit 26a42ed1ac)
2022-11-29 10:29:17 +01:00
Michal Nowak
9c165250a4 Merge branch 'mnowak/remove-unused-variable-from-resolver.c' into 'v9_16'
Remove unused variable reported by Clang 15

See merge request isc-projects/bind9!7117
2022-11-28 16:41:48 +00:00
Michal Nowak
69f00278c3 Remove unused variable reported by Clang 15
resolver.c:4776:15: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
            unsigned int count = 0;
                         ^
2022-11-28 14:35:03 +01:00
Tom Krizek
617e1c2188 Merge branch 'tkrizek/system-tests-start-stop-helpers-v9_16' into 'v9_16'
Simplify start/stop helper func in system tests [v9_16]

See merge request isc-projects/bind9!7125
2022-11-25 13:24:14 +00:00
Tom Krizek
172826bfa8 Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.

(cherry picked from commit c100308b7d)
2022-11-25 13:14:45 +01:00
Michal Nowak
7554a7ab29 Merge branch 'mnowak/gcovr-cleanup-v9_16' into 'v9_16'
[v9_16] Various gcovr clean-ups

See merge request isc-projects/bind9!7111
2022-11-23 17:10:59 +00:00
Michal Nowak
4b0d4169b2 Restructure contrib code coverage helper line 2022-11-23 18:09:06 +01:00
Michal Nowak
1ebb126621 Exclude fuzz directory from code coverage report
gcovr fails to process fuzz/old.gcda and fuzz/old.gcno files after !7045
MR with:

    (WARNING) GCOV produced the following errors processing /builds/isc-projects/bind9/fuzz/old.gcda:
    	Cannot open source file ../../fuzz/old.c
    Cannot open source file ../../lib/dns/include/dns/compress.h
    Cannot open source file ../../lib/isc/include/isc/buffer.h
    ...
    (gcovr could not infer a working directory that resolved it.)

Given that code coverage inspection is meant only for BIND 9 code and
not its tests and auxiliary tools, the "fuzz" directory should be
excluded from being included in the code coverage report.

(cherry picked from commit 3b5e9666c6)
2022-11-23 18:09:05 +01:00
Matthijs Mekking
991d7eb85a Merge branch '3667-deprecate-auto-dnssec-v9_16' into 'v9_16'
[v9_16] Deprecate auto-dnssec

See merge request isc-projects/bind9!7107
2022-11-23 16:58:06 +00:00
Matthijs Mekking
ce134f3e0d Add CHANGES and release note for GL #3667
Announce deprecation of 'auto-dnssec'.

(cherry picked from commit fde1d89d03)
2022-11-23 13:32:53 +01:00
Matthijs Mekking
ed8eba9180 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.

Cherry-picking triggered a lot of conflicts, so the changes
were manually picked.

(manually picked from commit f9845dd1)
2022-11-23 13:32:52 +01:00
Michal Nowak
339b51c6f3 Merge branch 'mnowak/fedora-37-v9_16' into 'v9_16'
[v9_16] Add Fedora 37

See merge request isc-projects/bind9!7102
2022-11-21 15:29:10 +00:00
Michal Nowak
33d2a173bf Add Fedora 37
(cherry picked from commit b293b2c638)
2022-11-21 14:00:22 +01:00
Matthijs Mekking
00dbaadea3 Merge branch 'matthijs-tweak-kasp-test-v9_16' into 'v9_16'
[v9_16] Tweak kasp system test script

See merge request isc-projects/bind9!7095
2022-11-17 12:07:13 +00:00
Matthijs Mekking
4ae380a7f2 Tweak kasp system test script
The retry 3 times when checking signatures did not make sense because
at this point the input file does not change.

Raise the number of retries when checking the apex DNSKEY response to
reduce the number of intermittent failures due to unexpected delays.

(cherry picked from commit 6ef0417274)
2022-11-17 12:32:18 +01:00
Mark Andrews
2f329bf696 Merge branch '3607-apex-in-name_external-may-be-invalid-when-using-dual-stack-servers-v9_16' into 'v9_16'
Resolve "apex in name_external may be invalid when using dual stack servers" [v9_16]

See merge request isc-projects/bind9!7093
2022-11-17 06:18:27 +00:00
Mark Andrews
e1854ff719 Ignore contrib/dlz/modules/mysql/Makefile 2022-11-17 16:32:53 +11:00
Mark Andrews
3dcf1afee2 Address back porting issues
Add and use dig_with_opts, resolve_with_opts and rndccmd.
Use $(()) and $() instead of back ticks.
Add more double quotes around variable.
Add non back ported error corrections from v9_18 and main.
2022-11-17 15:21:58 +11:00
Mark Andrews
924d8bbe5e Add CHANGES note for [GL #3607]
(cherry picked from commit 8a2149f502)
2022-11-17 13:08:59 +11:00
Mark Andrews
9ab162b856 Add system test for dual-stack-servers with possible DNAME response
Create a zone that triggers DNAME owner name checks in a zone that
is only reachable using a dual stack server.  The answer contains
a name that is higher in the tree than the query name.

e.g.
	foo.v4only.net.	CNAME	v4only.net.
	v4only.net.	A	10.0.0.1

ns4 is serving the test zone (ipv4-only)
ns6 is the root server for this test (dual stacked)
ns7 is acting as the dual stack server (dual stacked)
ns9 is the server under test (ipv6-only)

(cherry picked from commit f946133ec9)
2022-11-17 13:08:59 +11:00
Mark Andrews
078efb1526 Support starting and stopping IPv6 only servers
Look for $testdir/$server/named.ipv6-only and use
fd92:7065:b8e:ffff::$n instead of 10.53.0.$n to
communicate with the server.

(cherry picked from commit a35c34e10f)
2022-11-17 13:08:59 +11:00
Mark Andrews
3952f01cad Select the appropriate namespace when using a dual stack server
When using dual-stack-servers the covering namespace to check whether
answers are in scope or not should be fctx->domain.  To do this we need
to be able to distingish forwarding due to forwarders clauses and
dual-stack-servers.  A new flag FCTX_ADDRINFO_DUALSTACK has been added
to signal this.

(cherry picked from commit dfbffd77f9)
2022-11-17 13:07:58 +11:00
Mark Andrews
036823bf38 Merge branch '1905-check-wildcard-in-checkconf-z-v9_16' into 'v9_16'
Fix 'named-checkconf -z' was ignoring check-wildcard settings in named.conf [v9_16]

See merge request isc-projects/bind9!7091
2022-11-17 00:30:08 +00:00
Mark Andrews
349bd74b63 Check 'named-checkconf -z' and check-wildcard
Add tests to check the behavior of 'named-checkconf -z' and
check-wildcard setting in named.conf.

(cherry picked from commit 708dadac59)
2022-11-17 11:02:18 +11:00
Mark Andrews
8aa7601a42 named-checkzone -z ignored the check-wildcard option
Lookup and set the wildcard option according to the configuration
settings.  The default is on as per bin/named/config.c.

(cherry picked from commit dfc5c1e018)
2022-11-17 11:00:04 +11:00
Michal Nowak
4563357ab8 Merge tag 'v9_16_35' into v9_16
BIND 9.16.35
2022-11-16 16:20:31 +01:00
Michal Nowak
ff5f2a787d Merge branch 'mnowak/openbsd-7.2-v9_16' into 'v9_16'
[v9_16] Add OpenBSD 7.2

See merge request isc-projects/bind9!7083
2022-11-15 11:47:19 +00:00
Michal Nowak
27b0df2124 Add OpenBSD 7.2
(cherry picked from commit b239e6870d)
2022-11-15 10:44:04 +01:00
Michal Nowak
0f690eb8c8 Merge branch '2265-fix-and-check-bashisms-v9_16' into 'v9_16'
[v9_16] Fix and check bashisms in system test

See merge request isc-projects/bind9!7081
2022-11-15 07:00:49 +00:00
Michal Nowak
0b4be3a26c In POSIX sh, RANDOM variable is undefined
possible bashism in ./bin/tests/system/system-test-driver.sh line 77 ($RANDOM):
    ./run.sh -p "$(($RANDOM%32000+32000))" "$@" "$TEST_PROGRAM"

Also see: https://www.shellcheck.net/wiki/SC3028.
2022-11-14 23:13:04 +01:00
Michal Nowak
c40916dbf3 Hide sh-long-option checkbashism confusion
possible bashism in ./bin/tests/system/system-test-driver.sh line 30 (sh --long-option):
    OPTS=$(getopt --shell sh --name "$(basename "$0")" --options '' --longoptions test-name:,log-file:,trs-file:,color-tests:,expect-failure:,enable-hard-errors: -- "$@")
2022-11-14 23:13:04 +01:00
Michal Nowak
9cf52e51ab Add checkbashisms CI job
(cherry picked from commit 47a7c5123a)
2022-11-14 23:13:04 +01:00
Michal Nowak
8b9634c9ed Rename $HOSTNAME to $HOST_NAME to silence checkbashisms
checkbashisms warns about possible reliance on HOSTNAME environmental
variable which Bash sets to the name of the current host, and some
commands may leverage it:

    possible bashism in builtin/tests.sh line 199 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns1.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 221 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns2.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 228 ($HOST(TYPE|NAME)):
    grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.$n > /dev/null || ret=1

We don't use the variable this way but rename it to HOST_NAME to silence
the tool.

(cherry picked from commit ae33a8ddea)
2022-11-14 23:13:04 +01:00
Michal Nowak
0f2e25af52 Remove no-op assignment from kasp/tests.sh
"next_key_event_threshold" is assigned with
"next_key_event_threshold+i", but "i" is empty (never set, nor used
afterwards).

posh, the Policy-compliant Ordinary SHell, failed on this assignment
with:

    tests.sh:253: : unexpected `end of expression'

(cherry picked from commit 00c3b1e309)
2022-11-14 23:13:03 +01:00
Michal Nowak
9508a2ce46 Remove unused $@ array from cds/setup.sh
posh, the Policy-compliant Ordinary SHell, failed with:

    setup.sh:57: @: parameter not set

(cherry picked from commit 02a4a95395)
2022-11-14 23:13:03 +01:00
Michal Nowak
a1e697c8b3 Join two rndc lines not to confuse checkbashisms
checkbashisms gets confused by the rndc command being on two lines:

    possible bashism in bin/tests/system/nzd2nzf/tests.sh line 37 (type):
    rndccmd 10.53.0.1 addzone "added.example { type primary; file \"added.db\";

(cherry picked from commit 9eb2f6b0e8)
2022-11-14 23:13:03 +01:00
Michal Nowak
cf67657c71 Replace string comparisons with integer comparisons
checkbashisms reports Bash-style ("==") string comparisons inside test/[
command:

    possible bashism in bin/tests/system/checkconf/tests.sh line 105 (should be 'b = a'):
                    if [ $? == 0 ]; then echo_i "failed"; ret=1; fi
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 62 (should be 'b = a'):
                    test $ret == 0 || continue
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 79 (should be 'b = a'):
                    test $ret == 0 || continue

(cherry picked from commit 7640fc5b39)
2022-11-14 21:11:27 +01:00
Michal Nowak
be1379b6e4 Add shell interpreter line where missing
The checkbashisms script reports errors like this one:

    script util/check-line-length.sh does not appear to have a #! interpreter line;
    you may get strange results

(cherry picked from commit 9e68997cbb)
2022-11-14 21:09:42 +01:00
Mark Andrews
44c51cd320 Merge branch '3468-statistics-xml-rendering-does-not-seem-to-protect-against-concurrent-changes-v9_16' into 'v9_16'
Resolve "Statistics XML rendering does not seem to protect against concurrent changes" [v9_16]

See merge request isc-projects/bind9!7077
2022-11-11 16:40:54 +00:00
Mark Andrews
b70d4f5917 Add CHANGES note for [GL #3468]
(cherry picked from commit a4383c906c)
2022-11-11 16:13:55 +00:00
Mark Andrews
10083c2019 Have dns_zt_apply lock the zone table
There were a number of places where the zone table should have been
locked, but wasn't, when dns_zt_apply was called.

Added a isc_rwlocktype_t type parameter to dns_zt_apply and adjusted
all calls to using it.  Removed locks in callers.

(cherry picked from commit f053d5b414)
2022-11-11 16:13:55 +00:00
Petr Špaček
d0cca7ecc9 Merge branch '3669-update-policy-external-synchronous-doc-v9_16' into 'v9_16'
Document that update-policy external is synchronous [v9_16]

See merge request isc-projects/bind9!7074
2022-11-11 10:24:04 +00:00
Petr Špaček
62a0d10014 Document that update-policy external is synchronous
(cherry picked from commit 7d352741a0)
2022-11-11 11:15:54 +01:00
Mark Andrews
0fcec7a22c Merge branch '3630-nextpart-is-not-compatible-with-set-x-v9_16' into 'v9_16'
Resolve "'nextpart' is not compatible with 'set -x'" [v9_16]

See merge request isc-projects/bind9!7061
2022-11-08 17:50:26 +00:00
Mark Andrews
8cda49f604 Use file descriptor 3 to save file.prev
If 'set -x' is in effect file.prev gets populated with debugging output.
To prevent this open descriptor 3 and redirect stderr from the awk
command to descriptor 3. Debugging output will stay directed to stderr.

(cherry picked from commit 10f67938db)
2022-11-08 16:44:05 +00:00
Tom Krizek
f7ad072501 Merge branch 'tkrizek/danger-approve-v9_16' into 'v9_16'
ci: add danger checks - approve workflow & wip commits [v9_16]

See merge request isc-projects/bind9!7058
2022-11-08 13:41:55 +00:00
Tom Krizek
df30dffdd1 Check for cherry pick message in backport commits in danger CI
Using the -x option for cherry pick makes it easy to link commits across
branches and it is recommended to use for all backport commits (with
exceptions -- thus a warning level rather than failure).

(cherry picked from commit 5ecb277090)
2022-11-08 14:40:14 +01:00
Tom Krizek
f8ed380890 Detect work-in-progress commits in danger CI
To avoid accidentally merging unfinished work, detect prohibited
keywords at the start of the subject line. If the first word is any of
the following, fail the check:
WIP, wip, DROP, drop, TODO, todo

The only slightly controversial is the lowercase "drop" which might have
a legitimate use - seems like four commits in the history used it as a
start of a sentence. However, since people commonly use "drop" to
indicate a commit should be dropped before merging, let's prohibit it as
well. In case of false-positive, "Drop" with a capitalized first letter
can always be used.

(cherry picked from commit 402b11431c)
2022-11-08 14:40:14 +01:00
Tom Krizek
3a6e014b20 Use approve button workflow in danger CI
Since the LGTM label was deprecated in favor of using the Approve button
in gitlab, adjust the detection in danger bot.

Unfortunately, danger-python seems no longer maintained since 2020 and
MR approvals aren't available in its Python API (even though they're
supported in its Ruby/JS APIs). Going forward, let's use the more
comprehensive python-gitlab API.

It still makes sense to utilize the danger-python, since it handles the
integration with gitlab which doesn't need to be reimplemented as long
as it works - same with the other checks.

(cherry picked from commit e901342dd9)
2022-11-08 14:40:08 +01:00
Michał Kępień
04e434f113 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.36' into 'v9_16'
Set up version and release notes for BIND 9.16.36

See merge request isc-projects/bind9!7055
2022-11-08 12:30:14 +00:00
Michał Kępień
cc71b0afb0 Set up release notes for BIND 9.16.36 2022-11-08 13:24:19 +01:00
Michał Kępień
74ff93af19 Update BIND version to 9.16.36-dev 2022-11-08 13:24:19 +01:00
Michał Kępień
4ce90d03a8 Merge branch 'prep-release' into v9_16_35-release 2022-11-07 23:12:59 +01:00
Michał Kępień
a87c400fa8 prep 9.16.35 2022-11-07 23:12:48 +01:00
Michał Kępień
42e0859163 Merge branch 'michal/prepare-documentation-for-bind-9.16.35' into 'v9_16_35-release'
Prepare documentation for BIND 9.16.35

See merge request isc-private/bind9!473
2022-11-07 22:09:29 +00:00
Michał Kępień
619cd8d80f Add release note for GL #3603 2022-11-07 23:05:01 +01:00
Michał Kępień
472598f7ed Add release note for GL #3247 2022-11-07 23:05:01 +01:00
Michał Kępień
b91a75098f Reorder release notes 2022-11-07 23:05:01 +01:00
Michał Kępień
aa24942237 Tweak and reword release notes 2022-11-07 23:05:01 +01:00
Michał Kępień
20275113f5 Prepare release notes for BIND 9.16.35 2022-11-07 23:05:01 +01:00
Michał Kępień
8d15ce5ff0 Merge branch 'pspacek/doc-known-issues-reshuffle-v9_16' into 'v9_16'
[v9_16] Repeat Known Issues at the top of Release Notes page

See merge request isc-projects/bind9!7044
2022-11-07 14:10:58 +00:00
Petr Špaček
04cd80c0f5 Repeat Known Issues at the top of Release Notes page
From now on all per-version notes link to the global list
of Known Issues. If there is a new note it should be listed twice:
In the per-version list, and in the global list.

(cherry picked from commit c58dd2790a)
2022-11-07 15:04:23 +01:00
Michał Kępień
9b22c414ce Merge branch '3652-reference-manual-update-policies-unmatched-parenthesis-v9_16' into 'v9_16'
[v9_16] Add missing closing ')' to update-policy documentation

See merge request isc-projects/bind9!7039
2022-11-07 12:49:55 +00:00
Mark Andrews
bf3a8c7de9 Add missing closing ')' to update-policy documentation
The opening '(' before local was not being matched by a closing
')' after the closing '};'.

(cherry picked from commit 044c3b2bb8)
2022-11-07 13:08:20 +01:00
Michał Kępień
a9f5cbb4da Merge branch 'each-dupsigs-test-v9_16' into 'v9_16'
make dupsigs test less timing-sensitive [v9_16]

See merge request isc-projects/bind9!7037
2022-11-07 10:56:01 +00:00
Evan Hunt
4840d6f9c9 make dupsigs test less timing-sensitive
the dupsigs test is prone to failing on slow CI machines
because the first test can occur before the zone is fully
signed.

instead of just waiting ten seconds arbitrarily, we now
check every second, and allow up to 30 seconds before giving
up.

(cherry picked from commit d9b85cbaae)
2022-11-07 10:29:00 +01:00
Tom Krizek
149bda2764 Merge branch 'tkrizek/revert-random-algorithm-randomization' into 'v9_16'
Revert "Merge branch '3503-random-default-algorithm-in-tests-v9_16' into 'v9_16'"

See merge request isc-projects/bind9!7019
2022-11-04 09:32:02 +00:00
Tom Krizek
a1fd85ac70 Revert "Merge branch '3503-random-default-algorithm-in-tests-v9_16' into 'v9_16'"
This reverts commit a7ac1e0105, reversing
changes made to d690c55ed7.
2022-11-04 10:08:51 +01:00
Ondřej Surý
4e326b23fb Merge branch '3643-dont-use-dns_zone_attach-in-zone_refreshkeys-v9_16' into 'v9_16'
Don't use dns_zone_attach() in zone_refreshkeys() [9.16]

See merge request isc-projects/bind9!7026
2022-11-03 15:10:06 +00:00
Ondřej Surý
a6e3fc20d0 Don't use dns_zone_attach() in zone_refreshkeys()
The zone_refreshkeys() could run before the zone_shutdown(), but after
the last .erefs has been "detached" causing assertion failure when doing
dns_zone_attach().  Remove the use of .erefs (dns_zone_attach/detach)
and replace it with using the .irefs and additional checks whether the
zone is exiting in the callbacks.

(cherry picked from commit 80e66fbd2d)
2022-11-03 15:35:58 +01:00
Matthijs Mekking
aee91a01b4 Merge branch '3591-nsec3-crash-dynamic-to-inline-signing-v9_16' into 'v9_16'
[v9_16] Fix crash where dnssec-policy zone with NSEC3 crashes when inline-signing is turned on

See merge request isc-projects/bind9!7021
2022-11-03 14:31:24 +00:00
Matthijs Mekking
23f87f5ca7 Add release note and change for GL #3591
Breaking news.

(cherry picked from commit 1cf2f6fe68)
2022-11-03 14:45:12 +01:00
Matthijs Mekking
e4808e1f5f If a zone is not reusable, trigger full sign
If after a reconfig a zone is not reusable because inline-signing
was turned on/off, trigger a full resign. This is necessary because
otherwise the zone maintenance may decide to only apply the changes
in the journal, leaving the zone in an inconsistent DNSSEC state.

(cherry picked from commit 4d143f2cc4)
2022-11-03 14:44:41 +01:00
Matthijs Mekking
949768b252 Don't allow DNSSEC records in the raw zone
There was an exception for dnssec-policy that allowed DNSSEC in the
unsigned version of the zone. This however causes a crash if the
zone switches from dynamic to inline-signing in the case of NSEC3,
because we are now trying to add an NSEC3 record to a non-NSEC3 node.
This is because BIND expects none of the records in the unsigned
version of the zone to be NSEC3.

Remove the exception for dnssec-policy when copying non DNSSEC
records, but do allow for DNSKEY as this may be a published DNSKEY
from a different provider.

(cherry picked from commit 332b98ae49)
2022-11-03 14:44:35 +01:00
Matthijs Mekking
9533b68089 Remove checks when going to dnssec-policy none
The changes in the code have the side effect that the CDNSKEY and CDS
records in the secure version of the zone are not reusable and thus
are thrashed from the zone. Remove the apex checks for this use case.
We only care about that the zone is not immediately goes bogus, but
a user really should use the built-in "insecure" policy when unsigning
a zone.

(cherry picked from commit bc703a12e7)
2022-11-03 14:41:31 +01:00
Matthijs Mekking
3656e8c967 Add nsec3 system test that transfers in NSEC3
Similar to an attempt to add NSEC through dynamic update, add a test
case that tries to add NSEC3 through zone transfer.

(cherry picked from commit ef1cb9935c)
2022-11-03 14:41:23 +01:00
Matthijs Mekking
ee18cfe215 Add two more nsec3 system tests
Add one more case that tests reconfiguring a zone to turn off
inline-signing. It should still be a valid DNSSEC zone and the NSEC3
parameters should not change.

Add another test to ensure that you cannot update the zone with a
NSEC3 record.

(cherry picked from commit 4cd8e8e9c3)
2022-11-03 14:41:05 +01:00
Matthijs Mekking
8f6efb8446 Update kasp system test to work with .signed files
We no longer accept copying DNSSEC records from the raw zone to
the secure zone, so update the kasp system test that relies on this
accordingly.

Also add more debugging and store the dnssec-verify results in a file.

(cherry picked from commit 57ea9e08c6)
2022-11-03 14:39:38 +01:00
Matthijs Mekking
9bef41046f Test changing from dynamic to inline-signing
Add a kasp system test that reconfigures a dnssec-policy zone from
maintaining DNSSEC records directly to the zone to using inline-signing.

Add a similar test case to the nsec3 system test, testing the same
thing but now with NSEC3 in use.

(cherry picked from commit 9018fbb205)
2022-11-03 14:39:23 +01:00
Tom Krizek
a7ac1e0105 Merge branch '3503-random-default-algorithm-in-tests-v9_16' into 'v9_16'
Random selection of DEFAULT_ALGORITHM in system tests at runtime [v9_16]

See merge request isc-projects/bind9!6994
2022-11-01 18:52:54 +00:00
Tom Krizek
df436ed93b ci: disable algorithm support checking in softhsm
The algorithm support detection script doesn't seem to work when using
the SoftHSM module. For some reason, dnssec-keygen returns 'crypto
failure'. Since the tests themselves pass, this is likely to be some
bug/definiency in the test scripts that check algorithm support that get
confused by SoftHSM.

Since this issue only happens for the system:gcc:softhsm2.6 job in the
9.16 branch, use a workaround to not introduce this new feature for
this particular problematic job.
2022-11-01 19:51:52 +01:00
Tom Krizek
b5946acfc9 Randomize algorithm selection for mkeys test
Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

(cherry picked from commit f65f276f98)
2022-11-01 19:51:52 +01:00
Tom Krizek
8a6fc2d20e Set algorithms for system tests at runtime
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f)
2022-11-01 19:51:52 +01:00
Tom Krizek
8b5a9c185a Script for random algorithm selection in system tests
Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

(cherry picked from commit 5f480c8485)
2022-11-01 19:51:52 +01:00
Tom Krizek
ae86743e7b Export env variables in system tests
Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

(cherry picked from commit 37d14c69c0)
2022-11-01 19:51:52 +01:00
Tom Krizek
edd923e8eb Support testcrypto.sh usage without including conf.sh
The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

(cherry picked from commit bb1c6bbdc7)
2022-11-01 19:51:52 +01:00
Tom Krizek
a51b0ad31f Unify indentation level in testcrypto.sh
(cherry picked from commit 01b293b055)
2022-11-01 19:51:49 +01:00
Arаm Sаrgsyаn
d690c55ed7 Merge branch '2895-named-can-create-unrecoverable-managed-keys-v9_16' into 'v9_16'
[v9_16] Don't trust a placeholder KEYDATA record

See merge request isc-projects/bind9!7009
2022-11-01 12:11:16 +00:00
Aram Sargsyan
854b2cf182 Add CHANGES and release notes for [GL #2895]
(cherry picked from commit 3bf4bc7336)
2022-11-01 11:20:25 +00:00
Aram Sargsyan
78e04d8d0c Don't trust a placeholder KEYDATA record
When named starts it creates an empty KEYDATA record in the managed-keys
zone as a placeholder, then schedules a key refresh. If key refresh
fails for some reason (e.g. connectivity problems), named will load the
placeholder key into secroots as a trusted key during the next startup,
which will break the chain of trust, and named will never recover from
that state until managed-keys.bind and managed-keys.bind.jnl files are
manually deleted before (re)starting named again.

Before calling load_secroots(), check that we are not dealing with a
placeholder.

(cherry picked from commit 354ae2d7e3)
2022-11-01 10:55:38 +00:00
Aram Sargsyan
f12260c435 Test managed-keys placeholder
Add a dnssec test to make sure that named can correctly process a
managed-keys zone with a placeholder KEYDATA record.

(cherry picked from commit 8c48eabbc1)
2022-11-01 10:55:19 +00:00
Evan Hunt
946c389254 Merge branch '3617-keyfetch-race-v9_18-v9_16' into 'v9_16'
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

See merge request isc-projects/bind9!7007
2022-11-01 09:22:52 +00:00
Evan Hunt
90c41d41d7 CHANGES for [GL #3617] 2022-11-01 01:46:39 -07:00
Evan Hunt
8010389902 Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()
Because dns_resolver_createfetch() locks the view, it was necessary
to unlock the zone in zone_refreshkeys() before calling it in order
to maintain the lock order, and relock afterward. this permitted a race
with dns_zone_synckeyzone().

This commit moves the call to dns_resolver_createfetch() into a separate
function which is called asynchronously after the zone has been
unlocked.

The keyfetch object now attaches to the zone to ensure that
it won't be shut down before the asynchronous call completes.

This necessitated refactoring dns_zone_detach() so it always runs
unlocked. For managed zones it schedules zone_shutdown() to
run asynchronously; for unmanaged zones there is no task.
2022-11-01 01:46:17 -07:00
Tom Krizek
2e7f973c6e Merge branch '3517-serve-stale-cache-timeout-0-test-v9_16' into 'v9_16'
[v9_16] [CVE-2022-3080] Test serve stale cache with timeout 0 and CNAME

See merge request isc-projects/bind9!6977
2022-10-24 13:08:48 +00:00
Tom Krizek
29782e5613 Remove misleading comment from serve-stale test
The stale-answer-client-timeout option is not set to 0 in the config
neither is it the default value. This was probably caused by a
copy-paste error.
2022-10-24 14:39:48 +02:00
Tom Krizek
01293b86d9 Test serve stale cache with timeout 0 and CNAME
Add a couple of tests that verify the serve-stale behavior when
stale-answer-client-timeout is set to 0 and a (stale) CNAME record is
queried.

Related #3517
2022-10-24 14:39:46 +02:00
Michał Kępień
d736356e3d Merge branch 'michal/bump-sphinx-version-to-5.3.0-v9_16' into 'v9_16'
[v9_16] Bump Sphinx version to 5.3.0

See merge request isc-projects/bind9!6974
2022-10-24 09:57:45 +00:00
Michał Kępień
f93e4c160c Bump Sphinx version to 5.3.0
Make the Sphinx version listed in doc/arm/requirements.txt match the
version currently used in GitLab CI, so that Read the Docs builds the
documentation using the same Python software versions as those used in
GitLab CI.

(cherry picked from commit a8f0ab7df6)
2022-10-24 11:45:25 +02:00
Arаm Sаrgsyаn
523fa7c3a9 Merge branch '3603-resolver-prefetch-eligibility-edge-case-bug-v9_16' into 'v9_16'
[v9_16] Synchronize prefetch "trigger" and "eligibility" code and documentation

See merge request isc-projects/bind9!6970
2022-10-21 11:48:32 +00:00
Aram Sargsyan
c65c6ecee5 Getting the "prefetch" setting from the configuration cannot fail
The "prefetch" setting is in "defaultconf" so it cannot fail, use
INSIST to confirm that.

The 'trigger' and 'eligible' variables are now prefixed with
'prefetch_' and their declaration moved to an upper level, because
there is no more additional code block after this change.

(cherry picked from commit 0227565cf1)
2022-10-21 10:30:56 +00:00
Aram Sargsyan
ee7179f482 Fix prefetch "trigger" value's documentation in ARM
For the prefetch "trigger" parameter ARM states that when a cache
record with a lower TTL value is encountered during query processing,
it is refreshed. But in reality, the record is refreshed when the TTL
value is lower or equal to the configured "trigger" value.

Fix the documentation to make it match with with the code.

(cherry picked from commit ef344b1f52)
2022-10-21 10:30:43 +00:00
Aram Sargsyan
2f5bd9c15d Add a CHANGES note for [GL #3603]
(cherry picked from commit 041ffac0d7)
2022-10-21 10:30:37 +00:00
Aram Sargsyan
648e71b086 Match prefetch eligibility behavior with ARM
ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.

(cherry picked from commit 863f51466e)
2022-10-21 10:30:28 +00:00
Aram Sargsyan
822dd7b8b9 Add another prefetch check in the resolver system test
The test triggers a prefetch, but fails to check if it acutally
happened, which prevented it from catching a bug when the record's
TTL value matches the configured prefetch eligibility value.

Check that prefetch happened by comparing the TTL values.

(cherry picked from commit 89fa9a6592)
2022-10-21 10:30:13 +00:00
Arаm Sаrgsyаn
64fa7d0360 Merge branch '3598-adb-quota-might-not-be-decremented-v9_16' into 'v9_16'
[v9_16] Resolve "ADB quota might not be decremented"

See merge request isc-projects/bind9!6968
2022-10-21 10:01:07 +00:00
Aram Sargsyan
16a06d1dc3 Add CHANGES and release notes for [GL #3598]
(cherry picked from commit 6f50972e5f)
2022-10-21 09:04:13 +00:00
Aram Sargsyan
c3660564ce Call dns_adb_endudpfetch() on error path, if required
For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.

(cherry picked from commit 5da79e2be0)
2022-10-21 08:46:43 +00:00
Artem Boldariev
5e2c20a88c Merge branch '3563-fix-named-startup-on-manycore-solaris-systems-v9-16' into 'v9_16'
[Backport to v9.16] Fix named failing to start on Solaris systems with hundreds of CPUs

See merge request isc-projects/bind9!6963
2022-10-20 13:28:36 +00:00
Artem Boldariev
425fd36162 Modify release notes [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.

(cherry picked from commit 2c9400f116)
2022-10-20 15:23:00 +03:00
Artem Boldariev
d6c0aed9df Modify CHANGES [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.

(cherry picked from commit 03ee132e28)
2022-10-20 15:22:09 +03:00
Artem Boldariev
46664bfe5d Fix named failing to start on Solaris systems with hundreds of CPUs
This commit fixes a startup issue on Solaris systems with
many (reportedly > 510) CPUs by bumping RLIMIT_NOFILE. This appears to
be a regression from 9.11.

(cherry picked from commit fff01fe7eb)
2022-10-20 15:21:53 +03:00
Michal Nowak
1015ccf6a2 Merge tag 'v9_16_34' into v9_16
BIND 9.16.34
2022-10-20 12:51:06 +02:00
Michal Nowak
c4a2ea04d0 Merge branch '3394-cve-2022-2795-test-v9_16' into 'v9_16'
[v9_16] Add tests for CVE-2022-2795

See merge request isc-projects/bind9!6956
2022-10-20 08:22:19 +00:00
Michał Kępień
67319f1004 Add tests for CVE-2022-2795
Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.

(cherry picked from commit 604d8f0b96)
2022-10-20 10:19:22 +02:00
Evan Hunt
828e7f5257 Merge branch '3247-rpz-ip-cd-v9_16' into 'v9_16'
ensure RPZ lookups handle CD=1 correctly

See merge request isc-projects/bind9!6958
2022-10-20 00:31:52 +00:00
Evan Hunt
08ed9185cd CHANGES for [GL #3247] 2022-10-19 13:18:49 -07:00
Evan Hunt
2cf5fd67c0 add a test with CD=1 query for pending data
this is a regression test for [GL #3247].
2022-10-19 13:17:32 -07:00
Evan Hunt
8e4a1f3483 ensure RPZ lookups handle CD=1 correctly
RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.

(cherry picked from commit 305a50dbe1)
2022-10-19 13:16:51 -07:00
Tom Krizek
8097e97d9b Merge branch 'tkrizek/system-tests-fixes-v9_16' into 'v9_16'
Update various system tests and add them to default test suite [v9_16]

See merge request isc-projects/bind9!6950
2022-10-19 14:59:23 +00:00
Tom Krizek
a8f286c9a5 Remove generated controls.conf file from system tests
The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.

(cherry picked from commit cbd0355328)
2022-10-19 16:58:56 +02:00
Tom Krizek
456baa7f4a Revive dupsigs system test
Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.

(cherry picked from commit cb0a2ae1dd)
2022-10-19 16:58:56 +02:00
Tom Krizek
84d6484c5a Revive the stress system test
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883

(cherry picked from commit 7495deea3e)
2022-10-19 16:58:56 +02:00
Tom Krizek
81a224f418 Revive dialup system test
Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).

(cherry picked from commit 235ae5f344)
2022-10-19 16:58:55 +02:00
Matthijs Mekking
4c70fd2e21 Merge branch 'matthijs-fix-dnssec-signing-log-lovel-v9_16' into 'v9_16'
[v9_16] Change log level when doing rekey

See merge request isc-projects/bind9!6940
2022-10-19 14:27:58 +00:00
Matthijs Mekking
cbdf23e5ec Change log level when doing rekey
This log happens when BIND checks the parental-agents if the DS has
been published. But if you don't have parental-agents set up, the list
of keys to check will be empty and the result will be ISC_R_NOTFOUND.
This is not an error, so change the log level to debug in this case.

(cherry picked from commit a1d57fc8cb)
2022-10-18 16:31:01 +02:00
Petr Špaček
a6f9d0c7c4 Merge branch 'pspacek/ci-no-developer-mode-v9_16' into 'v9_16'
Add CI job with --disable-developer [v9_16]

See merge request isc-projects/bind9!6936
2022-10-18 13:48:35 +00:00
Petr Špaček
b57241ddbb Allow system tests to run under root user when inside CI
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
says variable CI_SERVER="yes" is available in all versions of Gitlab.

(cherry picked from commit ddf46056ca)

Adapted to v9_16's version of run.sh.
2022-10-18 15:18:13 +02:00
Petr Špaček
6a7ec0c01c Build gcc:oraclelinux9:amd64 CI jobs with --disable-developer
Purpose of this is to guard against tests which rely on querytrace or
other optional features enabled by --enable-developer switch.

(cherry picked from commit d6db5c5335)
2022-10-18 15:16:16 +02:00
Ondřej Surý
b3cb637a67 Merge branch 'ondrej-add-ISC_LIST,LINK_INITIALIZER-v9_16' into 'v9_16'
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers

See merge request isc-projects/bind9!6935
2022-10-18 13:15:29 +00:00
Ondřej Surý
7b4cf67261 Replace (void *)-1 with ISC_LINK_TOMBSTONE
Instead of having "arbitrary" (void *)-1 to define non-linked, add a
ISC_LINK_TOMBSTONE(type) macro that replaces the "magic" value with a
define.

(cherry picked from commit 5e20c2ccfb)
2022-10-18 14:30:49 +02:00
Ondřej Surý
a317b2ea1c Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do

    *foo = (foo_t){ .list = ISC_LIST_INITIALIZER };

Instead of:

    *foo = (foo_t){ 0 };
    ISC_LIST_INIT(foo->list);

(cherry picked from commit cb3c36b8bf)
2022-10-18 14:30:49 +02:00
Arаm Sаrgsyаn
3c34c54b6c Merge branch '3584-ns_statscounter_recursclients-bug-v9_16' into 'v9_16'
[v9_16] Fix ns_statscounter_recursclients counting bug

See merge request isc-projects/bind9!6929
2022-10-18 11:26:10 +00:00
Aram Sargsyan
8dbdf6bc1b Add a release note for [GL #3584]
(cherry picked from commit d83642b3ac)
2022-10-18 10:38:04 +00:00
Aram Sargsyan
f82f78d7f6 Add a CHANGES note for [GL #3584]
(cherry picked from commit 5b1ef41897)
2022-10-18 10:38:04 +00:00
Aram Sargsyan
b6aeccf697 Fix ns_statscounter_recursclients counting bug
The incrementing and decrementing of 'ns_statscounter_recursclients'
were not properly balanced: for example, it would be incremented for
a prefetch query but not decremented if the query failed.

This commit ensures that the recursion quota and the recursive clients
counter are always in sync with each other.

(cherry picked from commit 82991451b4)
2022-10-18 10:38:04 +00:00
Michal Nowak
b4158582fe Merge branch 'mnowak/grep-warnings-fix-ci-check' into 'v9_16'
Check systests.output for Grep warnings

See merge request isc-projects/bind9!6923
2022-10-18 09:20:31 +00:00
Michal Nowak
18b639c222 Check systests.output for Grep warnings
The v9_16 branch does not have "*.log" system test artifact BIND 9.18+
has and systests.output file needs to be checked for Grep warnings
instead.
2022-10-18 11:12:47 +02:00
Petr Špaček
816148bbce Merge branch 'pspacek/doc-nsupdate-server-gsstsig-v9_16' into 'v9_16'
Document that nsupdate ignores server command in GSS-TSIG mode [v9_16]

See merge request isc-projects/bind9!6926
2022-10-18 08:23:06 +00:00
Petr Špaček
b7cae87b2b Document that nsupdate ignores server command in GSS-TSIG mode
This behavior is present since introduction of GSS-TSIG support,
commit 289ae548d5.

(cherry picked from commit c8a38d70f0)
2022-10-18 10:14:54 +02:00
Arаm Sаrgsyаn
8a6b239000 Merge branch 'aram/cfg_print_duration-uninitialized-length-v9_16' into 'v9_16'
[v9_16] Fix a logical bug in cfg_print_duration()

See merge request isc-projects/bind9!6921
2022-10-17 12:02:03 +00:00
Aram Sargsyan
790db0a344 Handle large numbers when parsing/printing a duration
The duration_fromtext() function is truncating large numbers
to 32 bits instead of capping or rejecting them, i.e. 64424509445,
which is 0xf00000005, gets parsed as 32-bit value 5 (0x00000005).

Fail parsing a duration if any of its components is bigger than
32 bits. Using those kind of big numbers has no practical use case
for a duration.

The cfg_obj_asduration() function can overflow the 32 bit
seconds variable when calculating the duration from its component
parts.

To avoid that, use 64-bit calculation and return UINT32_MAX if the
calculated value is bigger than UINT32_MAX. Again, a number this big
has no practical use case anyway.

The buffer for the generated duration string is limited to 64 bytes,
which, in theory, is smaller than the longest possible generated
duration string.

Use 80 bytes instead, calculated by the '7 x (10 + 1) + 3' formula,
where '7' is the count of the duration's parts (year, month, etc.), '10'
is their maximum length when printed as a decimal number, '1' is their
indicator character (Y, M, etc.), and 3 is two more indicators (P and T)
and the terminating NUL character.

(cherry picked from commit fddaebb285)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
12560d1736 Add a CHANGES note for [GL !6880]
(cherry picked from commit 190aab84d7)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
d9a8c43107 Fix an off-by-one error in cfg_print_duration()
The cfg_print_duration() checks added previously in the 'duration_test'
unit test uncovered a bug in cfg_print_duration().

When calculating the current 'str' pointer of the generated text in the
buffer 'buf', it erroneously adds 1 byte to compensate for that part's
indicator character. For example, to add 12 minutes, it needs to add
2 + 1 = 3 characters, where 2 is the length of "12", and 1 is the length
of "M" (for minute). The mistake was that the length of the indicator
is already included in 'durationlen[i]', so there is no need to
calculate it again.

In the result of this mistake the current pointer can advance further
than needed and end up after the zero-byte instead of right on it, which
essentially cuts off any further generated text. For example, for a
5 minutes and 30 seconds duration, instead of having this:

    'P', 'T', '5', 'M', '3', '0', 'S', '\0'

The function generates this:

    'P', 'T', '5', 'M', '\0', '3', '0', 'S', '\0'

Fix the bug by adding to 'str' just 'durationlen[i]' instead of
'durationlen[i] + 1'.

(cherry picked from commit dc55f1ebb9)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
b7c5e95d6d Test cfg_print_duration() in duration_test.c
Currently the 'duration_test' unit test checks only the
cfg_obj_asduration() function.

Extend the test so it checks also the reverse operation using the
cfg_print_duration() function, which is used in named-checkconf.

(cherry picked from commit 39290bb7cd)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
f458f6496d Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.

(cherry picked from commit 9440910187)
2022-10-17 09:17:56 +00:00
Ondřej Surý
cda3b93232 Merge branch 'mnowak/fix-grep-3.8-warnings-v9_16' into 'v9_16'
Fix GNU Grep 3.8 warnings [v9_16]

See merge request isc-projects/bind9!6919
2022-10-17 07:39:47 +00:00
Michal Nowak
e0625baf3f Add CI check for Grep warnings
(cherry picked from commit 759e8a6671)
2022-10-17 09:12:51 +02:00
Michal Nowak
4be4deb740 Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
    fgrep: warning: fgrep is obsolescent; using grep -F

(cherry picked from commit 212c4de043)
2022-10-17 09:12:02 +02:00
Michal Nowak
52b86104ca Remove stray backslashes
GNU Grep 3.8 reports several instances of stray backslashes in matching
patterns:

    grep: warning: stray \ before /
    grep: warning: stray \ before :

(cherry picked from commit 65e91ef5e6)
2022-10-17 09:11:20 +02:00
Tom Krizek
d3b8050793 Merge branch 'tkrizek/remove-system-test-delzone-v9_16' into 'v9_16'
Remove system test delzone [v9_16]

See merge request isc-projects/bind9!6912
2022-10-14 16:26:23 +00:00
Tom Krizek
2637043f01 Remove system test delzone
There are multiple reasons to remove this test as obsolete:

- The test may not possibly work for over 2.5 years, since
  98b3b93791 removed the rndc.py python
  tool on which this test relies.
- It isn't part of the test suite either in CI or locally unless it is
  explicitly enabled. As a result, there are many issues which prevent
  the test from being executed caused by various refactoring efforts
  accumulated over time.
- Even if the test could be executed, it has no clear failure condition.
  If the python script(s) fail, the test still passes.

(cherry picked from commit 05180154d9)
2022-10-14 16:48:38 +02:00
Michał Kępień
042c33a381 Merge branch '3592-fix-startup-detection-after-restart-in-start.pl-v9_16' into 'v9_16'
[v9_16] Fix startup detection after restart in start.pl

See merge request isc-projects/bind9!6891
2022-10-11 10:27:43 +00:00
Michał Kępień
e535dc2b59 Fix startup detection after restart in start.pl
The bin/tests/system/start.pl script waits until a "running" message is
logged by a given name server instance before attempting to send a
version.bind/CH/TXT query to it.  The idea behind this was to make the
script wait until named loads all the zones it is configured to serve
before telling the system test framework that a given server is ready to
use; this prevents the need to add boilerplate code that waits for a
specific zone to be loaded to each test expecting that.

The problem is that when it looks for "running" messages, the
bin/tests/system/start.pl script assumes that the existence of any such
message in the named.run file indicates that a given named instance has
already finished loading all zones.  Meanwhile, some system tests
restart all the named instances they use throughout their lifetime (some
even do that a few times), for example to run Python-based tests.  The
bin/tests/system/start.pl script handles such a scenario incorrectly: as
soon as it finds any "running" message in the named.run file it inspects
and it gets a response to a version.bind/CH/TXT query, it tells the
system test framework that a given server is ready to use, which might
not be true - it is possible that only the "version.bind" zone is loaded
at that point and the "running" message found was logged by a
previously-shutdown named instance. This triggers intermittent failures
for Python-based tests.

Fix by improving the logic that the bin/tests/system/start.pl script
uses to detect server startup: check how many "running" lines are
present in a given named.run file before attempting to start a named
instance and only proceed with version.bind/CH/TXT queries when the
number of "running" lines found in that named.run file increases after
the server is started.

(cherry picked from commit 18e20f95f6)
2022-10-11 11:59:02 +02:00
Michał Kępień
c11f286d34 Do not truncate ns2 logs in the "rrsetorder" test
In the "rrsetorder" system test, the ns2 named instance is restarted
without passing the --restart option to bin/tests/system/start.pl.  This
causes the log file for that named instance to be needlessly truncated.
Prevent this from happening by restarting the affected named instance
in the same way as all the other named instances used in system tests.

(cherry picked from commit 9146b956ae)
2022-10-11 11:59:02 +02:00
Michał Kępień
5e926b444d Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.35' into 'v9_16'
Set up version and release notes for BIND 9.16.35

See merge request isc-projects/bind9!6886
2022-10-10 21:36:43 +00:00
Michał Kępień
aa85812c26 Set up release notes for BIND 9.16.35 2022-10-10 23:20:13 +02:00
Michał Kępień
6263e04544 Update BIND version to 9.16.35-dev 2022-10-10 23:20:13 +02:00
Michał Kępień
08724b7eef Merge branch 'prep-release' into v9_16_34-release 2022-10-10 10:08:17 +02:00
Michał Kępień
b06081eb36 prep 9.16.34 2022-10-10 10:08:17 +02:00
Michał Kępień
d31b8fe1f4 Merge branch 'michal/prepare-documentation-for-bind-9.16.34' into 'v9_16_34-release'
Prepare documentation for BIND 9.16.34

See merge request isc-private/bind9!465
2022-10-07 11:45:15 +00:00
Michał Kępień
2a00ea6305 Reorder release notes 2022-10-07 13:40:53 +02:00
Michał Kępień
e392bb194c Tweak and reword release notes 2022-10-07 13:40:53 +02:00
Michał Kępień
1fbff9bc80 Prepare release notes for BIND 9.16.34 2022-10-07 13:40:53 +02:00
Michał Kępień
1a90242ce4 Fix the location of a misplaced CHANGES entry 2022-10-07 13:40:53 +02:00
Petr Špaček
6e3ca66116 Merge branch '3554-improve-dnssec-policy-inline-signing-err-msg-v9_16' into 'v9_16'
Clarify new configuration incompabitility: dnssec-policy vs. inline-signing [v9_16]

See merge request isc-projects/bind9!6872
2022-10-06 08:55:44 +00:00
Petr Špaček
21c58497e2 Add Known Issue about config incompatibility
(cherry picked from commit 5589d0a49c)

Adapted for v9_16 branch: Removed hyperlinks, removed note about 9.18.
2022-10-06 10:32:52 +02:00
Petr Špaček
d63bc6af08 Clarify error message about missing inline-signing & dnssec-policy
(cherry picked from commit 058c1744ba)
2022-10-06 10:31:15 +02:00
Mark Andrews
1920c3d073 Merge branch '3577-reloads-in-ixfr-system-test-happen-too-fast-v9_16' into 'v9_16'
Add sleeps to ixfr system test [v9_16]

See merge request isc-projects/bind9!6870
2022-10-05 22:04:04 +00:00
Mark Andrews
03d363d0ee Add sleeps to ixfr system test
ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.

(cherry picked from commit 491a8cfe96)
2022-10-06 08:36:38 +11:00
Michal Nowak
2227974961 Merge branch 'mnowak/drop-flake8-ignore-lists-v9_16' into 'v9_16'
[v9_16] Drop flake8 ignore lists

See merge request isc-projects/bind9!6868
2022-10-05 16:40:05 +00:00
Michal Nowak
9f27c3f95e Drop flake8 ignore lists
flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.

(cherry picked from commit f5d9fa6ea4)
2022-10-05 18:33:34 +02:00
Petr Špaček
4fab54454d Merge branch 'pspacek/tsan-ci-artifacts-fix-v9_16' into 'v9_16'
Fix TSAN artifact gathering in CI [v9_16]

See merge request isc-projects/bind9!6859
2022-10-05 08:20:31 +00:00
Petr Špaček
815f89dbf9 Fix TSAN artifact gathering in CI
Fixup for 2c3b2dabe9.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243

(cherry picked from commit 9559eb3b21)
Adapted for v9_16 branch.
2022-10-05 09:50:54 +02:00
Evan Hunt
5770858152 Merge branch '3493-clear-httpd-buffer-v9_16' into 'v9_16'
compression buffer was not cleared properly

See merge request isc-projects/bind9!6854
2022-10-05 06:06:49 +00:00
Evan Hunt
7b6140e756 compression buffer was not cleared properly
clear the compression buffer before use. this eliminates the
possibility of a latent bug that, when combined with other changes,
allowed an overread in a later version of BIND.
2022-10-04 10:12:24 -07:00
Mark Andrews
59230bb58f Merge branch '3544-add-dohpath-parsing-to-svbc-v9_16' into 'v9_16'
Add support for 'dohpath' to SVCB (and HTTPS) [v9_16]

See merge request isc-projects/bind9!6850
2022-10-04 06:24:57 +00:00
Mark Andrews
9bb5157adf Use strnstr implementation from FreeBSD if not provided by OS
(cherry picked from commit 5f07fe8cbb)
2022-10-04 17:05:18 +11:00
Mark Andrews
5568aca5a5 Add release note for [GL #3544]
(cherry picked from commit 2f3441b40a)
2022-10-04 15:34:10 +11:00
Mark Andrews
14f4dadfe5 Add CHANGES note for [GL #3544]
(cherry picked from commit 335b397e15)
2022-10-04 15:34:08 +11:00
Mark Andrews
e396d5d72d Add support for 'dohpath' to SVCB (and HTTPS)
dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).

(cherry picked from commit 6d561d3886)
2022-10-04 15:33:49 +11:00
Michal Nowak
120077bcc2 Merge branch 'mnowak/add-oracle-linux-9-v9_16' into 'v9_16'
[v9_16] Add Oracle Linux 9

See merge request isc-projects/bind9!6808
2022-10-03 13:17:57 +00:00
Michal Nowak
7ae22392da Add Oracle Linux 9
(cherry picked from commit be08cf41d9)
2022-10-03 13:28:26 +02:00
Mark Andrews
47e8a98240 keymgr: use DEFAULT_ALGORITHM instead of {nsec3}rsasha1 2022-10-03 13:28:26 +02:00
Michal Nowak
f822943473 coverage: use $DEFAULT_ALGORITHM 2022-10-03 13:28:25 +02:00
Mark Andrews
21cd56b42b Fix mkeys to work with DEFAULT_ALGORITHM properly
Stop using a RSASHA1 fixed key in ns3's named.conf as the
trusted key and instead compute a broken digest from the
real digest to use in trusted-keys.

(cherry picked from commit be4cbe2b80)
2022-10-03 13:28:25 +02:00
Mark Andrews
42727aab9a kasp: stop using RSASHA1 unless necessary for the test
Moves tests from being RSASHA1 based to RSASHA256 based where possible
and split out the remaining RSASHA1 based tests so that they are not
run on OS's that don't support RSASHA1.

(cherry picked from commit db028684e5)
2022-10-03 13:28:25 +02:00
Mark Andrews
4daa3d6dae keymgr2kasp: use FIPS compliant algorithms and key sizes
migrate-nomatch-alglen: switched to RSASHA256 instead of RSASHA1
and the key size now changes from 2048 bits to 3072 bits instead
of 1024 bits to 2048 bits.

migrate-nomatch-algnum: switched to RSASHA256 instead of RSASHA1
as initial algorithm and adjusted mininum key size to 2048 bits.

rsasha256: adjusted minimum key size to 2048 bits.

(cherry picked from commit 048b015166)
2022-10-03 13:28:25 +02:00
Mark Andrews
3d642f46f2 dnssec/signer/general: Replace RSASHA1 keys with RSASHA512 keys
RSASHA1 is verify only in FIPS mode. Use RSASHA256 instead.

(cherry picked from commit 9c6de6d12d)
2022-10-03 13:28:25 +02:00
Mark Andrews
c6abcefee1 Check if RSASHA1 is supported by the OS
(cherry picked from commit 1690cb7bb4)
2022-10-03 13:28:25 +02:00
Mark Andrews
77e0878444 autosign: use FIPS compatible algorithms and key sizes
The nsec-only.example zone was not converted as we use it to
test nsec-only DNSSEC algorithms to nsec3 conversion failure.
The subtest is skipped in fips mode.

Update "checking revoked key with duplicate key ID" test
to use FIPS compatible algorithm.

(cherry picked from commit 99ad09975e)
2022-10-03 13:28:25 +02:00
Mark Andrews
e6d1117891 rsabigexponent: convert the test from RSASHA1 to RSASHA256
RSASHA1 is not supported on some platforms.

(cherry picked from commit 8c3c011860)
2022-10-03 13:28:25 +02:00
Mark Andrews
fe4d8ca7c7 mkeys: use $() instead of back quotes
(cherry picked from commit 0e45a2b02c)
2022-10-03 13:19:35 +02:00
Mark Andrews
4950ab72e8 Upgrade uses of hmac-sha1 to DEFAULT_HMAC
where the test is not hmac-sha1 specific

(cherry picked from commit c533e8bc5b)
2022-10-03 13:19:35 +02:00
Mark Andrews
aafc3f8cf3 Add CHANGES not for [GL #3440]
(cherry picked from commit be88c583bd)
2022-10-03 13:19:35 +02:00
Mark Andrews
e8545ad255 zonechecks: use $DEFAULT_ALGORITHM
(cherry picked from commit 459e6980e5)
2022-10-03 13:19:35 +02:00
Mark Andrews
864a2b127a wildcard: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f65c9cf85)
2022-10-03 13:19:34 +02:00
Mark Andrews
76a154d8b1 views: use $DEFAULT_ALGORITHM
(cherry picked from commit 86b29606c3)
2022-10-03 13:19:34 +02:00
Mark Andrews
16c6557aa2 verify: use $DEFAULT_ALGORITHM
(cherry picked from commit 93f7c7cdcd)
2022-10-03 13:19:34 +02:00
Mark Andrews
150ace9801 upforwd: use $DEFAULT_ALGORITHM
(cherry picked from commit 5585909904)
2022-10-03 13:19:34 +02:00
Mark Andrews
516694cd8c unknown: use $DEFAULT_ALGORITHM
(cherry picked from commit 9970d4317d)
2022-10-03 13:19:34 +02:00
Mark Andrews
b8645af516 synthfromdnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit 73fd49f8bb)
2022-10-03 13:19:34 +02:00
Mark Andrews
a2d8660485 staticstub: use $DEFAULT_ALGORITHM
(cherry picked from commit 32337b9dbf)
2022-10-03 13:19:34 +02:00
Mark Andrews
204811ae41 smartsign: use $DEFAULT_ALGORITHM
(cherry picked from commit 941b95edb0)
2022-10-03 13:19:34 +02:00
Mark Andrews
49d8978cb4 rpz: use $DEFAULT_ALGORITHM
(cherry picked from commit 1861c3e503)
2022-10-03 13:19:34 +02:00
Mark Andrews
b26a89df34 rootkeysentinel: use $DEFAULT_ALGORITHM
(cherry picked from commit b0e1d9b1b3)
2022-10-03 13:19:34 +02:00
Mark Andrews
e78c158ba6 resolver: use $DEFAULT_ALGORITHM
(cherry picked from commit 05ef8c81dd)
2022-10-03 13:19:34 +02:00
Mark Andrews
52ce408f0d redirect: use $DEFAULT_ALGORITHM
(cherry picked from commit e0e03602ba)
2022-10-03 13:19:33 +02:00
Mark Andrews
ce8cef8a4b pending: use $DEFAULT_ALGORITHM
(cherry picked from commit 6fd50b9fda)
2022-10-03 13:19:33 +02:00
Mark Andrews
1b94de8d1f nsupdate: use $DEFAULT_ALGORITHM
(cherry picked from commit c2d18567fc)
2022-10-03 13:19:33 +02:00
Mark Andrews
fd8bd94212 mkeys: use $DEFAULT_ALGORITHM
(cherry picked from commit 78fa082999)
2022-10-03 13:19:33 +02:00
Mark Andrews
61cfb9a68e mirror: use $DEFAULT_ALGORITHM
(cherry picked from commit ff95bafa39)
2022-10-03 13:19:33 +02:00
Mark Andrews
17a26bced4 metadata: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f1dc83bfb)
2022-10-03 13:19:33 +02:00
Mark Andrews
6843c764c6 inline: use $DEFAULT_ALGORITHM
(cherry picked from commit e3acddefd1)
2022-10-03 13:19:33 +02:00
Mark Andrews
45c21fd5af dsdigest: use $DEFAULT_ALGORITHM
(cherry picked from commit 49de14cb9e)
2022-10-03 13:19:33 +02:00
Mark Andrews
4ba58611c7 dnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit d0b0139c90)
2022-10-03 13:19:33 +02:00
Mark Andrews
53625cc639 dns64: use $DEFAULT_ALGORITHM
(cherry picked from commit 5cbf1e1598)
2022-10-03 13:19:33 +02:00
Mark Andrews
7cf9e28924 chain: use $DEFAULT_ALGORITHM
(cherry picked from commit 3419178bd2)
2022-10-03 13:19:33 +02:00
Mark Andrews
5f146c76bd cds: use $DEFAULT_ALGORITHM
(cherry picked from commit 6cf0b73ede)
2022-10-03 13:19:33 +02:00
Mark Andrews
1bd3c49454 autosign: use $DEFAULT_ALGORITHM
(cherry picked from commit bb810b0ac9)
2022-10-03 13:19:32 +02:00
Mark Andrews
212814cb7e Merge branch '3541-have-named-v-report-supported-algorithms-v9_16' into 'v9_16'
Report supported crypto algorithms [v9_16]

See merge request isc-projects/bind9!6838
2022-09-30 14:25:28 +00:00
Petr Špaček
85d0d86b62 Add release note for new crypto algorithm logging
(cherry picked from commit c138a8aa59)
2022-09-30 09:57:32 +10:00
Petr Špaček
2c09403ab4 Document list of crypto algorithms in named -V output
(cherry picked from commit c648e280e4)
2022-09-30 09:57:32 +10:00
Mark Andrews
e8439121ad Deduplicate string formating
(cherry picked from commit d34ecdb366)
2022-09-30 09:57:32 +10:00
Mark Andrews
ffbd1ab762 Add CHANGES entry for [GL #3541]
(cherry picked from commit e876de442e)
2022-09-30 09:57:32 +10:00
Mark Andrews
21d4befe09 silence scan-build false positive
(cherry picked from commit 3156d36495)
2022-09-30 09:57:32 +10:00
Mark Andrews
3265fc496e Report algorithms supported by named at startup
(cherry picked from commit cb1515e71f)
2022-09-30 09:57:32 +10:00
Mark Andrews
989811b6d9 Have 'named -V' report supported algorithms
These cover DNSSEC, DS, HMAC and TKEY algorithms.

(cherry picked from commit b308f866c0)
2022-09-30 09:57:32 +10:00
Matthijs Mekking
07748eb298 Merge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing-v9_16' into 'v9_16'
[v9_16] Add dnssec-policy inline-signing requirement to documentation

See merge request isc-projects/bind9!6833
2022-09-28 09:56:53 +00:00
Matthijs Mekking
df11527a9a Add inline-signing to config examples
Add 'inline-signing yes;' to configuration examples to have working
copy paste configurations.

(cherry picked from commit b13a0c8836d2d8bc5b4de1cdfcdb2057c0bb9d93)
2022-09-28 10:54:52 +02:00
Matthijs Mekking
5c0e98410f Update inline-signing requirement to ARM
This change was made in !6403, but the appropriate documentation
changes were not applied to the ARM.

(cherry picked from commit 7231383e4cc57caac36d03055e8627b12aa4b91a)
2022-09-28 10:54:52 +02:00
Matthijs Mekking
309bf3578b Add inline-signing requirement to DNSSEC Guide
This change was made in !6403, but the appropriate documentation
changes were not applied to the DNSSEC Guide.

(cherry picked from commit 09522c8d73)
2022-09-28 10:54:52 +02:00
Mark Andrews
55faa5ab84 Merge branch '3562-assign-default-value-to-suffix-v9_16' into 'v9_16'
Suffix may be used before it is assigned a value [v9_16]

See merge request isc-projects/bind9!6837
2022-09-28 04:22:41 +00:00
Mark Andrews
7f2b46f4e5 Suffix may be used before it is assigned a value
CID 350722 (#5 of 7): Bad use of null-like value (FORWARD_NULL)
        12. invalid_operation: Invalid operation on null-like value suffix.
    145        r.authority.append(
    146            dns.rrset.from_text(
    147                "icky.ptang.zoop.boing." + suffix,
    148                1,
    149                IN,
    150                NS,
    151                "a.bit.longer.ns.name." + suffix,
    152            )
    153        )

(cherry picked from commit 432064f63c)
2022-09-28 11:19:50 +10:00
Mark Andrews
c2884d1a4b Merge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2-v9_16' into 'v9_16'
Free 'rsa' if 'e' is NULL in opensslrsa_verify2 [v9_16]

See merge request isc-projects/bind9!6835
2022-09-28 00:42:18 +00:00
Mark Andrews
a2a06cf376 Add CHANGES note for [GL #3551]
(cherry picked from commit 1e3680193a)
2022-09-28 10:06:40 +10:00
Mark Andrews
12f902796d Check BN_dup results in rsa_check
(cherry picked from commit a47235f4f5)
2022-09-28 10:06:39 +10:00
Mark Andrews
2c8e38f359 Free 'n' on error path in rsa_check
(cherry picked from commit 483c5a1978)
2022-09-28 10:06:39 +10:00
Mark Andrews
03c5db001e Check that 'e' and 'n' are allocated in opensslrsa_fromdns
(cherry picked from commit db70c30213)
2022-09-28 10:06:39 +10:00
Mark Andrews
0b0718fba3 Check that 'e' and 'n' are non-NULL in opensslrsa_todns
(cherry picked from commit 5603cd69d1)
2022-09-28 09:56:03 +10:00
Mark Andrews
6f1e04409a Free 'rsa' if 'e' is NULL in opensslrsa_verify2
(cherry picked from commit a2b51ca6ac)
2022-09-28 09:53:27 +10:00
Mark Andrews
067dbde287 Merge branch '3557-catalog-zone-check-key-names-v9_16' into 'v9_16'
Check that primary key names have not changed [v9_16]

See merge request isc-projects/bind9!6827
2022-09-27 14:18:06 +00:00
Mark Andrews
3353529920 Add release note for [GL #3557]
(cherry picked from commit eacf41a20a)
2022-09-27 23:58:22 +10:00
Mark Andrews
034c34e634 Add CHANGES note for [GL #3557]
(cherry picked from commit 0774dacf2d)
2022-09-27 23:58:22 +10:00
Mark Andrews
4fc1975709 Check that changing the TSIG key is successful
Switch the primary to require 'next_key' for zone transfers then
update the catalog zone to say to use 'next_key'.  Next update the
zones contents then check that those changes are seen on the
secondary.

(cherry picked from commit 176e172210)
2022-09-27 23:58:22 +10:00
Mark Andrews
9524c493c9 Check that primary key names have not changed
When looking for changes in a catalog zone member zone we need to
also check if the TSIG key name associated with a primary server
has be added, removed or changed.

(cherry picked from commit 9172bd9b5a)
2022-09-27 22:20:41 +10:00
Michał Kępień
e72a275606 Merge branch 'mnowak/add-fedora-36-v9_16' into 'v9_16'
[v9_16] Add Fedora 36

See merge request isc-projects/bind9!6821
2022-09-27 07:44:52 +00:00
Michal Nowak
5b1ab4615a Add Fedora 36
(cherry picked from commit a313c49a3b)
2022-09-27 09:42:50 +02:00
Evan Hunt
0f68ad8830 Merge branch '3553-buffer-assertions-v9_16' into 'v9_16'
add assertions to isc_buffer macros

See merge request isc-projects/bind9!6802
2022-09-27 07:16:01 +00:00
Evan Hunt
2fdaa100c1 add assertions to isc_buffer macros
if ISC_BUFFER_USEINLINE is defined, then macros are used to implement
isc_buffer primitives (isc_buffer_init(), isc_buffer_region(), etc).
otherwise, functions are used. previously, only the functions had
DbC assertions, which made it possible for coding errors to go
undetected. this commit makes the macro versions enforce the same
requirements.
2022-09-26 23:48:21 -07:00
Petr Špaček
dd8c1f9f61 Merge branch 'bug/main/doc-arm-rhel9-v9_16' into 'v9_16'
Compatibility for building ARM on older sphinx [v9_16]

See merge request isc-projects/bind9!6818
2022-09-26 15:39:32 +00:00
Petr Menšík
8b07d457ef Simplify allowing warnings during ARM build
RHEL8 Sphinx does not support all features used in ARM building. But
with few emitted warnings it can build the documentation fine. Simplify
warnings acceptance by allowing make doc SPHINX_W=''.

(cherry picked from commit 3db7e241d2)
2022-09-26 17:30:48 +02:00
Petr Menšík
e036ac4d3d Compatibility for building ARM on older sphinx
Make documentation building successful even on RHEL9 sphinx 3.4.3. It
does not like case-insensitive matching of terms, so provide lowercase
text description with Uppercase word reference.

(cherry picked from commit bc6c6b1184)
2022-09-26 17:29:07 +02:00
Petr Špaček
81fd2d9874 Merge branch '3547-dns_message_checksig-leak-fix-v9_16' into 'v9_16'
Fix memory leak in dns_message_checksig() - SIG(0) sigs [v9_16]

See merge request isc-projects/bind9!6814
2022-09-26 11:06:42 +00:00
Mark Andrews
2905d70ad1 Stop passing mctx to dns_rdata_tostruct as it is unnecessary for SIG
dns_rdata_tostruct doesn't need a mctx passed to it for SIG (the signer
is already expanded at this point). About the only time when mctx is
needed is when the structure is to be used after the rdata has been
destroyed.

(cherry picked from commit d6ad56bd9e)
2022-09-26 12:45:21 +02:00
Petr Špaček
3e77d6bf87 Fix memory leak in dns_message_checksig() - SIG(0) sigs
Impact should be visible only in tests or tools because named never
uses view == NULL, which is a necessary condition to trigger this leak.

(cherry picked from commit 69256b3553)
2022-09-26 12:45:17 +02:00
Michał Kępień
e2448146cf Merge branch '3475-named-man-page-fix-ncpus' into 'v9_16'
Fix the description of named's -n option

See merge request isc-projects/bind9!6797
2022-09-21 17:48:25 +00:00
Michał Kępień
fe0b04d8d3 Fix the description of named's -n option
Since the advent of netmgr, named no longer creates a single thread per
CPU, but rather a set of two threads per CPU.  Update the man page for
named accordingly to prevent confusion.
2022-09-21 19:47:13 +02:00
Petr Špaček
9d5e7aca9c Merge branch '3542-arm-stats-socket-caution' into 'v9_16'
Provide stronger wording about the security of statistics channel

See merge request isc-projects/bind9!6795
2022-09-21 16:06:04 +00:00
Ondřej Surý
f830737c51 Provide stronger wording about the security of statistics channel
Add more text about the importance of properly securing the statistics
channel and what is and what is not considered a security vulnerability.

(cherry-picked from commit 6869c98d36)
2022-09-21 17:49:49 +02:00
Michał Kępień
69c38b5e1c Merge tag 'v9_16_33' into v9_16
BIND 9.16.33
2022-09-21 13:21:29 +02:00
Mark Andrews
6711d7d179 Merge branch '3525-key-id-clashes-across-algorithms-cause-problems-with-statistics-v9_18-v9_16' into 'v9_16'
Suppress manykeys test on duplicate key ids [v9_16]

See merge request isc-projects/bind9!6785
2022-09-16 00:21:12 +00:00
Mark Andrews
ff883fd75f Suppress manykeys test on duplicate key ids
If there are duplicate key ids across multiple algorithms expected
output is no met.  We have fixed this in on main but decided to not
back port the fix as it will change the statistics channel output.

This change detects when there are duplicate key id across algorithms
as skips the sub test.

(cherry picked from commit ea1d3476a8)
2022-09-16 09:49:41 +10:00
Evan Hunt
d244ff84ac Merge branch '3522-update-detach-v9_16' into 'v9_16'
fix an incorrect detach in update processing

See merge request isc-projects/bind9!6783
2022-09-15 20:14:30 +00:00
Evan Hunt
338663b1cd CHANGES for [GL #3522] 2022-09-15 11:36:37 -07:00
Evan Hunt
17924f4bdf fix an incorrect detach in update processing
when processing UDPATE requests, hold the request handle until
we either drop the request or respond to it.

(cherry picked from commit 00e0758e12)
2022-09-15 11:35:42 -07:00
Michal Nowak
97ea818086 Merge branch '3427-tcp-system-test-bump-socket.create_connection-timeout-v9_16' into 'v9_16'
[v9_16] Bump socket.create_connection() timeout to 10 seconds

See merge request isc-projects/bind9!6781
2022-09-15 12:41:03 +00:00
Michal Nowak
9b41b63607 Bump socket.create_connection() timeout to 10 seconds
The tcp Pytest on OpenBSD fairly reliably fails when receive_tcp()
on a socket is attempted:

    >           (response, rtime) = dns.query.receive_tcp(sock, timeout())

    tests-tcp.py:50:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    /usr/local/lib/python3.9/site-packages/dns/query.py:659: in receive_tcp
        ldata = _net_read(sock, 2, expiration)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    count = 2, expiration = 1662719959.8106785

        def _net_read(sock, count, expiration):
            """Read the specified number of bytes from sock.  Keep trying until we
            either get the desired amount, or we hit EOF.
            A Timeout exception will be raised if the operation is not completed
            by the expiration time.
            """
            s = b''
            while count > 0:
                try:
    >               n = sock.recv(count)
    E               socket.timeout: timed out

This is because the socket is already closed.

Bump the socket connection timeout to 10 seconds.

(cherry picked from commit 658cae9fad)
2022-09-15 12:36:14 +02:00
Tony Finch
f3766061e7 Merge branch '3531-initialize-struct-server-v9_16' into 'v9_16'
Ensure that named_server_t is properly initialized

See merge request isc-projects/bind9!6761
2022-09-12 10:40:40 +00:00
Tony Finch
dff843199f Ensure that named_server_t is properly initialized
There was a ubsan error reporting an invalid value for interface_auto
(a boolean value cannot be 190) because it was not initialized. To
avoid this problem happening again, ensure the whole of the server
structure is initialized to zero before setting the (relatively few)
non-zero elements.
2022-09-12 11:21:37 +01:00
Michał Kępień
208fc897b1 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.34' into 'v9_16'
Set up version and release notes for BIND 9.16.34

See merge request isc-projects/bind9!6760
2022-09-09 18:23:14 +00:00
Michał Kępień
666d315087 Set up release notes for BIND 9.16.34 2022-09-09 20:00:15 +02:00
Michał Kępień
990bd74104 Update BIND version to 9.16.34-dev 2022-09-09 20:00:15 +02:00
Michał Kępień
35e9c6e31d Merge branch 'prep-release' into security-v9_16 2022-09-08 15:01:23 +02:00
Michał Kępień
31fdc767f7 prep 9.16.33 2022-09-08 15:01:10 +02:00
Michał Kępień
f4ad07e82d Merge branch 'michal/prepare-documentation-for-bind-9.16.33' into 'security-v9_16'
Prepare documentation for BIND 9.16.33

See merge request isc-private/bind9!460
2022-09-08 12:40:59 +00:00
Michał Kępień
907b764b2a Tweak and reword release notes 2022-09-08 14:33:43 +02:00
Michał Kępień
b54ee83d50 Prepare release notes for BIND 9.16.33 2022-09-08 14:33:43 +02:00
Michał Kępień
0657c81d59 Merge branch '3487-eddsa-verify-leak-v9_16' into 'security-v9_16'
[v9_16] [CVE-2022-38178] eddsa verify leak

See merge request isc-private/bind9!440
2022-09-08 10:18:54 +00:00
Mark Andrews
ffd69ff780 Add release note for [GL #3487]
(cherry picked from commit e6cb1de20b)
2022-09-08 12:16:36 +02:00
Mark Andrews
a385e884f5 Add CHANGES note for [GL #3487]
(cherry picked from commit b3277f2e10)
2022-09-08 12:16:36 +02:00
Mark Andrews
1af23378eb Free ctx on invalid siglen
(cherry picked from commit 6ddb480a84)
2022-09-08 12:16:36 +02:00
Michał Kępień
1f1c4734fb Merge branch '3487-ecdsa-verify-leak' into 'security-v9_16'
[v9_16][CVE-2022-38177] ecdsa verify leak

See merge request isc-private/bind9!421
2022-09-08 10:14:18 +00:00
Mark Andrews
62c45573ba Add release note for [GL #3487] 2022-09-08 12:12:36 +02:00
Mark Andrews
21518e169a Add CHANGES note for [GL #3487] 2022-09-08 12:12:36 +02:00
Mark Andrews
5b2282afff Free eckey on siglen mismatch 2022-09-08 12:12:36 +02:00
Michał Kępień
b3abc2a844 Merge branch '3517-serve-stale-client-timeout-0-cname-crash-v9_16' into 'security-v9_16'
[v9_16] [CVE-2022-3080] Fix serve-stale-client-timeout 0 CNAME crash

See merge request isc-private/bind9!448
2022-09-08 10:10:34 +00:00
Matthijs Mekking
8ee4c3bbdc Add release notes for #3517
(cherry picked from commit 97c6c3712e)
2022-09-08 12:08:28 +02:00
Matthijs Mekking
57bf78e1ea Add CHANGES entry for 3517
(cherry picked from commit e394902965)
2022-09-08 12:08:28 +02:00
Matthijs Mekking
3f68e2ad83 Only refresh RRset once
Don't attempt to resolve DNS responses for intermediate results. This
may create multiple refreshes and can cause a crash.

One scenario is where for the query there is a CNAME and canonical
answer in cache that are both stale. This will trigger a refresh of
the RRsets because we encountered stale data and we prioritized it over
the lookup. It will trigger a refresh of both RRsets. When we start
recursing, it will detect a recursion loop because the recursion
parameters will eventually be the same. In 'dns_resolver_destroyfetch'
the sanity check fails, one of the callers did not get its event back
before trying to destroy the fetch.

Move the call to 'query_refresh_rrset' to 'ns_query_done', so that it
is only called once per client request.

Another scenario is where for the query there is a stale CNAME in the
cache that points to a record that is also in cache but not stale. This
will trigger a refresh of the RRset (because we encountered stale data
and we prioritized it over the lookup).

We mark RRsets that we add to the message with
DNS_RDATASETATTR_STALE_ADDED to prevent adding a duplicate RRset when
a stale lookup and a normal lookup conflict with each other. However,
the other non-stale RRset when following a CNAME chain will be added to
the message without setting that attribute, because it is not stale.

This is a variant of the bug in #2594. The fix covered the same crash
but for stale-answer-client-timeout > 0.

Fix this by clearing all RRsets from the message before refreshing.
This requires the refresh to happen after the query is send back to
the client.

(cherry picked from commit d939d2ecde)
2022-09-08 12:08:28 +02:00
Michał Kępień
0d5aecf3be Merge branch '3394-security-cve-2022-2795-mitigation-v9_16' into 'security-v9_16'
[CVE-2022-2795] [v9_16] Bound the amount of work performed for delegations

See merge request isc-private/bind9!453
2022-09-08 10:06:06 +00:00
Michał Kępień
315d35589a Add release note for GL #3394
(cherry picked from commit 672072812c)
2022-09-08 11:11:30 +02:00
Michał Kępień
ed6aa5c503 Add CHANGES entry for GL #3394
(cherry picked from commit e802beedfc)
2022-09-08 11:11:30 +02:00
Michał Kępień
bf2ea6d852 Bound the amount of work performed for delegations
Limit the amount of database lookups that can be triggered in
fctx_getaddresses() (i.e. when determining the name server addresses to
query next) by setting a hard limit on the number of NS RRs processed
for any delegation encountered.  Without any limit in place, named can
be forced to perform large amounts of database lookups per each query
received, which severely impacts resolver performance.

The limit used (20) is an arbitrary value that is considered to be big
enough for any sane DNS delegation.

(cherry picked from commit 3a44097fd6)
2022-09-08 11:11:30 +02:00
Michał Kępień
65245d8b3d Merge branch '3459-rrl-wildcard-handling-v9_16' into 'v9_16'
[v9_16] Make RRL code treat all QNAMEs subject to wildcard processing within a given zone as the same name

See merge request isc-projects/bind9!6749
2022-09-08 08:23:57 +00:00
Aram Sargsyan
5b6e4465be Add CHANGES and release notes for [GL #3459]
(cherry picked from commit 0b0cf12741)
2022-09-08 09:41:15 +02:00
Aram Sargsyan
6f46bfe705 Document RRL processing for wildcard names
All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.

(cherry picked from commit 89c2032421)
2022-09-08 09:41:15 +02:00
Aram Sargsyan
3ad0f165ab Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

(cherry picked from commit baa9698c9d)
2022-09-08 09:41:15 +02:00
Matthijs Mekking
f917f9480e Merge branch 'matthijs-fix-intermittent-inline-system-test-failure-v9_16' into 'v9_16'
[v9_16] Fix intermittent inline system test failure

See merge request isc-projects/bind9!6740
2022-09-07 15:34:24 +00:00
Matthijs Mekking
d1336d49b3 Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.

(cherry picked from commit 8b71cbd09c)
2022-09-07 16:30:19 +02:00
Evan Hunt
559c9c2e33 Merge branch '3521-interface-cleanup' into 'v9_16'
clean up properly when interface creation fails

See merge request isc-projects/bind9!6723
2022-09-07 00:10:10 +00:00
Evan Hunt
80a8322d65 clean up properly when interface creation fails
previously, if ns_clientmgr_create() failed, the interface was not
cleaned up correctly and an assertion or segmentation fault could
follow. this has been fixed.
2022-09-06 13:53:44 -07:00
Arаm Sаrgsyаn
f3e0915261 Merge branch '3518-libxml2-deprecated-functions-v9_16' into 'v9_16'
[v9_16] Do not use libxml2 deprecated functions

See merge request isc-projects/bind9!6732
2022-09-06 10:31:48 +00:00
Aram Sargsyan
c1be3bda3a Add CHANGES note for [GL #3518]
(cherry picked from commit 87920661b1)
2022-09-06 09:22:42 +00:00
Aram Sargsyan
8b328f0049 Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.

(cherry picked from commit a5d412d924)
2022-09-06 09:22:35 +00:00
Matthijs Mekking
3e041d15a1 Merge branch '3381-dnssec-policy-explicit-inline-signing-v9_16' into 'v9_16'
[v9_16] dnssec-policy now requires inline-signing

See merge request isc-projects/bind9!6730
2022-09-06 08:48:36 +00:00
Matthijs Mekking
77105a2f60 Add change and release note for #3381
Because folks want to know.

(cherry picked from commit 2b95c11905a1a5faff9efa97a4f2498aadfa467b)
2022-09-06 10:27:34 +02:00
Matthijs Mekking
bc9c65f465 Remove implicit inline-signing code
Remove the code that sets implicit inline-signing on zones using
dnssec-policy.

(cherry picked from commit a6b09c9c69186e81a9be54e8b7bb413b1ac4d650)
2022-09-06 10:27:33 +02:00
Matthijs Mekking
145e888815 Update system tests
Update checkconf and kasp related system tests after requiring
inline-signing.

(cherry picked from commit 8fd75e8a4e1035ce0e81bf47d954a3f5b8a4d571)
2022-09-06 10:27:33 +02:00
Matthijs Mekking
30fceec069 dnssec-policy now requires inline-signing
Having implicit inline-signing set for dnssec-policy when there is no
update policy is confusing, so lets make this explicit.

(cherry picked from commit 5ca02fe6e7e591d1fb85936ea4dda720c3d741ef)
2022-09-06 09:06:17 +02:00
Ondřej Surý
bc0c7243b1 Merge branch '3485-dig-fallback-to-idna2003-v9_16' into 'v9_16'
Allow fallback to IDNA2003 processing

See merge request isc-projects/bind9!6726
2022-09-05 09:29:59 +00:00
Ondřej Surý
561ef63e14 Add CHANGES and release note for [GL #3485]
(cherry picked from commit 0fe7acb4e6)
2022-09-05 10:22:25 +02:00
Ondřej Surý
104eaf34da Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.

(cherry picked from commit 87de726f5c)
2022-09-05 10:22:23 +02:00
Ondřej Surý
efbdf81931 Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.

(cherry picked from commit 10923f9d87)
2022-09-05 10:21:36 +02:00
Arаm Sаrgsyаn
dca244b1c1 Merge branch '3515-mctx-attach-detach-for-isc_mempool_t-v9_16' into 'v9_16'
[v9_16] Add mctx attach/detach when creating/destroying a memory pool

See merge request isc-projects/bind9!6721
2022-09-02 11:34:45 +00:00
Aram Sargsyan
5440f79cc4 Add CHANGES note for [GL #3515]
(cherry picked from commit 362ead8d85)
2022-09-02 09:05:03 +00:00
Aram Sargsyan
32779aba8a Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.

(cherry picked from commit e97c3eea95)
2022-09-02 09:05:03 +00:00
Evan Hunt
53fa68b39c Merge branch '3511-quote-yaml-addresses-v9_16' into 'v9_16'
quote addresses in YAML output

See merge request isc-projects/bind9!6718
2022-08-31 23:48:10 +00:00
Evan Hunt
91c61b8d2f CHANGES for [GL #3511] 2022-08-31 16:19:39 -07:00
Evan Hunt
28640e37d8 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.

(cherry picked from commit 66eaf6bb73)
2022-08-31 16:18:57 -07:00
Evan Hunt
b6d12e3181 Merge branch '3501-dnstap-response-v9_16' into 'v9_16'
dnstap query_message field was erroneously set with responses

See merge request isc-projects/bind9!6716
2022-08-31 23:15:57 +00:00
Evan Hunt
5efac2b4d2 CHANGES for [GL #3501] 2022-08-31 15:50:30 -07:00
Evan Hunt
e1fa6cbab8 dnstap query_message field was erroneously set with responses
The dnstap query_message field was in some cases being filled in
with response messages, along with the response_message field.
The query_message field should only be used when logging requests,
and the response_message field only when logging responses.
2022-08-31 15:49:25 -07:00
Mark Andrews
af8e0a2ec9 Merge branch '3505-missing-isc_mutex_destroy-v9_16' into 'v9_16'
Call isc_mutex_destroy(&lasttime_mx); [v9_16]

See merge request isc-projects/bind9!6698
2022-08-24 07:42:25 +00:00
Mark Andrews
5a66ca501b Call isc_mutex_destroy(&lasttime_mx);
(cherry picked from commit 8109f495c8b5d7c7f88d581f7905650add0c184e)
2022-08-24 17:05:00 +10:00
Matthijs Mekking
e3b4794ee7 Merge branch '3500-nsec3-missing-detach-node-9_16' into 'v9_16'
[v9_16] nsec3.c: Add a missing dns_db_detachnode() call

See merge request isc-projects/bind9!6694
2022-08-23 11:10:41 +00:00
Matthijs Mekking
31ed140863 Add CHANGES entry for #3500
There is no need for a release because this case was nearly impossible
to trigger (except for when 'sig-signing-type' was set to 0).

(cherry picked from commit 545ecb64b043617ea609f4f115d280bb5990e221)
2022-08-23 12:06:06 +02:00
Matthijs Mekking
58d01b821a nsec3.c: Add a missing dns_db_detachnode() call
There is one case in 'dns_nsec3_activex()' where it returns but forgets
to detach the db node. Add the missing 'dns_db_detachnode()' call.

This case only triggers if 'sig-signing-type' (privatetype) is set to 0
(which by default is not), or if the function is called with 'complete'
is set to 'true' (which at this moment do not exist).

(cherry picked from commit 0cf6c18ccb2205a1fc81431f908c8310f6136bbb)
2022-08-23 12:05:38 +02:00
Mark Andrews
9e7c12d3b7 Merge branch 'bug/main/delv-cfg_parser_reset-v9_16' into 'v9_16'
Reset parser before parsing of internal trust anchor [v9_16]

See merge request isc-projects/bind9!6687
2022-08-19 05:40:59 +00:00
Mark Andrews
414b35aabd Add CHANGES entry for [GL !6468]
(cherry picked from commit 23a8c15cb2efd3486a4e7ea41c1581cb2ed07912)
2022-08-19 15:21:24 +10:00
Petr Menšík
ba9a140e1f Reset parser before parsing of internal trust anchor
It might be reused if /etc/bind.keys exists, but failed correct parsing.
Release traces of previous parsing attempt of different data.

(cherry picked from commit dc07394c4724c1e1235af85dd8c044af70da93ae)
2022-08-19 15:20:59 +10:00
Michal Nowak
4858e4235d Merge branch 'mnowak/freebsd-13.1-v9_16' into 'v9_16'
[v9_16] Add FreeBSD 13.1

See merge request isc-projects/bind9!6684
2022-08-18 15:58:05 +00:00
Michal Nowak
87dc26e494 Add FreeBSD 13.1
(cherry picked from commit bc425be55e1736d4f2ffada5e8d76f96b08c8351)
2022-08-18 17:34:08 +02:00
Michal Nowak
16458122a8 Merge tag 'v9_16_32' into v9_16
BIND 9.16.32
2022-08-18 11:55:55 +02:00
Mark Andrews
1686b34023 Merge branch '3494-dnssec-awk-test-is-not-precise-enough-v9_16' into 'v9_16'
Improve awk tests to prevent false negatives [v9_16]

See merge request isc-projects/bind9!6677
2022-08-18 04:39:13 +00:00
Mark Andrews
69be4d3bdc Improve awk tests to prevent false negatives
The old code could incorrectly match "INSOA" in the RRSIG rdata
when looking for the SOA record.

(cherry picked from commit 2fc5f6fb2831697c79f75c50a769449ac561aad0)
2022-08-18 13:43:47 +10:00
Michal Nowak
f59757d0be Merge branch 'mnowak/coverity-scan-2022.06-v9_16' into 'v9_16'
[v9_16] Use Coverity Scan 2022.06

See merge request isc-projects/bind9!6674
2022-08-17 14:04:39 +00:00
Michal Nowak
6bf3d890b5 Use Coverity Scan 2022.06
(cherry picked from commit 3d683c704e271f1c8107a5b108c93db4bde7db7f)
2022-08-17 16:02:27 +02:00
Arаm Sаrgsyаn
ee28d4bd32 Merge branch '3492-fix-tkey.c-buildquery-cleanup-v9_16' into 'v9_16'
[v9_16] Fix tkey.c:buildquery() function's error handling

See merge request isc-projects/bind9!6671
2022-08-17 09:10:49 +00:00
Aram Sargsyan
30b1be4e59 Add CHANGES note for [GL #3492]
(cherry picked from commit 8dd12db505892640d885e81dc6701607da1df67f)
2022-08-17 08:46:31 +00:00
Aram Sargsyan
eb72c81e6a Fix tkey.c:buildquery() function's error handling
Add the missing cleanup code.

(cherry picked from commit 4237ab9550eeaea7121e3e3392fd14c26b5150f0)
2022-08-17 08:46:31 +00:00
Michal Nowak
1c6dbb5993 Merge branch 'mnowak/openbsd-7.1-v9_16' into 'v9_16'
[v9_16] Add OpenBSD 7.1

See merge request isc-projects/bind9!6667
2022-08-16 15:21:05 +00:00
Michal Nowak
591d58be6e Add OpenBSD 7.1
(cherry picked from commit 7edf8ab47cfd0cc3a633e941b2880ee11d75d6cd)
2022-08-16 17:17:34 +02:00
Michal Nowak
88aa703c75 Merge branch 'mnowak/configure-find-newer-python-versions' into 'v9_16'
Teach configure to find Python 3.9, 3.10, and 3.11

See merge request isc-projects/bind9!6662
2022-08-15 13:50:23 +00:00
Michal Nowak
d92b9a02b1 Teach configure to find Python 3.9, 3.10, and 3.11
FreeBSD does not have python3 symlink, and ./configure relies on finding
python3.X binaries instead.
2022-08-15 15:11:27 +02:00
Evan Hunt
80604b856d Merge branch '3488-prevent-adb-dump-race-v9_18-v9_16' into 'v9_16'
Lock the address entry bucket when dumping ADB namehook

See merge request isc-projects/bind9!6658
2022-08-13 00:48:17 +00:00
Evan Hunt
5aa4adc8e5 Lock the address entry bucket when dumping ADB namehook
When dumping an ADB address entry associated with a name,
the name bucket lock was held, but the entry bucket lock was
not; this could cause data races when other threads were updating
address entry info. (These races are probably not operationally
harmful, but they triggered TSAN error reports.)

(cherry picked from commit f841f545b7)
2022-08-12 17:17:43 -07:00
Michal Nowak
1c1c0e3dca Merge branch '3348-move-pkcs11-interface-test-to-debian-v9_16' into 'v9_16'
[v9_16] Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"

See merge request isc-projects/bind9!6654
2022-08-12 06:50:33 +00:00
Michal Nowak
b4b865aacd Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"
Fedora 36 uses OpenSSL 3.0.2 by default, but the OpenSSL engine API
which we use for PKCS#11 is deprecated in OpenSSL 3.0.0. For the
keyfromlabel system test to work operating system with OpenSSL 1.1 needs
to be used.

(cherry picked from commit 2eecebdea91868be571e3c7a5fb3324505fbd2ff)
2022-08-12 08:07:22 +02:00
Matthijs Mekking
cd43fa723c Merge branch '2982-servfail-servestale-duplicate-queries-v9_16' into 'v9_16'
[v9_16] Don't enable serve-stale on duplicate queries

See merge request isc-projects/bind9!6643
2022-08-09 09:02:31 +00:00
Matthijs Mekking
294431b8f8 Add release note and change entry for #2982
News worthy.

(cherry picked from commit 2bd4486766)
2022-08-09 09:38:23 +02:00
Matthijs Mekking
dd7dde5743 Don't enable serve-stale on duplicate queries
When checking if we should enable serve-stale, add an early out case
when the result is an error signalling a duplicate query or a query
that would be dropped.

(cherry picked from commit 059a4c2f4d)
2022-08-09 09:37:49 +02:00
Michał Kępień
44e0164b6c Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.33' into 'v9_16'
Set up version and release notes for BIND 9.16.33

See merge request isc-projects/bind9!6634
2022-08-05 06:40:40 +00:00
Michał Kępień
571a5b7cca Set up release notes for BIND 9.16.33 2022-08-05 06:58:17 +02:00
Michał Kępień
72b16782e6 Update BIND version to 9.16.33-dev 2022-08-05 06:58:17 +02:00
Michał Kępień
56f3439263 Merge branch 'prep-release' into v9_16_32-release 2022-08-05 00:06:08 +02:00
Michał Kępień
d4afcf3dfb prep 9.16.32 2022-08-05 00:06:08 +02:00
Michał Kępień
8ff8f2c1ca Merge branch 'michal/prepare-documentation-for-bind-9.16.32' into 'v9_16_32-release'
Prepare documentation for BIND 9.16.32

See merge request isc-private/bind9!420
2022-08-04 22:04:12 +00:00
Michał Kępień
c2ca99b710 Tweak and reword release notes 2022-08-04 23:59:36 +02:00
Michał Kępień
814d9f7bc8 Prepare release notes for BIND 9.16.32 2022-08-04 23:59:36 +02:00
Arаm Sаrgsyаn
c863061a13 Merge branch '3461-fetches-per-zone-final-log-message-v9_16' into 'v9_16'
[v9_16] Resolve "Do a better job of logging when fetches-per-zone is triggered"

See merge request isc-projects/bind9!6626
2022-08-01 14:46:29 +00:00
Aram Sargsyan
23bf8afbcb Add CHANGES and release notes for [GL #3461]
(cherry picked from commit 0d64f55f5d)
2022-08-01 14:01:37 +00:00
Aram Sargsyan
c0db0d7a8e Improve fetch limit logging
When initially hitting the `fetches-per-zone` value, a log message
is being generated for the event of dropping the first fetch, then
any further log events occur only when another fetch is being dropped
and 60 seconds have been passed since the last logged message.

That logic isn't ideal because when the counter of the outstanding
fetches reaches zero, the structure holding the counters' values will
get deleted, and the information about the dropped fetches accumulated
during the last minute will not be logged.

Improve the fcount_logspill() function to makie sure that the final
values are getting logged before the counter object gets destroyed.

(cherry picked from commit 039871ceb7)
2022-08-01 14:01:26 +00:00
Mark Andrews
6a866e30f5 Merge branch 'marka-set-suffix-in-ans.py-v9_16' into 'v9_16'
Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py [v9_16]

See merge request isc-projects/bind9!6620
2022-07-27 22:06:10 +00:00
Mark Andrews
19bf98201b Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py
initalise suffix to ""

    170        r.answer.append(
    171            dns.rrset.from_text(
    172                lqname + suffix, 1, IN, NS, "a.bit.longer.ns.name." + suffix
    173            )
    174        )
    175        r.flags |= dns.flags.AA
           15. Condition endswith(lqname, "icky.ptang.zoop.boing."), taking true branch.
    176    elif endswith(lqname, "icky.ptang.zoop.boing."):
           CID 350722 (#7 of 7): Bad use of null-like value (FORWARD_NULL)
           16. invalid_operation: Invalid operation on null-like value suffix.
    177        r.authority.append(
    178            dns.rrset.from_text(
    179                "icky.ptang.zoop.boing." + suffix,
    180                1,
    181                IN,
    182                SOA,
    183                "ns2." + suffix + " hostmaster.arpa. 2018050100 1 1 1 1",
    184            )
    185        )

(cherry picked from commit eb798d0478)
2022-07-27 14:27:26 -04:00
Matthijs Mekking
40c5816814 Merge branch '3462-rndc-dumpdb-expired-doesnt-always-work-v9_16' into 'v9_16'
[v9_16] Fix destination port extraction for client queries

See merge request isc-projects/bind9!6613
2022-07-26 08:43:39 +00:00
Matthijs Mekking
3c2f517415 Add change entry and release note for #3462
News worthy.

(cherry picked from commit 44bbc0175c)
2022-07-26 10:02:26 +02:00
Matthijs Mekking
f8ad7501dc Fix rndc dumpdb -expired for stuck cache contents
The command 'rndc dumpdb -expired' will include expired RRsets in the
output, but only for the RBTDB_VIRTUAL time (of 5 minutes). This means
that if there is a cache cleaning problem and contents are not cleaned
up, the rndc command has little diagnostic value. Fix this by including
all RRsets in the dumpdb output if the '-expired' flag is set.

(cherry picked from commit 930ba2c914)
2022-07-26 10:02:15 +02:00
Mark Andrews
24bb1d109c Merge branch '3469-auto-disable-rsasha1-and-nsec3rsasha1-when-not-supported-by-the-os-v9_16' into 'v9_16'
Check that we can verify a signature at initialisation time [v9_16]

See merge request isc-projects/bind9!6615
2022-07-25 15:59:21 +00:00
Mark Andrews
8be8257914 Add release note for [GL #3469]
(cherry picked from commit 16b133af40)
2022-07-25 11:37:49 -04:00
Mark Andrews
cbd2403633 CHANGES note for [GL #3469]
(cherry picked from commit c549249cb9)
2022-07-25 11:37:49 -04:00
Mark Andrews
a1452c32ab Check that we can verify a signature at initialisation time
Fedora 33 doesn't support RSASHA1 in future mode.  There is no easy
check for this other than by attempting to perform a verification
using known good signatures.  We don't attempt to sign with RSASHA1
as that would not work in FIPS mode.  RSASHA1 is verify only.

The test vectors were generated using OpenSSL 3.0 and
util/gen-rsa-sha-vectors.c.  Rerunning will generate a new set of
test vectors as the private key is not preserved.

e.g.
	cc util/gen-rsa-sha-vectors.c -I /opt/local/include \
		-L /opt/local/lib -lcrypto

(cherry picked from commit cd3f00874f)
2022-07-25 11:37:49 -04:00
Evan Hunt
5503d9aa68 Merge branch '2918-deprecate-max-zone-ttl-v9_16' into 'v9_16'
Test dnssec-policy max-zone-ttl rejects zone with too high TTL

See merge request isc-projects/bind9!6611
2022-07-22 22:57:00 +00:00
Evan Hunt
a20584dcf8 CHANGES and release note for [GL #2918] 2022-07-22 15:24:34 -07:00
Evan Hunt
fb8f102ffc warn about zones with both dnssec-policy and max-zone-ttl
max-zone-ttl in zone/view/options is a no-op if dnssec-policy
is in use, so generate a warning.
2022-07-22 15:24:34 -07:00
Evan Hunt
1ed5eb38e4 clarify "max-zone-ttl" documentation
The "max-zone-ttl" option should now be configured as part of
dnssec-policy. Use of this option in zone/view/options will be ignored
in any zone that also has dnssec-policy configured.
2022-07-22 15:24:29 -07:00
Matthijs Mekking
111b215987 Reject zones with TTL higher than dnssec-policy max-zone-ttl
Reject loading of zones with TTL higher than the max-zone-ttl
from the dnssec-policy.

With this change, any zone with a dnssec-policy in use will ignore
the max-zone-ttl option in zone/view/options.
2022-07-22 13:40:12 -07:00
Matthijs Mekking
2022384b8d Test dnssec-policy max-zone-ttl rejects zone with too high TTL
Similar to the 'max-zone-ttl' zone option, the 'dnssec-policy' option
should reject zones with TTLs that are out of range.
2022-07-22 13:39:17 -07:00
Petr Špaček
04c76d0055 Merge branch 'pspacek/minor-arm-tweaks-and-fixes-v9_16' into 'v9_16'
Fix dnssec-signzone examples in DNSSEC Guide [v9_16]

See merge request isc-projects/bind9!6604
2022-07-21 13:20:02 +00:00
Petr Špaček
a94c063c19 Avoid opt-out flag in dnssec-signzone examples
Since !6413 we discourage opt-out, so we should not be advertising it in
the examples. Even worse, it was just thrown into the command line
without even mentioning its meaning in the surrounding text.

Related: !6413
(cherry picked from commit beae857288)
2022-07-21 15:19:38 +02:00
Petr Špaček
445863c9fd Remove errorneous shell output redirection from dnssec-signzone example
The > looked like shell output redirection. It was present since we
imported DNSSEC Guide into the ARM.

(cherry picked from commit 1ab564d605)
2022-07-21 15:19:38 +02:00
Michal Nowak
a0e7b05aba Merge tag 'v9_16_31' into v9_16
BIND 9.16.31
2022-07-21 14:37:36 +02:00
Michał Kępień
55edba1dc6 Merge branch 'michal/run-a-short-respdiff-test-for-all-merge-requests-v9_16' into 'v9_16'
[v9_16] Run a short respdiff test for all merge requests

See merge request isc-projects/bind9!6591
2022-07-18 13:40:05 +00:00
Michał Kępień
1faaefd134 Run a short respdiff test for all merge requests
Running a respdiff test for every merge request would be useful for
catching protocol-breaking changes before they are applied to the source
code.  However, the existing respdiff-based tests take a while to
complete (about half an hour with our current CI infrastructure), which
does not make them a good fit for this purpose.  Add a new GitLab CI
job, "respdiff-short", which uses a smaller query set that gets
processed within a couple of minutes on our current CI infrastructure.
Rename the existing respdiff-based jobs to make distinguishing them
easier.

(cherry picked from commit 31ee43a314)
2022-07-18 15:28:21 +02:00
Michał Kępień
6b03f8bbfc Extract respdiff job definition to a YAML anchor
Ensure the common parts of all jobs using respdiff are available in the
form of a reusable YAML anchor, to reduce code duplication and to
simplify adding more respdiff-based jobs to GitLab CI.

(cherry picked from commit ca20a189f7)
2022-07-18 15:28:21 +02:00
Michał Kępień
d02d5b97f5 Use a pre-built executable as the reference named
The "respdiff" GitLab CI job compares DNS responses produced by the
current version of named with those produced by a reference version.
The latter is built from source in each "respdiff" job, despite the fact
that the reference version changes very rarely.  Use a pre-built named
executable as the reference version instead, assuming it is available in
the OS image used for "respdiff" tests.

(cherry picked from commit ab90a4705a)
2022-07-18 15:28:21 +02:00
Ondřej Surý
2e7e47f88d Merge branch '3453-cope-with-too-small-BUFSIZ-v9_16' into 'v9_16'
Increase the BUFSIZ-long buffers [v9.16]

See merge request isc-projects/bind9!6587
2022-07-15 19:48:15 +00:00
Ondřej Surý
c1b8f5f30c Increase the BUFSIZ-long buffers
The BUFSIZ value varies between platforms, it could be 8K on Linux and
512 bytes on mingw.  Make sure the buffers are always big enough for the
output data to prevent truncation of the output by appropriately
enlarging or sizing the buffers.

(cherry picked from commit b19d932262)
2022-07-15 21:21:03 +02:00
Michał Kępień
cacca9bdf9 Merge branch '3443-memory-related-cleanups-v9_16' into 'v9_16'
[v9_16] Memory-related cleanups

See merge request isc-projects/bind9!6569
2022-07-15 09:01:03 +00:00
Michał Kępień
b68851773c Make "named -h" output match option-handling code
The usage instructions printed by "named -h" are missing the "external"
and "internal" flags that can be passed to the -M command-line option.
Add the missing flags to "named -h" output.
2022-07-15 10:45:34 +02:00
Michał Kępień
31012c1c0d Update documentation for named's -M option
Add "internal" to the list of legal values for the -M command-line
option (commit 1f7d2d53f0 added that
flag).

Make the style of the relevant paragraph more in line with the next one
and split its contents up into an unordered list of options for improved
readability.

(cherry picked from commit f0c31ceb3b)
2022-07-15 10:45:34 +02:00
Michał Kępień
4d1986ebcb Handle ISC_MEM_DEFAULTFILL consistently
Contrary to what the documentation states, memory filling is only
enabled by --enable-developer (or by setting -DISC_MEM_DEFAULTFILL=1) if
the internal memory allocator is used.  However, the internal memory
allocator is disabled by default, so just using the --enable-developer
build-time option does not enable memory filling (passing "-M fill" on
the named command line is necessary to actually enable it).  As memory
filling is a useful tool for troubleshooting certain types of bugs, it
should also be enabled by --enable-developer when the system allocator
is used.

Furthermore, memory-related preprocessor macros are handled in two
distinct locations: lib/isc/include/isc/mem.h and bin/named/main.c.
This makes the logic hard to follow.

Move all code handling the ISC_MEM_DEFAULTFILL preprocessor macro to
lib/isc/include/isc/mem.h, ensuring memory filling is enabled by the
--enable-developer build-time switch, no matter which memory allocator
is used.
2022-07-15 10:45:34 +02:00
Michał Kępień
7df6070c02 Fix mempool stats bug in the internal allocator
Commit c96b6eb5ec changed the way mempool
code handles freed allocations that cannot be retained for later use as
"free list" items: it no longer uses different logic depending on
whether the internal allocator is used or the system one.  However, that
commit did not update a relevant piece of code in isc_mempool_destroy(),
causing memory context statistics to always be off upon shutdown when
BIND 9 is built with -DISC_MEM_USE_INTERNAL_MALLOC=1.  This causes
assertion failures.  Update isc_mempool_destroy() accordingly in order
to prevent this issue from being triggered.
2022-07-15 10:45:34 +02:00
Mark Andrews
5338fc9e19 Merge branch '3447-lib-dns-tkey-c-free_namelist-should-be-disassociating-associated-rdatatsets-v9_16' into 'v9_16'
disassociate rdatasets when cleaning up [v9_16]

See merge request isc-projects/bind9!6578
2022-07-14 01:08:57 +00:00
Mark Andrews
f2855facbe disassociate rdatasets when cleaning up
free_namelist could be passed names with associated rdatasets
when handling errors.  These need to be disassociated before
calling dns_message_puttemprdataset.

(cherry picked from commit 745d5edc3a)
2022-07-14 10:21:47 +10:00
Mark Andrews
29f0ac40f3 Merge branch '3449-kasp-system-test-failed-to-log-some-zones-during-setup-v9_16' into 'v9_16'
kasp: add missing logging during setup [v9_16]

See merge request isc-projects/bind9!6576
2022-07-14 00:18:27 +00:00
Mark Andrews
9980c7be8d kasp: add missing logging during setup
Some zones where not being logged when just DNSSEC keys where being
generated in system test setup phase.  Add logging for these zones.

(cherry picked from commit 04627997eb)
2022-07-14 09:46:16 +10:00
Mark Andrews
5e5232aa5b Merge branch '3446-autosign-s-checking-revoked-key-with-duplicate-key-id-test-was-incomplete-v9_16' into 'v9_16'
Make "checking revoked key with duplicate key ID" work [v9_16]

See merge request isc-projects/bind9!6558
2022-07-13 01:42:56 +00:00
Mark Andrews
5fec2fcbe7 Make "checking revoked key with duplicate key ID" work
There should be 2 keys with the same key id after the numerically
lower one is revoked (serial space arithmetic).  The DS points
at the non-revoked key so validation should still succeed.

(cherry picked from commit 513cb24b55)
2022-07-13 10:58:41 +10:00
Evan Hunt
492f614d0e Merge branch '2683-ixfr-logging-v9_16' into 'v9_16'
log the reason for falling back to AXFR from IXFR at level info

See merge request isc-projects/bind9!6552
2022-07-12 23:52:47 +00:00
Evan Hunt
0849fd2211 log the reason for falling back to AXFR from IXFR at level info
messages indicating the reason for a fallback to AXFR (i.e, because
the requested serial number is not present in the journal, or because
the size of the IXFR response would exceeed "max-ixfr-ratio") are now
logged at level info instead of debug(4).

(cherry picked from commit df1d81cf96)
2022-07-12 16:27:01 -07:00
Michal Nowak
d0bf87eab5 Merge branch 'mnowak/alpine-3.16-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.16

See merge request isc-projects/bind9!6549
2022-07-12 12:01:37 +00:00
Michal Nowak
0043999f54 Add Alpine Linux 3.16
(cherry picked from commit 0d0ab3db10)
2022-07-12 13:59:30 +02:00
Matthijs Mekking
77ee0f87b5 Merge branch '3438-dnssec-policy-does-not-set-inline-signing-v9_16' into 'v9_16'
[v9_16] Fix inheritance for dnssec-policy when checking for inline-signing

See merge request isc-projects/bind9!6547
2022-07-12 11:39:42 +00:00
Matthijs Mekking
60c297d717 Add release note and change entry for #3438
Bug worth mentioning.

(cherry picked from commit 689215a675)
2022-07-12 12:48:57 +02:00
Matthijs Mekking
0d5e0867df Inherit dnssec-policy in check for inline-signing
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. But the function responsible
for this did not inherit the dnssec-policy option from the view or
options level, and thus never enabled inline-signing, while the zone
should have been.

This is fixed by this commit.

(cherry picked from commit 576b21b168)
2022-07-12 12:48:21 +02:00
Matthijs Mekking
eb7d65b84d Test setting of inline-signing with dnssec-policy
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. Add test cases to verify this.

(cherry picked from commit efa8a4e88d)
2022-07-12 12:48:16 +02:00
Matthijs Mekking
2db23e475b Fix kasp system test bugs
Fix a comment, ensuring the right parameters are used (zone is
parameter $3, not $2) and add view and policy parameters to the comment.

Fix the view tests and test the correct view (example3 instead of
example2).

Fix placement of "n=$((n+1)" for two test cases.

(cherry picked from commit ff65f07779)
2022-07-12 12:48:08 +02:00
Mark Andrews
474bac53ba Merge branch '3389-unexpected-badkey-in-upforwd-system-test-v9_16' into 'v9_16'
Clone the message buffer before forwarding UPDATE messages [v9_16]

See merge request isc-projects/bind9!6545
2022-07-12 09:28:23 +00:00
Mark Andrews
17b2dc015e Add CHANGES note for [GL #3389]
(cherry picked from commit 09d8ed3970)
2022-07-12 19:02:00 +10:00
Mark Andrews
b485d95c66 Clone the message buffer before forwarding UPDATE messages
this prevents named forwarding a buffer that may have been over
written.

(cherry picked from commit 7a42417d61)
2022-07-12 19:01:32 +10:00
Michał Kępień
0e59965d6a Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.32' into 'v9_16'
Set up version and release notes for BIND 9.16.32

See merge request isc-projects/bind9!6540
2022-07-11 07:05:57 +00:00
Michał Kępień
c660730ea3 Set up release notes for BIND 9.16.32 2022-07-11 08:52:51 +02:00
Michał Kępień
c4e010ebaa Update BIND version to 9.16.32-dev 2022-07-11 08:52:51 +02:00
Tinderbox User
1c4b350ca2 Merge branch 'prep-release' into v9_16_31-release 2022-07-11 04:55:00 +00:00
Tinderbox User
a2bd0075bb prep 9.16.31 2022-07-11 04:49:15 +00:00
Michał Kępień
163c0b8089 Merge branch 'michal/prepare-documentation-for-bind-9.16.31' into 'v9_16_31-release'
Prepare documentation for BIND 9.16.31

See merge request isc-private/bind9!414
2022-07-11 04:40:29 +00:00
Michał Kępień
5cbf8d3c18 Tweak and reword release notes 2022-07-11 06:32:55 +02:00
Michał Kępień
59da803e86 Prepare release notes for BIND 9.16.31 2022-07-11 06:32:55 +02:00
Michał Kępień
7b1d377562 Merge branch '3441-fix-fetch-context-use-after-free-bugs' into 'v9_16'
Fix fetch context use-after-free bugs

See merge request isc-projects/bind9!6537
2022-07-11 04:18:04 +00:00
Michał Kępień
6505056267 Fix fetch context use-after-free bugs
fctx_decreference() may call fctx_destroy(), which in turn may free the
fetch context by calling isc_mem_putanddetach().  This means that
whenever fctx_decreference() is called, the fetch context pointer should
be assumed to point to garbage after that call.  Meanwhile, the
following pattern is used in several places in lib/dns/resolver.c:

    LOCK(&res->buckets[fctx->bucketnum].lock);
    bucket_empty = fctx_decreference(fctx);
    UNLOCK(&res->buckets[fctx->bucketnum].lock);

Given that 'fctx' may be freed by the fctx_decreference() call, there is
no guarantee that the value of fctx->bucketnum will be the same before
and after the fctx_decreference() call.  This can cause all kinds of
locking issues as LOCK() calls no longer match up with their UNLOCK()
counterparts.

Fix by always using a helper variable to hold the bucket number when the
pattern above is used.

Note that fctx_try() still uses 'fctx' after calling fctx_decreference()
(it calls fctx_done()).  This is safe to do because the reference count
for 'fctx' is increased a few lines earlier and it also cannot be zero
right before that increase happens, so the fctx_decreference() call in
that particular location never invokes fctx_destroy().  Nevertheless,
use a helper variable for that call site as well, to retain consistency
and to prevent copy-pasted code from causing similar problems in the
future.
2022-07-08 11:26:34 +02:00
Petr Špaček
bf2ea74622 Merge branch '3320-rewrite-arm-dnssec-chapter-v9_16' into 'v9_16'
Rewrite DNSSEC ARM Chapter [v9_16]

See merge request isc-projects/bind9!6536
2022-07-07 11:25:11 +00:00
Petr Špaček
4caaff0afa Deduplicate Manual Signing between DNSSEC chapter and DNSSEC Guide
The two procedures were essentially the same, but each instance was
missing some details from the other. They are now combined into one text
in the DNSSEC Guide and linked from DNSSEC chapter.

(cherry picked from commit 7d25027898)
2022-07-07 12:04:39 +02:00
Suzanne Goldlust
71f3d521cb Minor grammar improvements in the Signing chapter of the DNSSEC Guide
(cherry picked from commit 6b1ad4dcfb)
2022-07-07 11:48:33 +02:00
Petr Špaček
dd46af7f59 Deduplicate key filename description in the DNSSEC Guide
Third time ...

(cherry picked from commit 7e96801841)
2022-07-07 11:40:45 +02:00
Petr Špaček
6c1b34e9b5 Use ECDSAP256SHA256 in DNSSEC signing examples
(cherry picked from commit 3eb6898a14)
2022-07-07 11:39:32 +02:00
Matthijs Mekking
0a13a85dff Add a section about key rollover
Describe how to do key rollovers with dnssec-policy. Update the
revert to unsigned recipe in the DNSSEC guide.

(cherry picked from commit f721986589)
2022-07-07 11:37:25 +02:00
Petr Špaček
75854c5e6b Rewrite DNSSEC Validation subchapter in the ARM
Mostly deduplicating and linking information across the ARM.
Generally people should not touch it unless they what they are doing, so
let's try to discourage them a bit.

(cherry picked from commit bffa3063f0)
2022-07-07 11:07:32 +02:00
Petr Špaček
c9e52437ca Resynchronize DNSSEC chapter with the main branch
This is essentially a backport of !6296.

Replace DNSSEC chapter with version from the main branch, commit
901b6425d2.

There were structural changes to the ARM in the main branch, and
replacing the whole file with a new version is an order of magniture
easier than attempting to cherry-pick individual changes which should, in
the end, produce the same file under a different name.

File names in the main branch and v9_16 are now in sync (for the DNSSEC
chapter).

Fixes: #3320
2022-07-07 10:34:06 +02:00
Mark Andrews
339668b2e4 Merge branch '3433-support-default-hmac-v9_18-v9_16' into 'v9_16'
Add DEFAULT_HMAC to conf.sh.common [v9_16]

See merge request isc-projects/bind9!6534
2022-07-07 05:29:39 +00:00
Mark Andrews
40c7096caf Add DEFAULT_HMAC to conf.sh.common
(cherry picked from commit 972d7fd682)
(cherry picked from commit ba45075acb)
2022-07-07 15:11:33 +10:00
Mark Andrews
19970f720d Merge branch '3061-ifconfig-sh-down-messes-up-loopback-interfaces-v9_16' into 'v9_16'
update ifconfig.sh [v9_16]

See merge request isc-projects/bind9!6531
2022-07-07 00:53:08 +00:00
Mark Andrews
e1b3d3d259 Add CHANGES note for [GL #3061]
(cherry picked from commit e0708c8950)
2022-07-07 10:16:07 +10:00
Mark Andrews
76ed6f32e8 update ifconfig.sh
* make it harder to get the interface numbers wrong by using 'max'
to specify the upper bound of the sequence of interfaces and use 'max'
when calculating the interface number
* extract the platform specific instruction into 'up' and 'down'
and call them from the inner loop so that the interface number is
calculated in one place.
* calculate the A and AAAA address in a single place rather than
in each command
* use /sbin/ipadm on Solaris 2.11 and greater

(cherry picked from commit abfb5b1173)
2022-07-07 10:15:35 +10:00
Mark Andrews
abf9a59b1a Merge branch '3429-detect-overflow-in-generate-directive-v9_16' into 'v9_16'
Check for overflow in $GENERATE computations [v9_16]

See merge request isc-projects/bind9!6527
2022-07-06 01:55:41 +00:00
Mark Andrews
3433983407 Add CHANGES note for [GL #3429]
(cherry picked from commit d935ead14b)
2022-07-06 11:36:10 +10:00
Evan Hunt
4897f3ccc0 Improve $GENERATE documentation
Clarify the documentation of $GENERATE modifiers and add an example.

(cherry picked from commit 13fb2faf7a)
2022-07-06 11:35:16 +10:00
Mark Andrews
d10e20da0d Tighten $GENERATE directive parsing
The original sscanf processing allowed for a number of syntax errors
to be accepted.  This included missing the closing brace in
${modifiers}

Look for both comma and right brace as intermediate seperators as
well as consuming the final right brace in the sscanf processing
for ${modifiers}.  Check when we got right brace to determine if
the sscanf consumed more input than expected and if so behave as
if it had stopped at the first right brace.

(cherry picked from commit 7be64c0e94)
2022-07-06 11:26:24 +10:00
Mark Andrews
16ac79a8f7 Check for overflow in $GENERATE computations
$GENERATE uses 'int' for its computations and some constructions
can overflow values that can be represented by an 'int' resulting
in undefined behaviour.  Detect these conditions and return a
range error.

(cherry picked from commit 5327b9708f)
2022-07-06 11:26:24 +10:00
Mark Andrews
357ac87986 Merge branch '3437-cds-error-window-too-small-v9_16' into 'v9_16'
Only report not matching stderr content when we look for it [v9_16]

See merge request isc-projects/bind9!6524
2022-07-05 18:33:05 +00:00
Mark Andrews
7cd7f7d2cb Increase the amount of time allowed for signing to occur in
On slow systems we have seen this take 9 seconds.  Increased the
allowance from 3 seconds to 10 seconds to reduce the probabilty of
a false negative from the system test.

(cherry picked from commit 4db847e80e)
2022-07-05 23:12:22 +10:00
Mark Andrews
351aa3d3b5 Only report not matching stderr content when we look for it
The previous test code could emit "D:cds:stderr did not match ''" rather
that just showing the contents of stderr.  Moved the debug line inside
the if/else block.

Replaced backquotes with $() and $(()) as approriate.

(cherry picked from commit 304d33fb32)
2022-07-05 23:12:22 +10:00
Michał Kępień
a9407704e6 Merge branch '3357-test_send_timeout-add-code-comment' into 'v9_16'
Add code comment to test_send_timeout test

See merge request isc-projects/bind9!6503
2022-07-04 21:12:33 +00:00
Michał Kępień
8ebc9c76a9 Add a code comment to the test_send_timeout() test 2022-07-04 23:10:59 +02:00
Petr Špaček
269ecb6f63 Merge branch 'marka-cobertura-replaced-by-coverage_report-v9_16' into 'v9_16'
Fix for GitLab 15.0: cobertura replaced by coverage_report [v9_16]

See merge request isc-projects/bind9!6514
2022-07-04 05:50:40 +00:00
Mark Andrews
7680a12431 Fix for GitLab 15.0: cobertura replaced by coverage_report
From Gitlab 15.0 release notes:

   artifacts:reports:cobertura keyword

   As of GitLab 15.0, the artifacts:reports:cobertura keyword has
   been replaced by artifacts:reports:coverage_report. Cobertura
   is the only supported report file, but this is the first step
   towards GitLab supporting other report types.

(cherry picked from commit 008032d268)
2022-07-04 07:15:53 +02:00
Arаm Sаrgsyаn
d50036114e Merge branch '3398-race-resolver-query-timeout-and-validation-v9_16' into 'v9_16'
Fix a race between resolver query timeout and validation

See merge request isc-projects/bind9!6419
2022-07-01 09:20:29 +00:00
Aram Sargsyan
d31223d477 Add CHANGES and release note for [GL #3398] 2022-07-01 08:42:28 +00:00
Aram Sargsyan
61d77affdd Remove resolver.c:maybe_destroy()
After refactoring of `validated()`, the `maybe_destroy()` function is
no longer expected to actually destroy the fetch context when it is
being called, so effectively it only ensures that the validators are
canceled when the context has no more queries and pending events, but
that is redundant, because `maybe_destroy()` `REQUIRE`s that the context
should be in the shutting down state, and the function which sets that
state is already canceling the validators in its own turn.

As a failsafe, to make sure that no validators will be created after
`fctx_doshutdown()` is called, add an early return from `valcreate()` if
the context is in the shutting down state.
2022-06-30 19:12:17 +00:00
Aram Sargsyan
058a2e7d44 Fix a race between resolver query timeout and validation
The `resolver.c:validated()` function unlinks the current validator from
the fetch's validators list, which can leave it empty, then unlocks
the bucket lock. If, by a chance, the fetch was timed out just before
the `validated()` call, the final timeout callback running in parallel
with `validated()` can find the fetch context with no active fetches
and with an empty validators list and destroy it, which is unexpected
for the `validated()` function and can lead to a crash.

Increase the fetch context's reference count in the beginning of
`validated()` and decrease it when it finishes its work to avoid the
unexpected destruction of the fetch context.
2022-06-30 18:58:58 +00:00
Michal Nowak
b56317fc56 Merge branch '2371-add-stress-testing-with-rpz-v9_16' into 'v9_16'
[v9_16] Add stress testing with RPZ

See merge request isc-projects/bind9!6498
2022-06-28 22:06:34 +00:00
Michal Nowak
49f96e6287 Add stress testing with RPZ
(cherry picked from commit d272574653)
2022-06-28 20:43:15 +02:00
Petr Špaček
54609a00be Merge branch '3408-drop-debian-9-stretch-v9_16' into 'v9_16'
Drop support for Debian 9 (Stretch) [v9_16]

See merge request isc-projects/bind9!6496
2022-06-28 16:00:34 +00:00
Petr Špaček
561f2a3930 Declare Debian 9 (Stretch) community-maintained
(cherry picked from commit 4ce1f25210)
2022-06-28 17:59:21 +02:00
Petr Špaček
a6496edf7e Drop Debian 9 (Stretch) from CI
(cherry picked from commit aa86a8bcf0)
2022-06-28 17:59:20 +02:00
Matthijs Mekking
0420302a8a Merge branch '3422-dnssec-policy-clarifications-v9_16' into 'v9_16'
[v9_16] Add some clarifications wrt dynamic zones

See merge request isc-projects/bind9!6490
2022-06-27 12:38:18 +00:00
Matthijs Mekking
68105e66cf Add some clarifications wrt dynamic zones
These were suggested by GitLab user @elmaimbo.

(cherry picked from commit fb517eb52a)
2022-06-27 11:56:59 +02:00
Mark Andrews
0fbf59d6f8 Merge branch '3420-rrsetorder-update-status-v9_16' into 'v9_16'
Add missing update of status variable in rrsetorder system test [v9_16]

See merge request isc-projects/bind9!6481
2022-06-23 07:56:14 +00:00
Mark Andrews
c978785be6 Replace expr's with $((expression)) shell constucts
Also make indenting consistent.

(cherry picked from commit 669c42cd95)
2022-06-23 17:35:51 +10:00
Mark Andrews
9786a785f3 Add missing update of status variable in rrsetorder system test
(cherry picked from commit da63e63c41)
2022-06-23 17:28:58 +10:00
Michal Nowak
d29b7b2601 Merge branch 'mnowak/add-system_gcc_bullseye_unstable_amd64-ci-job-v9_16' into 'v9_16'
[v9_16] Add system:gcc:bullseye:unstable:amd64 CI job

See merge request isc-projects/bind9!6477
2022-06-22 13:52:21 +00:00
Michal Nowak
805fa06cc8 Put default-triggering-rules anchor in alphabetical order
(cherry picked from commit db1a72d581)
2022-06-22 15:06:10 +02:00
Michal Nowak
0f4623f717 Rename schedules_tags_web_triggering_rules anchor
The schedules_tags_web_triggering_rules anchor name should match it's
content, hence api_schedules_tags_triggers_web_triggering_rules anchor
name.

(cherry picked from commit 0629f53431)
2022-06-22 15:06:10 +02:00
Michal Nowak
4f3dc87d81 Extract API, schedules, triggers, and web triggering rules
(cherry picked from commit fbc1345dd7)
2022-06-22 14:58:54 +02:00
Michal Nowak
daadd8ebcd Add system:gcc:bullseye:unstable:amd64 CI job
Without this CI job long pytest jobs are not being run in the CI.

(cherry picked from commit d606f39022)
2022-06-22 14:58:42 +02:00
Michał Kępień
83dadbc75e Merge branch '3309-fix-destination-port-extraction-for-client-queries-v9_16' into 'v9_16'
[v9_16] Fix destination port extraction for client queries

See merge request isc-projects/bind9!6475
2022-06-22 12:28:13 +00:00
Michał Kępień
89aa97c455 Add CHANGES entry for GL #3309
(cherry picked from commit 58c3513fa6)
2022-06-22 13:52:08 +02:00
Mark Andrews
f271667a1b Check that the UDP destination port is logged via dnstap
(cherry picked from commit 8d8396c3a7)
2022-06-22 13:52:08 +02:00
Michał Kępień
cbfb93e1c7 Fix destination port extraction for client queries
The current logic for determining the address of the socket to which a
client sent its query is:

 1. Get the address:port tuple from the netmgr handle using
    isc_nmhandle_localaddr() or from the ns_interface_t structure.

 2. Convert the address:port tuple from step 1 into an isc_netaddr_t
    using isc_netaddr_fromsockaddr().

 3. Convert the address from step 2 back into a socket address with the
    port set to 0 using isc_sockaddr_fromnetaddr().

Note that the port number (readily available in the netmgr handle or in
the ns_interface_t structure) is needlessly lost in the process,
preventing it from being recorded in dnstap captures of client traffic
produced by named.

Fix by first storing the address:port tuple in client->destsockaddr and
then creating an isc_netaddr_t from that structure.  This allows the
port number to be retained in client->destsockaddr, which is what
subsequently gets passed to dns_dt_send().

Remove an outdated code comment.

(cherry picked from commit 2f945703f2)
2022-06-22 13:52:08 +02:00
Michal Nowak
4b9c2066b1 Merge branch 'mnowak/ubuntu-22.04-jammy-jellyfish-v9_16' into 'v9_16'
[v9_16] Add Ubuntu 22.04 LTS (Jammy Jellyfish)

See merge request isc-projects/bind9!6471
2022-06-22 11:05:49 +00:00
Michal Nowak
ce2e4c59d9 Do not run Ubuntu 18.04 jobs in MR-triggered pipelines
With the addition of Ubuntu 22.04 three more CI jobs were added. To
compensate for that, move Ubuntu 18.04 jobs out of MR-triggered
pipelines to schedule-triggered ones.

Also, move --disable-geoip ./configure options from Ubuntu 18.04 to
Ubuntu 20.04 jobs to keep these options in the more frequent
MR-triggered pipelines.

(cherry picked from commit 06c591667e)
2022-06-22 12:04:40 +02:00
Michal Nowak
009c7871ec Add Ubuntu 22.04 LTS (Jammy Jellyfish)
(cherry picked from commit 4c2af3bdfa)
2022-06-22 12:04:13 +02:00
Matthijs Mekking
7ebf6e5c59 Merge branch '3397-document-interaction-dnssec-update-config-options-v9_16' into 'v9_16'
[v9_16] Document where updates and DNSSEC records are stored

See merge request isc-projects/bind9!6464
2022-06-21 14:49:58 +00:00
Matthijs Mekking
3d2126cc82 Add comment on DNSSEC signing zone configuration
I was slightly confused here, so IMO it can use a comment.

(cherry picked from commit c80531758c)
2022-06-20 16:50:51 +02:00
Matthijs Mekking
e1f0acc3e7 Document where updates and DNSSEC records are stored
Make clear that inline-signing stores DNSSEC records in a signed
version of the zone, using the zone's filename plus ".signed" extension.

Tell that dynamic zones store updates in the zone's filename.

DNSSEC records for dynamic zones also go in the zone's filename, unless
inline-signing is enabled.

Then, dnssec-policy assumes inline-signing, but only if the zone is
not dynamic.

(cherry picked from commit 8860f6b4ff)
2022-06-20 16:50:42 +02:00
Michal Nowak
e75a1d4206 Merge branch 'mnowak/bump-clang-to-version-14-v9_16' into 'v9_16'
[v9_16] Update clang to version 14

See merge request isc-projects/bind9!6456
2022-06-17 06:36:39 +00:00
Michal Nowak
676dac06b6 Extract Clang version to $CLANG_VERSION
Extracting Clang version helps with updating Clang version in one place
and not missing one of its instances.

(cherry picked from commit bd17dec045)
2022-06-16 18:11:03 +02:00
Michal Nowak
08c89b2002 Fix external_symbolizer_path on Fedora
The external_symbolizer_path was wrong on Fedora since moving gcc:tsan
jobs from Debian to Fedora.

(cherry picked from commit e98b9c5009)
2022-06-16 18:11:03 +02:00
Michal Nowak
a584a8f88f Update clang to version 14
(cherry picked from commit 1c45a9885a)
2022-06-16 18:11:03 +02:00
Michal Nowak
8408f7d01e Merge branch 'mnowak/checkds-pylint-implicit-str-concat-fixes-v9_16' into 'v9_16'
[v9_16] Fix implicit string concatenation in tests-checkds.py

See merge request isc-projects/bind9!6454
2022-06-16 11:56:10 +00:00
Michal Nowak
84d2d25921 Fix implicit string concatenation in tests-checkds.py
pylint 2.14.2 reports the following warnings:

    bin/tests/system/checkds/tests-checkds.py:265:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
    bin/tests/system/checkds/tests-checkds.py:273:0: W1404: Implicit string concatenation found in call (implicit-str-concat)

(cherry picked from commit 831ac8add1)
2022-06-16 13:45:30 +02:00
Tom Krizek
b7fc9e43df Merge branch 'tkrizek/pytest-skipped-reason-v9_16' into 'v9_16'
Report reasons for skipped/xfailed system pytests [v9_16]

See merge request isc-projects/bind9!6450
2022-06-16 07:53:23 +00:00
Tom Krizek
dc5acad543 Report reasons for skipped/xfailed system pytests
If skip/xfail is used in pytest, it can have a reason string associated
with it. When evaluating these tests, it can be useful to be able to
differentiate the reason why the test was skipped/xfailed/xpassed,
because there might be multiple possible reasons for that.

The extra options passed to pytest ensure that the string with the
reason appears in the test summary and thus we're able to find the
string with the reason in the log output.

See https://docs.pytest.org/en/7.1.x/how-to/skipping.html for more info

(cherry picked from commit f6d368167a)
2022-06-16 09:18:32 +02:00
Petr Špaček
84a9ce2d87 Merge branch 'pspacek/nsec3-doc-update-v9_16' into 'v9_16'
Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10 [v9_16]

See merge request isc-projects/bind9!6448
2022-06-15 16:16:50 +00:00
Petr Špaček
3eae58207a Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10
https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-nsec3-guidance-10
is on it's way to become RFC, so let's update our recommendations in the
docs to be in line with it.

The default values for dnssec-policy and dnssec-signzone were adapted to
match v9_16 branch.

(cherry picked from commit 2ee3f4e6c8)
2022-06-15 18:10:50 +02:00
Michał Kępień
68fadd52c1 Merge tag 'v9_16_30' into v9_16
BIND 9.16.30
2022-06-15 16:02:06 +02:00
Petr Špaček
f4db2c69fa Merge branch 'pspacek/doc-cleanup-dnssec-prereq-v9_16' into 'v9_16'
Update intro texts in the DNSSEC Guide [v9_16]

See merge request isc-projects/bind9!6435
2022-06-14 16:22:46 +00:00
Petr Špaček
b14b29b969 Update FAQ in the DNSSEC Guide
Mention DoT/DoH, update stats, remove mentions of early stages of
deployment.

(cherry picked from commit fd3a2c7854)
2022-06-14 18:18:54 +02:00
Petr Špaček
308c7f7c5c Update Authoritative Server Hardware requirements in DNSSEC Guide
Based on measurements done on BIND v9_19_2 using bank. TLD and a
synthetitc fullly signed zone, using RSASHA256 and ECDSAP256SHA256
algorithms with NSEC and NSEC3 without opt-out.

(cherry picked from commit 635885afe6)
2022-06-14 18:18:36 +02:00
Petr Špaček
0efc93ce1a Update DNSSEC validation deployment stats in DNSSEC Guide
(cherry picked from commit 832c172985)
2022-06-14 18:18:36 +02:00
Petr Špaček
b64c8459f7 Rewrite Recursive Server Hardware requirements in DNSSEC Guide
This section was completely out of date. Current measurements on dataset
Telco EU 2022-02 and BIND 9.19.1 indicate absolutely different results
than described in the old version of the text.

(cherry picked from commit 6cf8066b9c)
2022-06-14 18:18:36 +02:00
Petr Špaček
4319b776f8 Remove outdated software requirements from DNSSEC Guide
Guide in this repo is tied to latest version anyway, so let's not even
mention ancient versions of BIND.

This also solves the OpenSSL question because it is now mandatory for
build, which subsequently removes the entropy problem - so let's not
mention it either.

(cherry picked from commit 6e79877759)
2022-06-14 18:18:35 +02:00
Michal Nowak
4e840e7d59 Merge branch '3138-capture-scripts-to-coverity-scan-v9_16' into 'v9_16'
[v9_16] Capture scripts for Coverity Scan analysis

See merge request isc-projects/bind9!6431
2022-06-14 12:38:07 +00:00
Michal Nowak
a95ced4d51 Capture scripts for Coverity Scan analysis
With the recent Coverity Scan 2021.12 version, Python 3 scripts are
being analyzed in addition to C files. The --fs-capture-search option
scripts for Coverity Scan analysis should be added to leverage this
feature.

(cherry picked from commit b4a2674d98)
2022-06-14 14:25:04 +02:00
Michal Nowak
f1ae1eb6f3 Download Coverity Scan analysis tool to /tmp
Downloading and unpacking Coverity Scan analysis tool tarball
(cov-analysis-linux64.tgz) to $CI_PROJECT_DIR interferes with the
execution of the analysis tool when the --fs-capture-search option is
used because the tool starts to analyze some of its Javascript files.
(There's the --fs-capture-search-exclude-regex <path> option, but I
failed to find a way to make it work.)

(cherry picked from commit 1333bdf67e)
2022-06-14 14:25:04 +02:00
Michal Nowak
b2b329af32 Drop coverity cache feature
The coverity CI job cache feature is used to ensure that the 1 GB
cov-analysis-linux64.tgz file is being cached on GitLab CI runner, where
it was downloaded in the past. This feature does not seem to work
anymore; given that the proper solution to creating distributed cache is
complicated, better to drop the feature altogether.

(cherry picked from commit c966304e90)
2022-06-14 14:25:04 +02:00
Ondřej Surý
dbda0b4ac2 Merge branch '3400-gracefully-handle-the-errors-from-uv_start_read-v9_16' into 'v9_16'
Gracefully handle uv_read_start() failures [v9.16]

See merge request isc-projects/bind9!6427
2022-06-14 10:45:13 +00:00
Ondřej Surý
5cd2acb374 Add CHANGES and release note for [GL #3400]
(cherry picked from commit 646df5cbbc)
2022-06-14 11:55:03 +02:00
Ondřej Surý
6cfab7e4f7 Gracefully handle uv_read_start() failures
Under specific rare timing circumstances the uv_read_start() could
fail with UV_EINVAL when the connection is reset between the connect (or
accept) and the uv_read_start() call on the nmworker loop.  Handle such
situation gracefully by propagating the errors from uv_read_start() into
upper layers, so the socket can be internally closed().

(cherry picked from commit b432d5d3bc)
2022-06-14 11:55:03 +02:00
Mark Andrews
0e90fa4234 Merge branch 'typo-in-log-on-update-forward-opcode-mismatch-v9_16' into 'v9_16'
corrected the opcode param to opcode_totext

See merge request isc-projects/bind9!6422
2022-06-14 02:57:46 +00:00
Mark Andrews
1e155f4fc4 Add CHANGES note for [GL !6420]
(cherry picked from commit bd508194be)
2022-06-14 12:08:02 +10:00
JINMEI Tatuya
673211492c make the fix more complete
(cherry picked from commit a58647df6a)
2022-06-14 12:07:39 +10:00
JINMEI Tatuya
66cfaf0fb0 corrected the opcode param to opcode_totext
(cherry picked from commit 2b81a69659)
2022-06-14 12:07:39 +10:00
Petr Špaček
5c327f209b Merge branch 'pspacek/keyfromlabel-doc-alg-clarif-v9_16' into 'v9_16'
Clarify dnssec-keyfromlabel -a in man page [v9_16]

See merge request isc-projects/bind9!6415
2022-06-10 06:06:28 +00:00
Petr Špaček
f01f316268 Clarify dnssec-keyfromlabel -a in man page
(cherry picked from commit 5f53003dae)
2022-06-10 08:02:33 +02:00
Tom Krizek
27f383182b Merge branch 'tkrizek/python-codestyle-v9_16' into 'v9_16'
Enforce Python codestyle with black [v9_16]

See merge request isc-projects/bind9!6406
2022-06-08 12:03:50 +00:00
Tom Krizek
883b6c8c1e Remove flake8 linter for Python from CI
Python codestyle is now handled by black and other issues are checked by
pylint. Flake8 checking has been made redundant and is thus removed as
obsolete.

(cherry picked from commit dae340a4a5)
2022-06-08 13:44:23 +02:00
Tom Krizek
b3c7bd1c04 Auto-format Python files with black
This patch is strictly the result of:
$ black $(git ls-files '*.py' '*.py.in')

There have been no manual changes.
2022-06-08 13:34:19 +02:00
Tom Krizek
cf92d05908 Enforce Python codestyle with black
Black is an opinionated tool for auto-formatting Python code so we no
longer have to worry about the codestyle.

For the codestyle decisions and discussion, refer to the upstream
documentation [1].

[1] https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html
2022-06-08 13:29:01 +02:00
Tom Krizek
8668c8c061 Remove trailing whitespace
My editor doesn't like that!

(cherry picked from commit 5d64d05be9)
2022-06-08 13:24:30 +02:00
Arаm Sаrgsyаn
983bd242b6 Merge branch '3380-catz-dont-cancel-processing-when-encountering-an-unexpected-rrtype-v9_16' into 'v9_16'
Resolve "member zones are deleted if RRsig appears in the catalog zone"

See merge request isc-projects/bind9!6355
2022-06-07 11:05:42 +00:00
Aram Sargsyan
87b3ced5fe Do not cancel processing record datasets in catalog zone after an error
When there are multiple record datasets in a database node of a catalog
zone, and BIND encounters a soft error during processing of a dataset,
it breaks from the loop and doesn't process the other datasets in the
node.

There are cases when this is not desired. For example, the catalog zones
draft version 5 states that there must be a TXT RRset named
`version.$CATZ` with exactly one RR, but it doesn't set a limitation
on possible non-TXT RRsets named `version.$CATZ` existing alongside
with the TXT one. In case when one exists, we will get a processing
error and will not continue the loop to process the TXT RRset coming
next.

Remove the "break" statement to continue processing all record datasets.

(cherry picked from commit 0b2d5490cd)
2022-06-07 09:59:32 +00:00
Matthijs Mekking
a0e05074fd Merge branch '3362-kasp-system-test-timing-issue-v9_16' into 'v9_16'
[v9_16] Fix another kasp test timing issue

See merge request isc-projects/bind9!6401
2022-06-07 09:11:07 +00:00
Matthijs Mekking
1dc36e2961 Retry quiet to deal with kasp test timing issue
In the cases where we test SOA serial updates and TTL updates, we check
if for "all zones loaded" to ensure the new zone content is loaded. But
this is the unsigned zone, the signed zone still needs to be produced.

There is thus a timing issue where the dig request comes in before
the signing process has finished.

Add a retry quiet to mitigate against it.

(cherry picked from commit 827bba05a0)
2022-06-07 09:38:06 +02:00
Petr Špaček
8f0682ecad Merge branch 'pspacek/danger-log-level-v9_16' into 'v9_16'
Flag new user-visible log messages for manual review [v9_16]

See merge request isc-projects/bind9!6393
2022-06-03 10:13:17 +00:00
Petr Špaček
ef8e3c72c6 Flag new user-visible log messages for review
Messages with log levels INFO or higher are flagged for manual review.
Purpose of this check is to prevent debug logs to being released with
too-high log level.

(cherry picked from commit b0f59cb5cb)
2022-06-03 12:12:37 +02:00
Michał Kępień
5636eca562 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.31' into 'v9_16'
Set up version and release notes for BIND 9.16.31

See merge request isc-projects/bind9!6391
2022-06-03 09:27:05 +00:00
Michał Kępień
913c0b833c Set up release notes for BIND 9.16.31 2022-06-03 11:05:47 +02:00
Michał Kępień
531323877c Update BIND version to 9.16.31-dev 2022-06-03 11:05:47 +02:00
Tinderbox User
61fdb40fb2 Merge branch 'prep-release' into v9_16_30-release 2022-06-02 19:34:02 +00:00
Tinderbox User
0842c032fd prep 9.16.30 2022-06-02 19:30:41 +00:00
Michał Kępień
609dde6e69 Merge branch 'michal/prepare-documentation-for-bind-9.16.30' into 'v9_16_30-release'
Prepare documentation for BIND 9.16.30

See merge request isc-private/bind9!408
2022-06-02 19:17:47 +00:00
Michał Kępień
e012953aea Add release note for GL #3327 2022-06-02 20:57:12 +02:00
Michał Kępień
35aaf41516 Reorder release notes 2022-06-02 20:57:12 +02:00
Michał Kępień
ee8b00bdf2 Tweak and reword release notes 2022-06-02 20:57:12 +02:00
Michał Kępień
501ac73a7c Prepare release notes for BIND 9.16.30 2022-06-02 20:57:12 +02:00
Petr Špaček
6fcc7bfe80 Merge branch 'pspacek/rtd-style-changes-v9_16' into 'v9_16'
ReadTheDocs style changes [v9_16]

See merge request isc-projects/bind9!6387
2022-06-02 15:30:26 +00:00
Petr Špaček
cc1599e454 ARM style change: render literals in black color
After enormous amount of bikesheding about colors we decided to override
ReadTheDocs default style for literals (``literal`` in the RST markup).

Justification:
- The default RTD "light red literal on white background" is hard to
  read.  https://webaim.org/resources/contrastchecker/ reports that text
  colored as rgb(231, 76, 60) on white background has insufficient
  contrast.
- The ARM has enormous amount of literals all over the place and thus
  one sentence can contain several black/red/black color changes. This
  is distracting. As a consequence, the ARM looks like a Geronimo
  Stilton book.

What we experimented with as replacements for red:
- Green - way too distracting
- Blue - too similar to "usual clickable link"
- Violet - too Geronimo Stilton style
- Brown - better but still distracting

After all the bikesheding we settled on black, i.e. the same as all
"normal" text. I.e. the color is now the same and literals are denoted
by monospaced font and a box around the literal. This has best contrast
and is way less distracting than it used to be.

This lead to a new problem: Internal references to "term definitions"
defined using directives like .. option:: were rendered almost the same
as literals:
- References: monospaced + box + bold + clickable
- Literals: monospaced + box To distinguish these two we added black
  dotted underline to clickable references.

I hereby declare the bikeshed painted.

(cherry picked from commit 833af31e7b)
2022-06-02 17:24:41 +02:00
Petr Špaček
dafacea24c Allow wrapping for ARM table content
RTD style default never wraps <th> and <td> elements and that just does
not work for real sentences or any other long lines.

We can reconsider styling some tables separately, but at the moment we
do not have use for tables with long but unwrappable lines so it's
easier to allow wrapping globally.

(cherry picked from commit a5dd98ac1b)
2022-06-02 17:24:39 +02:00
Arаm Sаrgsyаn
9fa26af659 Merge branch 'aram/catz-processing-skip-warnings-for-some-rrset-types-v9_16' into 'v9_16'
[v9_16] Don't process DNSSEC-related and ZONEMD records in catz

See merge request isc-projects/bind9!6384
2022-06-02 11:11:42 +00:00
Aram Sargsyan
a0121f4908 Add CHANGES and release note for [GL #3380]
(cherry picked from commit b8073cbe72)
2022-06-02 10:34:05 +00:00
Aram Sargsyan
1dc7288708 Don't process DNSSEC-related and ZONEMD records in catz
When processing a catalog zone update, skip processing records with
DNSSEC-related and ZONEMD types, because we are not interested in them
in the context of a catalog zone, and processing them will fail and
produce an unnecessary warning message.

(cherry picked from commit 73d6643137)
2022-06-02 10:33:03 +00:00
Mark Andrews
d34cc48045 Merge branch '3388-missing-indent-call-v9_16' into 'v9_16'
Add missing INDENT call for UPDATE messages [v9_16]

See merge request isc-projects/bind9!6381
2022-06-01 22:52:53 +00:00
Mark Andrews
b318db2b7f Add missing INDENT call for UPDATE messages
Reported by Peter <pmc@citylink.dinoex.sub.org> on bind-users.

(cherry picked from commit 03132c93ca)
2022-06-02 08:29:28 +10:00
Arаm Sаrgsyаn
73a3a1ad36 Merge branch 'aram/update-top-level-gitignore-add-ide-files-v9_16' into 'v9_16'
[v9_16] Update top-level .gitignore to ignore files generated by some IDEs

See merge request isc-projects/bind9!6376
2022-06-01 11:26:43 +00:00
Aram Sargsyan
46d6039e58 Update top-level .gitignore to ignore files generated by some IDEs
(cherry picked from commit ec3bc4142b)
2022-06-01 10:45:44 +00:00
Mark Andrews
219efa9d6f Merge branch '3345-fix-keyless-example-generation-v9_16' into 'v9_16'
Make modifications to keyless.example deterministic

See merge request isc-projects/bind9!6371
2022-06-01 01:03:53 +00:00
Mark Andrews
3183de20c3 Make modifications to keyless.example deterministic
The perl modifation code for keyless.example was not deterministic
(/NXT/ matched part of signature) resulting in different error
strings being returned.  Replaced /NXT/ with /A RRSIG NSEC/ and
updated expected error string,

(cherry picked from commit 69d5e22e58)
2022-06-01 10:42:55 +10:00
Mark Andrews
5c629e8a45 Merge branch '3368-trampoline-c-fatal-error-uv-h-file-not-found-on-bsd-when-json-c-is-disabled' into 'v9_16'
Resolve "trampoline.c: fatal error: 'uv.h' file not found on BSD when JSON-C is disabled"

See merge request isc-projects/bind9!6364
2022-05-31 12:42:25 +00:00
Mark Andrews
3292a54fed Add LIBUV_CFLAGS to CLINCLUDE in lib/isc/Makefile.in 2022-05-31 16:43:48 +10:00
Ondřej Surý
b9f035b8eb Merge branch 'ondrej-use-locked-queue-v9_16' into 'v9_16'
Replace netievent lock-free queue with simple locked queue [v9.16]

See merge request isc-projects/bind9!6357
2022-05-25 15:56:35 +00:00
Ondřej Surý
1c94d0ee6c Add CHANGES note for [GL #3180]
(cherry picked from commit d75b953489)
2022-05-25 16:01:58 +02:00
Ondřej Surý
32a3970b13 Replace netievent lock-free queue with simple locked queue
The current implementation of isc_queue uses Michael-Scott lock-free
queue that in turn uses hazard pointers.  It was discovered that the way
we use the isc_queue, such complicated mechanism isn't really needed,
because most of the time, we either execute the work directly when on
nmthread (in case of UDP) or schedule the work from the matching
nmthreads.

Replace the current implementation of the isc_queue with a simple locked
ISC_LIST.  There's a slight improvement - since copying the whole list
is very lightweight - we move the queue into a new list before we start
the processing and locking just for moving the queue and not for every
single item on the list.

NOTE: There's a room for future improvements - since we don't guarantee
the order in which the netievents are processed, we could have two lists
- one unlocked that would be used when scheduling the work from the
matching thread and one locked that would be used from non-matching
thread.

(cherry picked from commit 6bd025942c)
2022-05-25 16:01:58 +02:00
Ondřej Surý
5bed841c1c Merge branch '2801-unittest-isc-netmgr-s390x-v9_16' into 'v9_16'
Fix failures in isc netmgr_test on big endian machines

See merge request isc-projects/bind9!6354
2022-05-24 18:29:07 +00:00
Petr Menšík
1feb389f80 Fix failures in isc netmgr_test on big endian machines
Typing from libuv structure to isc_region_t is not possible, because
their sizes differ on 64 bit architectures. Little endian machines seems
to be lucky and still result in test passed. But big endian machine such
as s390x fails the test reliably.

Fix by directly creating the buffer as isc_region_t and skipping the
type conversion. More readable and still more correct.

(cherry picked from commit 057438cb45)
2022-05-24 20:23:04 +02:00
Matthijs Mekking
66ecde5b27 Merge branch '3354-cid-352776-missing_lock-v9_16' into 'v9_16'
[v9_16] Fix CID 352776: Concurrent data access violations

See merge request isc-projects/bind9!6345
2022-05-23 12:18:49 +00:00
Matthijs Mekking
d3147417c5 Require valid key for dst_key functions
Make sure that the key structure is valid when calling the following
functions:
- dst_key_setexternal
- dst_key_isexternal
- dst_key_setmodified
- dst_key_ismodified

This commit is adapted because 9.16 has a different approach
of deconsting the variable.

(cherry picked from commit 888ec4e0d4)
2022-05-23 12:31:23 +02:00
Matthijs Mekking
7c42c04f3f Fix CID 352776: Concurrent data access violations
*** CID 352776:  Concurrent data access violations  (MISSING_LOCK)
/lib/dns/dst_api.c: 474 in dst_key_setmodified()
468     dst_key_isexternal(dst_key_t *key) {
469		return (key->external);
470     }
471
472     void
473     dst_key_setmodified(dst_key_t *key, bool value) {
>>>     CID 352776:  Concurrent data access violations  (MISSING_LOCK)
>>>     Accessing "key->modified" without holding lock
>>>	"dst_key.mdlock". Elsewhere, "dst_key.modified" is accessed with
>>>	"dst_key.mdlock" held 8 out of 11 times (8 of these accesses
>>>	strongly imply that it is necessary).
474		key->modified = value;
475     }
476
477     bool
478     dst_key_ismodified(dst_key_t *key) {
479		return (key->modified);

(cherry picked from commit 1fa24d0afb)
2022-05-23 12:03:56 +02:00
Ondřej Surý
56adb30e23 Merge branch '3344-threadsanitizer-data-race-in-isc__nm_tcpdns_send-v9_16' into 'v9_16'
Move setting the sock->write_timeout to the async_*send [v9.16]

See merge request isc-projects/bind9!6342
2022-05-19 20:53:01 +00:00
Ondřej Surý
ed4eda5ebc Move setting the sock->write_timeout to the async_*send
Setting the sock->write_timeout from the TCP, TCPDNS, and TLSDNS send
functions could lead to (harmless) data race when setting the value for
the first time when the isc_nm_send() function would be called from
thread not-matching the socket we are sending to.  Move the setting the
sock->write_timeout to the matching async function which is always
called from the matching thread.

(cherry picked from commit 61117840c1)
2022-05-19 22:38:47 +02:00
Ondřej Surý
598c93f2b2 Merge branch '3371-check-for-__attribute__-fallthrough-support-is-sometimes-incorrect-v9_16' into 'v9_16'
Use C2x [[fallthrough]] when supported by LLVM/clang [v9.16]

See merge request isc-projects/bind9!6340
2022-05-19 20:35:26 +00:00
Ondřej Surý
4657b0f0c4 Use C2x [[fallthrough]] when supported by LLVM/clang
Clang added support for the gcc-style fallthrough
attribute (i.e. __attribute__((fallthrough))) in version 10.  However,
__has_attribute(fallthrough) will return 1 in C mode in older versions,
even though they only support the C++11 fallthrough attribute. At best,
the unsupported attribute is simply ignored; at worst, it causes errors.

The C2x fallthrough attribute has the advantages of being supported in
the broadest range of clang versions (added in version 9) and being easy
to check for support. Use C2x [[fallthrough]] attribute if possible, and
fall back to not using an attribute for clang versions that don't have
it.

Courtesy of Joshua Root

(cherry picked from commit 14c8d43863)
2022-05-19 22:02:07 +02:00
Michal Nowak
db5f8ebb6f Merge tag 'v9_16_29' into v9_16
BIND 9.16.29
2022-05-19 13:14:59 +02:00
Evan Hunt
17fd11edaf Merge branch '3350-rndc-dnssec-checkds-doc-v9_16' into 'v9_16'
specify time format in the documentation for 'rdnc dnssec -checkds'

See merge request isc-projects/bind9!6332
2022-05-18 22:49:56 +00:00
Evan Hunt
9aa68d0dd7 specify time format in the documentation for 'rdnc dnssec -checkds'
also clarified the writing in the surrounding paragraph.

(cherry picked from commit 83f9466d61)
2022-05-18 15:37:13 -07:00
Ondřej Surý
38b3d37475 Merge branch '3366-configure-fails-to-find-uv-h-on-bsd-v9_16' into 'v9_16'
Use libuv CFLAGS and LIBS when checking for features [v9.16]

See merge request isc-projects/bind9!6330
2022-05-18 19:55:03 +00:00
Ondřej Surý
b9e5b319db Use libuv CFLAGS and LIBS when checking for features
When autoconf was checking for libuv features, the LIBUV_CFLAGS was not
added to CFLAGS and LIBUV_LIBS to LIBS which resulted in false
negatives.

Use AX_SAVE_FLAGS and AX_RESTORE_FLAGS to temporarily add LIBUV_CFLAGS
and LIBUV_LIBS to their respective variables.

(cherry picked from commit f063ee276e)
2022-05-18 21:18:51 +02:00
Michal Nowak
3b6afee83b Merge branch 'mnowak/fix-typo-in-ednscompliance-test-v9_16' into 'v9_16'
[v9_16] Fix typo in ednscompliance test

See merge request isc-projects/bind9!6328
2022-05-18 17:30:20 +00:00
Michal Nowak
70c41c60b5 Fix typo in ednscompliance test
Caused by ba0313e649, an incomplete fix of
spelling errors.

(cherry picked from commit 9de2c06a21)
2022-05-18 19:19:48 +02:00
Mark Andrews
7204082bb6 Merge branch '3356-wrong-path-for-geoip-directory-v9_16' into 'v9_16'
Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])

See merge request isc-projects/bind9!6319
2022-05-17 20:02:12 +00:00
Mark Andrews
ea54e39cdb Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])
(cherry picked from commit 686d691fa9)
2022-05-18 05:38:46 +10:00
Matthijs Mekking
5b8d120d59 Merge branch '3352-kasp-test-broken-on-freebsd-v9_16' into 'v9_16'
[v9_16] Fix "kasp test broken on freebsd"

See merge request isc-projects/bind9!6313
2022-05-17 03:01:45 +00:00
Matthijs Mekking
f922dd3e70 Replace stat with PERL stat in kasp system test
7249bad7 introduced the -c option to stat(1) command, but BSD systems
do not know about it. Replace the stat(1) command with a PERL script
that achieves the same.

Why PERL? For consistency purposes, there are more places in the
system test where we use the same method.

(cherry picked from commit fe601c5915)
2022-05-16 18:53:17 +02:00
Matthijs Mekking
6eb3feb07f Merge branch '3302-keymgr-updates-key-files-each-run-v9_16' into 'v9_16'
[v9_16] Fix "keymgr updates key files each run"

See merge request isc-projects/bind9!6301
2022-05-16 16:51:42 +00:00
Matthijs Mekking
296cb390b6 Add new functions to lib/dns/win32/libdns.def.in
Missing from lib/dns/win32/libdns.def.in:
dst_key_setmodified
dst_key_ismodified
2022-05-16 18:31:55 +02:00
Matthijs Mekking
e8bcf3de5b Add changes and release notes for #3302
Add a comment to make danger happy.

(cherry picked from commit 0f89f0b134)
2022-05-16 10:35:50 +02:00
Matthijs Mekking
c2e8c72298 Check if key metadata is modified before writing
Add a new parameter to the dst_key structure, mark a key modified if
dst_key_(un)set[bool,num,state,time] is called. Only write out key
files during a keymgr run if the metadata has changed.

(cherry picked from commit 1da91b3ab4)
2022-05-16 10:35:33 +02:00
Matthijs Mekking
6226ab2fa9 Add kasp test for #3302
Add a test case that triggers a keymgr run that will not trigger any
metadata changes. Ensure that the last status change of the key files
is unmodified.

(cherry picked from commit 7249bad706)
2022-05-16 10:35:33 +02:00
Evan Hunt
62a5f5b81d Merge branch '3353-dyndb-failure' into 'v9_16'
dont run isc__trampoline_initialize() in dlopen library

See merge request isc-projects/bind9!6309
2022-05-15 19:54:47 +00:00
Evan Hunt
adeddfa8ff dont run isc__trampoline_initialize() in dlopen library
when built without libtool, the sample driver in the dyndb
system test runs library intializers that have already been
run, causing the value for isc__trampoline_min to be reset.
wrap the trampoline initialize and shutdown routines under
isc_once_do() to ensure that they are only run once.
2022-05-15 00:25:32 -07:00
Evan Hunt
7a1ae6255a Merge branch '3327-fetches-per-server-quota-v9_16' into 'v9_16'
fix the fetches-per-server quota calculation

See merge request isc-projects/bind9!6308
2022-05-14 08:28:12 +00:00
Evan Hunt
cd0e13f876 Add CHANGES note for [GL #3327]
(cherry picked from commit 3f478a3bed)
2022-05-14 00:58:29 -07:00
Evan Hunt
6edbe8452c Add lower bound checks to fetchlimit test
Check that the recursing client count is above a reasonable
minimum, as well as below a maximum, so that we can detect
bugs that cause recursion to fail too early or too often.

(cherry picked from commit 8834c44683)
2022-05-14 00:58:29 -07:00
Evan Hunt
82c197d93b Cleanup: always count ns_statscounter_recursclients
The ns_statscounter_recursclients counter was previously only
incremented or decremented if client->recursionquota was non-NULL.
This was harmless, because that value should always be non-NULL if
recursion is enabled, but it made the code slightly confusing.

(cherry picked from commit 0201eab655)
2022-05-14 00:58:26 -07:00
Evan Hunt
9582d05683 Disable EDNS for the fetchlimit test server
The fetchlimit test depends on a resolver continuing to try UDP
and timing out while the client waits for resolution to succeed.
but since commit bb990030 (flag day 2020), a fetch will always
switch to TCP after two timeouts, unless EDNS was disabled for
the query.

This commit adds "edns no;" to server statements in the fetchlimit
resolver, to restore the behavior expected by the test.

(cherry picked from commit 81deb24deb)
2022-05-14 00:52:22 -07:00
Evan Hunt
8516efa4fd Fix the fetches-per-server quota calculation
Since commit bad5a523c2, when the fetches-per-server quota
was increased or decreased, instead of the value being set to
the newly calculated quota, it was set to the *minimum* of
the new quota or 1 - which effectively meant it was always set to 1.
it should instead have been the maximum, to prevent the value from
ever dropping to zero.

(cherry picked from commit 694bc50273)
2022-05-14 00:52:22 -07:00
Evan Hunt
77418a1117 Merge branch '3351-checkconf-overflow-v9_16' into 'v9_16'
prevent a possible buffer overflow in configuration check

See merge request isc-projects/bind9!6305
2022-05-14 04:21:08 +00:00
Evan Hunt
b6670787d2 prevent a possible buffer overflow in configuration check
corrected code that could have allowed a buffer overfow while
parsing named.conf.

(cherry picked from commit 921043b541)
2022-05-13 20:30:41 -07:00
Ondřej Surý
45fbcb2f94 Merge branch 'ondrej-fix-trampoline-locking-v9_16' into 'v9_16'
Lock the trampoline when attaching [v9.16]

See merge request isc-projects/bind9!6299
2022-05-13 12:06:23 +00:00
Ondřej Surý
be7f672fcc Lock the trampoline when attaching
When attaching to the trampoline, the isc__trampoline_max was access
unlocked.  This would not manifest under normal circumstances because we
initialize 65 trampolines by default and that's enough for most
commodity hardware, but there are ARM machines with 128+ cores where
this would be reported by ThreadSanitizer.

Add locking around the code in isc__trampoline_attach().  This also
requires the lock to leak on exit (along with memory that we already)
because a new thread might be attaching to the trampoline while we are
running the library destructor at the same time.

(cherry picked from commit 933162ae14)
2022-05-13 13:42:23 +02:00
Matthijs Mekking
b2ae8ba5f8 Merge branch '3335-confusing-parental-source-documentation-v9_16' into 'v9_16'
[v9_16] Remove confusing parental-source line

See merge request isc-projects/bind9!6287
2022-05-11 15:02:32 +00:00
Matthijs Mekking
24913fc696 Remove confusing parental-source line
Remove the line "This address must appear in the secondary server’s
parental-agents zone clause". This line is a copy paste error from
notify-source.

Rewrap.

(cherry picked from commit 313f606692)
2022-05-11 15:01:35 +00:00
Michał Kępień
31abf01e04 Merge branch 'michal/drop-post-merge-pipelines-v9_16' into 'v9_16'
[v9_16] Drop post-merge pipelines

See merge request isc-projects/bind9!6294
2022-05-11 13:08:00 +00:00
Michał Kępień
fc028b873d Drop post-merge pipelines
Commit 24961f6068 introduced the concept
of post-merge pipelines.  These were used to build documentation after
each merge to any of the maintained branches, to allow up-to-date
documentation to be subsequently published on the bind.isc.org
microsite.  As the latter no longer downloads documentation from GitLab,
instead linking to Read the Docs for all currently maintained branches,
post-merge pipelines have become redundant since running the
"autoreconf" and "docs" jobs after each merge is not necessary any more.
Drop the "release_branch_triggering_rules" YAML anchor and revert to
default triggering rules for the "autoconf" and "docs" jobs, effectively
preventing pipelines from being created after each merge to any of the
maintained branches.

(cherry picked from commit 7b8c9e04fc)
2022-05-11 15:06:09 +02:00
Michał Kępień
925b15024d Merge branch '565-do-not-trigger-gitlab-pages-pipelines-any-more-v9_16' into 'v9_16'
Do not trigger GitLab Pages pipelines any more

See merge request isc-projects/bind9!6291
2022-05-11 12:22:44 +00:00
Michał Kępień
8ddb6cb12c Do not trigger GitLab Pages pipelines any more
The bind.isc.org microsite no longer downloads documentation from
GitLab, instead linking to Read the Docs for all currently maintained
branches.  This makes it redundant to trigger GitLab Pages pipelines
after each merge to any of the maintained branches.  Revert changes
introduced by commit 31bde118db: remove
the "push:docs" job along with the "push" stage it is associated with
and revert artifact expiry time for the "docs" job to the default value.

(cherry picked from commit a7fccaee82)
2022-05-11 14:14:11 +02:00
Petr Špaček
fb220e3652 Merge branch 'pspacek/arm-remove-solaris251-v9_16' into 'v9_16'
Remove ARM notes about Solaris 2.5.1 [v9_16]

See merge request isc-projects/bind9!6289
2022-05-11 10:54:24 +00:00
Petr Špaček
0366ff94ee Remove ARM notes about Solaris 2.5.1
It was released in May 1996 and hopefully is not used to run BIND
anymore.

(cherry picked from commit 4388656f60)
2022-05-11 12:54:01 +02:00
Michal Nowak
ed266b41cb Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.16.30' into 'v9_16'
Set up version and release notes for BIND 9.16.30

See merge request isc-projects/bind9!6283
2022-05-11 09:13:53 +00:00
Michal Nowak
9b7487b2f2 Set up release notes for BIND 9.16.30 2022-05-11 11:04:21 +02:00
Michal Nowak
68fe5ac27f Update BIND version to 9.16.30-dev 2022-05-11 11:03:35 +02:00
Tinderbox User
7e23e43e14 Merge branch 'prep-release' into v9_16_29-release 2022-05-10 09:02:21 +00:00
Tinderbox User
6c8e83b8fe prep 9.16.29 2022-05-10 08:55:26 +00:00
Michal Nowak
25dbd5c2ec Merge branch 'mnowak/prepare-documentation-for-bind-9.16.29' into 'v9_16_29-release'
Prepare documentation for BIND 9.16.29

See merge request isc-private/bind9!404
2022-05-09 22:19:16 +00:00
Michal Nowak
85d1c24a90 Tweak and reword release notes 2022-05-10 00:03:20 +02:00
Michal Nowak
e4f535334e Prepare release notes for BIND 9.16.29 2022-05-06 17:06:36 +02:00
Mark Andrews
3f4478f59a Merge branch '3232-rpz-rpz-nsip-rules-seem-not-to-understand-stub-and-static-stub-zones-and-don-t-handle-v9_16' into 'v9_16'
Add test cases using static and static-stub zones

See merge request isc-projects/bind9!6263
2022-05-04 14:16:44 +00:00
Mark Andrews
d408b7055c Add CHANGES entry for [GL #3232]
(cherry picked from commit 63f420c89a)
2022-05-04 23:53:57 +10:00
Mark Andrews
36612dadff Allow DNS_RPZ_POLICY_ERROR to be converted to a string
(cherry picked from commit f498d2db0d)
2022-05-04 23:53:21 +10:00
Mark Andrews
8f23d56fba Check the cache as well when glue NS are returned processing RPZ
(cherry picked from commit 8fb72012e3)
2022-05-04 23:53:21 +10:00
Mark Andrews
8c2ede6edc Process learned records as well as glue
(cherry picked from commit 07c828531c)
2022-05-04 23:53:21 +10:00
Mark Andrews
13129872eb Process the delegating NS RRset when checking rpz rules
(cherry picked from commit cf97c61f48)
2022-05-04 23:53:21 +10:00
Mark Andrews
967e5e09cd Add test cases using static and static-stub zones
RPZ NSIP and NSDNAME checks were failing with "unrecognized NS
rpz_rrset_find() failed: glue" when static or static-stub zones
where used to resolve the query name.

Add tests using stub and static-stub zones that are expected to
be filtered and not-filtered against NSIP and NSDNAME rules.

stub and static-stub queries are expected to be filtered

stub-nomatch and static-stub-nomatch queries are expected to be passed

(cherry picked from commit 30cb70c826)
2022-05-04 23:53:21 +10:00
Ondřej Surý
5d4e19ae05 Merge branch 'ondrej-add-missing-void-in-named_config_default-v9_16' into 'v9_16'
Add missing void in named_config_getdefault() definition [v9.16]

See merge request isc-projects/bind9!6261
2022-05-04 11:05:53 +00:00
Ondřej Surý
7a8e6d67a5 Add missing void in named_config_getdefault() definition
The named_config_getdefault() was missing void in the function
definition.  This broke clang-15 that didn't match the declaration that
had the void in the argument with the definition that hadn't.
2022-05-04 13:03:51 +02:00
Mark Andrews
c76a6349eb Merge branch '3266-rndc-system-test-fails-due-to-rate-limit-of-built-in-_bind-view-v9_16' into 'v9_16'
Improve forensics for the querylog section of rndc system test

See merge request isc-projects/bind9!6246
2022-05-02 19:54:44 +00:00
Mark Andrews
8ae4fda54a Improve forensics for the querylog section of rndc system test
The dig commands appear to be failing unexpectedly on some platforms
when rate limiting kicks in and the response is dropped.  Correct
behaviour should be for dig to retry the query.  Set +qr and capture
stdout and stderr of each of the dig commands involved.

(cherry picked from commit 614cf5a030)
2022-05-03 00:19:37 +10:00
Mark Andrews
3ad550f17a Merge branch '3307-socket-c-5111-setsockopt-20-ipv6_v6only-failed-invalid-argument-on-openbsd' into 'v9_16'
Resolve "socket.c:5111: setsockopt(20, IPV6_V6ONLY) failed: Invalid argument on OpenBSD"

See merge request isc-projects/bind9!6208
2022-05-02 04:27:49 +00:00
Mark Andrews
2a9ab8a732 Don't try to set IPV6_V6ONLY on OpenBSD
OpenBSD IPv6 sockets are always IPv6-only, so the socket option is read-only (not modifiable)
2022-05-02 14:09:31 +10:00
Matthijs Mekking
fe23b6e020 Merge branch 'matthijs-kasp-system-test-failure-v9_16' into 'v9_16'
[v9_16] Fix kasp system test failures

See merge request isc-projects/bind9!6237
2022-04-29 12:26:05 +00:00
Matthijs Mekking
22f3c453f0 Fix a kasp system test bug
In '_check_apex_dnskey' we check for each key (KEY1 to KEY4) if they
are present in the DNSKEY RRset if they should be.

However, we only grep the dig output for the first seven fields (owner,
ttl, class, type, flags, protocol, algorithm). This can be the same
for different keys.

For example, KEY1 may be KSK predecessor and KEY2 a KSK successor,
both DNSKEY records for these keys are the same up to the public key
field. This can cause test failures if KEY1 needs to be present, but
KEY2 not, because when grepping for KEY2 we will falsely detect the
key to be present (because the grep matches KEY1).

Fix the function by grepping looking for the first seven fields in the
corresponding key file and retrieve the public key part. Grep for this
in the dig output.

(cherry picked from commit 3e1d09ac66)
2022-04-29 13:59:49 +02:00
Matthijs Mekking
3625cf1f63 Minor fixes in kasp system test
Fix two typos and two grep calls.

(cherry picked from commit 2b34b326fc)
2022-04-29 13:59:41 +02:00
Petr Špaček
a62a672ce0 Merge branch 'feature/main/default-config-print-v9_16' into 'v9_16'
Export built-in default configuration for named binary [v9_16]

See merge request isc-projects/bind9!6235
2022-04-29 10:40:57 +00:00
Petr Menšík
c1127e3550 Export built-in default configuration for named binary
It might be useful to display built-in configuration with all its
values. It should make it easier to test what default values has changed
in a new release.

Related: #1326
(cherry picked from commit cf722d18b3)
2022-04-29 12:26:46 +02:00
Arаm Sаrgsyаn
fa9db55d59 Merge branch '3278-dig-+nssearch-hang-v9_16' into 'v9_16'
Resolve "dig +nssearch sometimes hangs in BIND v9.16, with an assertion failure after "ctrl+c"

See merge request isc-projects/bind9!6125
2022-04-29 10:00:34 +00:00
Aram Sargsyan
ab4ec2278e Add CHANGES note for [GL #3278] 2022-04-29 09:10:44 +00:00
Aram Sargsyan
1f2d2611ee Fix dig +nssearch race between recv_done() and send_done()
The `send_done()` callback needs to access query's `link.next` pointer
when running in `+nssearch` mode, even if the query is already canceled
or serviced, which can happen when `recv_done()` happens to be called
earlier than `send_done()`.

Keep the next query's pointer before unlinking the query from the
lookup's queries list in `clear_query()` so that `send_done()` can
use it even if the query is cleared.
2022-04-29 09:09:39 +00:00
Aram Sargsyan
e3b058bbcd Print more lookup and query pointers in dighost.c debug messages
Printing the pointers makes it clear, for example, for which query
exactly a recv_done() or send_done() callback was called, which
helps investigating and debugging issues easier.
2022-04-29 09:09:39 +00:00
Arаm Sаrgsyаn
6aac98bfa0 Merge branch '3313-dlz_ldap_driver.c-fix-fallthrough-v9_16' into 'v9_16'
Add missing FALLTHROUGH macros in a switch statement

See merge request isc-projects/bind9!6222
2022-04-29 07:48:23 +00:00
Aram Sargsyan
930cfe7d0f Add missing FALLTHROUGH macros in a switch statement
dzl_ldap_driver.c was missing some FALLTHROUGH macros in a switch
statement resulting in compiler warnings and a failed build when
configured with `--with-dlz-ldap` option.
2022-04-29 07:13:53 +00:00
Mark Andrews
44b8eea09e Merge branch 'bug/main/new-zones-dir-null-v9_16' into 'v9_16'
Don't test new-zones-directory argument validity

See merge request isc-projects/bind9!6231
2022-04-29 02:08:11 +00:00
Petr Menšík
c1b3862c4a Additional safety check for negative array index
inet_ntop result should always protect against empty string accepted
without an error. Make additional check to satisfy coverity scans.

(cherry picked from commit 656a0f076f)
2022-04-29 11:46:33 +10:00
Petr Menšík
1e88c0196c Initialize printed buffer
- var_decl: Declaring variable "tbuf" without initializer
- assign: Assigning: "target.base" = "tbuf", which points to
  uninitialized data
- assign: Assigning: "r.base" = "target.base", which points to
  uninitialized data

I expect it would correctly initialize length always. Add simple
initialization to silent coverity.

(cherry picked from commit 59132bd3ec)
2022-04-29 11:46:33 +10:00
Petr Menšík
1bc7552203 Ensure diff variable is not read uninitialized
Coverity detected issues:
- var_decl: Declaring variable "diff" without initializer.
- uninit_use_in_call: Using uninitialized value "diff.tuples.head" when
  calling "dns_diff_clear".

(cherry picked from commit 67e773c93c)
2022-04-29 11:46:33 +10:00
Petr Menšík
cde36497ba Don't test new-zones-directory argument validity
Parser ensures new-zones-directory has qstring parameter before it can
reach this place. dir == NULL then should never happen on any
configuration. Replace silent check with insist.

(cherry picked from commit 0a7d04367a)
2022-04-29 11:46:33 +10:00
Mark Andrews
a49ff2241f Merge branch '3306-undefined-macros-in-contrib-dlz-modules-wildcard-dlz_wildcard_dynamic-c-v9_16' into 'v9_16'
Define local instances of FALLTHROUGH and UNREACHABLE

See merge request isc-projects/bind9!6229
2022-04-29 01:16:30 +00:00
Mark Andrews
5e697b4f3c Add CHANGES note for [GL #3306]
(cherry picked from commit c57363fb7d)
2022-04-29 10:54:31 +10:00
Mark Andrews
13f8e879ab Define local instances of FALLTHROUGH and UNREACHABLE
FALLTHOUGH is a copy of how it is defined in <isc/util.h>

UNREACHABLE follows the model used in MacOS /usr/include/c++/v1/cstdlib
to determine if __builtin_ureachable is available

(cherry picked from commit 6d68a22954)
2022-04-29 10:53:54 +10:00
Mark Andrews
73a256f332 Merge branch '2813-build-named-with-dlz-is-broken-on-9-16-take-2' into 'v9_16'
Resolve "Build named with DLZ is broken on 9.16"

See merge request isc-projects/bind9!6227
2022-04-28 22:52:21 +00:00
Mark Andrews
4334674d93 Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB
It was discovered that MariaDB 10 didn't define LIBMARIADB leading
to compilation errors of MySQL DLZ modules on Debian stretch.

Use MARIADB_BASE_VERSION instead which is defined in all tested MariaDB
versions.
2022-04-29 07:13:57 +10:00
Ondřej Surý
9a2b1cf399 Merge branch '2813-build-named-with-dlz-is-broken-with-MariaDB-10-v9_16' into 'v9_16'
Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB [v9.16]

See merge request isc-projects/bind9!6226
2022-04-28 16:07:13 +00:00
Ondřej Surý
04c6d853c7 Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB
It was discovered that MariaDB 10 didn't define LIBMARIADB leading
to compilation errors of MySQL DLZ modules on Debian stretch.

Use MARIADB_BASE_VERSION instead which is defined in all tested MariaDB
versions.

(cherry picked from commit 5835aae694)
2022-04-28 18:05:24 +02:00
Mark Andrews
7351da4f24 Merge branch 'bug/v9_16/python3.11' into 'v9_16'
Move ignore case indication to flags passed to re

See merge request isc-projects/bind9!6157
2022-04-28 06:24:07 +00:00
Mark Andrews
236d39f20e Add CHANGES note for [GL !6157] 2022-04-28 16:05:03 +10:00
Petr Menšík
0ceba5a75a Remove universal newline mode when opening the file
It is default when open is called and obsolete. Removed in python 3.11,
where it triggers errors. Just use normal read-only text opening.
2022-04-28 05:38:42 +00:00
Petr Menšík
b98658a99a Move ignore case indication to flags passed to re
Recent python does not make parsetab.py successfully, because some token
regexp is starting with ?i flag. Remove that flag from regex and pass it
as extra flags parameter instead.
2022-04-28 05:38:42 +00:00
Petr Špaček
6800f552f2 Merge branch 'pspacek/pin-sphinx-packages-for-rtd-v9_16' into 'v9_16'
Pin Sphinx related package versions to match ReadTheDocs and our CI [v9_16]

See merge request isc-projects/bind9!6193
2022-04-27 12:36:26 +00:00
Petr Špaček
cf44faf6ae Pin Sphinx related package versions to match ReadTheDocs and our CI
This seems to be most appropriate way to ensure consistency between
release tarballs and public presentation on ReadTheDocs.

Previous attempt with removing docutils constraint, which relied on pip
depedency solver to pick the same packages as in CI was flawed. RTD
installs a bit different set of packages so it was inherently
unreliable.

As a result RTD pulled in sphinx-rtd-theme==0.4.3 while CI
had 1.0.0, and this inconsistency caused Table of Contents in Release
Notes to render incorrectly. Previous solution was to downgrade
docutils to < 0.17, but I think we should rather pin exact versions.

For the long history of messing with versions read also
isc-projects/bind9@2a8eda0084
isc-projects/images@d4435b97be
isc-projects/bind9@6a2daddf5b

(cherry picked from commit 6088ba3837)
2022-04-27 14:35:52 +02:00
Petr Špaček
fafa477c91 Merge branch 'pspacek/rtd-requirements-update-v9_16' into 'v9_16'
Fix mismatch between docutils version in CI and ReadTheDocs [v9_16]

See merge request isc-projects/bind9!6186
2022-04-26 13:49:59 +00:00
Petr Špaček
a5c06c0080 Fix mismatch between docutils version in CI and ReadTheDocs
Currently our CI images we use to build docs (which subsequently get
into release tarballs) are using docutils 0.17.1, which is latest version
which fulfills Sphinx 4.5.0 requirement for docutils < 0.18.

The old requirement for docutils < 0.17 was causing discrepancy between
the way we build release artifacts and the docs on ReadTheDocs.org which
uses doc/arm/requirements.txt from our repo.

Remove the limit for RDT with hope that it will pull latest permissible
version of docutils.

For the long history of messing with docutils version read also
isc-projects/images@d4435b97be
isc-projects/bind9@6a2daddf5b

(cherry picked from commit 2a8eda0084)
2022-04-26 15:48:46 +02:00
Ondřej Surý
a7f3951579 Merge branch 'ondrej-enforce-minimal-libuv-version-v9_16' into 'v9_16'
Abort when libuv at runtime mismatches libuv at compile time [v9.16]

See merge request isc-projects/bind9!6178
2022-04-26 10:21:26 +00:00
Ondřej Surý
4f30b16d96 Abort when libuv at runtime mismatches libuv at compile time
When we compile with libuv that has some capabilities via flags passed
to f.e. uv_udp_listen() or uv_udp_bind(), the call with such flags would
fail with invalid arguments when older libuv version is linked at the
runtime that doesn't understand the flag that was available at the
compile time.

Enforce minimal libuv version when flags have been available at the
compile time, but are not available at the runtime.  This check is less
strict than enforcing the runtime libuv version to be same or higher
than compile time libuv version.
2022-04-26 11:52:02 +02:00
Petr Špaček
64fb24a354 Merge branch '3294-support-ancient-sphinx' into 'v9_16'
Support Sphinx 1.6.7 again

See merge request isc-projects/bind9!6168
2022-04-26 09:34:28 +00:00
Petr Špaček
02f5e9c505 Support Sphinx 1.6.7 again
Older versions do not have "override" parameter in add_role_to_domain()
function signature. Luckily the override is _not_ required when
overidding the built-in standard domain roles for the first time, so we
just drop the paramter.

Tested with Sphinx 1.6.7 (does not have override) and Sphinx 4.5.0
(does have override).

Fixes: #3294
Related: !6086
2022-04-25 13:31:55 +02:00
Michał Kępień
2368359fe2 Merge branch '3297-use-setuptools-instead-of-distutils-if-possible' into 'v9_16'
Use setuptools instead of distutils if possible

See merge request isc-projects/bind9!6152
2022-04-22 10:38:12 +00:00
Michał Kępień
1f4667061f Use setuptools instead of distutils if possible
According to PEP 632 [1], the distutils module is considered deprecated
in Python 3.10 and will be removed in Python 3.12.  Setup scripts
using it should be migrated to the setuptools module, which contains
drop-in replacements for distutils functions [2].  The catch is that the
setuptools module is not part of the Python Standard Library.

While this problem could be addressed by adding a hard dependency on
setuptools, it only affects BIND 9.16, which is an Extended Support
Version.  To avoid unnecessary disruptions, try importing setup() from
the setuptools module and fall back to using distutils if that fails.
Add a PyLint suppression for this specific "deprecated-module" warning.

Since the setuptools module is not part of the Python Standard Library
and therefore it is not guaranteed that it is universally available in
every Python installation, update Python-related checks in configure.ac
to ensure Python module installation does not silently fail.

[1] https://peps.python.org/pep-0632/
[2] https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
2022-04-22 12:36:57 +02:00
Michał Kępień
eedf1df1f6 Merge branch '3287-prevent-memory-bloat-caused-by-a-jemalloc-quirk-v9_16' into 'v9_16'
[v9_16] Prevent memory bloat caused by a jemalloc quirk

See merge request isc-projects/bind9!6154
2022-04-21 12:45:48 +00:00
Michał Kępień
eb9a0c1fdd Add CHANGES entry for GL #3287
(cherry picked from commit e33aef4e39)
2022-04-21 14:23:59 +02:00
Michał Kępień
e850946557 Prevent memory bloat caused by a jemalloc quirk
Since version 5.0.0, decay-based purging is the only available dirty
page cleanup mechanism in jemalloc.  It relies on so-called tickers,
which are simple data structures used for ensuring that certain actions
are taken "once every N times".  Ticker data (state) is stored in a
thread-specific data structure called tsd in jemalloc parlance.  Ticks
are triggered when extents are allocated and deallocated.  Once every
1000 ticks, jemalloc attempts to release some of the dirty pages hanging
around (if any).  This allows memory use to be kept in check over time.

This dirty page cleanup mechanism has a quirk.  If the first
allocator-related action for a given thread is a free(), a
minimally-initialized tsd is set up which does not include ticker data.
When that thread subsequently calls *alloc(), the tsd transitions to its
nominal state, but due to a certain flag being set during minimal tsd
initialization, ticker data remains unallocated.  This prevents
decay-based dirty page purging from working, effectively enabling memory
exhaustion over time. [1]

The quirk described above has been addressed (by moving ticker state to
a different structure) in jemalloc's development branch [2], but not in
any numbered jemalloc version released to date (the latest one being
5.2.1 as of this writing).

Work around the problem by ensuring that every thread spawned by
isc_thread_create() starts with a malloc() call.  Avoid immediately
calling free() for the dummy allocation to prevent an optimizing
compiler from stripping away the malloc() + free() pair altogether.

An alternative implementation of this workaround was considered that
used a pair of isc_mem_create() + isc_mem_destroy() calls instead of
malloc() + free(), enabling the change to be fully contained within
isc__trampoline_run() (i.e. to not touch struct isc__trampoline), as the
compiler is not allowed to strip away arbitrary function calls.
However, that solution was eventually dismissed as it triggered
ThreadSanitizer reports when tools like dig, nsupdate, or rndc exited
abruptly without waiting for all worker threads to finish their work.

[1] https://github.com/jemalloc/jemalloc/issues/2251
[2] c259323ab3

(cherry picked from commit 7aa7b6474b)
2022-04-21 14:23:59 +02:00
Michał Kępień
d17d794722 Merge tag 'v9_16_28' into v9_16
BIND 9.16.28
2022-04-21 09:47:04 +02:00
Mark Andrews
61f86bb7b0 Merge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called-rdataset-v9_16' into 'v9_16'
Check that pending negative cache entries for DS can be used successfully

See merge request isc-projects/bind9!6136
2022-04-19 00:07:39 +00:00
Mark Andrews
18c479f4d5 Add CHANGES entry for [GL #3279]
(cherry picked from commit 14ca6270d3)
2022-04-19 09:45:48 +10:00
Mark Andrews
cb3c29cf8e Update the rdataset->trust field in ncache.c:rdataset_settrust
Both the trust recorded in the slab stucture and the trust on
rdataset need to be updated.

(cherry picked from commit d043a41499)
2022-04-19 09:45:16 +10:00
Mark Andrews
b5f2ab9cd4 Check that pending negative cache entries for DS can be used successfully
Prime the cache with a negative cache DS entry then make a query for
name beneath that entry. This will cause the DS entry to be retieved
as part of the validation process.  Each RRset in the ncache entry
will be validated and the trust level for each will be updated.

(cherry picked from commit d2d9910da2)
2022-04-19 09:45:16 +10:00
Matthijs Mekking
d44585fd94 Merge branch '2931-cds-delete-removed-on-signing-v9_16' into 'v9_16'
[v9_16] Don't delete CDS DELETE after zone sign

See merge request isc-projects/bind9!6127
2022-04-13 15:19:54 +00:00
Matthijs Mekking
24f9902753 Add CDS/CDNSKEY DELETE documentation
Mention in the DNSSEC guide in the "revert to unsigned" recipe that you
can publish CDS and CDNSKEY DELETE records to remove the corresponding
DS records from the parent zone.

(cherry picked from commit f088657eb1)
2022-04-13 15:13:49 +02:00
Matthijs Mekking
facf1c80a1 Add CHANGE and release note for #2931
Release note worthy.

(cherry picked from commit ebbcf4c34f)
2022-04-13 15:13:47 +02:00
Matthijs Mekking
42f43cebdd Update dns_dnssec_syncdelete() function
Update the function that synchronizes the CDS and CDNSKEY DELETE
records. It now allows for the possibility that the CDS DELETE record
is published and the CDNSKEY DELETE record is not, and vice versa.

Also update the code in zone.c how 'dns_dnssec_syncdelete()' is called.

With KASP, we still maintain the DELETE records our self. Otherwise,
we publish the CDS and CDNSKEY DELETE record only if they are added
to the zone. We do still check if these records can be signed by a KSK.

This change will allow users to add a CDS and/or CDNSKEY DELETE record
manually, without BIND removing them on the next zone sign.

Note that this commit removes the check whether the key is a KSK, this
check is redundant because this check is also made in
'dst_key_is_signing()' when the role is set to DST_BOOL_KSK.

(cherry picked from commit 3d05c99abb)
2022-04-13 15:13:12 +02:00
Matthijs Mekking
e5a5b23f41 Test CDS DELETE persists after zone sign
Add a test case for a dynamically added CDS DELETE record and make
sure it is not removed when signing the zone. This happens because
BIND maintains CDS and CDNSKEY publishing and it will only allow
CDS DELETE records if the zone is transitioning to insecure. This is
a state that can be identified when using KASP through 'dnssec-policy',
but not when using 'auto-dnssec'.

(cherry picked from commit f08277f9fb)
2022-04-13 15:13:03 +02:00
Michał Kępień
493ddc15f3 Merge branch 'michal/set-up-release-notes-for-bind-9.16.29' into 'v9_16'
Set up release notes for BIND 9.16.29

See merge request isc-projects/bind9!6120
2022-04-12 12:17:18 +00:00
Michał Kępień
0fb4b6520e Set up release notes for BIND 9.16.29 2022-04-12 14:15:41 +02:00
Michał Kępień
5c4dafe354 Merge branch 'michal/update-bind-version-to-9.16.29-dev' into 'v9_16'
Update BIND version to 9.16.29-dev

See merge request isc-projects/bind9!6116
2022-04-12 11:16:00 +00:00
Michał Kępień
5e4b940c9c Update BIND version to 9.16.29-dev 2022-04-12 13:15:31 +02:00
Tinderbox User
7aea13ff14 Merge branch 'prep-release' into v9_16_28-release 2022-04-11 15:28:12 +00:00
Tinderbox User
f7cbac4c36 prep 9.16.28 2022-04-11 15:21:43 +00:00
Michał Kępień
37a672467a Merge branch 'michal/prepare-documentation-for-bind-9.16.28' into 'v9_16_28-release'
Prepare documentation for BIND 9.16.28

See merge request isc-private/bind9!398
2022-04-11 15:15:04 +00:00
Michał Kępień
6810a0c055 Prepare release notes for BIND 9.16.28 2022-04-11 17:05:07 +02:00
Michał Kępień
d559c8ac0c Reorder release notes 2022-04-11 17:05:07 +02:00
Michał Kępień
ab0923a9ce Tweak and reword release notes 2022-04-11 17:05:07 +02:00
Michał Kępień
1c35cb1aa0 Merge branch 'michal/fix-forward-system-test-requirements-v9_16' into 'v9_16'
[v9_16] Fix "forward" system test requirements

See merge request isc-projects/bind9!6112
2022-04-11 13:33:16 +00:00
Michał Kępień
55f2457526 Fix "forward" system test requirements
Commit 59d1eb3ff8 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update the bin/tests/system/forward/prereq.sh
script to ensure Python is present in the test environment before the
"forward" system test is run.  Update bin/tests/system/forward/prereq.sh
to enforce that requirement.
2022-04-11 14:40:20 +02:00
Petr Špaček
7ee090be53 Merge branch '2950-cache-acceptance-rules-test-v9_16' into 'v9_16'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios [v9_16]

See merge request isc-projects/bind9!6106
2022-04-08 08:13:15 +00:00
Mark Andrews
59d1eb3ff8 Add tests for forwarder cache poisoning scenarios
- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).

(cherry picked from commit bf3fffff67)
2022-04-08 10:12:24 +02:00
Michal Nowak
cc0954631d Merge branch '3112-test-lingering-tcp-sockets-in-closewait-v9_16' into 'v9_16'
[v9_16] Add system test lingering CLOSE_WAIT TCP sockets

See merge request isc-projects/bind9!6104
2022-04-08 08:03:14 +00:00
Ondřej Surý
260e0ceaf5 Add system test **/named.* modifier files to .reuse/dep5
There's couple of files that modify behaviour of named when started via
bin/tests/system/start.pl.  Add those files as CC-1.0 to .reuse/dep5 as
they are just empty placeholders.

(cherry picked from commit b6eb31a0e3)
2022-04-08 09:36:08 +02:00
Matthijs Mekking
a8313a6c3c Add system test lingering CLOSE_WAIT TCP sockets
Add a test case to check for lingering TCP sockets stuck in the
CLOSE_WAIT state. This can happen if a client sends some garbage after
its first query.

The system test runs the reproducer script and then sends another TCP
query to the resolver. The resolver is configured to allow one TCP
client only. If BIND has its TCP socket stuck in CLOSE_WAIT, it does
not have the resources available to answer the second query.

Note: A better test would be to check if the named daemon does not
have a TCP socket stuck in CLOSE_WAIT for example with netstat. When
running this test locally you can examine named with netstat manually.
But since netstat is platform specific it is not a good candidate to do
this as a system test.

If you, if you could return, don't let it burn.
Do you have to let it linger?
- Cranberries

(cherry picked from commit b9ebde705b)
2022-04-08 09:36:08 +02:00
Petr Špaček
237d88fe22 Allow py.test system test to skip itself
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.

(cherry picked from commit b8829c801f)

In addition to b8829c801f,
"R:$systest:SKIPPED" is not being printed when pytests are skipped
because that leads to two `R:` lines - SKIPPED and PASS/FAIL which is
determined later based on other conditions (core files identified,
assertion failures, shell test result, ...) - which is wrong and
testsummary.sh rightfully stumbles on it:

    I:Found 106 test results, but 105 tests were run
2022-04-08 09:20:55 +02:00
Petr Špaček
7cffcce36f Merge branch 'pspacek/manpage-hyperlinks-v9_16' into 'v9_16'
Backport helpers for hyperlinks in manual pages [v9_16]

See merge request isc-projects/bind9!6086
2022-04-07 14:14:07 +00:00
Petr Špaček
148f6f20e7 Ignore :option: references in rst files to to simplify doc backports
Override Sphinx built-in :option: to act and render as `` literal.
This avoids problems with undefined :option:`target`s when merging
doc backports.
2022-04-07 15:46:55 +02:00
Petr Špaček
c9a512247d Introduce new Sphinx role iscman for ISC manual pages
The new directive and role "iscman" allow to tag & reference man pages in
our source tree. Essentially it is just namespacing for ISC man pages,
but it comes with couple benefits.

Differences from .. _man_program label we formerly used:
- Does not expand :ref:`man_program` into full text of the page header.
- Generates index entry with category "manual page".
- Rendering style is closer to ubiquitous to the one produced
  by ``named`` syntax.

Differences from Sphinx built-in :manpage: role:
- Supports all builders with support for cross-references.
- Generates internal links (unlike :manpage: which generates external
  URLs).
- Checks that target exists withing our source tree.

(cherry-picked from commit 7e7a946d44)
2022-04-07 15:46:52 +02:00
Michał Kępień
ecc6ec0754 Merge branch '3208-add-CHANGES-entry-v9_16' into 'v9_16'
[v9_16] Add CHANGES entry for GL #3208

See merge request isc-projects/bind9!6101
2022-04-07 13:08:10 +00:00
Michał Kępień
197e8989c9 Add CHANGES entry for GL #3208
(cherry picked from commit 059a602551)
2022-04-07 15:04:51 +02:00
Ondřej Surý
47eaecf69f Merge branch '3249-rename-configuration-option-to-reuseport-v9_16' into 'v9_16'
Rename the configuration option to load balance sockets to reuseport [v9.16]

See merge request isc-projects/bind9!6095
2022-04-06 16:07:52 +00:00
Ondřej Surý
a7f893e836 Rename the configuration option to load balance sockets to reuseport
After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

(cherry picked from commit 7e71c4d0cc)
2022-04-06 17:51:12 +02:00
Ondřej Surý
f943504b03 Merge branch '3190-offload-rpz-updates-revert-v9_16' into 'v9_16'
Revert "Run the RPZ update as offloaded work" [v9.16]

See merge request isc-projects/bind9!6092
2022-04-06 11:43:57 +00:00
Ondřej Surý
daa7d6d6db Revert "General cleanup of dns_rpz implementation"
This reverts commit 84e62cece5.
2022-04-06 10:41:49 +02:00
Ondřej Surý
f5fbe2c26f Revert "Refactor the dns_rpz_add/delete to use local rpz copy"
This reverts commit 635147d01a.
2022-04-06 10:41:39 +02:00
Ondřej Surý
b68ccdc48e Revert "Run the RPZ update as offloaded work"
This reverts commit 73a0bb8588.
2022-04-06 10:31:23 +02:00
Ondřej Surý
be936a10b0 Revert "Add CHANGES and release note for [GL #3190]"
This reverts commit 639e0600f0.
2022-04-06 10:31:21 +02:00
Ondřej Surý
d346d188ae Merge branch '3249-fix-windows-sockets-v9_16' into 'v9_16'
Fix the Windows code paths modified for load balanced sockets

See merge request isc-projects/bind9!6083
2022-04-05 14:35:22 +00:00
Ondřej Surý
d836f23f79 Fix the Windows paths modified for load balanced sockets
When backporting the load balanced sockets to BIND 9.16, the Windows
specific paths were missed.  Add the #if(n)def _WIN32 back into the
appropriate places.
2022-04-05 11:53:18 +02:00
Ondřej Surý
93d61ae5d2 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix-v9_16' into 'v9_16'
Enable the load-balance-sockets configuration [v9.16]

See merge request isc-projects/bind9!6079
2022-04-05 00:35:17 +00:00
Ondřej Surý
5f27873d01 Rename shutdown() to test_shutdown() in timer_test.c
The shutdown() is part of standard library (POSIX-1), don't use such
name in the timer_test.c, but rather rename it to test_shutdown().
2022-04-05 02:17:47 +02:00
Ondřej Surý
9159837315 Enable the load-balance-sockets configuration
Previously, HAVE_SO_REUSEPORT_LB has been defined only in the private
netmgr-int.h header file, making the configuration of load balanced
sockets inoperable.

Move the missing HAVE_SO_REUSEPORT_LB define the isc/netmgr.h and add
missing isc_nm_getloadbalancesockets() implementation.

(cherry picked from commit 142c63dda8)
2022-04-05 02:17:47 +02:00
Ondřej Surý
8f16a25522 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-v9_16' into 'v9_16'
Add option to configure load balance sockets [v9.16]

See merge request isc-projects/bind9!6075
2022-04-04 23:52:46 +00:00
Ondřej Surý
4026c3559b Add CHANGES and release note for [GL #3249]
(cherry picked from commit 855f49cfba)
2022-04-05 01:21:50 +02:00
Ondřej Surý
8993ebc01a Add option to configure load balance sockets
Previously, the option to enable kernel load balancing of the sockets
was always enabled when supported by the operating system (SO_REUSEPORT
on Linux and SO_REUSEPORT_LB on FreeBSD).

It was reported that in scenarios where the networking threads are also
responsible for processing long-running tasks (like RPZ processing, CATZ
processing or large zone transfers), this could lead to intermitten
brownouts for some clients, because the thread assigned by the operating
system might be busy.  In such scenarious, the overall performance would
be better served by threads competing over the sockets because the idle
threads can pick up the incoming traffic.

Add new configuration option (`load-balance-sockets`) to allow enabling
or disabling the load balancing of the sockets.

(cherry picked from commit 85c6e797aa)
2022-04-05 01:21:50 +02:00
Ondřej Surý
cd9dd70594 Merge branch '3190-offload-rpz-updates-v9_16' into 'v9_16'
Run the RPZ update as offloaded work [v9.16]

See merge request isc-projects/bind9!6074
2022-04-04 22:53:55 +00:00
Ondřej Surý
639e0600f0 Add CHANGES and release note for [GL #3190]
(cherry picked from commit 23a4559b34)
(cherry picked from commit f3ae14d8c3)
2022-04-05 00:30:39 +02:00
Ondřej Surý
73a0bb8588 Run the RPZ update as offloaded work
Previously, the RPZ updates ran quantized on the main nm_worker loops.
As the quantum was set to 1024, this might lead to service
interruptions when large RPZ update was processed.

Change the RPZ update process to run as the offloaded work.  The update
and cleanup loops were refactored to do as little locking of the
maintenance lock as possible for the shortest periods of time and the db
iterator is being paused for every iteration, so we don't hold the rbtdb
tree lock for prolonged periods of time.

(cherry picked from commit f106d0ed2b)
(cherry picked from commit e128b6a951)
2022-04-05 00:30:39 +02:00
Ondřej Surý
635147d01a Refactor the dns_rpz_add/delete to use local rpz copy
Previously dns_rpz_add() were passed dns_rpz_zones_t and index to .zones
array.  Because we actually attach to dns_rpz_zone_t, we should be using
the local pointer instead of passing the index and "finding" the
dns_rpz_zone_t again.

Additionally, dns_rpz_add() and dns_rpz_delete() were used only inside
rpz.c, so make them static.

(cherry picked from commit b6e885c97f)
(cherry picked from commit f4cba0784e)
2022-04-05 00:30:39 +02:00
Ondřej Surý
84e62cece5 General cleanup of dns_rpz implementation
Do a general cleanup of lib/dns/rpz.c style:

 * Removed deprecated and unused functions
 * Unified dns_rpz_zone_t naming to rpz
 * Unified dns_rpz_zones_t naming to rpzs
 * Add and use rpz_attach() and rpz_attach_rpzs() functions
 * Shuffled variables to be more local (cppcheck cleanup)

(cherry picked from commit 840179a247)
(cherry picked from commit bfee462403)
2022-04-05 00:02:35 +02:00
Tony Finch
ae34c574bb Merge branch 'fanf/macos-ifconfig-v9_16' into 'v9_16'
MacOS needs more IP addresses to run the system tests (backport to 9.16)

See merge request isc-projects/bind9!6070
2022-04-04 14:29:21 +00:00
Tony Finch
3f4a63332a MacOS needs more IP addresses to run the system tests
The launchd script only counted up to 8 whereas ifconfig.sh went all
the way up to 10, and even a bit further than that.

(cherry picked from commit 29a3e77425)
2022-04-04 15:08:45 +01:00
Mark Andrews
e9ff292be3 Merge branch '3191-issue-45178-in-oss-fuzz-bind9-dns_master_load_fuzzer-integer-overflow-in-generate-v9_16' into 'v9_16'
Prevent arithmetic overflow of 'i' in master.c:generate

See merge request isc-projects/bind9!6056
2022-04-01 22:24:11 +00:00
Evan Hunt
975a3da84e add a system test for $GENERATE with an integer overflow
the line "$GENERATE 19-28/2147483645 $ CNAME x" should generate
a single CNAME with the owner "19.example.com", but prior to the
overflow bug it generated several CNAMEs, half of them with large
negative values.

we now test for the bugfix by using "named-checkzone -D" and
grepping for a single CNAME in the output.

(cherry picked from commit bd814b79d4)
2022-04-01 21:47:24 +11:00
Evan Hunt
fc7ed00d70 update shell syntax
clean up the shell syntax in the checkzone test prior to adding
a new test.

(cherry picked from commit 2261c853b5)
2022-04-01 21:46:33 +11:00
Mark Andrews
f06c446ae8 Add test case for issue-45178
(cherry picked from commit 9039aad0f8)
2022-04-01 21:42:53 +11:00
Mark Andrews
c284112bec Prevent arithmetic overflow of 'i' in master.c:generate
the value of 'i' in generate could overflow when adding 'step' to
it in the 'for' loop.  Use an unsigned int for 'i' which will give
an additional bit and prevent the overflow.  The inputs are both
less than 2^31 and and the result will be less than 2^32-1.

(cherry picked from commit 5abdee9004)
2022-04-01 21:42:53 +11:00
Tony Finch
6cb79ead4c Merge branch '3209-notauth-subdomain-v9_16' into 'v9_16'
Log "not authoritative for update zone" more clearly (v9.16)

See merge request isc-projects/bind9!6048
2022-03-30 13:24:49 +00:00
Tony Finch
a5d65815bc Log "not authoritative for update zone" more clearly
Ensure the update zone name is mentioned in the NOTAUTH error message
in the server log, so that it is easier to track down problematic
update clients. There are two cases: either the update zone is
unrelated to any of the server's zones (previously no zone was
mentioned); or the update zone is a subdomain of one or more of the
server's zones (previously the name of the irrelevant parent zone was
misleadingly logged).

Closes #3209

(cherry picked from commit 84c4eb02e7)
2022-03-30 13:24:56 +01:00
Ondřej Surý
78971e9a57 Merge branch 'ondrej/cleanup-unreachable-calls-v9_16' into 'v9_16'
Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()

See merge request isc-projects/bind9!6044
2022-03-28 22:16:38 +00:00
Ondřej Surý
79b7804ce8 Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()
In couple places, we have missed INSIST(0) or ISC_UNREACHABLE()
replacement on some branches with UNREACHABLE().  Replace all
ISC_UNREACHABLE() or INSIST(0) calls with UNREACHABLE().
2022-03-28 23:28:05 +02:00
Ondřej Surý
3512e4985a Merge branch 'ondrej/dont-use-__builtin_unreachable-on-win32-v9_16' into 'v9_16'
Add win32 __builtin_unreachable() shim

See merge request isc-projects/bind9!6039
2022-03-28 21:22:23 +00:00
Ondřej Surý
4d1d91d709 Add win32 __builtin_unreachable() shim
The backport of using modern compiler features broken Windows debug
build because there's no __builtin_unreachable() in MSVC.

Define __builtin_unreachable() shim on MSVC using __assume(0).
2022-03-28 12:57:42 +02:00
Ondřej Surý
626c17af72 Merge branch '3210-dns64-errors-v9_16' into 'v9_16'
More explicit dns64 prefix errors [v9.16]

See merge request isc-projects/bind9!6031
2022-03-25 15:48:20 +00:00
Tony Finch
b000f5a7c1 Add CHANGES note for [GL #3210]
(cherry picked from commit 132f30b623)
2022-03-25 16:09:34 +01:00
Tony Finch
aaa923845d More explicit dns64 prefix errors
Quote the dns64 prefix in error messages that complain about
problems with it, to avoid confusion with the following ACLs.

Closes #3210

(cherry picked from commit 496c02d32a)
2022-03-25 16:09:12 +01:00
Ondřej Surý
dcf562b2cf Merge branch 'ondrej/statements-following-return-break-continue-or-goto-will-never-be-executed-v9_16' into 'v9_16'
Remove UNREACHABLE() statements after exit() [v9.16]

See merge request isc-projects/bind9!6029
2022-03-25 09:20:24 +00:00
Ondřej Surý
81614b4304 Merge branch 'ondrej/use-newer-compiler-features-v9_16' into 'v9_16'
Use modern C and modern compiler features [v9.16]

See merge request isc-projects/bind9!6026
2022-03-25 09:08:58 +00:00
Ondřej Surý
888dcc6aab Remove UNREACHABLE() statements after exit()
Couple of UNREACHABLE() statements following exit() were found and
removed.

(cherry picked from commit 81fdc4a822)
2022-03-25 10:08:39 +01:00
Ondřej Surý
8b1d60933c Remove workaround for ancient clang versions (<< 3.2 and << 4.0.1)
Some ancient versions of clang reported uninitialized memory use false
positive (see https://bugs.llvm.org/show_bug.cgi?id=14461).  Since clang
4.0.1 has been long obsoleted, just remove the workarounds.

(cherry picked from commit ae508c17bc)
2022-03-25 09:37:22 +01:00
Ondřej Surý
b624be2544 Remove use of the inline keyword used as suggestion to compiler
Historically, the inline keyword was a strong suggestion to the compiler
that it should inline the function marked inline.  As compilers became
better at optimising, this functionality has receded, and using inline
as a suggestion to inline a function is obsolete.  The compiler will
happily ignore it and inline something else entirely if it finds that's
a better optimisation.

Therefore, remove all the occurences of the inline keyword with static
functions inside single compilation unit and leave the decision whether
to inline a function or not entirely on the compiler

NOTE: We keep the usage the inline keyword when the purpose is to change
the linkage behaviour.

(cherry picked from commit 20f0936cf2)
2022-03-25 09:37:18 +01:00
Ondřej Surý
75f9dd8e82 Simplify way we tag unreachable code with only ISC_UNREACHABLE()
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.

(cherry picked from commit 584f0d7a7e)
2022-03-25 09:33:51 +01:00
Ondřej Surý
673e53f81d Add FALLTHROUGH macro for __attribute__((fallthrough))
Gcc 7+ and Clang 10+ have implemented __attribute__((fallthrough)) which
is explicit version of the /* FALLTHROUGH */ comment we are currently
using.

Add and apply FALLTHROUGH macro that uses the attribute if available,
but does nothing on older compilers.

In one case (lib/dns/zone.c), using the macro revealed that we were
using the /* FALLTHROUGH */ comment in wrong place, remove that comment.

(cherry picked from commit fe7ce629f4)
2022-03-25 09:30:16 +01:00
Ondřej Surý
374fe8c70e Merge branch 'ondrej-save-tsan-files-with-txt-extension-v9_16' into 'v9_16'
Save parsed tsan files with .txt extension [v9.16]

See merge request isc-projects/bind9!6021
2022-03-25 07:20:02 +00:00
Ondřej Surý
f2a5ba0250 Save parsed tsan files with .txt extension
When the parse tsan files have text extension they can be viewed
directly in the GitLab web UI without downloading them locally.

(cherry picked from commit 80582073a5)
2022-03-23 20:31:50 +01:00
Ondřej Surý
ae9b9ca0a1 Merge branch '3201-no-vla-v9_16' into 'v9_16'
Remove a redundant variable-length array

See merge request isc-projects/bind9!6005
2022-03-18 18:12:51 +00:00
Tony Finch
afb5f59a6f Remove a redundant variable-length array
In the GSS-TSIG verification code there was an alarming
variable-length array whose size came off the network, from the
signature in the request. It turned out to be safe, because the caller
had previously checked that the signature had a reasonable size.
However, the safety checks are in the generic TSIG implementation, and
the risky VLA usage was in the GSS-specific code, and they are
separated by the DST indirection layer, so it wasn't immediately
obvious that the risky VLA was in fact safe.

In fact this risky VLA was completely unnecessary, because the GSS
signature can be verified in place without being copied to the stack,
like the message covered by the signature. The `REGION_TO_GBUFFER()`
macro backwardly assigns the region in its left argument to the GSS
buffer in its right argument; this is just a pointer and length
conversion, without copying any data. The `gss_verify_mic()` call uses
both message and signature GSS buffers in a read-only manner.
2022-03-18 17:21:57 +00:00
Ondřej Surý
865808939b Merge branch 'ondrej/remove-ATOMIC_VAR_INIT-v9_16' into 'v9_16'
Remove usage of deprecated ATOMIC_VAR_INIT() macro

See merge request isc-projects/bind9!5951
2022-03-17 21:43:13 +00:00
Ondřej Surý
2c86bd4ed9 Remove debugging implementation of stdatomic using mutexes
Upcoming LLVM/Clang 15 has marked the ATOMIC_VAR_INIT() as deprecated
breaking the build.  In the previous commit, we have removed the use of
ATOMIC_VAR_INIT(), but as that was a prerequisite to using the
--enable-mutexatomic debugging mode, we have to remove the debugging
mode.
2022-03-17 21:44:04 +01:00
Ondřej Surý
25732d818d Remove usage of deprecated ATOMIC_VAR_INIT() macro
The C17 standard deprecated ATOMIC_VAR_INIT() macro (see [1]).  Follow
the suite and remove the ATOMIC_VAR_INIT() usage in favor of simple
assignment of the value as this is what all supported stdatomic.h
implementations do anyway:

  * MacOSX.plaform: #define ATOMIC_VAR_INIT(__v) {__v}
  * Gcc stdatomic.h: #define ATOMIC_VAR_INIT(VALUE)	(VALUE)

1. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1138r0.pdf

(cherry picked from commit f251d69eba)
2022-03-17 21:44:04 +01:00
Ondřej Surý
87cd661638 Merge branch '3208-fix-xfrout-maxtimer-timer-log-message-log-level-v9_16' into 'v9_16'
Change xfer-out timer message log level to DEBUG(1)

See merge request isc-projects/bind9!5997
2022-03-17 20:41:20 +00:00
Ondřej Surý
821be88002 Change xfer-out timer message log level to DEBUG(1)
When max-transfer-*-out timeouts were reintroduced, the log message
about starting the timer was errorneously left as ISC_LOG_ERROR.
Change the log level of said message to ISC_LOG_DEBUG(1).

(cherry picked from commit 8f6e4dfa15)
2022-03-17 21:39:20 +01:00
Ondřej Surý
dfb2e611de Merge branch 'ondrej/add-missing-braces-clang-format-15-v9_16' into 'v9_16'
Add couple missing braces around single-line statements [v9.16]

See merge request isc-projects/bind9!5970
2022-03-17 19:45:06 +00:00
Ondřej Surý
be47b2e5e4 Add couple missing braces around single-line statements
The clang-format-15 has new option InsertBraces that could add missing
branches around single line statements.  Use that to our advantage
without switching to not-yet-released LLVM version to add missing braces
in couple of places.
2022-03-17 18:31:36 +01:00
Ondřej Surý
f81b183c78 Merge branch '3200-add-per-send-timer-v9_16' into 'v9_16'
Change single write timer to per-send timers [v9.16]

See merge request isc-projects/bind9!5962
2022-03-17 16:25:04 +00:00
Ondřej Surý
96e01d40bf Add CHANGES and release note for [GL #3200]
(cherry picked from commit 8ace9e0c62)
2022-03-17 16:07:52 +01:00
Ondřej Surý
7a386256b6 On shutdown, reset the established TCP connections
Previously, the established TCP connections (both client and server)
would be gracefully closed waiting for the write timeout.

Don't wait for TCP connections to gracefully shutdown, but directly
reset them for faster shutdown.

(cherry picked from commit 6ddac2d56d)
2022-03-17 16:07:52 +01:00
Ondřej Surý
d17d043499 Change single write timer to per-send timers
Previously, there was a single per-socket write timer that would get
restarted for every new write.  This turned out to be insufficient
because the other side could keep reseting the timer, and never reading
back the responses.

Change the single write timer to per-send timer which would in turn
reset the TCP connection on the first send timeout.

(cherry picked from commit a761aa59e3)
2022-03-17 16:07:52 +01:00
Michał Kępień
25382f1d2d Merge branch 'v9_16_27-release' into 'v9_16'
Merge 9.16.27 release branch

See merge request isc-projects/bind9!5991
2022-03-16 23:26:55 +00:00
Michał Kępień
e82ffa9b03 Set up release notes for BIND 9.16.28 2022-03-17 00:19:11 +01:00
Tinderbox User
0eab4dd1ae Merge branch 'prep-release' into security-v9_16 2022-03-17 00:19:11 +01:00
Michał Kępień
b6c6c70e33 Merge branch 'michal/prepare-documentation-for-bind-9.16.27' into 'security-v9_16'
Prepare documentation for BIND 9.16.27

See merge request isc-private/bind9!393
2022-03-17 00:19:11 +01:00
Tinderbox User
05e2e8c98b prep 9.16.27 2022-03-17 00:19:11 +01:00
Michał Kępień
6066c45496 Merge branch '3112-ensure-correct-ordering-in-isc__nm_process_sock_buffer-v9_16' into 'security-v9_16'
[CVE-2022-0396] [v9_16] Resolve #3112 TCP sockets stuck in CLOSE_WAIT

See merge request isc-private/bind9!376
2022-03-17 00:19:11 +01:00
Michał Kępień
3849ad19fb Prepare release notes for BIND 9.16.27 2022-03-17 00:19:11 +01:00
Michał Kępień
f1bc36f193 Merge branch '2950-confidential-cache-acceptance-rules-v9_16' into 'security-v9_16'
[CVE-2021-25220] [v9_16] prevent cache poisoning from forwarder responses

See merge request isc-private/bind9!380
2022-03-17 00:19:11 +01:00
Ondřej Surý
e0565c3362 Add CHANGES and release note for [GL #3112] 2022-03-17 00:19:11 +01:00
Michał Kępień
768fdcd38b Reorder release notes 2022-03-17 00:19:11 +01:00
Petr Špaček
6939b9f47d Add Release Note for [GL #2950] 2022-03-17 00:19:11 +01:00
Ondřej Surý
afee2b5a7b Run .closehandle_cb asynchrounosly in nmhandle_detach_cb()
When sock->closehandle_cb is set, we need to run nmhandle_detach_cb()
asynchronously to ensure correct order of multiple packets processing in
the isc__nm_process_sock_buffer().  When not run asynchronously, it
would cause:

  a) out-of-order processing of the return codes from processbuffer();

  b) stack growth because the next TCP DNS message read callback will
     be called from within the current TCP DNS message read callback.

The sock->closehandle_cb is set to isc__nm_resume_processing() for TCP
sockets which calls isc__nm_process_sock_buffer().  If the read callback
(called from isc__nm_process_sock_buffer()->processbuffer()) doesn't
attach to the nmhandle (f.e. because it wants to drop the processing or
we send the response directly via uv_try_write()), the
isc__nm_resume_processing() (via .closehandle_cb) would call
isc__nm_process_sock_buffer() recursively.

The below shortened code path shows how the stack can grow:

 1: ns__client_request(handle, ...);
 2: isc_nm_tcpdns_sequential(handle);
 3: ns_query_start(client, handle);
 4:   query_lookup(qctx);
 5:     query_send(qctcx->client);
 6:       isc__nmhandle_detach(&client->reqhandle);
 7:         nmhandle_detach_cb(&handle);
 8:           sock->closehandle_cb(sock); // isc__nm_resume_processing
 9:             isc__nm_process_sock_buffer(sock);
10:               processbuffer(sock); // isc__nm_tcpdns_processbuffer
11:                 isc_nmhandle_attach(req->handle, &handle);
12:                 isc__nm_readcb(sock, req, ISC_R_SUCCESS);
13:                   isc__nm_async_readcb(NULL, ...);
14:                     uvreq->cb.recv(...); // ns__client_request

Instead, if 'sock->closehandle_cb' is set, we need to run detach the
handle asynchroniously in 'isc__nmhandle_detach', so that on line 8 in
the code flow above does not start this recursion. This ensures the
correct order when processing multiple packets in the function
'isc__nm_process_sock_buffer()' and prevents the stack growth.

When not run asynchronously, the out-of-order processing leaves the
first TCP socket open until all requests on the stream have been
processed.

If the pipelining is disabled on the TCP via `keep-response-order`
configuration option, named would keep the first socket in lingering
CLOSE_WAIT state when the client sends an incomplete packet and then
closes the connection from the client side.
2022-03-17 00:19:11 +01:00
Michał Kępień
0470bce329 Tweak and reword release notes 2022-03-17 00:19:11 +01:00
Petr Špaček
da84b6ea4f Add CHANGES note for [GL #2950] 2022-03-17 00:19:11 +01:00
Michał Kępień
b622db776c Fix typo in CHANGES 2022-03-17 00:19:11 +01:00
Mark Andrews
71b2421054 Look for zones deeper than the current domain or forward name
When caching glue, we need to ensure that there is no closer
source of truth for the name. If the owner name for the glue
record would be answered by a locally configured zone, do not
cache.
2022-03-17 00:19:11 +01:00
Mark Andrews
ea06552a3d Check cached names for possible "forward only" clause
When caching additional and glue data *not* from a forwarder, we must
check that there is no "forward only" clause covering the owner name
that would take precedence.  Such names would normally be allowed by
baliwick rules, but a "forward only" zone introduces a new baliwick
scope.
2022-03-17 00:19:11 +01:00
Mark Andrews
3fc7accd88 Check that the forward declaration is unchanged and not overridden
If we are using a fowarder, in addition to checking that names to
be cached are subdomains of the forwarded namespace, we must also
check that there are no subsidiary forwarded namespaces which would
take precedence. To be safe, we don't cache any responses if the
forwarding configuration has changed since the query was sent.
2022-03-17 00:19:11 +01:00
Mark Andrews
24155213be Add additional name checks when using a forwarder
When using a forwarder, check that the owner name of response
records are within the bailiwick of the forwarded name space.
2022-03-17 00:19:11 +01:00
Michał Kępień
d20a04aea8 Merge branch 'michal/tidy-setup-of-python-based-tests-v9_16' into 'v9_16'
[v9_16] Tidy setup of Python-based tests

See merge request isc-projects/bind9!5974
2022-03-14 11:44:10 +00:00
Michał Kępień
eaed6c74d8 Fix broken dnspython version checks
The dns.query Python module has the send_tcp() method defined in both
dnspython 1.x and 2.x, so checking for the existence of that method to
determine the dnspython version available in the test environment does
not make any sense.  Fix by checking the dns.version.MAJOR integer
instead.
2022-03-14 09:19:03 +01:00
Michał Kępień
e41c0a6b6c Rework skipping long tests
The ability to conveniently mark tests which should only be run when the
CI_ENABLE_ALL_TESTS environment variable is set seems to be useful on a
general level and therefore it should not be limited to the "timeouts"
system test, where it is currently used.

pytest documentation [1] suggests to reuse commonly used test markers by
putting them all in a single Python module which then has to be imported
by test files that want to use the markers defined therein.  Follow that
advice by creating a new bin/tests/system/pytest_custom_markers.py
Python module containing the relevant marker definitions.

Note that "import pytest_custom_markers" works from a test-specific
subdirectory because pytest modifies sys.path so that it contains the
paths to all parent directories containing a conftest.py file (and
bin/tests/system/ is one).  PyLint does not like that, though, so add a
relevant PyLint suppression.

The above changes make bin/tests/system/timeouts/conftest.py redundant,
so remove it.

[1] https://docs.pytest.org/en/7.0.x/how-to/skipping.html#id1

(cherry picked from commit 00392921f0)
2022-03-14 09:19:03 +01:00
Michał Kępień
30bbbc7aef Rework imports in dnspython-based system tests
Ensure all "import dns.*" statements are always placed after
pytest.importorskip('dns') calls, in order to allow the latter to
fulfill their purpose.  Explicitly import all dnspython modules used by
each dnspython-based test to avoid relying on nested imports.  Replace
function-scoped imports with global imports to reduce code duplication.

(cherry picked from commit 49312d6bb2)
2022-03-14 09:19:03 +01:00
Michał Kępień
45bbb518d5 Fix skipping tests requiring dnspython
The intended purpose of the @pytest.mark.dnspython{,2} decorators was to
cause dnspython-based tests to be skipped if dnspython is not available
(or not recent enough).  However, a number of system tests employing
those decorators contain global "import dns.resolver" statements which
trigger ImportError exceptions during test initialization if dnspython
is not available.  In other words, the @pytest.mark.dnspython{,2}
decorators serve no useful purpose.

Currently, whenever a Python-based test requires dnspython, that
requirement applies to all tests in a given *.py file.  Given that,
employ global pytest.importorskip() calls to ensure dnspython-based
parts of various system tests are skipped when dnspython is not
available.  Remove all occurrences of the @pytest.mark.dnspython{,2}
decorators (and all associated code) to prevent confusion.

(cherry picked from commit 05c97f2329)
2022-03-14 09:19:03 +01:00
Michał Kępień
d9ae31be8c Fix skipping tests requiring the requests module
The intended purpose of the @pytest.mark.requests decorator was to cause
Python-based parts of the "statschannel" system test to be skipped if
the requests Python module is not available.  However, both
tests-json.py and tests-xml.py contain a global "import requests"
statement which triggers ImportError exceptions during test
initialization if the requests module is not available.  In other words,
the @pytest.mark.requests decorator serves no useful purpose.

Since all tests in both tests-json.py and tests-xml.py depend on the
requests Python module, employ pytest.importorskip() to ensure the
Python-based parts of the "statschannel" system test are skipped when
the requests module is not available.  Remove all occurrences of the
@pytest.mark.requests decorator (and all associated code) to prevent
confusion.

(cherry picked from commit 704ad2907f)
2022-03-14 09:19:03 +01:00
Michał Kępień
098bd03f7d Simplify skipping tests depending on libxml2
All tests in bin/tests/system/statschannel/tests-xml.py require libxml2
support to be enabled in BIND 9 at build-time.  Instead of applying the
same pytest.mark.skipif() decorator to every test in that file, set the
'pytestmark' global accordingly in order to immediately skip all tests
in tests-xml.py if libxml2 support is not compiled in.

Remove all occurrences of the @pytest.mark.xml decorator (and all
associated code) from the "statschannel" system test as the
xml.etree.ElementTree module is a part of the Python standard library
since Python 2.5 (so checking whether it is available is redundant) and
checking for libxml2 support in the tested BIND 9 build is already
handled by setting the 'pytestmark' global accordingly.

(cherry picked from commit 286b57c7f1)
2022-03-14 09:19:03 +01:00
Michał Kępień
c1a0651f54 Simplify skipping tests depending on json-c
All tests in bin/tests/system/statschannel/tests-json.py require json-c
support to be enabled in BIND 9 at build-time.  Instead of applying the
same pytest.mark.skipif() decorator to every test in that file, set the
'pytestmark' global accordingly in order to immediately skip all tests
in tests-json.py if json-c support is not compiled in.

Remove all occurrences of the @pytest.mark.json decorator (and all
associated code) from the "statschannel" system test as the json module
is a part of the Python standard library since Python 2.6 (so checking
whether it is available is redundant) and checking for json-c support in
the tested BIND 9 build is already handled by setting the 'pytestmark'
global accordingly.

Also remove a related excerpt from bin/tests/system/rpzextra/conftest.py
as it is a copy-paste artifact that serves no purpose in the "rpzextra"
system test.

(cherry picked from commit 0a76f186a5)
2022-03-14 09:19:03 +01:00
Michał Kępień
14a3bb4897 Refactor "statschannel" test's helper modules
The "statschannel" system test contains two Python helper modules:

  - generic.py: test functions directly invoked by both tests-json.py
    and test-xml.py,

  - helper.py: helper functions invoked by test functions in generic.py.

The above logic for splitting helper functions into Python modules
prevents selective test skipping from working due to unconditional
import statements being present in both helper modules.  For example, if
dnspython is not available on the test host, tests-json.py imports
generic.py, which in turn imports helper.py, which in turn attempts to
import various dnspython modules, triggering ImportError exceptions
during test initialization.  Various decorators used for some tests
(like @pytest.mark.dnspython) suggest that such a scenario should be
handled gracefully, but that is not the case - modifying the test
collection in conftest.py does not prevent pytest from failing due to
import errors.

Fix by moving helper functions around to achieve a different split:

  - generic.py: helper functions only relying on the Python standard
    library,

  - generic_dnspython.py: helper functions requiring dnspython.

Only two tests in tests-{json,xml}.py need dnspython to work
(test_traffic_json(), test_traffic_xml()).  Since all
dnspython-dependent code is now present in generic_dnspython.py, employ
pytest.importorskip() in those two tests to ensure they can be
selectively skipped when dnspython is not available.  Adjust other code
to account for the revised Python helper module layout.  Remove all
occurrences of the @pytest.mark.dnspython decorator (and all associated
code) from the "statschannel" system test to prevent confusion.

(cherry picked from commit 96b7f9f9aa)
2022-03-14 09:19:03 +01:00
Michał Kępień
30d7a68129 Reuse common port-related test fixtures
Most Python-based system tests need to know which ports were assigned to
a given test by bin/tests/system/get_ports.sh.  This is currently
handled by inspecting the values of various environment variables (set
by bin/tests/system/run.sh) and passing the port numbers to Python
scripts via pytest fixtures.  However, this glue code has so far been
copy-pasted into each system test using it, rather than reused.

Since pytest also looks for conftest.py files in parent directories,
move commonly used fixtures to bin/tests/system/conftest.py.  Set the
scope of all the moved fixtures to "session" as their return values are
only based on environment variables, so there is no point in recreating
them for every test requesting them.  Adjust test code accordingly.

(cherry picked from commit 53ef8835c1)
2022-03-14 09:19:03 +01:00
Petr Špaček
049ab48776 Merge branch '2799-documentation-for-administrative-tools-is-out-of-sync-with-manual-pages-v9_16' into 'v9_16'
Fix Administrative Tools section in the ARM [v9_16]

See merge request isc-projects/bind9!5959
2022-03-10 21:10:29 +00:00
Tony Finch
1558adbcdf Refer to RFC 4592 for DNS wildcards
The named-checkzone(1) and named-compilezone(1) manual pages used to
refer to the description of wildcards in RFC 1034.

(cherry picked from commit 178aef5b8c)
2022-03-10 21:58:36 +01:00
Suzanne Goldlust
da3369179f Fix Tools for Use With the Name Server Daemon in the ARM
Remove outdated command references from ARM section
3.3.1. Tools for Use With the Name Server Daemon
and replace them with links to man pages.

Fixes: #2799
(cherry picked from commit 2d2d87a615)
2022-03-10 21:58:36 +01:00
Tony Finch
b8a3359d76 In the ARM appendix, sort man page sections alphabetically
(cherry picked from commit 315b3c3a1a)
2022-03-10 21:58:36 +01:00
Petr Špaček
9242f53e3d Split out named-compilezone and named-checkzone man pages
Both utilities were included as one man page, but this caused a problem:
Sphinx directive .. include was used twice on the same file, which
prevented us from using labels (or anything with unique identifier) in
the man pages. This effectivelly prevented linking to them.

Splitting man pages allows us to solve the linking problems and also
clearly make text easier to follow because it does not mention two tools
at the same time.

This change causes duplication of text, but given the frequecy of changes
to these tools I think it is acceptable. I've considered deduplication
using smaller .rst snippets which get included into both man pages,
but it would require more sed scripting to handle defaults etc. and
I think it would be way too complex solution for this problem.

Related: #2799
(cherry picked from commit 9992f7808c)
2022-03-10 21:58:35 +01:00
Petr Špaček
e46322c583 Split out ddns-confgen and tsig-keygen man pages
Both utilities were included as one man page, but this caused a problem:
Sphinx directive .. include was used twice on the same file, which
prevented us from using labels (or anything with unique identifier) in
the man pages. This effectivelly prevented linking to them.

Splitting man pages allows us to solve the linking problems and also
clearly make text easier to follow because it does not mention two tools
at the same time.

This change causes duplication of text, but given the frequecy of changes
to these tools I think it is acceptable.

Related: #2799
(cherry picked from commit 2e42414522)
2022-03-10 21:56:15 +01:00
Petr Špaček
e322fc3cff Remove nonexistent option -r from confgen man pages
Fixes omission in !269.

Fixes: #2826
(cherry picked from commit 473d5a8d03)
2022-03-10 20:32:37 +01:00
Ondřej Surý
c2496f833a Merge branch 'ondrej/lib/isc/heap.c-cleanup-v9_16' into 'v9_16'
Make isc_heap_create() and isc_heap_insert() return void [v9.16]

See merge request isc-projects/bind9!5948
2022-03-08 20:29:36 +00:00
Ondřej Surý
e7fb7c1de5 Make isc_heap_create() and isc_heap_insert() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.

(cherry picked from commit bbb4cdb92d)
2022-03-08 20:49:15 +01:00
Ondřej Surý
d39016b635 Merge branch 'ondrej/lib/isc/ht.c-cleanup-v9_16' into 'v9_16'
Make isc_ht_init() and isc_ht_iter_create() return void [v9.16]

See merge request isc-projects/bind9!5947
2022-03-08 19:42:25 +00:00
Ondřej Surý
848e6ee7b6 Make dns_catz_get_iterator() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.

(cherry picked from commit d128656d2e)
2022-03-08 20:20:54 +01:00
Ondřej Surý
ba89da052a Make isc_ht_init() and isc_ht_iter_create() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.

(cherry picked from commit 8fa27365ec)
2022-03-08 20:20:52 +01:00
Mark Andrews
a045febada Merge branch '3142-add-checkconf-check-for-dnssec-policy-keys-algorithm-v9_16' into 'v9_16'
Add test configurations with invalid dnssec-policy clauses

See merge request isc-projects/bind9!5945
2022-03-08 11:16:48 +00:00
Mark Andrews
9f69fc83db Add release note for [GL #3142]
(cherry picked from commit e48af36981)
2022-03-08 21:57:14 +11:00
Mark Andrews
bfb7df714b Add CHANGES entry for [GL #3142]
(cherry picked from commit d4c2395fff)
2022-03-08 21:57:13 +11:00
Mark Andrews
2c7f02ca45 Check dnssec-policy key roles for validity
For each algorithm there must be a key performing the KSK and
ZSK rolls.  After reading the keys from named.conf check that
each algorithm present has both rolls.  CSK implicitly has both
rolls.

(cherry picked from commit 9bcf45f4ce)
2022-03-08 21:56:39 +11:00
Mark Andrews
38d930e5cb Add test configurations with invalid dnssec-policy clauses
bad-ksk-without-zsk.conf only has a ksk defined without a
matching zsk for the same algorithm.

bad-zsk-without-ksk.conf only has a zsk defined without a
matching ksk for the same algorithm.

bad-unpaired-keys.conf has two keys of different algorithms
one ksk only and the other zsk only

(cherry picked from commit f23e86b96b)
2022-03-08 21:56:39 +11:00
Arаm Sаrgsyаn
96b564173e Merge branch '3172-libressl-3.5.0-compat-v9_16' into 'v9_16'
[v9_16] Resolve "BIND is not compatible with LibreSSL 3.5.0"

See merge request isc-projects/bind9!5915
2022-03-02 11:40:19 +00:00
Aram Sargsyan
908fdeb4d2 Add CHANGES entry for [GL #3172]
(cherry picked from commit 0f399851d88b7958a45bfbc4f626e82bdc34c771)
2022-03-02 09:34:29 +00:00
Aram Sargsyan
73e660a806 Use autoconf check for BN_GENCB_new()
BIND unconditionally uses shims for BN_GENCB_new(), BN_GENCB_free(),
and BN_GENCB_get_arg() for all LibreSSL versions and, correctly, for
OpenSSL <1.1.0 versions.

This breaks LibreSSL compilation starting with LibreSSL 3.5.0.

Use autoconf check instead to check whether the family of the functions
are available.

(cherry picked from commit 749973f3259b7638a6af02b7da2f40ae28bdd402)
2022-03-02 09:34:29 +00:00
Aram Sargsyan
2325ed66c5 Remove EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() shims
LibreSSL 3.5.0 fails to compile with these shims. We could have just
removed the LibreSSL check from the pre-processor condition, but it
seems that these shims are no longer needed because all the supported
versions of OpenSSL and LibreSSL have those functions.

According to EVP_ENCRYPTINIT(3) manual page in LibreSSL,
EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() first appeared in
OpenSSL 0.9.8b, and have been available since OpenBSD 4.5.

(cherry picked from commit a3789053682b57a2031de8c544134f1923e76cf3)
2022-03-02 09:31:50 +00:00
Mark Andrews
4ac616bb4a Merge branch '3175-add-missing-grow-data-call-in-isc-lex-gettoken-v9_16' into 'v9_16'
Grow the lex token buffer in one more place

See merge request isc-projects/bind9!5919
2022-03-02 02:13:30 +00:00
Mark Andrews
cb7511495e Add CHANGES note for [GL #3175]
(cherry picked from commit ce8703a79e)
2022-03-02 01:04:40 +00:00
Mark Andrews
c1a127643f Add seed that demonstrated INSIST triggered in isc_lex_gettoken
this is similar to the input found by ClusterFuzz Issue 45027 with
the 0xff characters replaced for readability.

(cherry picked from commit d36938321e)
2022-03-02 01:04:40 +00:00
Mark Andrews
0b6af23d61 Grow the lex token buffer in one more place
when parsing key pairs, if the '=' character fell at max_token
a protective INSIST preventing buffer overrun could be triggered.
Attempt to grow the buffer immediately before the INSIST.

Also removed an unnecessary INSIST on the opening double quote
of key buffer pair.

(cherry picked from commit 4c356d2770)
2022-03-02 01:04:40 +00:00
Mark Andrews
84a96a1bb0 Merge branch '3176-issue-45110-by-clusterfuzz-external-bind9-dns_master_load_fuzzer-undefined-shift-in-soa_get-v9_16' into 'v9_16'
Use unsigned arithmetic when shifting by 24

See merge request isc-projects/bind9!5918
2022-03-02 01:01:24 +00:00
Mark Andrews
a247d282bf Use unsigned arithmetic when shifting by 24
By default C promotes short unsigned values to signed int which
leads to undefined behaviour when the value is shifted by too much.
Force unsigned arithmetic to be perform by explicitly casting to a
unsigned type.

(cherry picked from commit b8b99603f1)
2022-03-02 11:06:53 +11:00
Ondřej Surý
98183ef28b Merge branch '3177-add-missing-isc_nm_tcpsocket-to-isc__nmsocket_reset-v9_16' into 'v9_16'
Handle TCP sockets in isc__nmsocket_reset()

See merge request isc-projects/bind9!5912
2022-02-28 11:14:14 +00:00
Ondřej Surý
ac5952aee8 Handle TCP sockets in isc__nmsocket_reset()
The isc__nmsocket_reset() was missing a case for raw TCP sockets (used
by RNDC and DoH) which would case a assertion failure when write timeout
would be triggered.

TCP sockets are now also properly handled in isc__nmsocket_reset().

(cherry picked from commit b220fb32bd)
2022-02-28 11:44:47 +01:00
Mark Andrews
604a267054 Merge branch '3170-tiny-typo-in-doc-build-script-v9_16' into 'v9_16'
correctly exclude logging-categories.rst

See merge request isc-projects/bind9!5903
2022-02-24 22:14:26 +00:00
Mark Andrews
287df673dc correctly exclude logging-categories.rst
(cherry picked from commit 0069a689a6)
2022-02-25 01:20:54 +11:00
Ondřej Surý
9f7ddf8c18 Merge branch '3166-disable-inactivehandles-caching-with-address-sanitizer-v9_16' into 'v9_16'
Disable inactive handles caching when compiled with sanitizers

See merge request isc-projects/bind9!5897
2022-02-23 23:44:58 +00:00
Ondřej Surý
fe5cd40a3a Disable inactive uvreqs caching when compiled with sanitizers
When isc__nm_uvreq_t gets deactivated, it could be just put onto array
stack to be reused later to save some initialization time.
Unfortunately, this might hide some use-after-free errors.

Disable the inactive uvreqs caching when compiled with Address or
Thread Sanitizer.

(cherry picked from commit be339b3c83)
2022-02-24 00:16:31 +01:00
Ondřej Surý
55780afdb9 Disable inactive handles caching when compiled with sanitizers
When isc_nmhandle_t gets deactivated, it could be just put onto array
stack to be reused later to safe some initialization time.
Unfortunately, this might hide some use-after-free errors.

Disable the inactive handles caching when compiled with Address or
Thread Sanitizer.

(cherry picked from commit 92cce1da65)
2022-02-24 00:10:18 +01:00
Ondřej Surý
822879f2c7 Merge branch '3167-remove-isc__nmsocket_t-ah_handles-v9_16' into 'v9_16'
Remove active handles tracking from isc__nmsocket_t

See merge request isc-projects/bind9!5895
2022-02-23 22:55:22 +00:00
Ondřej Surý
7765263e68 Remove active handles tracking from isc__nmsocket_t
The isc__nmsocket_t has locked array of isc_nmhandle_t that's not used
for anything.  The isc__nmhandle_get() adds the isc_nmhandle_t to the
locked array (and resized if necessary) and removed when
isc_nmhandle_put() finally destroys the handle.  That's all it does, so
it serves no useful purpose.

Remove the .ah_handles, .ah_size, and .ah_frees members of the
isc__nmsocket_t and .ah_pos member of the isc_nmhandle_t struct.

(cherry picked from commit e2555a306f)
2022-02-23 23:50:54 +01:00
Ondřej Surý
eff10e681a Merge branch '3166-delay-isc__nm_uvreq_t-deallocation-v9_16' into 'v9_16'
Delay isc__nm_uvreq_t deallocation to connection callback

See merge request isc-projects/bind9!5893
2022-02-23 22:47:53 +00:00
Ondřej Surý
7b8e265a40 Delay isc__nm_uvreq_t deallocation to connection callback
When the TCP, TCPDNS or TLSDNS connection times out, the isc__nm_uvreq_t
would be pushed into sock->inactivereqs before the uv_tcp_connect()
callback finishes.  Because the isc__nmsocket_t keeps the list of
inactive isc__nm_uvreq_t, this would cause use-after-free only when the
sock->inactivereqs is full (which could never happen because the failure
happens in connection timeout callback) or when the sock->inactivereqs
mechanism is completely removed (f.e. when running under Address or
Thread Sanitizer).

Delay isc__nm_uvreq_t deallocation to the connection callback and only
signal the connection callback should be called by shutting down the
libuv socket from the connection timeout callback.

(cherry picked from commit 3268627916)
2022-02-23 23:36:09 +01:00
Ondřej Surý
bfecb1b6f7 Merge branch 'ondrej-cleanup-nm_destroy-dequeue-v9_16' into 'v9_16'
Properly free up enqueued netievents in nm_destroy()

See merge request isc-projects/bind9!5890
2022-02-23 22:30:55 +00:00
Ondřej Surý
af2bddc242 Properly free up enqueued netievents in nm_destroy()
When the isc_netmgr is being destroyed, the normal and priority queues
should be dequeued and netievents properly freed.  This wasn't the case.

(cherry picked from commit 88418c3372)
2022-02-23 22:53:41 +01:00
Michał Kępień
28e9d7d222 Merge branch '3147-fix-more-ns_statscounter_recursclients-underflows-v9_16' into 'v9_16'
[v9_16] Fix more ns_statscounter_recursclients underflows

See merge request isc-projects/bind9!5881
2022-02-23 14:03:01 +00:00
Michał Kępień
ae2fa12d2d Add CHANGES entry for GL #3147
(cherry picked from commit 600f9010d2)
2022-02-23 14:45:06 +01:00
Michał Kępień
2344201385 Add release note for GL #3147
(cherry picked from commit 1c462a63ec)
2022-02-23 14:45:06 +01:00
Michał Kępień
60e82835ec Fix more ns_statscounter_recursclients underflows
Commit aab691d512 did not fix all possible
scenarios in which the ns_statscounter_recursclients counter underflows.
The solution implemented therein can be ineffective e.g. when CNAME
chaining happens with prefetching enabled.

Here is an example recursive resolution scenario in which the
ns_statscounter_recursclients counter can underflow with the current
logic in effect:

 1. Query processing starts, the answer is not found in the cache, so
    recursion is started.  The NS_CLIENTATTR_RECURSING attribute is set.
    ns_statscounter_recursclients is incremented (Δ = +1).

 2. Recursion completes, returning a CNAME.  client->recursionquota is
    non-NULL, so the NS_CLIENTATTR_RECURSING attribute remains set.
    ns_statscounter_recursclients is decremented (Δ = 0).

 3. Query processing restarts.

 4. The current QNAME (the target of the CNAME from step 2) is found in
    the cache, with a TTL low enough to trigger a prefetch.

 5. query_prefetch() attaches to client->recursionquota.
    ns_statscounter_recursclients is not incremented because
    query_prefetch() does not do that (Δ = 0).

 6. Query processing restarts.

 7. The current QNAME (the target of the CNAME from step 4) is not found
    in the cache, so recursion is started.  client->recursionquota is
    already attached to (since step 5) and the NS_CLIENTATTR_RECURSING
    attribute is set (since step 1), so ns_statscounter_recursclients is
    not incremented (Δ = 0).

 8. The prefetch from step 5 completes.  client->recursionquota is
    detached from in prefetch_done().  ns_statscounter_recursclients is
    not decremented because prefetch_done() does not do that (Δ = 0).

 9. Recursion for the current QNAME completes.  client->recursionquota
    is already detached from, i.e. set to NULL (since step 8), and the
    NS_CLIENTATTR_RECURSING attribute is set (since step 1), so
    ns_statscounter_recursclients is decremented (Δ = -1).

Another possible scenario is that after step 7, recursion for the target
of the CNAME from step 4 completes before the prefetch for the CNAME
itself.  fetch_callback() then notices that client->recursionquota is
non-NULL and decrements ns_statscounter_recursclients, even though
client->recursionquota was attached to by query_prefetch() and therefore
not accompanied by an incrementation of ns_statscounter_recursclients.
The net result is also an underflow.

Instead of trying to properly handle all possible orderings of events
set into motion by normal recursion and prefetch-triggered recursion,
adjust ns_statscounter_recursclients whenever the recursive clients
quota is successfully attached to or detached from.  Remove the
NS_CLIENTATTR_RECURSING attribute altogether as its only purpose is made
obsolete by this change.

(cherry picked from commit f7482b68b9)
2022-02-23 14:45:06 +01:00
Matthijs Mekking
2debaaddbe Merge branch '3164-fix-parental-agents-documentation-v9_16' into 'v9_16'
Fix typo in DNSSEC guide parental-agents example

See merge request isc-projects/bind9!5874
2022-02-22 13:45:34 +00:00
Matthijs Mekking
ff61d74310 Fix typo in DNSSEC guide parental-agents example
The example will not load because of the typo, the comma should be a
semicolon.

(cherry picked from commit fd5e39cc76)
2022-02-22 14:07:30 +01:00
Petr Špaček
3e17e79484 Merge branch '3132-add-send-timeout-python2-fix-v9_16' into 'v9_16'
Fix timeouts system test compatibility with python2

See merge request isc-projects/bind9!5869
2022-02-18 10:54:45 +00:00
Petr Špaček
17ff0227f8 Fix timeouts system test compatibility with python2
v9_16 branch still supports Python 2.7.
Fixup for 260b4c02cf.

Related: !5856
2022-02-18 11:26:58 +01:00
Petr Špaček
a30dac540e Merge branch 'v9_16_26-release' into 'v9_16'
Merge 9.16.26 release branch

See merge request isc-projects/bind9!5866
2022-02-18 09:12:00 +00:00
Petr Špaček
bcd07e71d6 Prepare release notes for BIND 9.16.27 2022-02-18 10:07:48 +01:00
Petr Špaček
faf800893f Merge branch 'prep-release' into v9_16_26-release 2022-02-18 10:03:25 +01:00
Petr Špaček
0229a688a9 Merge branch 'pspacek/prepare-documentation-for-bind-9.16.26' into v9_16_26-release
Prepare documentation for BIND 9.16.26

See merge request isc-private/bind9!352
2022-02-18 10:03:25 +01:00
Petr Špaček
7394e09b50 prep 9.16.26 2022-02-18 10:03:25 +01:00
Petr Špaček
69989b1320 Prepare release notes for BIND 9.16.26 2022-02-18 10:03:20 +01:00
Petr Špaček
4ba9be8005 Tweak and reword release notes 2022-02-18 09:36:16 +01:00
Ondřej Surý
5cdc832c10 Merge branch '1897-fix-max-transfer-timeouts-v9_16' into 'v9_16'
Reimplement the max-transfer-time-out and max-transfer-idle-out (v9.16)

See merge request isc-projects/bind9!5863
2022-02-17 22:38:53 +00:00
Ondřej Surý
e9ad424cec Add CHANGES and release note for [GL #1897]
(cherry picked from commit 987ad32fac)
2022-02-17 22:59:24 +01:00
Ondřej Surý
b3efa9f7ed Add XFR max-transfer-time-out and max-tranfer-idle-out system tests
Extend the timeouts system test to ensure that the maximum outgoing
transfer time (max-transfer-time-out) and maximum outgoing transfer idle
time (max-transfer-idle-out) works as expected.  This is done by
lowering the limits to 5/1 minutes and testing that the connection has
been dropped while sleeping between the individual XFR messages.

(cherry picked from commit 8fed1b6461)
2022-02-17 22:59:24 +01:00
Ondřej Surý
cbf2bed95e Reimplement the max-transfer-time-out and max-transfer-idle-out
While refactoring the libns to use the new network manager, the
max-transfer-*-out options were not implemented and they were turned
non-operational.

Reimplement the max-transfer-idle-out functionality using the write
timer and max-transfer-time-out using the new isc_nm_timer API.

(cherry picked from commit 8643bbab84)
2022-02-17 22:59:24 +01:00
Ondřej Surý
6de1b12f59 Remove unused client->shutdown and client->shutdown_arg
While refactoring the lib/ns/xfrout.c, it was discovered that .shutdown
and .shutdown_arg members of ns_client_t structure are unused.

Remove the unused members and associated code that was using in it in
the ns_xfrout.

(cherry picked from commit 037549c405)
2022-02-17 22:59:24 +01:00
Ondřej Surý
914a7e14e2 Add network manager based timer API
This commits adds API that allows to create arbitrary timers associated
with the network manager handles.

(cherry picked from commit 3c7b04d015)
2022-02-17 22:59:24 +01:00
Evan Hunt
3ec9c711d8 Merge branch '3157-test-blackhole-v9_16' into 'v9_16'
backport regression test from GL #3157

See merge request isc-projects/bind9!5859
2022-02-17 18:15:24 +00:00
Evan Hunt
d822a87804 backport regression test from GL #3157
add "blackhole { none; };" to a secondary server in the xfer system
test to ensure that the error in GL #3157 is not present in 9.16.
2022-02-17 09:38:26 -08:00
Ondřej Surý
421a1dfa82 Merge branch '3132-add-send-timeout-v9_16' into 'v9_16'
Add TCP, TCPDNS and TLSDNS write timer

See merge request isc-projects/bind9!5856
2022-02-17 11:08:19 +00:00
Ondřej Surý
132bed0014 Add CHANGES and release note for [GL #3132]
(cherry picked from commit 0c35bda762)
2022-02-17 11:26:16 +01:00
Ondřej Surý
3f24bd2bce Update writetimeout to be T_IDLE in netmgr_test.c
Use the isc_nmhandle_setwritetimeout() function in the netmgr unit test
to allow more time for writing and reading the responses because some of
the intervals that are used in the unit tests are really small leaving a
little room for any delays.

(cherry picked from commit ee359d6ffa)
2022-02-17 11:26:16 +01:00
Ondřej Surý
1d0f2eb2c4 Add isc_nmhandle_setwritetimeout() function
In some situations (unit test and forthcoming XFR timeouts MR), we need
to modify the write timeout independently of the read timeout.  Add a
isc_nmhandle_setwritetimeout() function that could be called before
isc_nm_send() to specify a custom write timeout interval.

(cherry picked from commit a89d9e0fa6)
2022-02-17 11:26:16 +01:00
Ondřej Surý
260b4c02cf Add TCP write timeout system test
Extend the timeouts system test that bursts the queries for large TXT
record and never read any responses back filling up the server TCP write
buffer.  The test should work with the default wmem_max value on
Linux (208k).

(cherry picked from commit b735182ae0)
2022-02-17 10:05:24 +01:00
Ondřej Surý
6a88131d03 Add TCP, TCPDNS and TLSDNS write timer
When the outgoing TCP write buffers are full because the other party is
not reading the data, the uv_write() could wait indefinitely on the
uv_loop and never calling the callback.  Add a new write timer that uses
the `tcp-idle-timeout` value to interrupt the TCP connection when we are
not able to send data for defined period of time.

(cherry picked from commit 408b362169)
2022-02-17 10:05:24 +01:00
Ondřej Surý
11ae4399d9 Add uv_tcp_close_reset compat
The uv_tcp_close_reset() function was added in libuv 1.32.0 and since we
support older libuv releases, we have to add a shim uv_tcp_close_reset()
implementation loosely based on libuv.

(cherry picked from commit cd3b58622c)
2022-02-17 09:50:10 +01:00
Ondřej Surý
eb2463115f Rename sock->timer to sock->read_timer
Before adding the write timer, we have to remove the generic sock->timer
to sock->read_timer.  We don't touch the function names to limit the
impact of the refactoring.

(cherry picked from commit 45a73c113f)
2022-02-17 09:50:07 +01:00
Ondřej Surý
9b7a0cb778 Merge branch 'ondrej/add-UV_RUNTIME_CHECK-macro-v9_16' into 'v9_16'
Add UV_RUNTIME_CHECK() macro to print uv_strerror()

See merge request isc-projects/bind9!5846
2022-02-16 11:30:07 +00:00
Ondřej Surý
cdd725f1db Add semantic patch to keep UV_RUNTIME_CHECK in sync
The UV_RUNTIME_CHECK() macro requires to keep the function name in sync
like this:

    r = func(...);
    UV_RUNTIME_CHECK(func, r);

Add semantic patch to keep the function name and return variable in sync
with the previous line.

(cherry picked from commit 62bd5cb08c)
2022-02-16 11:48:33 +01:00
Ondřej Surý
1c564b808f Use UV_RUNTIME_CHECK() as appropriate
Replace the RUNTIME_CHECK() calls for libuv API calls with
UV_RUNTIME_CHECK() to get more detailed error message when
something fails and should not.

(cherry picked from commit 8715be1e4b)
2022-02-16 11:48:30 +01:00
Ondřej Surý
88751da114 Add UV_RUNTIME_CHECK() macro to print uv_strerror()
When libuv functions fail, they return correct return value that could
be useful for more detailed debugging.  Currently, we usually just check
whether the return value is 0 and invoke assertion error if it doesn't
throwing away the details why the call has failed.  Unfortunately, this
often happen on more exotic platforms.

Add a UV_RUNTIME_CHECK() macro that can be used to print more detailed
error message (via uv_strerror() before ending the execution of the
program abruptly with the assertion.

(cherry picked from commit 62e15bb06d)
2022-02-16 11:46:10 +01:00
Matthijs Mekking
cff0d3fbd0 Merge branch 'matthijs-document-dnssec-policy-keys-algorithm-match-v9_16' into 'v9_16'
Update documentation wrt key algorithms (9.16)

See merge request isc-projects/bind9!5843
2022-02-16 10:11:21 +00:00
Matthijs Mekking
483beec0fd Update documentation wrt key algorithms
Add a note to the DNSSEC guide and to the ARM reference that A ZSK/KSK
pair used for signing your zone should have the same algorithm.

This commit also updates the 'dnssec-policy/keys' example to use the
slightly more modern 'rsasha256' algorithm.

(cherry picked from commit 7365400610)
2022-02-16 10:25:30 +01:00
Michal Nowak
6917b32d6c Merge branch 'mnowak/make-cocci-parallel-v9_16' into 'v9_16'
[v9_16] Run spatch jobs in parallel

See merge request isc-projects/bind9!5833
2022-02-14 19:10:57 +00:00
Michal Nowak
2823885e1b Run spatch jobs in parallel
Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.

(cherry picked from commit 48c44fe6d4)
2022-02-14 20:01:43 +01:00
Michal Nowak
fb0aaa3c10 Merge branch 'mnowak/coverity-scan-2021.12-v9_16' into 'v9_16'
[v9_16] Update Coverity Scan CI job to 2021.12.1

See merge request isc-projects/bind9!5830
2022-02-14 17:59:01 +00:00
Michal Nowak
d73143af51 Update Coverity Scan CI job to 2021.12.1
(cherry picked from commit f0edf07fbc)
2022-02-14 18:46:08 +01:00
Petr Špaček
b1c7a94dc9 Merge branch 'pspacek/rfc-nits-v9_16' into 'v9_16'
Update and deduplicate list of RFCs in documentation [v9_16]

See merge request isc-projects/bind9!5828
2022-02-14 11:48:57 +00:00
Petr Špaček
3637ce9c7c Remove rfc-compliance list in plaintext - ARM deduplication
The plaintext version is now fully replaced by the doc/arm/general.rst.

(cherry picked from commit 63989e98ac)
2022-02-14 12:23:39 +01:00
Petr Špaček
a2ebd90f30 Reorder list of supported RFCs in more user-oriented manner
For users it's not really important if a RFC is Internet Standard,
Proposed Standard, or Experimental. RFCs are now regrouped by
"Protocol", Best Current Practice, and "catch all" category FYI.

(cherry picked from commit 7fd61f9403)
2022-02-14 12:23:31 +01:00
Petr Špaček
636ea2d5bc Replace obsolete RFC2845 reference with RFC8945 (TSIG)
(cherry picked from commit 4dbad65bfd)
2022-02-14 12:21:27 +01:00
Petr Špaček
f0d5e029bd Remove special chapter about IPv6 address formats from ARM
In 2022, IPv6 is not anything unusual, and it was really odd
to have it in a separate section next to a huge list of RFCs.

Fixes: #1918
(cherry picked from commit 2774b497a6)
2022-02-14 12:21:15 +01:00
Petr Špaček
519660c84a Replace obsolete RFC6944 reference with RFC8624 (DNSSEC algorithm status)
(cherry picked from commit 3c83a9d503)
2022-02-14 12:21:15 +01:00
Petr Špaček
ee5d716ca7 Replace obsolete RFC5966 reference with RFC7766 (TCP)
(cherry picked from commit bd3b310eae)
2022-02-14 12:21:15 +01:00
Petr Špaček
717d218935 Replace obsolete RFC4408 reference with RFC7208 (SPF)
(cherry picked from commit f8cb0ac141)
2022-02-14 12:21:13 +01:00
Petr Špaček
bc41ef8687 Replace obsolete RFC2915 reference with RFC3403 (NAPTR)
(cherry picked from commit 16dec1ff58)
2022-02-14 12:20:41 +01:00
Petr Špaček
09f562eb0d Add link to RFC8749 (DLV is historic)
(cherry picked from commit f7225db822)
2022-02-14 12:20:39 +01:00
Petr Špaček
eef6134587 Add newer version of IDNA RFC to docs
(cherry picked from commit 09d6cf89df)
2022-02-14 12:20:14 +01:00
Petr Špaček
d16197fe62 Remove obsolete RFCs from documentation
There is little point of listing all of the obsolete RFCs. I think it is
more likely confuse people than to do anything useful.

(cherry picked from commit 9437ea08e1)
2022-02-14 12:20:14 +01:00
Petr Špaček
8925fb2e56 Replace obsolete RFC6488 reference with RFC8659 (CAA)
(cherry picked from commit 2b5b777c07)
2022-02-14 12:20:11 +01:00
Petr Špaček
d1ee57b4bd Remove obsolete book reference from ARM
(cherry picked from commit b686b5c161)
2022-02-14 12:19:29 +01:00
Petr Špaček
d7ca8c4c9b Use Sphinx footnotes for DNS Reference Information
It limits risk of errors while doing updates, which are next in the
pipeline.

(cherry picked from commit f713984886)
2022-02-14 12:19:24 +01:00
Ondřej Surý
0456213334 Merge branch 'ondrej/change-bug-reporting-address-v9_16' into 'v9_16'
Change the bug reporting address from email to gitlab URI

See merge request isc-projects/bind9!5822
2022-02-11 08:26:17 +00:00
Ondřej Surý
13cc8e3109 Change the bug reporting address from email to gitlab URI
In autoconf, the AC_INIT() accepts bugreport address for reporting
issues (f.e. when the test suite fails).  Instead of providing generic
emails address, change this to the address where to report with the
default Bug template applied.

(cherry picked from commit bb60622250)
2022-02-11 08:55:17 +01:00
Ondřej Surý
5af0b34f1c Merge branch '3137-create-new-log-messages-when-entering-and-exiting-exlusive-task-mode-v9_16' into 'v9_16'
Log when starting and ending task exclusive mode

See merge request isc-projects/bind9!5820
2022-02-10 21:01:38 +00:00
Ondřej Surý
2889492865 Add CHANGES and release note for [GL #3137]
(cherry picked from commit 44aa8ef997)
2022-02-10 21:28:48 +01:00
Ondřej Surý
6b2d9dcfd9 Log when starting and ending task exclusive mode
The task exclusive mode stops all processing (tasks and networking IO)
except the designated exclusive task events.  This has impact on the
operation of the server.  Add log messages indicating when we start the
exclusive mode, and when we end exclusive task mode.

(cherry picked from commit b9cb29076f)
2022-02-10 21:22:46 +01:00
Ondřej Surý
bb9cde6fb6 Merge branch '3130-cleanup-pthread-api-usage-v9_16' into 'v9_16'
Remove unused functions from isc_thread API

See merge request isc-projects/bind9!5809
2022-02-09 17:46:36 +00:00
Ondřej Surý
ad5869ac6c Remove unused functions from isc_thread API
The isc_thread_setaffinity call was removed in !5265 and we are not
going to restore it because it was proven that the performance is better
without it.  Additionally, remove the already disabled cpu system test.

The isc_thread_setconcurrency function is unused and also calling
pthread_setconcurrency() on Linux has no meaning, formerly it was
added because of Solaris in 2001 and it was removed when taskmgr was
refactored to run on top of netmgr in !4918.

(cherry picked from commit 0500345513)
2022-02-09 18:09:48 +01:00
Michal Nowak
2c200922bb Merge branch '2599-run-less-stable-unit-tests-in-aws-v9_16' into 'v9_16'
[v9_16] Run unstable unit tests in CI

See merge request isc-projects/bind9!5807
2022-02-09 12:22:25 +00:00
Michal Nowak
14b0041474 Run unstable unit tests in CI
Running unstable unit tests in CI should help with making sure they
don't fail permanently without the fact being noticed in daily
pipelines.

(cherry picked from commit 1d8788464e)
2022-02-09 13:08:00 +01:00
Evan Hunt
826f744e16 Merge branch 'each-missing-relnotes-v9_16' into 'v9_16'
Release notes for [GL #3082] and [GL #3111]

See merge request isc-projects/bind9!5798
2022-02-02 20:06:30 +00:00
Evan Hunt
556f4d8870 Release notes for [GL #3082] and [GL #3111]
(cherry picked from commit d45f0e1d9e)
2022-02-02 12:04:48 -08:00
Petr Špaček
e75ab60804 Merge branch '2974-improve-directory-documentation-v9_16' into 'v9_16'
Clarify effect of "directory" configuration option [v9_16]

See merge request isc-projects/bind9!5794
2022-02-02 11:39:20 +00:00
Ondřej Surý
774d82bde1 Clarify effect of "directory" configuration option
The "directory" configuration options affects the configuration listed
after the directive but not before which may affect ``include``
directive with relative file paths.

(cherry picked from commit 00ba6967b1)
2022-02-02 12:34:08 +01:00
Ondřej Surý
6107a5a932 Merge branch '3125-log-hard-quota-when-not-accepting-the-connection-v9_16' into 'v9_16'
Add log message when hard quota is reached in TCP accept

See merge request isc-projects/bind9!5790
2022-02-01 21:47:47 +00:00
Ondřej Surý
4f6f74015f Add CHANGES and release notes for [GL #3125]
(cherry picked from commit 932fc7b826703f8b0f30ed11c496f94a02e6ebbb)
2022-02-01 21:16:27 +01:00
Ondřej Surý
00e8bfcdfc Add log message when hard quota is reached in TCP accept
When isc_quota_attach_cb() API returns ISC_R_QUOTA (meaning hard quota
was reached) the accept_connection() would return without logging a
message about quota reached.

Change the connection callback to log the quota reached message.

(cherry picked from commit 2ae84702ad)
2022-02-01 21:06:43 +01:00
Petr Špaček
d7d0289dd6 Merge branch '3120-recent-editions-9-17-22-onwards-of-arm-have-many-empty-grammar-descriptions-v9_16' into 'v9_16'
Fix empty grammar descriptions in the ARM [v9_16]

See merge request isc-projects/bind9!5787
2022-02-01 18:05:37 +00:00
Petr Špaček
3819f88c66 Rename parental-agents grammar file
For consistency with rest of the system, the grammar file and
the link anchors were renamed from "parentals" to "parental-agents".

Technically this is fixup for commit
90ef2b9c81.

Related: !5239
(reimplementation of commit 34a3b35b08)
2022-02-01 18:59:41 +01:00
Petr Špaček
2fd265eebe Regenerate .rst files with grammars after changes to rst generators
$ make -C doc/misc rst

(reimplementation of commit e97c35b3bc)
2022-02-01 18:59:31 +01:00
Mark Andrews
f6aa69889f Fix grammar generators to produce renderable include files in rst format
The missing `::` in the .rst files caused grammar section in docs to
render empty.

The `::` was accidentally removed in an unrelated commit
58bd26b6cf which was supposed to update
only copyright headers.

Fixes: #3120
(cherry picked from commit d975e6630f)
2022-02-01 18:29:23 +01:00
Mark Andrews
8acbf77da0 Add missing rst-grammars.pl dependecy to config grammar build
(reimplementation of commit f5c66f311a)
2022-02-01 18:29:03 +01:00
Evan Hunt
b9584ef68a Merge branch 'each-dns-clientinfo-v9_16' into 'v9_16'
allow dns_clientinfo to store client ECS data

See merge request isc-projects/bind9!5776
2022-01-28 00:31:02 +00:00
Evan Hunt
9219bc187f CHANGES for [GL #3082]
(cherry picked from commit e42f7d2722)
2022-01-27 16:20:55 -08:00
Evan Hunt
ef20d189ab test ECS information is passed in dlzexternal
the dlzexternal test driver now includes ECS, if present in the
query, in the TXT record returned for QNAME "source-addr".

(cherry picked from commit 79ddedabf8)
2022-01-27 16:20:55 -08:00
Petr Špaček
dbe0778b67 extend DLZ interface and example with ECS support
Apparently we forgot about DLZ when updating DNS_CLIENTINFO_VERSION
constant for ECS, which is at value "3" since ECS was introduced.

The code in example drivers and tests now hardcodes version numbers
2 (without ECS) and 3 (with ECS) depending on what a given code path
requires.

(cherry picked from commit f81debe1c8)
2022-01-27 16:20:55 -08:00
Evan Hunt
558b060de5 allow dns_clientinfo to store client ECS data
this brings DNS_CLIENTINFO_VERSION into line with the subscription
branch so that fixes applied to clientinfo processing can also be
applied to the main branch without diverging.

(cherry picked from commit 737e658602)
2022-01-27 16:08:57 -08:00
Ondřej Surý
952b3ffd79 Merge branch '3115-qname-wait-recurse-typo-v9_16' into 'v9_16'
Fix typo in qname-wait-recurse

See merge request isc-projects/bind9!5770
2022-01-27 11:57:07 +00:00
Ondřej Surý
4b93ec0805 Fix typo in qname-wait-recurse
In the RPZ documentation, there's a mistake where it states that the
default behavior will be disabled by setting `qname-wait-recurse yes;`
while in fact it's opposite `qname-wait-recurse no;`.

This affects only the RST documentation.

(cherry picked from commit 1e711dcccb)
2022-01-27 12:55:47 +01:00
Michał Kępień
0362d04fcc Merge branch 'michal/misc-test-framework-fixes-v9_16' into 'v9_16'
[v9_16] Miscellaneous test framework fixes

See merge request isc-projects/bind9!5764
2022-01-26 14:59:54 +00:00
Michał Kępień
d995bd8dec Fix waiting for lock file removal upon exit
Commit c787a539d2 fixed a certain class of
intermittent system test failures caused by named instances unable to
restart.  The root cause was bin/tests/system/stop.pl returning without
waiting for a named instance to remove its lock file.

Later on, it turned out that the above change causes other issues on
Windows due to the way named handles signals on that platform.  Commit
761ba4514f intended to address those
issues by making the server_lock_file() subroutine in
bin/tests/system/stop.pl return an empty value on Windows, in order to
prevent the script for waiting for lock file cleanup on that platform.
Note, however, that Windows detection in that subroutine is limited to
checking whether the CYGWIN environment variable is set.

While that environment variable was not set on Unix-like systems before
commit 761ba4514f, another commit
(a33237f070, merged a few weeks later)
changed that by setting the CYGWIN environment variable to an empty
value on Unix-like systems.  This made the defined($ENV{'CYGWIN'}) check
in server_lock_file() return true, inadvertently preventing
bin/tests/system/stop.pl from waiting for lock file removal before
exiting on Unix-like systems and therefore reintroducing the original
issue.

Fix by making server_lock_file() only return an empty value when the
CYGWIN environment variable is set to a non-empty value (which is what
bin/tests/system/conf.sh.win32 does).  Adjust a similar check in the
pid_file_exists() subroutine in the same way for consistency.

(cherry picked from commit a938db2170)
2022-01-26 15:29:39 +01:00
Michał Kępień
93ad500f38 Do not strip leading whitespace from test output
The echo_*() and cat_*() functions in bin/tests/system/conf.sh.common
call the "read" builtin command without specifying the field separator
to use.  This results in leading whitespace getting stripped from each
line of the texts passed to those functions, which mangles e.g. pytest
output, hindering test failure troubleshooting.

Address by setting IFS to an empty value for the "read" calls used in
the aforementioned helper functions.

(cherry picked from commit fb87022115)
2022-01-26 15:29:39 +01:00
Michał Kępień
318adbee61 Retain all named.run files from each test run
The bin/tests/system/start.pl script truncates the named.run file for a
given named instance unless it is invoked with the --restart
command-line option.  Ever since Python-based tests were introduced,
bin/tests/system/run.sh may start named instances used by a given system
test multiple times within a single run, causing the
bin/tests/system/start.pl script to truncate some of the log files
written during the test.  This makes troubleshooting certain test
failures hard or even impossible.

Fix by calling bin/tests/system/start.pl with the --restart command-line
option for every start_servers() invocation except the first one.

(cherry picked from commit 65abbca79b)
2022-01-26 15:29:39 +01:00
Petr Špaček
e9673d7cd1 Merge branch 'pspacek/misc-doc-cleanups-v9_16' into 'v9_16'
Miscellaneous documentation cleanups [v9_16]

See merge request isc-projects/bind9!5754
2022-01-26 11:14:21 +00:00
Petr Špaček
57f5a2f6e0 Fix incorrect RFC footnote about A6 RR type in RFC4033
A6 type is not mentioned anywhere in RFC4033.

(cherry-picked from commit ee3ba3cac9)
2022-01-26 12:03:35 +01:00
Petr Špaček
c843c73e42 Remove RFCs not implemented in BIND from list in the ARM
This commit partially removes extra RFCs which are not listed in
file doc/misc/rfc-compliance.

Most of the removed RFCs are either outright obsolete, irrelevant,
or not implemented. Rationale:
- 974 - obsolete
- 1033 - ops info, hardly followed today
- 1464 - ops info
- 1591 - policy
- 1537 - obsolete
- 1713 - obsolete
- 1794 - notimp
- 2010 - ops info
- 2052 - obsolete
- 2065 - obsolete
- 2137 - obsolete
- 2168 - obsolete
- 2240 - obsolete
- 2345 - not dns
- 2352 - not dns
- 2540 - notimp
- 2825 - notimp, info, obsolete
- 2826 - notimp
- 2929 - obsolete
- 3071 - policy
- 3090 - obsolete
- 3258 - notimp
- 6594 - iana, SSHFP
- 7216 - not dns
- 8482 - notimp
- 8490 - notimp

Probably most notable RFCs removed are:
- 8482 for special ANY handling
- 8490 for Stateful Operations
As far as I can tell BIND does not implement those.

(cherry-picked from commit 8c82b0f2d0)
2022-01-26 12:03:35 +01:00
Petr Špaček
e538995890 Reword RFC section in the ARM
Add couple links and caveant for uninitiated readers.

(cherry-picked from commit 4379e16996)
2022-01-26 12:03:35 +01:00
Petr Špaček
b73623370e Add RFCs listed in doc/misc/rfc-compliance to doc/arm/general.rst
There were three RFCs listed in list of "RFCs we implement" but missing
in the ARM.

Command to compare lists in the two documents:

    diff <(grep -o '^  RFC[0-9]\+' doc/misc/rfc-compliance | sed -e 's/[^0-9]//g' | sort -n) <(grep  '^:rfc:`' doc/arm/general.rst | sed -e 's/^.*`\([0-9]*\)`.*$/\1/' | sort -n)

(cherry-picked from commit b1af79acc7)
2022-01-26 12:03:35 +01:00
Petr Špaček
fc77d0e4bf Rework doc/arm/build.rst
- Revise the list of required libraries.
  - Apply miscellaneous tweaks to style, formatting, and ordering.

(cherry-picked from commit 4b1c70de90)
2022-01-26 12:03:35 +01:00
Petr Špaček
2542fdf059 Deduplicate text between Building BIND 9 / Supported Platforms in the ARM
Supported Platforms section is now really only about platforms and not
libraries. Libraries were moved to the Building BIND section.

We now have section for required libraries, and second with optional
features.  Wordy explanations were taken verbatim from the original
README.md.

(cherry-picked from commit 2c81fa9013)
2022-01-26 12:03:35 +01:00
Petr Špaček
93f782581e Replace Building BIND 9 section in README with reference to ARM
Plain-text README file was regenerated using commands from v9.16
Makefile.

(cherry-picked from commit 933ed9d537)
2022-01-26 12:03:35 +01:00
Petr Špaček
d351f78709 Convert "Building BIND" section from README.md to reStructuredText
Converted using pandoc 2.14.2-14 on Arch Linux:

    $ pandoc --shift-heading-level-by=-1 -f markdown -t rst README.md > doc/arm/build.rst

Plus hand-edit to remove sections other than Building BIND 9, remove
misindentation in section headers, and add a standard copyright header.
2022-01-26 12:03:35 +01:00
Petr Špaček
5058817f5a Link to ISC KB for most up-to-date platform support statuses
(cherry-picked from commit 3bd4318fcc)
2022-01-26 12:03:35 +01:00
Petr Špaček
27cfa574dc Replace all occurences of PLATFORMS file with reference to the ARM
The conf.py exclude_patterns now includes platforms.rst to avoid
problems with redefining labels:
https://github.com/sphinx-doc/sphinx/issues/1668#issuecomment-71376208

Plain-text README file was regenerated using commands from v9.16
Makefile.

(cherry-picked from commit 920a2e730b)
2022-01-26 12:03:35 +01:00
Petr Špaček
dd901b5c42 Replace duplicate Supported Operating Systems in the ARM by PLATFORMS.rst
(cherry-picked from commit f693c9b1a7)
2022-01-26 12:03:35 +01:00
Petr Špaček
b13592f650 Convert PLATFORMS file from Markdown to reStructuredText
Converted using pandoc 2.14.2-14 on Arch Linux:

    $ pandoc -f markdown -t rst PLATFORMS.md > PLATFORMS.rst

The pandoc-generated copyright header was subsequently replaced with
usual one for .rst files.
2022-01-26 12:03:30 +01:00
Arаm Sаrgsyаn
5fba218bf4 Merge branch '3060-revert-view-on-failed-reconfig-v9_16' into 'v9_16'
[v9_16] Improve the view configuration error handling and reverting logic

See merge request isc-projects/bind9!5753
2022-01-26 08:43:31 +00:00
Aram Sargsyan
4ada743291 Don't use RTLD_DEEPBIND with sanitizers
dlopen(3) RTLD_DEEPBIND flag is incompatible with sanitizer runtime
(see https://github.com/google/sanitizers/issues/611 for details).
2022-01-26 08:19:02 +00:00
Aram Sargsyan
254cabb558 Fix a memory leak in dns_dlzcreate()
dns_dlzcreate() fails to free the memory allocated for dlzname
when an error occurs.

Free dlzname's memory (acquired earlier with isc_mem_strdup())
by calling isc_mem_free() before returning an error code.

(cherry picked from commit 4a6c66288f)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
b5735ec37a Fix invalid control port number in the catz system test
When failure is expected, the `rndc` command in the catz system test
is being called directly instead of using a function, i.e.:

    $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig \
        > /dev/null 2>&1 && ret=1

... instead of:

    rndccmd 10.53.0.2 reconfig && ret=1

This is done to suppress messages like "lt-rndc: 'reconfig' failed:
failure" appearing in the message log of the test, because failure
is actually expected, and the appearance of that message can be
confusing.

The port value used in this case is not correct, making the
`rndc reload` command to fail.  This error was not detected earlier
only because the failure of the command is actually expected, but
the failure happens for a "wrong" reason, and the test still passes.

Fix the error by using the existing variable instead of the fixed
number.

(cherry picked from commit 5f9d4b5db4)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
094e416fff Add a system test for view reverting after a failed reconfiguration
Test the view reverting code by introducing a faulty dlz configuration
in named.conf and using `rndc reconfig` to check if named handles the
situation correctly.

We use "dlz" because the dlz processing code is located in an ideal
place in the view configuration function for the test to cover the
view reverting code.

This test is specifically added to the catz system test to additionally
cover the catz reconfiguration during the mentioned failed
reconfiguration attempt.

(cherry picked from commit 62337d433f)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
acc774e4dd Add CHANGES and release notes for [GL #3060]
(cherry picked from commit d7dfa2dc4b)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
a663216c0e Improve the zones' view reverting logic when a zone is a catalog zone
When a zone is being configured with a new view, the catalog zones
structure will also be linked to that view. Later on, in case of some
error, should the zone be reverted to the previous view, the link
between the catalog zones structure and the view won't be reverted.

Change the dns_zone_setviewrevert() function so it calls
dns_zone_catz_enable() during a zone revert, which will reset the
link between `catzs` and view.

(cherry picked from commit 2fd967136a)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
885e44650b Separate the locked parts of dns_zone_catz_enable/disable functions
Separate the locked parts of dns_zone_catz_enable() and
dns_zone_catz_disable() functions into static functions.  This will
let us perform those tasks from the other parts of the module while
the zone is locked, avoiding one pair of additional unlocking and
locking operations.

(cherry picked from commit 6b937ed5f6)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
f555f1d2eb Improve the view configuration error handling and reverting logic
If a view configuration error occurs during a named reconfiguration
procedure, BIND can end up having twin views (old and new), with some
zones and internal structures attached to the old one, and others
attached to the new one, which essentially creates chaos.

Implement some additional view reverting mechanisms to avoid the
situation described above:

 1. Revert rpz configuration.

 2. Revert catz configuration.

 3. Revert zones to view attachments.

(cherry picked from commit 3697560f04)
2022-01-26 08:19:02 +00:00
Evan Hunt
8e9e2d7608 Merge branch '3111-fix-dlz-pthreads' into 'v9_16'
restore missing lines in dlz_pthread.h

See merge request isc-projects/bind9!5757
2022-01-26 05:09:10 +00:00
Evan Hunt
5996c73516 restore missing lines in dlz_pthread.h
some lines were accidentally deleted during a backport that
made it imposisble to build DLZ modules.
2022-01-25 12:28:48 -08:00
Petr Špaček
7b50984350 Merge branch 'pspacek/fix-historical-relnotes' into 'v9_16'
[v9_16] Fix historical release notes

See merge request isc-projects/bind9!5722
2022-01-24 16:39:22 +00:00
Petr Špaček
675f6c6b57 Remove reference to (unavailable) nsdname-wait-recurse option from ARM
This option is available only in 9.16-S edition, but docs for it were
accidentally imported when documentation was migrated to Sphinx in
!3536.
2022-01-24 17:34:53 +01:00
Petr Špaček
ea4a90a96a Fix inconsistent release note for #1807
This was an omission in !3495.
2022-01-24 17:34:53 +01:00
Petr Špaček
c3a1287e1f Add missing release notes for CVE-2020-8616 and CVE-2020-8617
These release notes were lost when converting docs from XML to RST
formats. These two notes were removed by commit
5a855f6754.

Related: #1388, #1703, !3536
2022-01-24 17:34:48 +01:00
Ondřej Surý
5656609879 Merge branch 'ondrej/use-utc-for-reproducible-builds-v9_16' into 'v9_16'
Use UTC datetime for reproducible builds

See merge request isc-projects/bind9!5751
2022-01-24 15:35:09 +00:00
Ondřej Surý
7df5065c75 Use UTC datetime for reproducible builds
For reproducible builds, we use last modification time of the CHANGES
file.  This works pretty well, unless the builds are made in different
timezones.

Use UTC option to date command to make the builds reproducible.
2022-01-24 16:24:36 +01:00
Petr Špaček
c4769937a5 Merge branch 'pspacek/remove-duplicate-named.conf.rst-v9_16' into 'v9_16'
Remove duplicate named.conf.rst file [v9_16]

See merge request isc-projects/bind9!5746
2022-01-21 14:43:21 +00:00
Petr Špaček
da70d59f40 Remove duplicate named.conf.rst file
As far as I can tell, it is some leftover from the times when Sphinx
docs were introduced (commit 9fb6d11abb).
It seems like it is not referenced from anywhere.

(cherry picked from commit 0a5c2c23bb)
2022-01-21 15:33:40 +01:00
Michał Kępień
fbb824c167 Merge branch 'v9_16_25-release' into 'v9_16'
Merge 9.16.25 release branch

See merge request isc-projects/bind9!5742
2022-01-20 10:43:21 +00:00
Michał Kępień
5111a76eb0 Prepare release notes for BIND 9.16.26 2022-01-20 11:38:18 +01:00
Tinderbox User
f4cdb2448c Merge branch 'prep-release' into v9_16_25-release 2022-01-20 11:37:08 +01:00
Michał Kępień
4a2f91272c Merge branch 'pspacek/prepare-documentation-for-bind-9.16.25' into 'v9_16_25-release'
Prepare documentation for BIND 9.16.25

See merge request isc-private/bind9!343
2022-01-20 11:37:08 +01:00
Tinderbox User
4e0d55cdcd prep 9.16.25 2022-01-20 11:37:08 +01:00
Michał Kępień
9987ff1edf Prepare release notes for BIND 9.16.25 2022-01-20 11:37:08 +01:00
Michał Kępień
c5f7ece3ad Reorder release notes 2022-01-20 11:37:08 +01:00
Petr Špaček
00aeba54c9 Tweak and reword release notes 2022-01-20 11:37:08 +01:00
Michał Kępień
3d1544726b Merge branch '3080-rndc-catch-canceled-v9_16' into 'v9_16'
rndc: add an extra task reference

See merge request isc-projects/bind9!5740
2022-01-20 08:06:21 +00:00
Evan Hunt
3aa529a9e0 CHANGES for [GL #3080] 2022-01-19 12:01:45 -08:00
Evan Hunt
075722f8a2 rndc: add an extra task reference
adding an extra task before launching the rndc app prevents
a use-after-free when task events fire after the app has been
shut down by a signal.
2022-01-19 11:05:00 -08:00
Ondřej Surý
65314e437f Merge branch 'each-fix-changes-v9_16' into 'v9_16'
fix CHANGES

See merge request isc-projects/bind9!5723
2022-01-17 10:59:39 +00:00
Evan Hunt
e437ef6d6b fix misplaced CHANGES note
Change #5676 was incorrectly placed under 9.16.24 when backporting,
but is actually in 9.16.25.
2022-01-17 11:55:46 +01:00
Ondřej Surý
c7413e9f5d Merge branch 'djt-update-cookie-secret-doc-v9_16' into 'v9_16'
docs: Update ARM to reflect changes to acceptable cookie-secret values

See merge request isc-projects/bind9!5729
2022-01-17 10:53:57 +00:00
Dan Theisen
133b5c1a52 docs: Update ARM to reflect changes to acceptable cookie-secret values
(cherry picked from commit acf1d502d6)
2022-01-17 11:52:13 +01:00
Ondřej Surý
5beaf7638c Merge branch '3093-missing-libuv-code-v9_16' into 'v9_16'
add UV_ENOTSUP to isc___nm_uverr2result()

See merge request isc-projects/bind9!5728
2022-01-17 10:51:31 +00:00
Evan Hunt
464b09a804 add UV_ENOTSUP to isc___nm_uverr2result()
This error code is now mapped to ISC_R_FAMILYNOSUPPORT.

(cherry picked from commit be0bc24c7f)
2022-01-17 11:47:12 +01:00
Ondřej Surý
ea26c36d62 Merge branch 'ondrej/fix-missing-backtick-in-host.rst-v9_16' into 'v9_16'
Add missing backtick to host.rst

See merge request isc-projects/bind9!5725
2022-01-16 07:06:44 +00:00
Ondřej Surý
35aba6f078 Add missing backtick to host.rst
The missing backtick was causing formatting problems in the host
manpage.

(cherry picked from commit aaa31962d2)
2022-01-16 08:02:26 +01:00
Ondřej Surý
c79a35294e Merge branch '3095-invalid-recvmmsg-detection-v9_16' into 'v9_16'
Fix the UDP recvmmsg support

See merge request isc-projects/bind9!5717
2022-01-13 22:26:42 +00:00
Ondřej Surý
4666cb4a4e Add CHANGES and release notes for [GL #3095]
(cherry picked from commit 8d778f758b)
2022-01-13 23:05:38 +01:00
Ondrej Sury
04eeb67d97 Instead of detecting MUSL libc, detect padding in struct msghdr
The detection of MUSL libc via autoconf $host turned out to be
not reliable.

Convert the autoconf check from $host detection to actually detect
the padding used in the struct msghdr.
2022-01-13 23:05:38 +01:00
Ondřej Surý
86f9b16fd7 Revert "Always enqueue isc__nm_tcp_resumeread()"
The commit itself is harmless, but at the same time it is also useless,
so we are reverting it.

This reverts commit 11c869a3d5.

(cherry picked from commit 0a4e91ee47)
2022-01-13 21:39:57 +01:00
Ondrej Sury
de8dbcbfbc Disable udp recvmmsg support on systems with MUSL libc
The Linux kernel diverts from the POSIX specification for two members of
struct msghdr making them size_t sized (instead of int and socklen_t).
In glibc, the developers have decided to use that.  However, the MUSL
developers used padding for the struct and kept the members defined
according to the POSIX.

This creates a problem, because libuv doesn't use recvmmsg() library
call where the padding members are correctly zeroed and instead calls
the syscall directly, the struct msghdr is passed to the kernel with
enormous values in those two members (because of the random junk in the
padding members) and the syscall thus fail with EMSGSIZE.

Disable udp recvmmsg support on systems with MUSL libc until the libuv
starts zeroing the struct msghdr before passing it to the syscall.

(cherry picked from commit 287ea095f1)
2022-01-13 21:39:57 +01:00
Ondřej Surý
5b02f5a8a0 Fix the UDP recvmmsg support
Previously, the netmgr/udp.c tried to detect the recvmmsg detection in
libuv with #ifdef UV_UDP_<foo> preprocessor macros.  However, because
the UV_UDP_<foo> are not preprocessor macros, but enum members, the
detection didn't work.  Because the detection didn't work, the code
didn't have access to the information when we received the final chunk
of the recvmmsg and tried to free the uvbuf every time.  Fortunately,
the isc__nm_free_uvbuf() had a kludge that detected attempt to free in
the middle of the receive buffer, so the code worked.

However, libuv 1.37.0 changed the way the recvmmsg was enabled from
implicit to explicit, and we checked for yet another enum member
presence with preprocessor macro, so in fact libuv recvmmsg support was
never enabled with libuv >= 1.37.0.

This commit changes to the preprocessor macros to autoconf checks for
declaration, so the detection now works again.  On top of that, it's now
possible to cleanup the alloc_cb and free_uvbuf functions because now,
the information whether we can or cannot free the buffer is available to
us.

(cherry picked from commit 7370725008)
2022-01-13 21:38:43 +01:00
Ondřej Surý
570aae5b9b Merge branch 'ondrej/remove-util-copyrights-v9_16' into 'v9_16'
Remove the copyright handling via util/copyrights

See merge request isc-projects/bind9!5709
2022-01-11 12:06:11 +00:00
Ondřej Surý
b62feae347 Remove util/copyrights
(cherry picked from commit e1d2e26360)
2022-01-11 12:22:09 +01:00
Ondřej Surý
2bf7921c7e Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.

(cherry picked from commit 58bd26b6cf)
2022-01-11 12:22:09 +01:00
Ondřej Surý
f27df9899b Add reuse lint CI job
Instead of checking for the licenses in the misc step, add a separate
job that uses the upstream provided image that has reuse tool installed
and run `reuse lint` from the separate job.

(cherry picked from commit dbcff56043)
2022-01-11 09:49:00 +01:00
Ondřej Surý
7b532569e3 Remove the copyright handling via util/copyrights
The copyright handling has been long obsolete, the works is covered as
whole by the COPYING/LICENSE file even if a specific file doesn't have
a copyright header.

The important thing to remember here is that any work is covered by a
copyright law and by explicitly giving it license we provide extra
rights to the users of the works.

(cherry picked from commit 09c32a8d75)
2022-01-11 09:48:58 +01:00
Mark Andrews
e38a74a610 Merge branch '3025-document-how-rate-limiting-uses-dns-cookies-v9_16' into 'v9_16'
[v9_16] Document how rate limiting uses DNS cookies

See merge request isc-projects/bind9!5701
2022-01-07 08:49:37 +00:00
Björn Persson
fd1d6b5d1c Document the interation of DNS COOKIE and RRL
Send back BADCOOKIE responses instead of TC=1 when slipping.

Skip rate limiting for UDP requests with valid server cookies.

(cherry picked from commit a59482b85c)
2022-01-07 19:29:26 +11:00
Ondřej Surý
e1d9996222 Merge branch '3079-always-enqueue-isc__nm_tcp_resumeread-v9_16' into 'v9_16'
Always enqueue isc__nm_tcp_resumeread()

See merge request isc-projects/bind9!5699
2022-01-06 19:32:18 +00:00
Ondřej Surý
21b74b8c48 Add CHANGES and release note for [GL #3079]
(cherry picked from commit 5563d06d62)
2022-01-06 20:00:44 +01:00
Ondřej Surý
8590251f5a Always enqueue isc__nm_tcp_resumeread()
The isc__nm_tcp_resumeread() was using maybe_enqueue function to enqueue
netmgr event which could case the read callback to be executed
immediately if there was enough data waiting in the TCP queue.

If such thing would happen, the read callback would be called before the
previous read callback was finished and the worker receive buffer would
be still marked "in use" causing a assertion failure.

This would affect only raw TCP channels, e.g. rndc and http statistics.

(cherry picked from commit 11c869a3d5)
2022-01-06 20:00:44 +01:00
Ondřej Surý
a06707c63e Merge branch 'ondrej/fix-taskmgr-exiting-access-v9_16' into 'v9_16'
On shutdown, return ISC_R_SHUTTINGDOWN from isc_taskmgr_excltask()

See merge request isc-projects/bind9!5698
2022-01-06 17:29:49 +00:00
Ondřej Surý
5be356760d Remove taskmgr->excl_lock, fix the locking for taskmgr->exiting
While doing code review, it was found that the taskmgr->exiting is set
under taskmgr->lock, but accessed under taskmgr->excl_lock in the
isc_task_beginexclusive().

Additionally, before the change that moved running the tasks to the
netmgr, the task_ready() subrouting of isc_task_detach() would lock
mgr->lock, requiring the mgr->excl to be protected mgr->excl_lock
to prevent deadlock in the code.  After !4918 has been merged, this is
no longer true, and we can remove taskmgr->excl_lock and use
taskmgr->lock in its stead.

Solve both issues by removing the taskmgr->excl_lock and exclusively use
taskmgr->lock to protect both taskmgr->excl and taskmgr->exiting which
now doesn't need to be atomic_bool, because it's always accessed from
within the locked section.

(cherry picked from commit e705f213ca)
2022-01-06 17:56:45 +01:00
Ondřej Surý
9ec7d78d16 On shutdown, return ISC_R_SHUTTINGDOWN from isc_taskmgr_excltask()
The isc_taskmgr_excltask() would return ISC_R_NOTFOUND either when the
exclusive task was not set (yet) or when the taskmgr is shutting down
and the exclusive task has been already cleared.

Distinguish between the two states and return ISC_R_SHUTTINGDOWN when
the taskmgr is being shut down instead of ISC_R_NOTFOUND.

(cherry picked from commit f9d90159b8)
2022-01-06 17:56:45 +01:00
Petr Špaček
39a8511084 Merge branch 'vicky-main-patch-33672-v9_16' into 'v9_16'
Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo [v9_16]

See merge request isc-projects/bind9!5697
2022-01-06 15:26:30 +00:00
Vicky Risk
18322cd85b Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo
(cherry picked from commit 896fa924f3)
2022-01-06 16:20:11 +01:00
Ondřej Surý
ebec9c701a Merge branch '3071-signed-version-of-an-inline-signed-zone-may-be-dumped-without-unsigned-serial-number-fix-v9_16' into 'v9_16'
Check unsigned serial number in signed zone files

See merge request isc-projects/bind9!5693
2022-01-06 11:33:11 +00:00
Ondřej Surý
721c175bf4 Add CHANGES and release note for [GL #3071]
(cherry picked from commit ff8d37cbdb)
2022-01-06 12:27:12 +01:00
Ondřej Surý
4aed6821d7 Revert "Add CHANGES and release note for [GL #3071]"
This reverts commit 7a6365d02875ca1344013ad16ae2d33a51307bec.

(cherry picked from commit 5f36948176)
2022-01-06 12:27:12 +01:00
Michał Kępień
149285168e Do not detach raw zone until dumping is complete
When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is stored in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is modified
while named is not running.

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This should
always be the case as long as the signed version of the zone is used for
anything by named.

However, a scenario exists in which the signed version of the zone has
zone->raw set to NULL while it is being dumped:

 1. Zone dump is requested; zone_dump() is invoked.

 2. Another zone dump is already in progress, so the dump gets deferred
    until I/O is available (see zonemgr_getio()).

 3. The last external reference to the zone is released.
    zone_shutdown() gets queued to the zone's task.

 4. I/O becomes available for zone dumping.  zone_gotwritehandle() gets
    queued to the zone's task.

 5. The zone's task runs zone_shutdown().  zone->raw gets set to NULL.

 6. The zone's task runs zone_gotwritehandle().  zone->raw is determined
    to be NULL, causing the serial number of the unsigned version of the
    zone to be omitted from the raw-format dump of the signed zone file.

Note that the naïve solution - deferring the dns_zone_detach() call for
zone->raw until zone_free() gets called for the secure version of the
zone - does not work because it leads to a chicken-and-egg problem when
the inline-signed zone is about to get freed: the raw zone holds a weak
reference to the secure zone and that reference does not get released
until the reference count for the raw zone reaches zero, which in turn
would not happen until all weak references to the secure zone were
released.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.  Ensure zone->raw gets detached from
after the dump is finished if detaching gets deferred.  Prevent zone
dumping from being requeued upon failure if the zone is in the process
of being cleaned up as it opens up possibilities for the zone->raw
reference to leak, triggering a shutdown hang.

(cherry picked from commit ef625f5f06)
2022-01-06 12:27:12 +01:00
Ondřej Surý
b8e6dffdbc Revert "Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()"
This reverts commit cc1d4e1aa6.

(cherry picked from commit 1064b2fc47)
2022-01-06 12:27:12 +01:00
Michał Kępień
1904acc7ef Check unsigned serial number in signed zone files
All signed zone files present in bin/tests/system/inline/ns8 should
contain the unsigned serial number in the raw-format header.  Add a
check to ensure that is the case.  Extend the dnssec-signzone command
line in ns8/sign.sh with the -L option to allow the zones initially
signed there to pass the newly added check.  Add another zone to the
configuration for the ns8 named instance to ensure the check also passes
when multiple zones are inline-signed by a single named instance.

(cherry picked from commit ab49205af3)
2022-01-06 12:27:12 +01:00
Matthijs Mekking
be1efdcf24 Merge branch '3035-dnssec-policy-stops-signing-when-removing-zsk-v9_16' into 'v9_16'
Fix autosign system test, allow expired zone signatures to be replaced with KSK RRSIGs (9.16)

See merge request isc-projects/bind9!5694
2022-01-06 08:58:44 +00:00
Matthijs Mekking
99316385d3 Replace RSASHA1 in autosign test with default alg
Change RSASHA1 to $DEFAULT_ALGORITHM to be FIPS compliant.

There is one RSASHA1 occurence left, to test that dynamically adding an
NSEC3PARAM record to an NSEC-only zone fails.

(cherry picked from commit 6e9fed2d24)
2022-01-06 09:35:53 +01:00
Matthijs Mekking
b002ed569c Add CHANGES and release note for GL #3049
This is a bugfix worth mentioning.

(cherry picked from commit f3e668d630)
2022-01-06 09:35:48 +01:00
Matthijs Mekking
17ae663084 Update autosign test
Update the autosign system test with new expected behavior.

The 'nozsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

The 'inaczsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

In both scenarios, signatures are deleted, not retained, so the
"retaining signatures" warning should not be logged.

Furthermore, thsi commit fixex a test bug where the 'awk' command
always returned 0.

Finally, this commit adds a test case for an offline KSK, for the zone
'noksk.example'. In this case the expired signatures should be retained
(despite the zone being bogus, but resigning the DNSKEY RRset with the
ZSK won't help here).

(cherry picked from commit fbd559ad0d)
2022-01-06 09:35:42 +01:00
Matthijs Mekking
bdb91e3825 Fix bug introduced by #763 related to offline keys
In some cases we want to keep expired signatures. For example, if the
KSK is offline, we don't want to fall back to signing with the ZSK.
We could remove the signatures, but in any case we end up with a broken
zone.

The change made for GL #763 prevented the behavior to sign the DNSKEY
RRset with the ZSK if the KSK was offline (and signatures were expired).

The change causes the definition of "having both keys": if one key is
offline, we still consider having both keys, so we don't fallback
signing with the ZSK if KSK is offline.

That change also works the other way, if the ZSK is offline, we don't
fallback signing with the KSK.

This commit fixes that, so we only fallback signing zone RRsets with
the KSK, not signing key RRsets with the ZSK.

(cherry picked from commit beeefe35c4)
2022-01-06 09:35:36 +01:00
Matthijs Mekking
8e31f6981a Only warn if we could not delete signature
BIND can log this warning:

    zone example.ch/IN (signed): Key example.ch/ECDSAP256SHA256/56340
      missing or inactive and has no replacement: retaining signatures.

This log can happen when BIND tries to remove signatures because the
are about to expire or to be resigned. These RRsets may be signed with
the KSK if the ZSK files has been removed from disk. When we have
created a new ZSK we can replace the signatures creeated by the KSK
with signatures from the new ZSK.

It complains about the KSK being missing or inactive, but actually it
takes the key id from the RRSIG.

The warning is logged if BIND detects the private ZSK file is missing.

The warning is logged even if we were able to delete the signature.

With the change from this commit it only logs this warning if it is not
okay to delete the signature.

(cherry picked from commit 2d2858841a)
2022-01-06 09:35:29 +01:00
Ondřej Surý
0c2e37a064 Merge branch '3074-catz-excl-task-v9_16' into 'v9_16'
Prevent a shutdown race in catz_create_chg_task()

See merge request isc-projects/bind9!5691
2022-01-05 13:01:15 +00:00
Evan Hunt
e243f68f00 Add CHANGES note for [GL #3074]
(cherry picked from commit 81c09b005b)
2022-01-05 13:37:47 +01:00
Evan Hunt
21b0093440 Prevent a shutdown race in catz_create_chg_task()
If a catz event is scheduled while the task manager was being
shut down, task-exclusive mode is unavailable. This needs to be
handled as an error rather than triggering an assertion.

(cherry picked from commit 973ac1d891)
2022-01-05 13:37:46 +01:00
Matthijs Mekking
221adf3471 Merge branch '3023-auto-dnssec-documentation-bug-v9_16' into 'v9_16'
Update auto-dnssec documentation

See merge request isc-projects/bind9!5689
2022-01-05 11:24:37 +00:00
Matthijs Mekking
ec483977e4 Add CHANGES for #3023
(cherry picked from commit 447fa2a816)
2022-01-05 11:57:14 +01:00
Matthijs Mekking
219f5ebd32 Update auto-dnssec documentation
Explain that 'auto-dnssec' may only be activated at zone level.

(cherry picked from commit aac39647f3)
2022-01-05 11:57:08 +01:00
Ondřej Surý
d9b4a3d123 Merge branch '3071-signed-version-of-an-inline-signed-zone-may-be-dumped-without-unsigned-serial-number-v9_16' into 'v9_16'
Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()

See merge request isc-projects/bind9!5688
2022-01-05 10:02:54 +00:00
Ondřej Surý
604612e5b9 Add CHANGES and release note for [GL #3071]
(cherry picked from commit 4d71a3b309)
2022-01-05 10:33:46 +01:00
Michał Kępień
7b455124d5 Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()
When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is written in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is
modified while named is not running (see RT #26676).

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This
should always be the case as long as the signed version of the zone is
used for anything by named.

However, under certain circumstances the zone->raw could be set to NULL
while the zone is being dumped.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.

(cherry picked from commit cc1d4e1aa6)
2022-01-05 10:32:50 +01:00
Mark Andrews
e837701a36 Merge branch '3065-memory-leak-on-duplicately-named-dnssec-policy-v9_16' into 'v9_16'
Address memory leak when processing dnssec-policy clauses

See merge request isc-projects/bind9!5685
2022-01-03 22:23:36 +00:00
Mark Andrews
8b0b85828b Add CHANGES for [GL #3065]
(cherry picked from commit 6de041f19c)
2022-01-04 09:04:49 +11:00
Mark Andrews
0e0cd6bf17 Report duplicate dnssec-policy names
Duplicate dnssec-policy names were detected as an error condition
but were not logged.

(cherry picked from commit b8845454c8)
2022-01-04 09:04:07 +11:00
Mark Andrews
8dd1288dca Address memory leak when processing dnssec-policy clauses
A kasp structure was not detached when looking to see if there
was an existing kasp structure with the same name, causing memory
to be leaked.  Fixed by calling dns_kasp_detach() to release the
reference.

(cherry picked from commit 694440e614)
2022-01-04 09:04:07 +11:00
Michal Nowak
478438c1a8 Merge branch 'mnowak/year-2022-v9_16' into 'v9_16'
[v9_16] Update copyrights to 2022

See merge request isc-projects/bind9!5682
2022-01-03 15:49:10 +00:00
Michal Nowak
71d780df3c Update copyrights to 2022
(cherry picked from commit befd654e00)
2022-01-03 11:57:58 +01:00
Michał Kępień
365593be15 Merge branch '2782-set-version-and-release-variables-in-conf.py-v9_16' into 'v9_16'
[v9_16] Set version and release variables in conf.py

See merge request isc-projects/bind9!5677
2021-12-29 09:21:47 +00:00
Michał Kępień
523b38875e Remove man_SPHINXOPTS from doc/arm/Makefile.in
The man_SPHINXOPTS variable is only used in doc/man/Makefile.in.  Remove
its duplicate definition from doc/arm/Makefile.in.
2021-12-29 09:59:38 +01:00
Michał Kępień
7eac78ccc0 Clarify use of the "today" Sphinx variable
Add a comment explaining the purpose of setting the "today" variable in
Sphinx invocations to prevent confusion caused by the absence of that
variable from reStructuredText sources.

(cherry picked from commit e67cdb390a)
2021-12-29 09:59:38 +01:00
Michał Kępień
02387700ff Set version and release variables in conf.py
Some Sphinx variables used in the ARM are only set in
doc/arm/Makefile.in.  This works fine when building the ARM using
"make", but does not work with Read the Docs, which only looks at
conf.py files.

Since Read the Docs does not run ./configure, renaming conf.py to
conf.py.in and using Autoconf output variables is not a feasible
solution.

Instead, extend doc/arm/conf.py with some Python code which processes
the "version" file using regular expressions and sets the relevant
Sphinx variables accordingly.  As this solution also works fine when
building the ARM using "make", drop the relevant -D options from the
list of sphinx-build options used for building the ARM in
doc/arm/Makefile.in.

Note that the man_SPHINXOPTS counterparts of the removed -D switches are
left intact because doc/man/conf.py is a separate Sphinx project which
is only processed using "make" and duplicating the Python code added to
doc/arm/conf.py by this commit would be inelegant.

(cherry picked from commit 38d251e11b)
2021-12-29 09:59:38 +01:00
Michal Nowak
0f81ad2428 Merge branch 'mnowak/make-debian-11-bullseye-base-image-v9_16' into 'v9_16'
[v9_16] Make bullseye the base image

See merge request isc-projects/bind9!5670
2021-12-23 15:58:13 +00:00
Michal Nowak
38228927e1 Use /dev/urandom as BIND 9.11 randomness source
This prevents resolver timeouts for the reference (BIND 9.11) servers
used in respdiff tests run on Debian 11 "bullseye".

(cherry picked from commit 4d7e343813)
2021-12-23 15:45:36 +01:00
Michal Nowak
f145b884a4 Make bullseye the base image
"buster" jobs are now only going to be run in scheduled pipelines.

"--without-gssapi" ./configure option of "bullseye" before it became
the base image is dropped from "bullseye"-the-base-image because it
reduces gcov coverage by 0.38 % (651 lines) and is used in Debian 9
"stretch".

(cherry picked from commit 910d595fbc)
2021-12-23 15:45:36 +01:00
Michał Kępień
37a4d0fff6 Merge branch 'rhbz/fedora/2032704-v9_16' into 'v9_16'
[v9_16] Avoid conflict with ldap_connect function of openldap

See merge request isc-projects/bind9!5668
2021-12-22 21:21:20 +00:00
Petr Mensik
6ea7005d0e Change all internal functions to dlz_ldap prefix
To prevent any conflict in the future, avoid ldap_ prefix in any
internal functions. Keep it reserved for openldap only.

(cherry picked from commit 7bce3e7791)
2021-12-22 22:15:40 +01:00
Petr Mensik
8408656489 Avoid conflict with ldap_connect function of openldap
ldap_connect is defined by OpenLDAP 2.6. Compiler complains there are
conflicting declarations. Use dlz_ldap prefix instead of ldap to avoid
conflict.

(cherry picked from commit 49e523e56f)
2021-12-22 22:15:40 +01:00
Michal Nowak
7baec16188 Merge branch 'mnowak/respdiff-job-dependency-fix-v9_16' into 'v9_16'
[v9_16] Execute respdiff jobs out-of-order

See merge request isc-projects/bind9!5666
2021-12-22 14:31:57 +00:00
Michal Nowak
a68f482e14 Execute respdiff jobs out-of-order
Commit e8d8b43e dropped dependency of "respdiff" and
"respdiff-third-party" jobs on "tarball-create" job because these jobs
don't need to depend on in (e.g., for its artifacts). This, however,
caused that respdiff jobs weren't started out-of-order and artifacts
from all the "Build" stage jobs plus "unit:gcc:buster:amd64" job were
downloaded to project directory and caused problems with compilation:

Originally, the dependency on "tarball-create" has been added in
704eeb32 to indicate that respdiff "is meant to operate on two different
BIND versions". It seems that the intent didn't work out, and we better
make it obvious that respdiff jobs don't depend on any other job and
should be run out-of-order.

(cherry picked from commit 87578efc71)
2021-12-22 15:19:56 +01:00
Michal Nowak
ac61902dfa Merge branch 'mnowak/respdiff-add-third-party-server-support-v9_16' into 'v9_16'
[v9_16] Add respdiff job with third-party recursors

See merge request isc-projects/bind9!5662
2021-12-21 16:39:59 +00:00
Michal Nowak
e8d8b43e67 Add respdiff job with third-party recursors
The order of directories with reference and test BIND 9 are now reversed
for respdiff.sh.

The data.mdb file has more than 10 GB and makes artifact download take
an unnecessarily long time.

(cherry picked from commit 2ececf2c02)
2021-12-21 17:28:22 +01:00
Michal Nowak
c17cf36e53 Merge branch 'mnowak/freebsd-12.3-v9_16' into 'v9_16'
[v9_16] Add FreeBSD 12.3

See merge request isc-projects/bind9!5659
2021-12-20 16:34:58 +00:00
Michal Nowak
4741135328 Add FreeBSD 12.3
(cherry picked from commit a4d8571fa2)
2021-12-20 17:00:10 +01:00
Michal Nowak
c60d6b5029 Merge branch 'mnowak/add-fedora-35-v9_16' into 'v9_16'
[v9_16] Add Fedora 35

See merge request isc-projects/bind9!5657
2021-12-17 15:09:38 +00:00
Michal Nowak
344b95d8fc Add Fedora 35
(cherry picked from commit 668be42965)
2021-12-17 15:41:38 +01:00
Michal Nowak
905d51fe79 Merge branch 'mnowak/drop-freebsd-11-v9_16' into 'v9_16'
[v9_16] Drop FreeBSD 11

See merge request isc-projects/bind9!5654
2021-12-17 12:02:16 +00:00
Michal Nowak
937dcbaac8 Drop FreeBSD 11
Support for FreeBSD 11.4, the last FreeBSD 11.x release, ended on
September 30, 2021.

The "--with-readline" ./configure option has been added to gcc:sid:amd64
CI job; otherwise, it would be lost with the FreeBSD 11 removal.

Link: https://www.freebsd.org/security/unsupported/
(cherry picked from commit 981579f379)
2021-12-17 12:53:21 +01:00
Michal Nowak
765750bc39 Merge branch 'mnowak/alpine-3.15-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.15

See merge request isc-projects/bind9!5651
2021-12-16 16:02:46 +00:00
Michal Nowak
e0a80d64c9 Add Alpine Linux 3.15
(cherry picked from commit d43127a387)
2021-12-16 16:54:37 +01:00
Petr Špaček
39fca4f220 Merge branch 'pspacek/ci-api-triggers-v9_16' into 'v9_16'
Enable regular pipeline jobs to be triggered from Gitlab API [v9_16]

See merge request isc-projects/bind9!5649
2021-12-16 15:22:05 +00:00
Petr Špaček
d6fd1d7172 Enable regular pipeline jobs to be triggered from Gitlab API
(cherry picked from commit eb8c8753ad)
2021-12-16 16:20:23 +01:00
Petr Špaček
b3fb70cf67 Merge branch 'v9_16_24-release' into 'v9_16'
Merge 9.16.24 release branch

See merge request isc-projects/bind9!5645
2021-12-16 12:36:10 +00:00
Petr Špaček
d9d6c0ba66 Set up release notes for BIND 9.16.25 2021-12-16 13:29:31 +01:00
Petr Špaček
bd3201c799 Merge branch 'prep-release' into 'v9_16_24-release'
prep 9.16.24

See merge request isc-private/bind9!340
2021-12-16 13:29:06 +01:00
Petr Špaček
8ef5147598 Merge branch 'michal/prepare-documentation-for-bind-9.16.24' into 'v9_16_24-release'
Prepare documentation for BIND 9.16.24

See merge request isc-private/bind9!339
2021-12-16 13:29:06 +01:00
Petr Špaček
0eb9e59610 prep 9.16.24 2021-12-16 13:29:06 +01:00
Michał Kępień
7a88254d2c Prepare release notes for BIND 9.16.24 2021-12-16 13:29:04 +01:00
Michał Kępień
8cbdef4591 Add release note for GL #853 2021-12-16 13:28:39 +01:00
Michał Kępień
d30ad03361 Tweak and reword release notes 2021-12-16 13:27:30 +01:00
Ondřej Surý
885df6ff32 Merge branch '2398-reduce-memory-used-by-mempools-v9_16' into 'v9_16'
Replace locked mempools with memory contexts

See merge request isc-projects/bind9!5637
2021-12-15 20:42:50 +00:00
Ondřej Surý
16aabacc80 Add CHANGES and release notes for [GL #2398] 2021-12-15 21:23:25 +01:00
Ondřej Surý
1f7d2d53f0 Disable the internal memory allocator by default
For small sized allocations, the internal allocator gets the memory in
bigger blobs that gets splits into right-sized chunks.  This increases
speed of small allocations and reduced the fragmentation, but such
memory is never released back to the operating system.

Disable the internal allocator by default, and add new `-M internal`
command line option to `named`.
2021-12-15 13:29:19 +01:00
Ondřej Surý
c96b6eb5ec Don't use mem freelists for isc_mempools
Previously, with BIND 9 internal allocator, when isc_mempool_put() would
return memory to the allocator, it would not be freed, but it would be
returned to the "freelists" and the memory would not be released to the
operating system.

Change the isc_mempool_get() and isc_mempool_put() to avoid the internal
allocator (mem_getunlocked() and mem_putunlocked()).
2021-12-15 13:29:19 +01:00
Ondřej Surý
c5b703d1c6 Adjust the fillcount and freemax for dns_message mempools
According to the measurements (recorded on GL!5085), the fillcount of 2
for namepool and fillcount of 4 for rdspool can fit 99.99% of request
for tested scenarios.

This was discovered by perf recording the single second recursive test
using flamethrower where the initial malloc lit up like a flare.
2021-12-15 13:29:19 +01:00
Ondřej Surý
6abebaaad9 Remove locking mechanism from the isc_mempool
Now, that all the locked mempools have been replaced with simple isc_mem
context, remove unused optional locking from isc_mempool API.
2021-12-15 13:29:19 +01:00
Ondřej Surý
974f2f6ace Replace locked mempools with memory contexts
Current mempools are kind of hybrid structures - they serve two
purposes:

 1. mempool with a lock is basically static sized allocator with
    pre-allocated free items

 2. mempool without a lock is a doubly-linked list of preallocated items

The first kind of usage could be easily replaced with jemalloc small
sized arena objects and thread-local caches.

The second usage not-so-much and we need to keep this (in
libdns:message.c) for performance reasons.
2021-12-15 13:29:19 +01:00
Michal Nowak
8decad467c Merge branch '2886-drop-cppcheck-v9_16' into 'v9_16'
[v9_16] Drop cppcheck CI job

See merge request isc-projects/bind9!5640
2021-12-14 14:39:21 +00:00
Michal Nowak
4f5d0ea1a2 Drop cppcheck CI job
Every cppcheck update brings the cost of addressing new false positives
in the BIND 9 source code while not reaping any benefits in case of
identified issues with the code.

(cherry picked from commit 654cc61bb9)
2021-12-14 15:10:30 +01:00
Michal Nowak
aa1f5885ab Merge branch 'mnowak/drop-debian-softhsm-ci-jobs' into 'v9_16'
Drop Debian SoftHSM v2.4 CI jobs

See merge request isc-projects/bind9!5610
2021-12-14 11:58:53 +00:00
Michal Nowak
a278145a48 Drop Debian SoftHSM v2.4 CI jobs
The base image is in the process of being upgraded from Debian Buster to
Debian Bullseye, which has SoftHSM v2.6, the same SoftHSM version we
already test PKCS#11 with on Fedora. We don't need to test with two
SoftHSM 2.6 versions, drop CI jobs running on the base image.
2021-12-14 12:33:52 +01:00
Ondřej Surý
a1389327aa Merge branch 'matthijs-regen-configure-after-mr-5625' into 'v9_16'
Regenerate configure file

See merge request isc-projects/bind9!5630
2021-12-09 16:51:52 +00:00
Matthijs Mekking
8dd2038f13 Regenerate configure file
Commit 3c77a51f added a configure check for OPENSSL_cleanup. The
regenerated configure file should have been added to that commit.
2021-12-09 17:03:31 +01:00
Matthijs Mekking
5928f2a5e7 Merge branch 'matthijs-fix-openssl-init-ssl-leak-v9_16' into 'v9_16'
Add OPENSSL_cleanup to tls_shutdown function (9.16)

See merge request isc-projects/bind9!5625
2021-12-09 10:07:19 +00:00
Matthijs Mekking
3c77a51f6b Add OPENSSL_cleanup to tls_shutdown function
This prevents a direct leak in OPENSSL_init_crypto (called from
OPENSSL_init_ssl).

Add shim version of OPENSSL_cleanup because it is missing in LibreSSL on
OpenBSD.

(cherry picked from commit 89f4f8f0c8)
2021-12-09 10:47:56 +01:00
Ondřej Surý
95432e0865 Merge branch '3051-missing-destroy-for-pthread-primitives-v9_16' into 'v9_16'
Stop leaking mutex in nmworker and cond in nm socket

See merge request isc-projects/bind9!5626
2021-12-08 17:39:12 +00:00
Ondřej Surý
1804a0332a Add CHANGES and release not for [GL #3051]
(cherry picked from commit dff5888d9b)
2021-12-08 18:20:16 +01:00
Ondřej Surý
d5cdcf924a Stop leaking mutex in nmworker and cond in nm socket
On FreeBSD, the pthread primitives are not solely allocated on stack,
but part of the object lives on the heap.  Missing pthread_*_destroy
causes the heap memory to grow and in case of fast lived object it's
possible to run out-of-memory.

Properly destroy the leaking mutex (worker->lock) and
the leaking condition (sock->cond).

(cherry picked from commit 57d0fabadd)
2021-12-08 18:19:37 +01:00
Ondřej Surý
4ea50a810c Merge branch '2700-improve-failed-tcp-accept-logging-v9_16' into 'v9_16'
Improve the logging on failed TCP accept

See merge request isc-projects/bind9!5613
2021-12-02 13:40:39 +00:00
Ondřej Surý
597cb80c3e Add CHANGES and release note for [GL #2700]
(cherry picked from commit 9d53471890)
2021-12-02 14:20:16 +01:00
Ondřej Surý
75c484e36d Improve the logging on failed TCP accept
Previously, when TCP accept failed, we have logged a message with
ISC_LOG_ERROR level.  One common case, how this could happen is that the
client hits TCP client quota and is put on hold and when resumed, the
client has already given up and closed the TCP connection.  In such
case, the named would log:

    TCP connection failed: socket is not connected

This message was quite confusing because it actually doesn't say that
it's related to the accepting the TCP connection and also it logs
everything on the ISC_LOG_ERROR level.

Change the log message to "Accepting TCP connection failed" and for
specific error states lower the severity of the log message to
ISC_LOG_INFO.

(cherry picked from commit 20ac73eb22)
2021-12-02 14:19:46 +01:00
Arаm Sаrgsyаn
dd243656be Merge branch '1608-catz-reconfig-crash-fix-v9_16' into 'v9_16'
[v9_16] Fix catalog zone reconfiguration crash

See merge request isc-projects/bind9!5608
2021-12-01 10:31:02 +00:00
Evan Hunt
c243daf839 Add a regression test
Reconfigure the server without catalog-zone configuration, and then
put it back and reconfigure again, to confirm that there's no crash.

(cherry picked from commit bb411af31d)
2021-12-01 09:56:59 +00:00
Aram Sargsyan
a6572062b1 Add CHANGES and release notes for [GL #1608]
(cherry picked from commit e644738310)
2021-12-01 09:56:59 +00:00
Aram Sargsyan
4b362a82eb Fix catalog zone reconfiguration crash
The following scenario triggers a "named" crash:

1. Configure a catalog zone.
2. Start "named".
3. Comment out the "catalog-zone" clause.
4. Run `rndc reconfig`.
5. Uncomment the "catalog-zone" clause.
6. Run `rndc reconfig` again.

Implement the required cleanup of the in-memory catalog zone during
the first `rndc reconfig`, so that the second `rndc reconfig` could
find it in an expected state.

(cherry picked from commit 43ac2cd229)
2021-12-01 09:56:59 +00:00
Mark Andrews
f70a43d8d3 Merge branch '2850-the-list-of-fetches-at-the-end-of-rndc-recursing-output-is-very-poorly-explained-in-the-arm-v9_16' into 'v9_16'
Update the description of fetches-per-zone counters

See merge request isc-projects/bind9!5604
2021-11-30 13:04:03 +00:00
Mark Andrews
566fc191e1 Update the description of fetches-per-zone counters
(cherry picked from commit 65f6d8af75)
2021-11-30 22:40:28 +11:00
Mark Andrews
50d401be1c Merge branch '853-dnssec-dsfromkey-doesn-t-omit-revoked-ksk-v9_16' into 'v9_16'
dnssec-dsfromkey should not convert revoked keys

See merge request isc-projects/bind9!5603
2021-11-30 11:39:27 +00:00
Mark Andrews
f454d0501f Add CHANGES for [GL #853]
(cherry picked from commit d632df3c11)
2021-11-30 22:11:35 +11:00
Mark Andrews
f805436655 Check dnssec-dsfromkey with revoked DNSKEY
Checks that there is a revoked key in the DNSKEY RRset then checks
that only the correct number of DS records are produced.

(cherry picked from commit e7a3ada1d2)
2021-11-30 22:11:03 +11:00
Tony Finch
3f7fa710d7 dnssec-dsfromkey should not convert revoked keys
it is pointless to convert revoked keys to DS or CDS records as
they cannot be used to provide a cryptographic link from the parent
zone.

(cherry picked from commit 04a5529c2d)
2021-11-30 22:11:03 +11:00
Mark Andrews
7a6de3f830 Merge branch '3009-set-dopenssl_suppress_deprecated-for-9-16-and-9-11' into 'v9_16'
Resolve "Set -DOPENSSL_SUPPRESS_DEPRECATED for 9.16 and 9.11"

See merge request isc-projects/bind9!5562
2021-11-26 13:16:25 +00:00
Mark Andrews
91052ae29e Suppress OpenSSL deprecated warnings from OpensSSL 3.0.0
We are not back porting OpenSSL 3.0.0 fixes to this branch so there
is no point in emitting warnings about using deprecated code.
Additionally this impacts --enable-developer and --enable-warn-error.
2021-11-26 12:54:21 +00:00
Mark Andrews
e687014c30 Merge branch '3021-dns_sdlz_putrr-does-not-auto-increase-buffer-v9_16' into 'v9_16'
Do not convert ISC_R_NOSPACE to DNS_R_SERVFAIL too early

See merge request isc-projects/bind9!5596
2021-11-25 21:08:16 +00:00
Mark Andrews
1e908ca076 Add CHANGES for [GL #3021]
(cherry picked from commit ed5d28088a)
2021-11-26 07:47:54 +11:00
Mark Andrews
bf1eaf4661 Exercise ISC_R_NOSPACE path in dns_sdlz_putrr
Use relative names when adding SOA record and a long domain
name to create SOA RR where the wire format is longer than
the initial buffer allocation in dns_sdlz_putrr.

(cherry picked from commit 6dc5248606)
2021-11-26 07:47:14 +11:00
Mark Andrews
4ace37bf73 Do not convert ISC_R_NOSPACE to DNS_R_SERVFAIL too early
The parsing loop needs to process ISC_R_NOSPACE to properly
size the buffer.  If result is still ISC_R_NOSPACE at the end
of the parsing loop set result to DNS_R_SERVFAIL.

(cherry picked from commit 08f1cba096)
2021-11-26 07:44:37 +11:00
Michal Nowak
e7f23efb79 Merge branch 'mnowak/warning-array-subscript-is-of-type-char-on-netbsd-9-v9_16' into 'v9_16'
[v9_16] Fix "array subscript is of type 'char'" on NetBSD 9

See merge request isc-projects/bind9!5594
2021-11-25 18:20:11 +00:00
Michal Nowak
b61eec8376 Fix "array subscript is of type 'char'" on NetBSD 9
In file included from rdata.c:602:
    In file included from ./code.h:88:
    ./rdata/in_1/svcb_64.c:259:9: warning: array subscript is of type 'char' [-Wchar-subscripts]
                            if (!isdigit(*region->base)) {
                                 ^~~~~~~~~~~~~~~~~~~~~~
    /usr/include/sys/ctype_inline.h:51:44: note: expanded from macro 'isdigit'
    #define isdigit(c)      ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_D))
                                                    ^~~~

(cherry picked from commit d09447287f)
2021-11-25 18:54:18 +01:00
Matthijs Mekking
4f4d5302c2 Merge branch 'matthijs-doc-fix-cookie-algorithm-desc-v9_16' into 'v9_16'
Update docs with correct cookie-algorithm values (9.16)

See merge request isc-projects/bind9!5583
2021-11-18 13:08:23 +00:00
Dan Theisen
82d2016b20 Update docs with correct cookie-algorithm values
The documentation was inconsistent with the code. The new description
for cookie-algorithm now reflects the current behavior.

The following two commits are the relevant code changes to this
section of docs: afa81ee4 a912f313

(cherry picked from commit b29a748119)
2021-11-18 13:47:08 +01:00
Michał Kępień
e656d4f957 Merge branch 'v9_16_23-release' into 'v9_16'
Merge 9.16.23 release branch

See merge request isc-projects/bind9!5582
2021-11-18 08:28:40 +00:00
Michał Kępień
2512fb8873 Set up release notes for BIND 9.16.24 2021-11-18 09:19:02 +01:00
Tinderbox User
a8399473bc Merge branch 'prep-release' into v9_16_23-release 2021-11-18 09:19:02 +01:00
Michał Kępień
957dc6c4e0 Merge branch 'michal/prepare-documentation-for-bind-9.16.23' into 'v9_16_23-release'
Prepare documentation for BIND 9.16.23

See merge request isc-private/bind9!336
2021-11-18 09:19:02 +01:00
Tinderbox User
274aae0cc7 prep 9.16.23 2021-11-18 09:19:02 +01:00
Michał Kępień
b4c9087130 Prepare release notes for BIND 9.16.23 2021-11-18 09:19:02 +01:00
Michał Kępień
666cd60807 Tweak and reword release notes 2021-11-18 09:19:02 +01:00
Evan Hunt
9dec7d97d5 Merge branch '2374-mdig-ephemeral-v9_16' into 'v9_16'
Make mdig use the OS-supplied ephemeral port range

See merge request isc-projects/bind9!5579
2021-11-17 23:52:58 +00:00
Evan Hunt
43df2f3aba Make mdig use the OS-supplied ephemeral port range
mdig was always using the default 1024-65535 range for outgoing
messages, instead of using the system's configured ephemeral ports.

(cherry picked from commit 0fecb10c17)
2021-11-17 14:46:32 -08:00
Mark Andrews
18abb4fc3b Merge branch '3012-begin-end-dnssec-managed-keys-in-bin-named-config-c-are-mismatched-v9_16' into 'v9_16'
Update comments around built in trust anchors

See merge request isc-projects/bind9!5577
2021-11-16 22:05:37 +00:00
Mark Andrews
1a94a31484 Embed NAMED_SYSCONFDIR contents in the bind.keys comment
(cherry picked from commit 1d7b1f74c9)
2021-11-17 08:46:07 +11:00
Mark Andrews
4ad84547c5 Update comments around built in trust anchors
The comments now say "# BEGIN TRUST ANCHORS" and "# END TRUST ANCHORS".

(cherry picked from commit 43a7f3f532)
2021-11-17 08:46:07 +11:00
Ondřej Surý
6930550d16 Merge branch 'ondrej/update-flycheck-configuration-on-Linux-v9_16' into 'v9_16'
Add flycheck configuration for libxml2 and json-c on Linux

See merge request isc-projects/bind9!5571
2021-11-15 11:37:03 +00:00
Ondřej Surý
ef5da72b05 Add flycheck configuration for libxml2 and json-c on Linux
(cherry picked from commit 41f86440c4)
2021-11-15 12:34:27 +01:00
Mark Andrews
eef5b35828 Merge branch '3003-greedy-regular-expression-causes-intermittent-nsupdate-system-test-failures-v9_16' into 'v9_16'
Replace incorrect sed expersion with awk

See merge request isc-projects/bind9!5566
2021-11-10 02:35:02 +00:00
Mark Andrews
7bc811f589 Add CHANGES note for [GL #3003]
(cherry picked from commit c1df7884f0)
2021-11-10 12:51:32 +11:00
Mark Andrews
c28478e0ee Replace incorrect sed expersion with awk
The sed expression could find the wrong instance of 10.
Use awk to replace the TTL field and also to specify the
server and issue the send command.

(cherry picked from commit be879cda72)
2021-11-10 12:51:03 +11:00
Petr Špaček
b9731408c6 Merge branch '2779-wildcard_test_property_based-v9_16' into 'v9_16'
Add property based test for wildcard expansion [v9.16]

See merge request isc-projects/bind9!5560
2021-11-09 12:15:16 +00:00
Petr Špaček
21b5dd81ef Add missing PYTHONPATH variable export to pylint job in CI
The old .gitlab-ci.yaml accidentally worked because pylint
was importing modules internally, probably as a side-effect
of testing other code.

This pylint invocation errors out when PYTHONPATH is not set:
    $ pylint --rcfile $CI_PROJECT_DIR/.pylintrc bin/tests/system/keymgr/testpolicy.py
    ************* Module testpolicy
    bin/tests/system/keymgr/testpolicy.py:13:0: E0401: Unable to import 'isc' (import-error)

And this invocation works even without PYTHONPATH:
    $ pylint --rcfile $CI_PROJECT_DIR/.pylintrc bin/python/setup.py bin/tests/system/keymgr/testpolicy.py
2021-11-09 13:13:56 +01:00
Petr Špaček
f3838f76ac Fix system test .status file cleanup
(cherry picked from commit 6495e59a4c)
2021-11-09 13:13:56 +01:00
Petr Špaček
602683d081 Add new system test for wildcard expansion
This is almost minimal prototype to show how to use python-hypothesis
library in a system test. It does not fully replace existing shell-based
system test for wildcards.

(cherry picked from commit 49da19c353)
2021-11-09 13:13:56 +01:00
Petr Špaček
34714e100d Use more liberal pylint for tests
Ignore wrong-import-position to enable use of pytest.importorskip.

(cherry picked from commit 8ce4759c5c)
2021-11-09 13:13:56 +01:00
Petr Špaček
531faf7e53 Use more liberal flake8 for tests
Ignore rule W402 (wrong import order) to enable use of
pytest.importorskip.

(cherry picked from commit 1a80e641e9)
2021-11-09 13:13:51 +01:00
Petr Špaček
61df820d39 Merge branch 'pspacek/ci-jobs-interruptible-v9_16' into 'v9_16'
Automatically cancel CI jobs on outdated branches [v9_16]

See merge request isc-projects/bind9!5564
2021-11-09 12:09:40 +00:00
Petr Špaček
e82918a4c7 Automatically cancel CI jobs on outdated branches
Gitlab feature
https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
can automatically cancel jobs which operate on an outdated code, i.e. on
branches which received new commits while jobs with an older set of
commits are still running. For this feature to work jobs have to be
configured with boolean interruptible: true.

I think practically all of our current CI jobs can be cancelled,
so the option is now on by default for all jobs.
2021-11-09 13:06:13 +01:00
Petr Špaček
781ae9d781 Merge branch 'pspacek/clang-format-v9_16' into 'v9_16'
retain diff output if clang-format changes something [v9_16]

See merge request isc-projects/bind9!5553
2021-11-02 15:02:03 +00:00
Petr Špaček
3934551251 retain diff output if clang-format changes something
It's major PITA trying to guess what exactly clang-format has changed,
so how CI stores patch file with changes which can be applied locally if
needed.

(cherry picked from commit ca4393fc9f)
2021-11-02 15:52:46 +01:00
Mark Andrews
f77940d0b1 Merge branch '2976-restore-xsltproc-discovery-for-statistics-system-test-9-16' into 'v9_16'
Resolve "Restore 'xsltproc' discovery for statistics system test 9.16"

See merge request isc-projects/bind9!5532
2021-10-30 01:47:42 +00:00
Mark Andrews
de801a5063 Look for xsltproc
xsltproc is used by the statistics system test
2021-10-30 10:24:45 +11:00
Arаm Sаrgsyаn
572b363110 Merge branch '2972-rsa-keys-compare-typo-bug-v9_16' into 'v9_16'
[v9_16] Fix a bug when comparing two RSA keys

See merge request isc-projects/bind9!5541
2021-10-28 15:36:24 +00:00
Aram Sargsyan
c6e4c28b4e Add dst_key_pubcompare and dst_key_compare unit test
The dst_key_pubcompare() and dst_key_compare() didn't have a unit test,
add the unit tests which test comparing the same keys, different keys,
and, where possible, similar keys with a manually altered parameter.

dst_key_pubcompare() internally uses the *_todns() functions of the
lib/dns/openssl*_link.c modules.

dst_key_compare() internally uses the *_compare() functions of the
lib/dns/openssl*_link.c modules.
2021-10-28 14:52:28 +00:00
Aram Sargsyan
49ebe409e3 Add CHANGES note for [GL #2972]
(cherry picked from commit 1ceb1f7ab0)
2021-10-28 13:47:20 +00:00
Aram Sargsyan
b122455009 Fix a bug when comparing two RSA keys
When comparing different parameters of two RSA keys there is a typo
which causes the "p" prime factors to not being compared.

Fix the typo.

(cherry picked from commit 930e4f52a5)
2021-10-28 13:46:22 +00:00
Michał Kępień
532a171e96 Merge branch 'michal/disable-pylint-warning-C0209-v9_16' into 'v9_16'
[v9_16] Disable PyLint warning C0209

See merge request isc-projects/bind9!5539
2021-10-28 13:40:25 +00:00
Michał Kępień
60ac3362d7 Disable PyLint warning C0209
PyLint 2.11 reports a new warning, C0209 (consider-using-f-string).
Since f-strings are only available in Python 3.6+, existing scripts
cannot be updated to use this feature just yet because they would stop
working with older Python versions.  Instead, disable PyLint warning
C0209 for the time being.  Sort all disabled warnings in .pylintrc.

(cherry picked from commit 860ca4e0ef)
2021-10-28 15:37:51 +02:00
Michał Kępień
36f89e137d Merge branch 'v9_16_22-release' into 'v9_16'
Merge 9.16.22 release branch

See merge request isc-projects/bind9!5536
2021-10-28 10:27:09 +00:00
Michał Kępień
02c9ee06b2 Move CHANGES entry for GL #2308
GL #2308 was originally referenced by CHANGES entry 5727.  However, the
corresponding code change turned out to be flawed and had to be reverted
in BIND 9.16.22, causing CHANGES entry 5727 to be removed on the release
branch.

Commit d329d47bae subsequently addressed
the flaw, so the fix for GL #2308 will be included in BIND 9.16.23.
Move the relevant CHANGES entry to reflect that.
2021-10-28 12:22:33 +02:00
Michał Kępień
6c399eda27 Set up release notes for BIND 9.16.23 2021-10-28 12:22:33 +02:00
Tinderbox User
2d0bfd6017 Merge branch 'prep-release' into security-v9_16 2021-10-28 12:22:33 +02:00
Michał Kępień
9fdf509213 Merge branch 'michal/prepare-documentation-for-bind-9.16.22' into 'security-v9_16'
Prepare documentation for BIND 9.16.22

See merge request isc-private/bind9!326
2021-10-28 12:22:33 +02:00
Tinderbox User
45c45e9b7e prep 9.16.22 2021-10-28 12:22:33 +02:00
Michał Kępień
5f04af90c2 Merge branch '2899-security-disable-lame-cache-v9_16' into 'security-v9_16'
[CVE-2021-25219] [v9_16] Disable "lame-ttl" cache

See merge request isc-private/bind9!323
2021-10-28 12:22:33 +02:00
Michał Kępień
5ed42ad256 Prepare release notes for BIND 9.16.22 2021-10-28 12:22:33 +02:00
Ondřej Surý
841769863f Add CHANGES and release note for [GL #2899] 2021-10-28 12:22:33 +02:00
Michał Kępień
16bdd5d158 Add release note for GL #2911 2021-10-28 12:22:33 +02:00
Ondřej Surý
498bcc5c9c Enable lame response detection even with disabled lame cache
Previously, when lame cache would be disabled by setting lame-ttl to 0,
it would also disable lame answer detection.  In this commit, we enable
the lame response detection even when the lame cache is disabled.  This
enables stopping answer processing early rather than going through the
whole answer processing flow.
2021-10-28 12:22:33 +02:00
Michał Kępień
14c525450b Reorder release notes 2021-10-28 12:22:33 +02:00
Ondřej Surý
0ac270dff2 Disable lame-ttl cache
The lame-ttl cache is implemented in ADB as per-server locked
linked-list "indexed" with <qname,qtype>.  This list has to be walked
every time there's a new query or new record added into the lame cache.
Determined attacker can use this to degrade performance of the resolver.

Resolver testing has shown that disabling the lame cache has little
impact on the resolver performance and it's a minimal viable defense
against this kind of attack.
2021-10-28 12:22:33 +02:00
Michał Kępień
25f8a86e0d Tweak and reword release notes 2021-10-28 12:22:33 +02:00
Michał Kępień
237500b2c7 Tweak and reword recent CHANGES entries 2021-10-28 12:22:33 +02:00
Evan Hunt
3aca4fc81f Merge branch 'each-test-fixes-v9_16' into 'v9_16'
Fix test errors that caused intermittent failures

See merge request isc-projects/bind9!5534
2021-10-27 20:21:58 +00:00
Evan Hunt
9c834a99a4 Fix statistics test error
The statistics system test sometimes needs a pause to wait for the
expected stats to be reported.

Also, the test for priming queries was ineffective; the result of
the grep was not being checked.

(cherry picked from commit c167feb1dc)
2021-10-27 12:56:51 -07:00
Evan Hunt
0085a8205f Fix cds test error
The margin of error (up to 2 seconds) allowed for the inception time
in the cds system test was a bit too small, and has been increased to 3
seconds.

(cherry picked from commit 3ecaccb961)
2021-10-27 12:08:19 -07:00
Evan Hunt
bf599c1649 Fix catz test error
The catz system test included a test case that was looking for a single
answer record after an update, when it should have been looking for two.
The test usually passed because of timing - the first dig usually got a
response before the update was completed - but occasionally the update
processed fast enough for the test to fail. On investigation, it turned
out to be the test that was wrong.

(cherry picked from commit 9b6060c6c4)
2021-10-27 12:08:19 -07:00
Evan Hunt
c2f7b2e7d2 Fix digdelv test error
The digdelv system test has a test case in which stderr was
included in the dig output. When trace logging was in use,
this confused the grep and caused a spurious test failure.

(cherry picked from commit 2143120636)
2021-10-27 12:08:12 -07:00
Mark Andrews
563c0be633 Merge branch '2947-unexpected-deletion-of-configured-catalog-zone-v9_16' into 'v9_16'
Prevent existing catalog zone entries being incorrectly deleted

See merge request isc-projects/bind9!5533
2021-10-27 13:26:56 +00:00
Mark Andrews
e1490496a6 Check that existing catalog zone entries are preserved
Update the 'catz' system test by adding tests that update an
catalog zone (catalog1.example) while preserving existing entries
(increase SOA serial) then check that catalog zone has transferred
and that the existing entries have not accidentally been removed
as a consequence (can return updated zone content).

(cherry picked from commit bf9c569852)
2021-10-28 00:04:44 +11:00
Mark Andrews
d329d47bae Prevent existing catalog zone entries being incorrectly deleted
After receiving a new version of a catalog zone it is required
to merge it with the old version.

The algorithm walks through the new version's hash table and applies
the following logic:

1. If an entry from the new version does not exist in the old
   version, then it's a new entry, add the entry to the `toadd` hash
   table.
2. If the zone does not exist in the set of configured zones, because
   it was deleted via rndc delzone or it was removed from another
   catalog zone instance, then add into to the `toadd` hash table to
   be reinstantiated.
3. If an entry from the new version also exists in the old version,
   but is modified, then add the entry to the `tomod` hash table, then
   remove it from the old version's hash table.
4. If an entry from the new version also exists in the old version and
   is the same (unmodified) then just remove it from the old version's
   hash table.

The algorithm then deletes all the remaining zones which still exist
in the old version's hash table (because only the ones that don't
exist in the new version should now remain there), then adds the ones
that were added to the `toadd`, and modifies the ones that were added
to the `tomod`, completing the merge.

During a recent refactoring, the part when the entry should be
removed from the old version's hash table on condition (4.) above
was accidentally omitted, so the unmodified zones were remaining
in the old version's hash table and consequently being deleted.

(cherry picked from commit 63145fb1d3)
2021-10-28 00:04:44 +11:00
Michal Nowak
b0f9c75c03 Merge branch '2458-run-asan-and-tsan-with-latest-stable-gcc-v9_16' into 'v9_16'
[v9_16] Use Fedora image for GCC ASAN and TSAN CI jobs

See merge request isc-projects/bind9!5527
2021-10-22 13:22:12 +00:00
Michal Nowak
b7c2870c4b Drop GCC ThreadSanitizer suppresion of fstrm-originated calls
With custom fstrm library in the Fedora image which uses mutexes instead
of barriers ThreadSanitizer suppression with GCC is not necessary
anymore.

(cherry picked from commit 6179011a50)
2021-10-22 13:06:40 +02:00
Michal Nowak
bbc39801ae Rename ASAN_OPTIONS_COMMON to ASAN_OPTIONS
Renaming the variable removes some of the complexity.

(cherry picked from commit 1f4a56cb3e)
2021-10-22 13:06:10 +02:00
Michal Nowak
5f1c9c28e9 Use Fedora image for GCC ASAN and TSAN CI jobs
For the sake of running ASAN and TSAN jobs with the latest stable GCC,
replace "base image" (Debian Buster with GCC 8.3.0) with Fedora 34 image
with GCC 11.

(cherry picked from commit 6ab2d89686)
2021-10-22 13:03:13 +02:00
Michal Nowak
9dbcd636e8 Merge branch 'mnowak/debian-11-bullseye-v9_16' into 'v9_16'
[v9_16] Add Debian 11 (bullseye)

See merge request isc-projects/bind9!5525
2021-10-22 09:05:34 +00:00
Michal Nowak
376712cd12 Do not spawn Debian 9 CI jobs in merge requests
(cherry picked from commit 1b9a9c2829)
2021-10-22 10:44:41 +02:00
Michal Nowak
3b95ecbd47 Add Debian 11 (bullseye)
(cherry picked from commit 2b5dfae5de)
2021-10-22 10:35:40 +02:00
Michal Nowak
74d2abdfc3 Merge branch 'mnowak/openbsd-7.0-v9_16' into 'v9_16'
[v9_16] Add OpenBSD 7.0

See merge request isc-projects/bind9!5523
2021-10-22 07:50:17 +00:00
Michal Nowak
85a37ee002 Add OpenBSD 7.0
(cherry picked from commit 75e873ed98)
2021-10-22 09:40:00 +02:00
Ondřej Surý
bbcd772b16 Merge branch 'ondrej/fix-missing-DNS_ZONEFLG_DUMPING-in-setmodtime-v9_16' into 'v9_16'
Add missing DNS_ZONEFLG_DUMPING to setmodtime()

See merge request isc-projects/bind9!5520
2021-10-21 10:52:44 +00:00
Ondřej Surý
40fa423fd3 Add missing DNS_ZONEFLG_DUMPING to setmodtime()
It was found, that the original commit adding the setmodtime() was
incompletely squashed and there was double check for
DNS_ZONEFLG_NEEDDUMP instead of check for DNS_ZONEFLG_NEEDDUMP and
DNS_ZONEFLG_DUMPING.

Change the duplicate check to DNS_ZONEFLG_DUMPING.

(cherry picked from commit 55ac6b7394)
2021-10-21 12:33:24 +02:00
Ondřej Surý
9d47109b2b Merge branch 'ondrej/fix-isc_time_add-overflow-v9_16' into 'v9_16'
Fix isc_time_add() overflow

See merge request isc-projects/bind9!5517
2021-10-21 08:17:22 +00:00
Ondřej Surý
3d4ec2f244 Add isc_time_add and isc_time_subtract unit test
The isc_time_add() and isc_time_subtract() didn't have a unit test, add
the unit test with couple of edge case vectors to check whether overflow
and underflow is correctly handled.

(cherry picked from commit 04511736a0)
2021-10-21 09:51:53 +02:00
Ondřej Surý
b58611a08b Fix isc_time_add() overflow
The isc_time_add() could overflow when t.seconds + i.seconds == UINT_MAX
and t.nanoseconds + i.nanoseconds >= NS_PER_S.

Fix the overflow in isc_time_add(), and simplify the ISC_R_RANGE checks
both in isc_time_add() and isc_time_subtract() functions.

(cherry picked from commit 8c05f12bc8)
2021-10-21 09:51:48 +02:00
Evan Hunt
68ee77ae42 Merge branch 'each-cleanup-qmin-test-v9_16' into 'v9_16'
fix qmin system test

See merge request isc-projects/bind9!5510
2021-10-20 08:56:22 +00:00
Evan Hunt
9456be2225 fix qmin system test
The qmin system test was printing spurious output.  On investigation,
the test case turned out to be both broken and ineffective: its
expectations were wrong, and it was printing the output because its
wrong expectations were not met, and those failed expectations were
not causing a test failure. All of this has been corrected.

(cherry picked from commit ac3eb921fc)
2021-10-20 01:36:53 -07:00
Michał Kępień
c144134532 Merge branch 'compat/main/arm-sphinx-v9_16' into 'v9_16'
[v9_16] Enable building documentation with Sphinx < 2.0.0

See merge request isc-projects/bind9!5507
2021-10-19 11:55:38 +00:00
Petr Mensik
7101192301 Enable building documentation with Sphinx < 2.0.0
The ReferenceRole class is only available in Sphinx >= 2.0.0, which
makes building BIND 9 documentation impossible with older Sphinx
versions:

    Running Sphinx v1.7.6

    Configuration error:
    There is a programable error in your configuration file:

    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/sphinx/config.py", line 161, in __init__
        execfile_(filename, config)
      File "/usr/lib/python3.6/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
        exec_(code, _globals)
      File "conf.py", line 21, in <module>
        from sphinx.util.docutils import ReferenceRole
    ImportError: cannot import name 'ReferenceRole'

Work around the problem by defining a stub version of the ReferenceRole
class if the latter cannot be imported.  This allows documentation
(without GitLab hyperlinks in release notes) to be built with older
Sphinx versions.

(cherry picked from commit 8f8bbae3fc)
2021-10-19 13:47:48 +02:00
Ondřej Surý
b2b4d8117f Merge branch '2873-configuration-issues-on-solaris-v9_16' into 'v9_16'
Use correct compiler version flag in the autoconf script

See merge request isc-projects/bind9!5502
2021-10-18 13:46:44 +00:00
Ondřej Surý
36f97713a1 Use correct compiler version flag in the autoconf script
The autoconf script prints used compiler version at the end of the
configure script.  Solaris native compiler doesn't support --version,
and -V has to be used which in turn isn't supported by Gcc/Clang.
Detect which version flag has to be used and call $CC with it.

(cherry picked from commit 7eb208005f)
2021-10-18 15:27:18 +02:00
Mark Andrews
36d2c5b741 Merge branch '2326-some-of-the-statschannel-system-test-cases-fail-if-i-build-bind-9-16-9-v9_16' into 'v9_16'
Don't tests stats channels that haven't been configured

See merge request isc-projects/bind9!5495
2021-10-14 06:52:24 +00:00
Mark Andrews
981643b19a Don't tests stats channels that haven't been configured
pytest was failing because it was testing features that had
not been configured.  test to see if those features have been
configured before running the tests.

(cherry picked from commit 10c01cba61)
2021-10-14 17:33:01 +11:00
Evan Hunt
9093cd8662 Merge branch 'each-cleanup-ancient-v9_16' into 'v9_16'
cleanup references to ancient named.conf options

See merge request isc-projects/bind9!5492
2021-10-13 16:09:34 +00:00
Evan Hunt
6836e3c071 cleanup references to ancient named.conf options
some removed options were still referenced in config.c or the ARM.

(cherry picked from commit 69e25f41ae)
2021-10-12 23:52:39 -07:00
Ondřej Surý
8522d97433 Merge branch '2933-bump-the-default-clang-version-to-13-v9_16' into 'v9_16'
Change the LLVM tools version to 13

See merge request isc-projects/bind9!5488
2021-10-12 10:00:02 +00:00
Ondřej Surý
093cd31ae2 Update the source code formatting using clang-format-13
clang-format-13 fixed some of the formatting that clang-format-12 got
wrong.  Update the formatting.

(cherry picked from commit ed95f9fba3)
2021-10-12 11:31:55 +02:00
Ondřej Surý
173675bbd0 Change the LLVM tools version to 13
LLVM 13.0.0 was released on 4. October 2021, change the default version
to the current stable.

(cherry picked from commit 16916ab3e3)
2021-10-12 11:31:10 +02:00
Mark Andrews
64786a60b7 Merge branch '2935-cid-339035-1-of-1-explicit-null-dereferenced-forward_null-v9_16' into 'v9_16'
Fix cleanup of signature buffer in dns_dnssec_signmessage

See merge request isc-projects/bind9!5483
2021-10-12 00:09:22 +00:00
Mark Andrews
8a962622f2 Add CHANGES for [GL #2935]
(cherry picked from commit c48ca52851)
2021-10-12 10:19:49 +11:00
Mark Andrews
187787c723 Fix cleanup of signature buffer in dns_dnssec_signmessage
A NULL pointer could be freed if error handling occured.

(cherry picked from commit 0378c05ba0)
2021-10-12 10:19:08 +11:00
Mark Andrews
5f07ee0da3 Merge branch '2901-large-number-of-small-zones-in-map-format-cannot-be-loaded' into 'v9_16'
Resolve "Large number of small zones in `map` format cannot be loaded"

See merge request isc-projects/bind9!5398
2021-10-06 23:41:35 +00:00
Mark Andrews
f6e66e94f0 document 'masterfile-format map' vs 'vm.max_map_count' 2021-10-06 23:22:10 +00:00
Arаm Sаrgsyаn
092284b2a8 Merge branch '2818-catz-arm-primaries-masters-fix-v9_16' into 'v9_16'
[v9_16] Fix catalog zones configuration syntax in the ARM

See merge request isc-projects/bind9!5459
2021-10-05 13:11:27 +00:00
Aram Sargsyan
72d12aff56 Fix catalog zones configuration syntax in the ARM
The 55636ab5 commit made some changes in the reference manual
regarding catalog zones which do not actually correspond to reality
for the v9_16 branch.

This commit reverts those changes.
2021-10-05 12:46:57 +00:00
Mark Andrews
b16d52c13c Merge branch '2900-listenlist_test-notify_test-and-query_test-failing-v9_16' into 'v9_16'
Increase the number of file descriptors available

See merge request isc-projects/bind9!5462
2021-10-05 09:54:32 +00:00
Mark Andrews
050e6e757a Increase the number of file descriptors available
The 'listenlist_test', 'notify_test', and 'query_test' tests failed
when the descriptor limit was 256 on MacOS 11.6 with 8 cpus. On the
test platform the limit needed to be increased to ~400.  Increase
the limit to at least 1024 to give some head room.

(cherry picked from commit 877f52b772)
2021-10-05 17:46:56 +11:00
Arаm Sаrgsyаn
9298caddf4 Merge branch '2308-catz-reload-when-missing-a-zone-v9_16' into 'v9_16'
[v9_16] Handle a missing zone when reloading a catalog zone

See merge request isc-projects/bind9!5454
2021-09-30 20:43:24 +00:00
Aram Sargsyan
b85e92f82f Add CHANGES and release notes for [GL #2308]
(cherry picked from commit 3edaa0bde6)
2021-09-30 20:16:25 +00:00
Aram Sargsyan
311074f51e Handle a missing zone when reloading a catalog zone
Previously a missing/deleted zone which was referenced by a catalog
zone was causing a crash when doing a reload.

This commit will make `named` to ignore the fact that the zone is
missing, and make sure to restore it later on.

(cherry picked from commit 94a5712801)
2021-09-30 20:15:19 +00:00
Ondřej Surý
a6741da4af Merge branch '2908-rwlock-with-reader-and-writer-both-waiting-v9_16' into 'v9_16'
Pause the dbiterator before calling dns_db_find

See merge request isc-projects/bind9!5450
2021-09-29 16:23:31 +00:00
Mark Andrews
85fd9821e5 Add CHANGES note for [GL #2908]
(cherry picked from commit c04bce278f)
2021-09-29 18:04:14 +02:00
Mark Andrews
21771f5295 Pause the dbiterator before calling dns_db_find
zone.c:integrity_checks() acquires a read lock while iterating the
zone database, and calls zone_check_mx() which acquires another
read lock. If another thread tries to acquire a write lock in the
meantime, it can deadlock. Calling dns_dbiterator_pause() to release
the first read lock prevents this.

(cherry picked from commit 4e1faa35d5)
2021-09-29 18:04:14 +02:00
Mark Andrews
b166563e06 Merge branch '2911-9-16-21-regression-legacy-check-names-configuration-does-not-work-anymore-v9_16' into 'v9_16'
Fix "check-names master" and "check-names slave"

See merge request isc-projects/bind9!5448
2021-09-29 10:11:56 +00:00
Mark Andrews
190f71f93a Add CHANGES note for [GL #2911]
(cherry picked from commit 14249ce9fe)
2021-09-29 19:52:31 +10:00
Mark Andrews
0a6ed417b5 Check that 'check-names {secondary|slave} ignore;' works
(cherry picked from commit 0b0d400d7c)
2021-09-29 19:51:53 +10:00
Mark Andrews
f72946794f Check that 'check-names master ignore;' works
(cherry picked from commit 9107c8caeb)
2021-09-29 19:51:53 +10:00
Mark Andrews
7aa30aae38 Fix "check-names master" and "check-names slave"
check for type "master" / "slave" at the same time as checking
for "primary" / "secondary" as we step through the maps.

Checking "primary" then "master" or "master" then "primary" does
not work as the synomym is not checked for to stop the search.
Similarly with "secondary" and "slave".

(cherry picked from commit a3c6516a75)
2021-09-29 19:51:53 +10:00
Mark Andrews
617d786713 Merge branch '2909-pointers-used-before-validation-v9_16' into 'v9_16'
Address use before NULL check warning of uvreq

See merge request isc-projects/bind9!5445
2021-09-29 02:02:50 +00:00
Mark Andrews
74353330cd Address use before NULL check warning of obj
move deference of obj to after NULL check

(cherry picked from commit 06a69e03ac)
2021-09-29 11:43:14 +10:00
Mark Andrews
5dff412a08 Address use before NULL check warning of ievent->sock
Reorder REQUIRE checks to ensure ievent->sock is checked earlier

(cherry picked from commit 8fc9bb8e8e)
2021-09-29 11:43:14 +10:00
Mark Andrews
addd580b0a Address use before NULL check warning of uvreq
move dereference of uvreq until the after NULL check.

(cherry picked from commit 7079829b84)
2021-09-29 11:43:14 +10:00
Mark Andrews
3859fea828 Merge branch '2910-unknown-system-test-doesn-t-leave-forensics-v9_16' into 'v9_16'
Preserve dig results in case of test failure

See merge request isc-projects/bind9!5441
2021-09-24 04:19:03 +00:00
Mark Andrews
3295339391 Preserve dig results in case of test failure
(cherry picked from commit 96b7421f8c)
2021-09-24 13:37:43 +10:00
Matthijs Mekking
dd1454bc67 Merge branch 'matthijs-fix-arm-typos-v9_16' into 'v9_16'
The s stands for security (9.16)

See merge request isc-projects/bind9!5439
2021-09-23 09:56:21 +00:00
Matthijs Mekking
dff495a0d0 Remove copy paste error on zone-max-ttl
The "zone-max-ttl" option inside a "dnssec-policy" is not used to cap
the TTLs in a zone, only yo calculate key rollover timings.

(cherry picked from commit 4e3ba81696)
2021-09-23 09:53:01 +02:00
Matthijs Mekking
cc8391943c Add a note about salt length
Apparently it is confusing that you don't specify a specific salt,
but a salt length.

(cherry picked from commit 9ddc23b2bf)
2021-09-23 09:52:55 +02:00
Matthijs Mekking
6a5efd791e The s stands for security
So "hardware security modules" not "hardware service modules"

(cherry picked from commit a73a07832e)
2021-09-23 09:52:50 +02:00
Petr Špaček
fabe4b7e6c Merge branch 'ondrej/add-python-3.8-check-v9_16' into 'v9_16'
Add python3.8 to the autoconf search list

See merge request isc-projects/bind9!5434
2021-09-22 08:53:17 +00:00
Ondřej Surý
38244fdf88 Add python3.8 to the autoconf search list
It was discovered that FreeBSD doesn't setup alias from default
Python version neither to python3 nor python, and thus the configure
step would fail to find working python installation.
2021-09-22 10:24:16 +02:00
Ondřej Surý
eeba2e305e Merge branch '2814-fix-has-have-typo-v9_16' into 'v9_16'
Fix has->have typo in DLZ drivers deprecation message

See merge request isc-projects/bind9!5433
2021-09-22 07:42:06 +00:00
Ondřej Surý
df7646785e Fix has->have typo in DLZ drivers deprecation message
We fixed the CHANGES and release notes and missed this one.
2021-09-22 09:37:04 +02:00
Ondřej Surý
072c76055c Merge branch '2814-add-deprecation-warning-when-DLZ-drivers-are-used-v9_16' into 'v9_16'
Add deprecation warning about DLZ drivers

See merge request isc-projects/bind9!5430
2021-09-21 12:58:11 +00:00
Ondřej Surý
489b503381 Add CHANGES and release note for [GL #2814] 2021-09-21 14:53:19 +02:00
Ondřej Surý
c3b3dd3229 Add deprecation warning about DLZ drivers
DLZ drivers are going to be removed from the next major BIND 9 release,
this commit adds a deprecation warning to inform the users about the
need to migrate to DLZ modules.
2021-09-21 10:44:41 +02:00
Ondřej Surý
8ef5ea2a38 Merge branch '2882-deprecate-masterfile-map-option-v9_16' into 'v9_16'
Mark the masterfile-format type 'map' as deprecated

See merge request isc-projects/bind9!5423
2021-09-17 07:36:13 +00:00
Ondřej Surý
f4b72d5646 Add CHANGES and releases notes for [GL #2882]
(cherry picked from commit c518036988)
2021-09-17 09:16:10 +02:00
Ondřej Surý
4515523aa2 Add masterfile-format checkconf tests
Add tests that check that masterfile-format map generate deprecation
warning and mastefile-formats text and raw doesn't.

(cherry picked from commit f4e6348f29)
2021-09-17 09:16:10 +02:00
Ondřej Surý
f7adef5162 Mark the masterfile-format type 'map' as deprecated
The map masterfile-format is very fragile and it needs API bump every
time a RBTDB data structures changes.  Also while testing it, we found
out that files larger than 2GB weren't loading and nobody noticed, and
loading many map files were also failing (subject to kernel limits).

Thus we are marking the masterfile-format type 'map' as deprecated and
to be removed in the next stable BIND 9 release.

(cherry picked from commit 6b7a488cbc)
2021-09-17 09:10:29 +02:00
Michal Nowak
617411ed42 Merge branch 'mnowak/replace-centos-with-oraclelinux-v9_16' into 'v9_16'
[v9_16] Replace CentOS 7 & 8 with Oracle Linux

See merge request isc-projects/bind9!5419
2021-09-16 15:19:26 +00:00
Michal Nowak
76a51a4aed Replace CentOS 7 & 8 with Oracle Linux
(cherry picked from commit 3085edf1a0)
2021-09-16 16:15:48 +02:00
Michał Kępień
553c058853 Merge branch 'michal/regenerate-man-pages-with-docutils-0.17.1-v9_16' into 'v9_16'
[v9_16] Regenerate man pages with docutils 0.17.1

See merge request isc-projects/bind9!5416
2021-09-16 09:22:24 +00:00
Michał Kępień
b083238f22 Regenerate man pages with docutils 0.17.1
The Debian 10 (buster) Docker image, which GitLab CI uses for building
documentation, currently contains the following package versions:

  - Sphinx 4.2.0
  - sphinx-rtd-theme 1.0.0
  - docutils 0.17.1

Regenerate the man pages to match contents produced in a Sphinx
environment using the above package versions.  This is necessary to
prevent the "docs" GitLab CI job from failing.

(cherry picked from commit ffd1e71fdf)
2021-09-16 11:15:31 +02:00
Evan Hunt
65fc6d311e Merge branch '2903-cache-file-v9_16' into 'v9_16'
deprecate and remove "cache-file"

See merge request isc-projects/bind9!5414
2021-09-16 08:02:56 +00:00
Evan Hunt
863dfed0b5 deprecate "cache-file"
this commit marks the "cache-file" option as deprecated.

(cherry picked from commit a67d008ba5)
2021-09-16 00:57:58 -07:00
Michał Kępień
00f1d885dd Merge branch '2907-address-pylint-2.10.2-warnings-v9_16' into 'v9_16'
[v9_16] Address PyLint 2.10.2 warnings

See merge request isc-projects/bind9!5413
2021-09-16 07:14:58 +00:00
Michał Kępień
586f6fd367 Remove redundant prefix from Python 3 strings
Address the following warnings reported by PyLint 2.10.2:

    ************* Module conf
    doc/arm/conf.py:90:10: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:92:12: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:93:9: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:139:31: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:33:10: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:38:12: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:39:9: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)

(cherry picked from commit e5944bc610)
2021-09-16 08:55:15 +02:00
Michał Kępień
7d6c2b9e48 Explicitly specify encoding for open() calls
Address the following warnings reported by PyLint 2.10.2:

    ************* Module tests-checkds
    bin/tests/system/checkds/tests-checkds.py:70:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    bin/tests/system/checkds/tests-checkds.py:120:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    bin/tests/system/checkds/tests-checkds.py:206:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    ************* Module yamlget
    bin/tests/system/digdelv/yamlget.py:22:5: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

(cherry picked from commit 6a4b8b1456)
2021-09-16 08:55:15 +02:00
Michał Kępień
f9c6951190 Remove redundant zone_keyid() function
The zone_keyid() helper function defined in
bin/tests/system/statschannel/helper.py is not used anywhere.  Remove
it.

(cherry picked from commit acb7e61409)
2021-09-16 08:55:15 +02:00
Michał Kępień
c84e002675 Merge branch 'v9_16_21-release' into 'v9_16'
Merge 9.16.21 release branch

See merge request isc-projects/bind9!5409
2021-09-15 21:09:51 +00:00
Michał Kępień
24237d66c5 Set up release notes for BIND 9.16.22 2021-09-15 23:05:21 +02:00
Tinderbox User
b7ee30ef4f Merge branch 'prep-release' into v9_16_21-release 2021-09-15 23:05:21 +02:00
Michał Kępień
5f3ca004ff Merge branch 'michal/prepare-documentation-for-bind-9.16.21' into 'v9_16_21-release'
Prepare documentation for BIND 9.16.21

See merge request isc-private/bind9!321
2021-09-15 23:05:21 +02:00
Tinderbox User
e1dd00f921 prep 9.16.21 2021-09-15 23:05:21 +02:00
Michał Kępień
2080af2394 Prepare release notes for BIND 9.16.21 2021-09-15 23:05:21 +02:00
Michał Kępień
08fc463cd3 Add release note for GL #2837 2021-09-15 23:05:21 +02:00
Michał Kępień
19eee07763 Add release note for GL #2878 2021-09-15 23:05:21 +02:00
Michał Kępień
1bb184688b Add release note for GL #2844 2021-09-15 23:05:21 +02:00
Michał Kępień
7e2384f08a Reorder release notes 2021-09-15 23:05:21 +02:00
Michał Kępień
fb49e05679 Tweak and reword release notes 2021-09-15 23:05:21 +02:00
Michał Kępień
d9ddbf2545 Tweak and reword recent CHANGES entries 2021-09-15 23:05:21 +02:00
Mark Andrews
40ce1e8b02 Merge branch '2904-typo-in-nsupdate-1-v9_16' into 'v9_16'
Fix closing brackets in help message

See merge request isc-projects/bind9!5406
2021-09-15 13:28:06 +00:00
Mark Andrews
3c175b741d Fix closing brackets in help message
(cherry picked from commit 55fc57e244)
2021-09-15 23:09:17 +10:00
Ondřej Surý
0f62635932 Merge branch '2866-split-gssapi-and-krb5-check-from-krb5-config' into 'v9_16'
Fix the krb5-config usage (v9.16)

See merge request isc-projects/bind9!5389
2021-09-14 19:30:50 +00:00
Ondřej Surý
870614a030 Add CHANGES note for [GL #2866] 2021-09-14 21:02:07 +02:00
Michał Kępień
8027aac650 Test various --with-gssapi options in GitLab CI
The implicit ./configure default is to use --with-gssapi=auto.  There is
already a GitLab CI job (gcc:stretch:amd64) which uses --without-gssapi.
Add four more forms of the --with-gssapi option to various GitLab CI job
configurations so that its every possible variant is regularly tested.
2021-09-14 20:58:22 +02:00
Ondřej Surý
c3546531f7 Call krb5-config with just one argument at the time
The autoconf script would call the krb5-config with both gssapi and krb5
libraries as arguments in a single call.  It turned out that this is
actually not supported and it breaks some platforms.  This commit splits
the call into two separate calls - one for gssapi and one for krb5
library.
2021-09-14 20:58:22 +02:00
Ondřej Surý
370ad21772 Merge branch '2888-be-more-strict-about-clashing-source-ports-v9_16' into 'v9_16'
check port in *-source and *-source-v6 options in named.conf

See merge request isc-projects/bind9!5401
2021-09-14 18:56:59 +00:00
Ondřej Surý
f301e7bb40 Add CHANGES and release notes for [GL #2888]
(cherry picked from commit bba5e98734)
2021-09-14 20:32:11 +02:00
Ondřej Surý
c42e533b84 Document caveats related to single source port in the ARM
Discourage the single source port on general level and document that the
source port cannot be same as the listening port.  This applies to
query-source, transfer-source, notify-source, parental-source, and their
respective IPv6 counterparts.

(cherry picked from commit c9a17c878a)
2021-09-14 20:32:11 +02:00
Evan Hunt
4d674b5c41 check port in *-source and *-source-v6 options in named.conf
- when transfer-source(-v6), query-source(-v6), notify-source(-v6)
  or parental-source(-v6) are specified with a port number, issue a
  warning.
- when the port specified is the same as the DNS listener port (i.e.,
  53, or whatever was specified as "port" in "options"), issue a fatal
  error.
- check that "port" is in range. (previously this was only checked
  by named, not by named-checkconf.)
- added checkconf tests.
- incidental fix: removed dead code in check.c:bind9_check_namedconf().

(note: if the DNS port is specified on the command line with "named -p",
that is not conveyed to libbind9, so these checks will not take it into
account.)

(cherry picked from commit 14c8d7dfb7)
2021-09-14 20:32:10 +02:00
Ondřej Surý
dcf88f1450 Merge branch '2852-remove-adjust_interfaces-v9_16' into 'v9_16'
Remove the code to adjust listening interfaces for *-source-v6

See merge request isc-projects/bind9!5400
2021-09-14 15:39:07 +00:00
Ondřej Surý
f3ac0632f7 Add CHANGES and release note for [GL #2852]
(cherry picked from commit 23624a7adb)
2021-09-14 17:13:42 +02:00
Ondřej Surý
37cb2b0dea Adjust system forward test to also use IPv6 addresses
The ns3->ns2 forwarding is now done using the IPv6 addresses, so we also
test that the query-source-v6 address is still operational after removal
of interface adjustment.

(cherry picked from commit 8a4c44ca24)
2021-09-14 17:13:42 +02:00
Ondřej Surý
0807d8b058 Remove the code to adjust listening interfaces for *-source-v6
Previously, named would run with a configuration
where *-source-v6 (notify-source-v6, transfer-source-v6 and
query-source-v6) address and port could be simultaneously used for
listening.  This is no longer true for BIND 9.16+ and the code that
would do interface adjustments would unexpectedly disable listening on
TCP for such interfaces.

This commit removes the code that would adjust listening interfaces
for addresses/ports configured in *-source-v6 option.

(cherry picked from commit 8ac1d4e0da)
2021-09-14 16:59:18 +02:00
Ondřej Surý
52ea129204 Merge branch '2691-deprecate-native-pkcs11-v9_16' into 'v9_16'
Add deprecation notice about --enable-native-pkcs11 to configure.ac

See merge request isc-projects/bind9!5396
2021-09-09 21:14:21 +00:00
Ondřej Surý
197d64b302 Add CHANGES and release notes for [GL ##2691] 2021-09-09 22:46:23 +02:00
Ondřej Surý
6cf86cc75b Add deprecation notice about --enable-native-pkcs11 to configure.ac
The native PKCS#11 feature has been removed in BIND 9.18, so we need to
add a deprecation notice (warning at ./configure time) to the next 9.16
release.
2021-09-09 22:35:03 +02:00
Arаm Sаrgsyаn
ca521b3824 Merge branch '2344-devpoll-lockid-dead-code-v9_16' into 'v9_16'
Remove dead code (v9.16)

See merge request isc-projects/bind9!5394
2021-09-08 13:14:07 +00:00
Aram Sargsyan
18514a43d5 Remove dead code
Remove dead code from the USE_DEVPOLL branch in libisc's unix/socket.c
2021-09-08 12:52:33 +00:00
Arаm Sаrgsyаn
3eb524c38a Merge branch '2635-default-iana-root-zone-primaries-update-v9_16' into 'v9_16'
Update the default IANA root zone primaries list (v9.16)

See merge request isc-projects/bind9!5392
2021-09-08 12:46:35 +00:00
Aram Sargsyan
930f082027 Update the default IANA root zone primaries list
The default IANA root zone primaries list was outdated, this commit
updates it.
2021-09-08 10:39:17 +00:00
Evan Hunt
6704a2ac08 Merge branch '69-relax-fetchlimit-test-v9_16' into 'v9_16'
increase 1-second timeout in fetchlimit

See merge request isc-projects/bind9!5381
2021-09-03 06:27:21 +00:00
Evan Hunt
6773c1144f increase 1-second timeout in fetchlimit
when "checking lame server clients are dropped below the hard limit",
periodically a query is sent for a name for which the server is
authoritative, to verify that legitimate queries can still be
processed while the server is dealing with a flood of lame delegation
queries. those queries used the same dig options as elsewhere in the
fetchlimit test, including "+tries=1 +timeout=1". on slow systems, a
1-second timeout may be insufficient to get an answer even if the server
is behaving well. this commit increases the timeout for the check
queries to 2 seconds in hopes that will be enough to eliminate test
failures in CI.

(cherry picked from commit 45f330339c)
2021-09-02 23:24:57 -07:00
Mark Andrews
0a3e398e0c Merge branch '2890-update-documentation-with-respect-to-sig-validity-interval-and-update-v9_16' into 'v9_16'
Update sig-validity-interval description

See merge request isc-projects/bind9!5379
2021-09-03 03:45:01 +00:00
Mark Andrews
ad411b1120 Update sig-validity-interval description
Document that the interval on new RRSIG records is randomally
chosen between the limits specified by sig-validity-interval.
document the operatations when this occurs.

(cherry picked from commit e65ce00f11)
2021-09-03 13:19:09 +10:00
Evan Hunt
9174cff949 Merge branch '2878-large-map-file-v9_16' into 'v9_16'
map files over 2GB could not be loaded

See merge request isc-projects/bind9!5374
2021-09-01 15:53:47 +00:00
Evan Hunt
fe66c88d02 CHANGES 2021-09-01 08:17:32 -07:00
Evan Hunt
06b9fc8a7d add a test for large map files
- a test has been added to 'masterformat', but disabled by default,
  because it takes several minutes to run and uses a lot of disk.
2021-09-01 08:17:32 -07:00
Evan Hunt
e9d62d2442 map files over 2GB could not be loaded
- fixed a size comparison using "signed int" that failed if the file
  size was more than 2GB, since that was treated as a negative number.
- incidentally renamed deserialize32() to just deserialize(). we no
  longer have separate 32 and 64 bit rbtdb implementations.
2021-09-01 00:43:54 -07:00
Mark Andrews
cfaba88f15 Merge branch '2891-missing-parenthesis-in-the-atomic_load_explicit-macro' into 'v9_16'
Resolve "Missing parenthesis in the `atomic_load_explicit` macro"

See merge request isc-projects/bind9!5375
2021-09-01 07:42:43 +00:00
Mark Andrews
6cbfbe5381 Add CHANGES for [GL #2891] 2021-09-01 17:23:14 +10:00
Mark Andrews
9a01b867af Fix the definition of atomic_load_explicit in the win32 shim
incorrect parentheses result in incorrect sizeof test
2021-09-01 10:26:16 +10:00
Ondřej Surý
f9b005e2f6 Merge branch '2837-windows-service-isc-trampoline-v9_16' into 'v9_16'
Initialize the main thread trampoline for Windows Service process

See merge request isc-projects/bind9!5352
2021-08-31 18:19:35 +00:00
Ondřej Surý
49212d9595 Add CHANGES for [GL #2837] 2021-08-31 17:54:04 +00:00
Ondřej Surý
ec64f4492b Initialize the main thread trampoline for Windows Service process
When BIND is running as a Windows Service the ISC library's
initializations initiated by the DLLMain loading procedure are
happening under the Windows Service Manager thread instead of
BIND's main thread.

This commit will make sure that BIND's main thread trampoline has
been initialized before running the main() function.
2021-08-31 17:53:30 +00:00
Evan Hunt
05ce4af871 Merge branch '1944-primary-secondary-v9_16' into 'v9_16'
update to primary/secondary terminology internally

See merge request isc-projects/bind9!5370
2021-08-30 19:32:05 +00:00
Evan Hunt
9acd616ba5 CHANGES
(cherry picked from commit 18b878fb01)
2021-08-30 12:00:42 -07:00
Evan Hunt
fb88554bf0 switch to primary/secondary in config.c
some of the built-in configuration was still using outdated terms.

(cherry picked from commit ae8cfa4683)
2021-08-30 12:00:42 -07:00
Evan Hunt
255d092c40 change CFG_ZONE_MASTER and CFG_ZONE_SLAVE
these values have been renamed as CFG_ZONE_PRIMARY and
CFG_ZONE_SECONDARY.

(cherry picked from commit 679f1c0dad)
2021-08-30 12:00:39 -07:00
Evan Hunt
ddc677ae64 rename dns_zone_master and dns_zone_slave
dns_zone_master and dns_zone_slave are renamed as dns_zone_primary
and dns_zone_secondary.

(cherry picked from commit 916760ae46)
2021-08-30 11:58:29 -07:00
Petr Špaček
2bd05add9a Merge branch '2856-CVE-2021-25218-regression-test-v9_16' into 'v9_16'
[v9_16] Add a regression test in the RRL system test

See merge request isc-projects/bind9!5361
2021-08-30 16:44:12 +00:00
Petr Špaček
d1a5f4ee9f Lower loopback MTU size on other unix systems as well
This change should cover recent versions of:
Solaris, illumos, OpenBSD, FreeBSD, Dragonfly BSD, NetBSD.

(cherry picked from commit d8363845b6)
2021-08-30 17:31:48 +02:00
Evan Hunt
422c032151 Add a regression test in the RRL system test
This commit modifies the MTU of the loopback interface on
Linux systems to 1500, so that oversized UDP packets can
trigger EMSGSIZE errors, and tests that named handles
such errors correctly.

Note that the loopback MTU size has not yet been modified
for other platforms.

(cherry picked from commit cfd058d622)
2021-08-30 17:31:43 +02:00
Evan Hunt
1dacb46892 Merge branch '2872-fix-map-zonefile-version-number-v9_16' into 'v9_16'
Fix crash while loading map zone files generated by BIND >= 9.16.2 && <= 9.16.19 [v9.16]

See merge request isc-projects/bind9!5346
2021-08-28 15:20:58 +00:00
Evan Hunt
9123feca1e CHANGES, release note
(cherry picked from commit 351ed777c2)
2021-08-28 07:45:39 -07:00
Evan Hunt
8118ce9f6d expand map file documentation
discuss map file compatibility issues in more detail.

(cherry picked from commit 4b61e74470)
2021-08-28 07:45:39 -07:00
Petr Špaček
b70a2c2d07 increase MAPAPI
bump the map zonefile version number to avoid an assertion
failure when loading map files from versions of BIND prior to
the most recent change to the in-memory structure of zone
databases.

(cherry picked from commit 4a68c7be22)
2021-08-28 07:45:39 -07:00
Evan Hunt
405fa18ff3 Merge branch '1927-fix-keepalive-v9_16' into 'v9_16'
Resolve "keepalive appears to be unused"

See merge request isc-projects/bind9!5368
2021-08-27 20:40:36 +00:00
Evan Hunt
a69008210b CHANGES
(cherry picked from commit 45752f9505)
2021-08-27 13:20:06 -07:00
Evan Hunt
e28f5e28c4 add a test of the keepalive timeout
test server now has tcp-idle-timeout set to 5 seconds and
tcp-keepalive-timeout set to 7, so queries that follow a 6-second sleep
should either succeed or fail depending on whether the keepalive option
was sent.

(cherry picked from commit 947e80066c)
2021-08-27 13:20:06 -07:00
Evan Hunt
4f87dcac1a replace per-protocol keepalive functions with a common one
this commit removes isc__nm_tcpdns_keepalive(); the keepalive
value for this protocol and for TCP will now be set directly from
isc_nmhandle_keepalive().

(cherry picked from commit fc6f751fbe)
2021-08-27 13:20:06 -07:00
Evan Hunt
6b7e4e753a enable keepalive when the keepalive EDNS option is seen
previously, receiving a keepalive option had no effect on how
long named would keep the connection open; there was a place to
configure the keepalive timeout but it was never used. this commit
corrects that.

this also fixes an error in isc__nm_tcpdns_keepalive()
in which the sense of a REQUIRE test was reversed; previously this
error had not been noticed because the functions were not being
used.

(cherry picked from commit 7867b8b57d)
2021-08-27 13:20:06 -07:00
Evan Hunt
de00df3669 cleanup netmgr-int.h
- fix some duplicated and out-of-order prototypes declared in
  netmgr-int.h
- rename isc_nm_tcpdns_keepalive to isc__nm_tcpdns_keepalive as
  it's for internal use

(cherry picked from commit 19e24e22f5)
2021-08-27 13:20:02 -07:00
Mark Andrews
1c721e67d6 Merge branch '1805-save-failed-build-artifacts-v9_16' into 'v9_16'
always save build artifacts

See merge request isc-projects/bind9!5364
2021-08-26 04:45:22 +00:00
Mark Andrews
b8e7bdc8e6 always save build artifacts
(cherry picked from commit 221228572f)
2021-08-26 14:21:52 +10:00
Mark Andrews
e216c79a5e Merge branch '2880-timing-issues-with-rndc-system-test-v9_16' into 'v9_16'
wait for post 'rndc freeze' writes to complete

See merge request isc-projects/bind9!5363
2021-08-26 04:15:58 +00:00
Mark Andrews
a8413d5f0f wait for post 'rndc freeze' writes to complete
(cherry picked from commit 45b6b8199e)
2021-08-26 13:18:33 +10:00
Mark Andrews
a8914f9e11 Merge branch '2461-named-checkconf-fails-to-detect-illegal-key-names-in-primaries-lists-v9_16' into 'v9_16'
[v9_16] Named-checkconf fails to detect illegal key names in primaries lists

See merge request isc-projects/bind9!5359
2021-08-26 00:27:51 +00:00
Mark Andrews
2ffb2e5ffd Add CHANGED for [GL #2461]
(cherry picked from commit 5d2183c450)
2021-08-26 00:00:16 +00:00
Mark Andrews
706f5811c3 Check that primary key names are syntactically valid
(cherry picked from commit 4fa9d8389a)
2021-08-26 00:00:16 +00:00
Evan Hunt
3638f2d284 Merge branch '331-further-refactoring-of-functions-in-lib-dns-zoneverify-c-v9_16' into 'v9_16'
Resolve "Further refactoring of functions in lib/dns/zoneverify.c"

See merge request isc-projects/bind9!5362
2021-08-25 23:32:58 +00:00
Diego Fronza
f262860d5d Replace literal 255 with a more descriptive macro name
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12186

(cherry picked from commit bd0cc048d1)
2021-08-25 15:57:35 -07:00
Diego Fronza
caa4af08d4 Avoid an empty block under if condition
This commit doesn't change the logic flow from previous code, it only
makes the code more readable and consistent.

More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12185

(cherry picked from commit 90e724af45)
2021-08-25 15:57:35 -07:00
Diego Fronza
7af2573219 Remove redundant function 'newchain'
The removed function 'newchain(a, b)' was almost the same as calling
!chain_equal(a, b), varying only in the amount of data compared
in the non-fixed-length data portion of given chain nodes.

A third argument 'data_size' has been introduced into 'chain_equal'
function in order to allow it to know how many bytes to compare in the
variable-length data portion of the chain nodes.

A helper function 'chain_length(e)' has been introduced to allow
easy calculation of the total length of the non-fixed-length data part
of chain nodes.

Check the thread below for more details:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12184

(cherry picked from commit 37f42d19a1)
2021-08-25 15:57:35 -07:00
Diego Fronza
063bc21543 Use sizeof instead of arbitrary number to iterate fixed size array
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12180

(cherry picked from commit 6a12e37382)
2021-08-25 15:57:34 -07:00
Diego Fronza
9954c2da91 Initialize buffers with { 0 } instead of memset
More details on threads:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12178
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12181

(cherry picked from commit 87e970474f)
2021-08-25 15:57:34 -07:00
Diego Fronza
9f5c643769 Minor refactoring on function match_nsec3
The logic for matching a set of nsec3 objects against an nsec3param
object was moved to a specific function.

For more details check thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12176

(cherry picked from commit 98d1e40143)
2021-08-25 15:57:34 -07:00
Diego Fronza
ebb827c1d5 Minor refactoring/cleanup
This commit moves the warning message to the logical block where it
belongs better.

For more details check thread comment:
https://gitlab.isc.org/isc-projects/bind9/merge_requests/291#note_12167

(cherry picked from commit 966c06a9e6)
2021-08-25 15:57:34 -07:00
Mark Andrews
cac4c29f64 Merge branch '2842-clean-up-catalog-journal-v9_16' into 'v9_16'
[v9_16] Clean up catalog journal

See merge request isc-projects/bind9!5358
2021-08-25 05:44:48 +00:00
Mark Andrews
d4d7e060ab Add CHANGES for [GL #2842]
(cherry picked from commit 53f9416176)
2021-08-25 15:17:51 +10:00
Mark Andrews
c3db4acf61 Also delete journal file
(cherry picked from commit 0b83636648)
2021-08-25 15:17:51 +10:00
Mark Andrews
3e2a39dc7a check that journal files are also removed
(cherry picked from commit 1972300919)
2021-08-25 15:17:51 +10:00
Matthijs Mekking
2bc855fff8 Merge branch '1721-grow-shrink-dnssec-sign-stats-v9_16' into 'v9_16'
Grow and shrink dnssec-sign statistics on key rollover events (9.16)

See merge request isc-projects/bind9!5354
2021-08-24 08:58:21 +00:00
Matthijs Mekking
7505703a43 Add CHANGES for [GL #1721]
(cherry picked from commit 8224dc8e35)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
229bc4ee95 Add statschannel test case for key removal
Add a statschannel test case to confirm that when keys are removed
(in this case because of a dnssec-policy change), the corresponding
dnssec-sign stats are cleared and are no longer shown in the
statistics.

(cherry picked from commit 1a3c82f765)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
c499478321 Clear dnssec-sign stats for removed keys
Clear the key slots for dnssec-sign statistics for keys that are
removed. This way, the number of slots will stabilize to the maximum
key usage in a zone and will not grow every time a key rollover is
triggered.

(cherry picked from commit de15e07800)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
7e90ef8f8c Add back the statschannel manykeys test case
Add a test case that has more than four keys (the initial number of
key slots that are created for dnssec-sign statistics). We shouldn't
be expecting weird values.

This fixes some errors in the manykeys zone configuration (keys
were created for algorithm RSASHA256, but the policy expected RSASHA1,
and the zone was not allowing dynamic updates).

This also fixes an error in the calls to 'zones-json.pl': The perl
script excepts an index number where the zone can be found, rather
than the zone name.

(cherry picked from commit 019a52a184)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
df6fb95621 Grow dnssec-sign statistics instead of rotating
We have introduced dnssec-sign statistics to the zone statistics. This
introduced an operational issue because when using zone-statistics
full, the memory usage was going through the roof. We fixed this by
by allocating just four key slots per zone. If a zone exceeds the
number of keys for example through a key rollover, the keys will be
rotated out on a FIFO basis.

This works for most cases, and fixes the immediate problem of high
memory usage, but if you sign your zone with many, many keys, or are
sign with a ZSK/KSK double algorithm strategy you may experience weird
statistics. A better strategy is to grow the number of key slots per
zone on key rollover events.

That is what this commit is doing: instead of rotating the four slots
to track sign statistics, named now grows the number of key slots
during a key rollover (or via some other method that introduces new
keys).

(cherry picked from commit d9cca81d50)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
4a1987a380 Add a function isc_stats_resize
Add a new function to resize the number of counters in a statistics
counter structure. This will be needed when we keep track of DNSSEC
sign statistics and new keys are introduced due to a rollover.

(cherry picked from commit 9acce8a82a)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
4f08beb1de Add stats unit test
Add a simple stats unit test that tests the existing library functions
isc_stats_ncounters, isc_stats_increment, isc_stats_decrement,
isc_stats_set, and isc_stats_update_if_greater.

(manually picked from commit 0bac9c7c5c)
2021-08-24 09:27:38 +02:00
Matthijs Mekking
713ded2cc3 Merge branch '2857-migrate-csk-to-dnssec-policy-v9_16' into 'v9_16'
Test migrating CSK to dnssec-policy (9.16)

See merge request isc-projects/bind9!5351
2021-08-23 08:58:44 +00:00
Matthijs Mekking
4822c2a618 Add a test case for non-SEP CSK migration
A zone with a single key without the SEP bit set must also be assumed
to be a CSK.

(cherry picked from commit a8d0d2feed)
2021-08-23 10:37:17 +02:00
Matthijs Mekking
073f11fcac Changes to kasp script to deal with non-SEP CSK
In order to test cases with non-SEP CSK keys, the Flags Field needs to
be determined differently to deal with such exceptional scenarios.

(cherry picked from commit 36ad0331e2)
2021-08-23 10:37:11 +02:00
Matthijs Mekking
89349b4661 Add change and release note for [#2857]
(cherry picked from commit c43faf44cd)
2021-08-23 10:37:02 +02:00
Matthijs Mekking
db18004d69 Migrate a single key to CSK with dnssec-policy
When migrating keys to dnssec-policy, if a zone has only one key,
assume it is going to be a CSK.

(cherry picked from commit 3ea953512a)
2021-08-23 10:36:42 +02:00
Matthijs Mekking
9df0bf8f17 Test migrating CSK to dnssec-policy
Add a test case for migrating CSK to dnssec-policy. The keymgr has no
way of telling that the key is used as a CSK, but if there is only one
key to migrate it is going to assume it must be a CSK.

(cherry picked from commit 96ee323622)
2021-08-23 10:36:37 +02:00
Michał Kępień
0ccd0468a3 Merge branch '2845-rndc-freeze-edit-include-file-thaw-v9_16' into 'v9_16'
[v9_16] Add test for in-view zone edits

See merge request isc-projects/bind9!5344
2021-08-19 10:36:49 +00:00
Mark Andrews
9eb98e024d wait for each staged to complete
(cherry picked from commit 8e189840b1)
2021-08-19 11:44:38 +02:00
Matthijs Mekking
d9b19dade5 Add test for in-view zone edits
Add a test case for GL #2845 where a zone is in two views, one base
view and one "in-view" and that zone is using an $INCLUDE. Make sure
that there is a jnl file (have ixfr-from-differences enabled and do a
dynamic update). Then freeze and make updates in the included file
(this requires the test.db file also to be updated because 'rndc freeze'
causes the zone file to be overwritten). Finally reload and ensure that
the edit in the included file has been loaded.

(cherry picked from commit 598bf1c29b)
2021-08-19 11:44:38 +02:00
Mark Andrews
b6a744479c Merge branch '2868-svbc-fromwire-should-reject-zero-length-alpn-elements-v9_16' into 'v9_16'
Reject zero length ALPN elements in fromwire

See merge request isc-projects/bind9!5343
2021-08-19 09:18:04 +00:00
Mark Andrews
7d3d7cacf9 Reject zero length ALPN elements in fromwire
(cherry picked from commit 8833d90292)
2021-08-19 18:59:29 +10:00
Mark Andrews
b1583122ca Merge branch '2867-svbc-from-wire-needs-to-check-that-alpn-in-present-when-no-default-alpn-is-present-v9_16' into 'v9_16'
Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire

See merge request isc-projects/bind9!5342
2021-08-19 08:07:15 +00:00
Mark Andrews
c9858fa078 Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire
(cherry picked from commit 2f51bb2d93)
2021-08-19 17:32:32 +10:00
Michał Kępień
6e9eb068bd Merge branch 'v9_16_20-release' into 'v9_16'
Merge 9.16.20 release branch

See merge request isc-projects/bind9!5339
2021-08-19 05:29:23 +00:00
Michał Kępień
2bbec2bf74 Set up release notes for BIND 9.16.21 2021-08-19 07:20:15 +02:00
Tinderbox User
e05387ac12 Merge branch 'prep-release' into security-v9_16 2021-08-19 07:20:15 +02:00
Michał Kępień
d17acf0df3 Merge branch 'michal/prepare-documentation-for-bind-9.16.20' into 'security-v9_16'
Prepare documentation for BIND 9.16.20

See merge request isc-private/bind9!317
2021-08-19 07:20:15 +02:00
Tinderbox User
69dcc8bb58 prep 9.16.20 2021-08-19 07:20:15 +02:00
Michal Nowak
8ae32b0972 Merge branch '2839-confidential-rrl-msgsize-v9_16' into 'security-v9_16'
[CVE-2021-25218]: assertion failure in RRL after EMSGSIZE error (v9.16)

See merge request isc-private/bind9!314
2021-08-19 07:20:15 +02:00
Michał Kępień
e5534b2991 Prepare release notes for BIND 9.16.20 2021-08-19 07:20:15 +02:00
Evan Hunt
21dbf3798c Add CHANGES and release notes for [GL #2839] 2021-08-19 07:20:15 +02:00
Michał Kępień
152a946c6e Add release note for GL #2756 2021-08-19 07:20:15 +02:00
Ondřej Surý
607f8d114e Disable the Path MTU Discover on UDP Sockets
Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.
2021-08-19 07:20:15 +02:00
Michał Kępień
9407ee95c1 Reorder release notes 2021-08-19 07:20:15 +02:00
Evan Hunt
15996f0cb1 ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.

More recently, it was used in a3ba95116e
commit (part of GL #2790) to force the sending of a TC=1 NOERROR
response, triggering a retry via TCP, when a UDP packet could not be
sent due to ISC_R_MAXSIZE.

This ran afoul of a pre-existing INSIST in ns_client_error() when
RRL was in use. the INSIST was based on the assumption that
ns_client_error() could never result in a non-error rcode. as
that assumption is no longer valid, the INSIST has been removed.
2021-08-19 07:20:15 +02:00
Michał Kępień
1a3ac45a04 Tweak and reword release notes 2021-08-19 07:20:15 +02:00
Michał Kępień
6b2217b06f Tweak and reword recent CHANGES entries 2021-08-19 07:20:15 +02:00
Michal Nowak
ae370e3e61 Fix typos in lib/isc/trampoline_p.h 2021-08-19 07:20:15 +02:00
Mark Andrews
6beb0f660b Merge branch '1132-wip-httpssvc-record-v9_16' into 'v9_16'
[v9_16] HTTPS and SVCB records

See merge request isc-projects/bind9!5332
2021-08-18 07:26:42 +00:00
Mark Andrews
adc4fe5c06 Add CHANGES and release notes
(cherry picked from commit 8ebb05b0b7)
2021-08-18 16:54:31 +10:00
Mark Andrews
c9e67b33c1 Add check-names for svbc (https) server name examples
(cherry picked from commit f6bfc685aa)
2021-08-18 16:54:31 +10:00
Mark Andrews
e3c22ec53a Check that the hostname of the server is legal
(cherry picked from commit f46a0c27df)
2021-08-18 16:54:31 +10:00
Mark Andrews
20cb00e1a5 add tests for string and qstring
(cherry picked from commit 26b22a1445)
2021-08-18 16:54:31 +10:00
Mark Andrews
2db56ffbd8 Add unit test for keypair
(cherry picked from commit a6357d8b5c)
2021-08-18 15:00:08 +10:00
Mark Andrews
74b796fdf0 add svcb fuzzing seed
(cherry picked from commit baaa5492ee)
2021-08-18 14:59:29 +10:00
Mark Andrews
c0c38eeb36 Add invalid test vectors
(cherry picked from commit bc21015438)
2021-08-18 14:59:29 +10:00
Mark Andrews
4fd35998e6 add text vs unknown test vectors
(cherry picked from commit 3e459b4808)
2021-08-18 14:59:29 +10:00
Mark Andrews
c7130b36fc Parse and print HTTPS and SVCB records
(cherry picked from commit 36f34a3e79)
2021-08-18 14:59:29 +10:00
Mark Andrews
cc93d10c82 Add support for parsing <tag>[=<value>]
where <value> may be a quoted string.  Previously quoted string
only supported opening quotes at the start of the string.

(cherry picked from commit 42c22670b3)
2021-08-18 14:59:29 +10:00
Mark Andrews
24e5e3ffd6 Make whether to follow additional data records generic
Adds dns_rdatatype_followadditional() and
DNS_RDATATYPEATTR_FOLLOWADDITIONAL

(cherry picked from commit f0265b8fa6)
2021-08-18 14:59:20 +10:00
Matthijs Mekking
24921fdac4 Merge branch '2665-qname-minimization-disabled-after-first-resolution-v9_16' into 'v9_16'
QNAME minimization is bypassed with stale zonecut in cache (9.16)

See merge request isc-projects/bind9!5329
2021-08-16 17:50:59 +00:00
Mark Andrews
4ba4d7cfbe More correctly implement ends with label sequence check
string.endswith("label.sequence") doesn't check for the implict
period before "label.sequence" when matching longer strings.

"foo.label.sequence" should match but "foolabel.sequence shouldn't".

(cherry picked from commit f79876b2d5)
2021-08-16 19:32:16 +02:00
Matthijs Mekking
086236910a Add change entry and release note for GL #2665
(cherry picked from commit 192329d3c6)
2021-08-16 19:32:16 +02:00
Matthijs Mekking
5688bd31e3 Don't use stale nodes when looking up a zonecut
When looking up a zonecut in cache, we use 'dns_rbt_findnode' to find
the closest matching node. This function however does not take into
account stale nodes. When we do find a stale node and use it, this
has implications for subsequent lookups. For example, this may break
QNAME minimization because we are using a deeper zonecut than we should
have.

Check the header for staleness and if so, and stale entries are not
accepted, look for the deepest zonecut from this node up.

(cherry picked from commit bc448fb3b1)
2021-08-16 19:32:16 +02:00
Matthijs Mekking
5c23ec44bd Add extra checks for !ANCIENT(header)
There are some occurrences where we check if a header exists in the
rbtdb. These cases require that the header is also not marked as
ancient (aka ready for cleanup). These cases involve finding certain
data in cache.

(cherry picked from commit e2d4896864)
2021-08-16 16:42:41 +02:00
Matthijs Mekking
ca0f078dbc Add qmin test cases when RRset has expired
Add test cases for GL #2665: The QNAME minimization (if enabled) should
also occur on the second query, after the RRsets have expired from
cache. BIND will still have the entries in cache, but marked stale.
These stale entries should not prevent the resolver from minimizing
the QNAME. We query for the test domain a.b.stale. in all cases (QNAME
minimization off, strict mode, and relaxed mode) and expect it to
behave the same the second time we have a stale delegation structure in
cache.

(cherry picked from commit 322626ab5b)
2021-08-16 16:42:34 +02:00
Evan Hunt
f17f673772 Merge branch 'feature/master/dig-return-codes-v9_16' into 'v9_16'
Document return codes of dig

See merge request isc-projects/bind9!5326
2021-08-12 17:38:22 +00:00
Petr Menšík
ca52adf81c Document return codes of dig
The dig tool reports some states as exit status. Document them briefly
in the manual page.

(cherry picked from commit f20cc30a6a)
2021-08-12 10:34:46 -07:00
Mark Andrews
5a1fbc3155 Merge branch '2844-rndc-freeze-command-always-fails-perhaps-due-to-in-view-v9_16' into 'v9_16'
Check 'rndc freeze' with in-view zones works

See merge request isc-projects/bind9!5322
2021-08-12 04:38:54 +00:00
Mark Andrews
17c0d3f054 Add CHANGES not for [GL #2844]
(cherry picked from commit 1f8ef7cfe2)
2021-08-12 04:19:44 +00:00
Mark Andrews
42856b25bd Don't freeze / thaw non-explict in-view zones
(cherry picked from commit dcdd9a403a)
2021-08-12 04:19:44 +00:00
Mark Andrews
3376aec286 Check 'rndc freeze' with in-view zones works
(cherry picked from commit ebc92b799b)
2021-08-12 04:19:44 +00:00
Mark Andrews
1991f7de92 Merge branch 'marka-remove-print0-run.sh-v9_16' into 'v9_16'
replace '-print0 | xargs -0' with '-exec ... {} +'

See merge request isc-projects/bind9!5323
2021-08-12 02:06:43 +00:00
Mark Andrews
e7e6b50300 replace '-print0 | xargs -0' with '-exec ... {} +'
(cherry picked from commit de88d83a78)
2021-08-12 11:12:32 +10:00
Matthijs Mekking
8d490656f9 Merge branch '1551-dnssec-signzone-prepublish-zsk-support-v9_16' into 'v9_16'
dnssec-signzone ZSK smooth rollover (9.16)

See merge request isc-projects/bind9!5321
2021-08-11 13:42:32 +00:00
Matthijs Mekking
5656143a1f Add release note and change entry for [#1551]
(cherry picked from commit 1befaa5d45)
2021-08-11 15:20:43 +02:00
Matthijs Mekking
4fec33fd20 Fix bug in dst_key_copymetadata
When copying metadata from one dst_key to another, when the source
dst_key has a boolean metadata unset, the destination dst_key will
have a numeric metadata unset instead.

This means that if a key has KSK or ZSK unset, we may be clearing the
Predecessor or Successor metadata in the destination dst_key.

(cherry picked from commit 94bb545087)
2021-08-11 15:18:10 +02:00
Matthijs Mekking
e43d9f08b9 Add test for dnssec-signzone smooth ZSK roll
Add a test case to the dnssec system test to check that:
- a zone with a prepublished key is only signed with the active key.
- a zone with an inactive key but valid signatures retains those
  signatures and does not add signatures from successor key.
- signatures are swapped in a zone when signatures of predecessor
  inactive key are within the refresh interval.

(cherry picked from commit 35efbc270f)
2021-08-11 15:17:55 +02:00
Matthijs Mekking
c3bdc06278 dnssec-signzone ZSK smooth rollover
When signing with a ZSK, check if it has a predecessor. If so, and if
the predecessor key is sane (same algorithm, key id matches predecessor
value, is zsk), check if the RRset is signed with this key. If so, skip
signing with this successor key. Otherwise, do sign with the successor
key.

This change means we also need to apply the interval to keys that are
not actively signing. In other words, 'expired' is always
'isc_serial_gt(now + cycle, rrsig.timeexpire)'.

Fix a print style issue ("removing signature by ..." was untabbed).

(cherry picked from commit 837adb93d3)
2021-08-11 15:17:49 +02:00
Matthijs Mekking
7e906f24d3 Merge branch 'matthijs-iterations-typo-dnssec-guide-v9_16' into 'v9_16'
Fix missing iterations value in dnssec-guide (9.16)

See merge request isc-projects/bind9!5320
2021-08-11 10:35:22 +00:00
Matthijs Mekking
18c134263e Fix missing iterations value in dnssec-guide
In the "Migrating from NSEC to NSEC3" section, it says:

    dnssec-policy "standard" {
        nsec3param iterations optout no salt-length 16;
    };

There should be an integer after "iterations". Based on the following
text, the number of iterations should be 10.

(cherry picked from commit 9e109191cc)
2021-08-11 10:40:35 +02:00
Mark Andrews
ae7aa2664d Merge branch '2830-statistics-system-tests-needs-to-save-named-stats-files-v9_16' into 'v9_16'
save named.stats files

See merge request isc-projects/bind9!5310
2021-08-03 01:38:44 +00:00
Mark Andrews
d18bec59cb save named.stats files
(cherry picked from commit 53afccf42b)
2021-08-03 10:54:33 +10:00
Michał Kępień
908c3c3a9f Merge branch '2838-indicate-esv-status' into 'v9_16'
Indicate ESV status of BIND 9.16

See merge request isc-projects/bind9!5308
2021-07-30 07:51:54 +00:00
Michał Kępień
a9adf172ac Update release notes to indicate ESV status
BIND 9.16 has been designated as an Extended Support Version.  Update
the release notes accordingly.
2021-07-29 11:10:20 +02:00
Michał Kępień
34bd40dc32 Update version description in "named -v" output
BIND 9.16 has been designated as an Extended Support Version.  Update
the version description in "named -v" / "named -V" output accordingly.
2021-07-29 11:10:20 +02:00
Michal Nowak
a025f0c2d0 Merge branch 'mnowak/fix-pylint-v9_16' into 'v9_16'
Make kasp2policy.py PyLint-clean

See merge request isc-projects/bind9!5306
2021-07-28 09:11:18 +00:00
Michal Nowak
4e09411371 Make kasp2policy.py PyLint-clean
PyLint 2.9.5 reported the following errors:
    contrib/kasp/kasp2policy.py:25:0: R0402: Use 'from ply import yacc' instead (consider-using-from-import)
    contrib/kasp/kasp2policy.py:26:0: R0402: Use 'from ply import lex' instead (consider-using-from-import)
2021-07-28 11:05:41 +02:00
Matthijs Mekking
86e9981240 Merge branch '2836-parental-agents-documentation-missing-string-net-v9_16' into 'v9_16'
Fix parental-agents documentation

See merge request isc-projects/bind9!5305
2021-07-27 13:06:48 +00:00
Matthijs Mekking
575436c3cb Fix parental-agents documentation
There is a missing string "net" in the ARM in the parental-agents
example.

(cherry picked from commit 8d75ec8300)
2021-07-27 14:11:38 +02:00
Michal Nowak
f45bf73a92 Merge branch 'v9_16_19-release' into 'v9_16'
Merge 9.16.19 release branch

See merge request isc-projects/bind9!5299
2021-07-26 09:51:48 +00:00
Michał Kępień
1a58574393 Add a missing CHANGES entry for BIND 9.16.17 2021-07-23 09:43:46 +02:00
Michał Kępień
4433315351 Fix version number in a backported release note 2021-07-23 09:43:46 +02:00
Michal Nowak
c775e62a86 Set up release notes for BIND 9.16.20 2021-07-23 09:43:46 +02:00
Tinderbox User
d7d81bf2c8 Merge branch 'prep-release' into v9_16_19-release 2021-07-23 09:43:46 +02:00
Tinderbox User
e2fb29ad71 prep 9.16.19 2021-07-23 09:43:46 +02:00
Tinderbox User
b22548d8be Add prereq.sh script for the "checkds" system test 2021-07-23 09:43:46 +02:00
Michał Kępień
1f152dbf78 Merge branch 'michal/prepare-documentation-for-bind-9.16.19' into 'v9_16_19-release'
Prepare documentation for BIND 9.16.19

See merge request isc-private/bind9!309
2021-07-23 09:43:45 +02:00
Michał Kępień
018e887bd8 Prepare release notes for BIND 9.16.19 2021-07-23 09:43:45 +02:00
Michał Kępień
53351f3d2a Add release note for GL #2758 2021-07-23 09:43:45 +02:00
Michał Kępień
8d5c429816 Add release note for GL #2686 2021-07-23 09:43:45 +02:00
Michał Kępień
36906b1bb2 Reorder release notes 2021-07-23 09:43:45 +02:00
Michal Nowak
f122497c72 Tweak and reword release notes 2021-07-23 09:43:45 +02:00
Michal Nowak
17e5161dea Tweak and reword recent CHANGES entries 2021-07-23 09:43:45 +02:00
Michał Kępień
e7b1d49b76 Restore release note for GL #2780 2021-07-23 09:43:45 +02:00
Mark Andrews
e2733fe401 Merge branch '2735-bind-9-16-must-stop-named-delete-jnl-files-for-signed-zones-to-be-updated-v9_16' into 'v9_16'
Remove spurious early exit

See merge request isc-projects/bind9!5301
2021-07-22 23:39:17 +00:00
Mark Andrews
af13320917 Add CHANGES note for [GL #2735]
(cherry picked from commit ba950cf193)
2021-07-23 09:20:26 +10:00
Mark Andrews
18fc3319bc Check that reload with deleted journal works
(cherry picked from commit cf8aadfeb6)
2021-07-23 09:20:26 +10:00
Mark Andrews
d51b8f7228 Check that restart with zone changes and deleted journal works
(cherry picked from commit 163fb0b825)
2021-07-23 09:20:25 +10:00
Mark Andrews
da13526669 Order the diff from dns_db_diffx so that deletes proceed adds
for the same rdataset.  This allows the diff when passed to
dns_diff_apply to succeed.

(cherry picked from commit 76453961bd)
2021-07-23 09:20:25 +10:00
Mark Andrews
8a81830001 Check reload of dnssec-policy zone works
(cherry picked from commit c7fc13a9fa)
2021-07-23 09:20:25 +10:00
Mark Andrews
d50a1ade1c Remove spurious early exit
(cherry picked from commit 9c9ee59fa7)
2021-07-23 09:20:25 +10:00
Mark Andrews
1dab5a0cde Merge branch '2542-inline-loadtime-not-recorded-v9_16' into 'v9_16'
Record load time when a inline zone file has been touched

See merge request isc-projects/bind9!5300
2021-07-22 22:23:30 +00:00
Mark Andrews
c539da031f Add CHANGES for [GL #2542]
(cherry picked from commit 10d3a48e2f)
2021-07-23 07:49:21 +10:00
Mark Andrews
0ffdca4e83 Check that load time was recorded for unchanged inline zone
subsequent reloads should not report 'ixfr-from-differences: unchanged'

(cherry picked from commit b84c057130)
2021-07-23 07:49:21 +10:00
Mark Andrews
37f6b31017 Record load time when a inline zone file has been touched
(cherry picked from commit 194e47cb0d)
2021-07-23 07:49:21 +10:00
Michal Nowak
b201b97dbf Merge branch '2473-run-respdiff-as-part-of-daily-runs-v9_16' into 'v9_16'
[v9_16] Run respdiff also for scheduled and web pipelines

See merge request isc-projects/bind9!5297
2021-07-22 13:01:08 +00:00
Michal Nowak
7e59abc76d Run respdiff also for scheduled and web pipelines
respdiff needs to be run regularly to identify problems with query
responses discrepancies sooner than after tagging a release.

Contrary to the main branch, which hosts the BIND 9 Development Version
and thus sets MAX_DISAGREEMENTS_PERCENTAGE variable to 0.5, branches
hosting BIND 9 Stable Versions have it set to 0.1, which provides only
tiny room for non-timeout response disagreements between the baseline
version and version under test.

(cherry picked from commit 561b58196b)
2021-07-22 13:41:15 +02:00
Evan Hunt
c8ad282d01 Merge branch '2833-notify-delay-doc-v9_16' into 'v9_16'
clarify 'notify-delay' documentation

See merge request isc-projects/bind9!5294
2021-07-22 03:01:45 +00:00
Evan Hunt
b8074dce94 clarify 'notify-delay' documentation
- the explanation was unclear
- the reference to 'serial-query-rate' was outdated
2021-07-21 20:00:09 -07:00
Ondřej Surý
4e70480444 Merge branch 'ondrej/reduce-the-node-lock-count-v9_16' into 'v9_16'
Reduce the nodelock count for both cache and regular rbtdb

See merge request isc-projects/bind9!5283
2021-07-21 15:35:01 +00:00
Ondřej Surý
19a33ce72d Add CHANGES note for [GL #2829] 2021-07-21 17:03:52 +02:00
Ondřej Surý
bceda720e4 Reduce the nodelock count for both cache and regular rbtdb
Increasing the nodelock count had major impact on the memory footprint
in scenarios where multiple rbtdb structure would be created like
hosting many zones in a single server.

This reverts commit 0344684385 and sets
the nodelock count to previously used values.
2021-07-21 17:03:33 +02:00
Michal Nowak
fc0dd7191c Merge branch 'mnowak/support-cross-compilation-on-buster-v9_16' into 'v9_16'
[v9_16] Add 32-bit cross-compiled CI jobs on Debian Buster

See merge request isc-projects/bind9!5291
2021-07-21 10:02:08 +00:00
Michal Nowak
5729bfe7b3 Drop FreeBSD 13 EXTRA_CONFIGURE variable
The FreeBSD 13 EXTRA_CONFIGURE variable contains only the invalid
WITH_READLINE_LIBEDIT variable, which slipped in ddf03e while
backporting and should not be present at all.
2021-07-21 11:39:10 +02:00
Michal Nowak
4e091cc19c Drop gcc:sid:i386
With gcc:buster:amd64cross32, the unmaintained gcc:sid:i386 is not
needed anymore.
2021-07-21 11:39:02 +02:00
Michal Nowak
d6d91bac09 Add 32-bit cross-compiled CI jobs on Debian Buster
Since the forced removal of gcc:sid:i386 in 0aacabc6, we lacked a 32-bit
environment to build and test BIND 9 in the CI. gcc:buster:amd64cross32
adds an environment to cross-compile BIND 9 to 32-bits on Debian Buster
amd64 image with 32-bit BIND 9 dependencies. Commit also adds sanity
checks to ensure that compiled objects are not of the build platform
triplet type.

(cherry picked from commit bfcaa2a8f1)
2021-07-21 11:38:27 +02:00
Mark Andrews
e3da1507b0 Merge branch '2762-check-opcode-v9_16' into 'v9_16'
Check opcode of messages returned by dns_request_getresponse

See merge request isc-projects/bind9!5287
2021-07-21 03:00:30 +00:00
Mark Andrews
72e2c6e4b8 add release note for [GL #2762]
(cherry picked from commit 36720fb4a6)
2021-07-21 12:41:19 +10:00
Mark Andrews
697016d6c1 Add CHANGES for [GL #2762]
(cherry picked from commit 466db0f49e)
2021-07-21 12:41:17 +10:00
Mark Andrews
17a65b2443 check nsupdate handles UPDATE response to QUERY
(cherry picked from commit 0bba0ab10d)
2021-07-21 12:40:47 +10:00
Mark Andrews
350605a3cc dns_rdata_tostruct() should reject rdata with DNS_RDATA_UPDATE set
(cherry picked from commit e97249e012)
2021-07-21 12:40:47 +10:00
Mark Andrews
498de906fa Check opcode of messages returned by dns_request_getresponse
(cherry picked from commit ed4e00713f)
2021-07-21 12:40:47 +10:00
Michal Nowak
7f25f79afd Merge branch 'mnowak/process-core-dumps-when-named-fails-to-start-v9_16' into 'v9_16'
[v9_16] Process core dump from named which failed to start

See merge request isc-projects/bind9!5281
2021-07-16 16:35:16 +00:00
Michal Nowak
195b88cb22 Fix handling of restart option in run.sh
The support for stat.pl's --restart option was incomplete in run.sh.
This change makes sure it's handled properly and that named.run file is
not being removed by clean.sh when the --restart option is used.

(cherry picked from commit a39697635b)
2021-07-16 17:37:58 +02:00
Michal Nowak
3e0f3e1d57 Process core dump from named which failed to start
When named failed to start and produced core dump, the core file wasn't
processed by GDB because of run.sh script exiting immediately. This
remedies the limitation, simplifies the surrounding code, and makes the
script shellcheck clean.

(cherry picked from commit bc097d3358)
2021-07-16 17:27:24 +02:00
Michal Nowak
f81887f8ae Merge branch 'mnowak/replace-literal-blocks-with-anchors-v9_16' into 'v9_16'
[v9_16] Use anchors instead of literal blocks in .gitlab-ci.yml

See merge request isc-projects/bind9!5279
2021-07-16 14:33:13 +00:00
Michal Nowak
77eb928b79 Use anchors instead of literal blocks in .gitlab-ci.yml
Anchor lets the user see the full command logged in GitLab CI:

    ${CONFIGURE} --disable-maintainer-mode --enable-developer ...

Instead of a folded multi-line when literal block is used:

    ${CONFIGURE} \ # collapsed multi-line command

(cherry picked from commit c22008629e)
2021-07-16 15:52:28 +02:00
Michał Kępień
ddd8b166bf Merge branch '2759-extend-tests-for-signed-cname-sourced-delegations-v9_16' into 'v9_16'
[v9_16] Extend tests for signed, CNAME-sourced delegations

See merge request isc-projects/bind9!5277
2021-07-16 05:45:04 +00:00
Michał Kępień
5c8f3463d5 Extend tests for signed, CNAME-sourced delegations
Extend the "chain" system test with AUTHORITY section checks for signed,
secure delegations.  This complements the checks for signed, insecure
delegations added by commit 82b7e6ccef.

Extend the existing AUTHORITY section checks for signed, insecure
delegations to ensure nonexistence of DS RRsets in such responses.
Adjust comments accordingly.

Ensure dig failures cause the "chain" system test to fail.

(cherry picked from commit a14efdf54c)
2021-07-16 07:24:34 +02:00
Michał Kępień
f81c8e3e73 Tweak query_addds() comments to avoid confusion
It has been noticed that commit f88c90f47f
did not only fix NSEC record handling in signed, insecure delegations
prepared using both wildcard expansion and CNAME chaining - it also
inadvertently fixed DS record handling in signed, secure delegations
of that flavor.  This is because the 'rdataset' variable in the relevant
location in query_addds() can be either a DS RRset or an NSEC RRset.
Update a code comment in query_addds() to avoid confusion.

Update the comments describing the purpose of query_addds() so that they
also mention NSEC(3) records.

(cherry picked from commit 29d8d35869)
2021-07-16 07:24:34 +02:00
Mark Andrews
0bf3553d5a Merge branch '2820-rndc-reconfig-does-not-act-on-change-to-zone-statistics-v9_16' into 'v9_16'
Test that 'zone-statistics full;' is properly processed

See merge request isc-projects/bind9!5276
2021-07-16 04:34:01 +00:00
Mark Andrews
64beb36f73 Add CHANGES for [GL #2820]
(cherry picked from commit f2461afff7)
2021-07-16 14:13:49 +10:00
Mark Andrews
5d9dced395 zone->requeststats_on was not being set at the correct point
(cherry picked from commit 616896d735)
2021-07-16 14:13:49 +10:00
Mark Andrews
5e4f22aa83 Test that 'zone-statistics full;' is properly processed
(cherry picked from commit 592f9ff6bc)
2021-07-16 14:13:49 +10:00
Matthijs Mekking
ec66f8ff35 Merge branch '2710-multisigner-cds-v9_16' into 'v9_16'
Allow update CDS/CDNSKEY records that do not match DNSKEY (9.16)

See merge request isc-projects/bind9!5275
2021-07-15 08:21:44 +00:00
Matthijs Mekking
4415688d44 Add change and release notes [#2710]
(cherry picked from commit ba5869943d)
2021-07-15 09:26:40 +02:00
Matthijs Mekking
65f58d68f0 Relax zone_cdscheck function
If we have a CDS or CDNSKEY we at least need to have a DNSKEY with the
same algorithm published and signing the CDS RRset. Same for CDNSKEY
of course.

This relaxes the zone_cdscheck function, because before the CDS or
CDNSKEY had to match a DNSKEY, now only the algorithm has to match.

This allows a provider in a multisigner model to update the CDS/CDNSKEY
RRset in the zone that is served by the other provider.

(cherry picked from commit 577bf913b9)
2021-07-15 09:26:16 +02:00
Matthijs Mekking
9aeadf31f0 Add test for allowing update CDS/CDNSKEY
Add tests to the nsupdate system test to make sure that CDS and/or
CDNSKEY that match an algorithm in the DNSKEY RRset are allowed. Also
add tests that updates are rejected if the algorithm does not match.

Remove the now redundant test cases from the dnssec system test.

Update the checkzone system test: Change the algorithm of the CDS and
CDNSKEY records so that the zone is still rejected.

(cherry picked from commit 6b79db1fdd)
2021-07-15 09:26:11 +02:00
Evan Hunt
e2606d1ccb Merge branch 'each-doc-trampoline-v9_16' into 'v9_16'
document isc__trampoline

See merge request isc-projects/bind9!5274
2021-07-14 18:00:52 +00:00
Evan Hunt
312c78809a document isc__trampoline
Added some header file documentation to the isc__trampoline
implementation in trampoline_p.h.
2021-07-14 10:56:42 -07:00
Ondřej Surý
58aa9658a6 Merge branch '2822-inconsistent-recursive-performance-v9_16' into 'v9_16'
Disable setting the thread affinity (v9.16)

See merge request isc-projects/bind9!5269
2021-07-13 14:16:23 +00:00
Ondřej Surý
7791181840 Add CHANGES and release notes for [GL #2822]
(cherry picked from commit 41afe6bc5e)
2021-07-13 15:48:30 +02:00
Ondřej Surý
46ecb94cb6 Disable the cpu system test
As we don't set the thread affinity, the cpu test would consistently
fail.  Disable it, but don't remove it as we might restore setting the
affinity in the future versions of BIND 9.

(cherry picked from commit 4c5dc1904b)
2021-07-13 15:48:27 +02:00
Ondřej Surý
c546545d32 Disable setting the thread affinity
It was discovered that setting the thread affinity on both the netmgr
and netthread threads lead to inconsistent recursive performance because
sometimes the netmgr and netthread threads would compete over single
resource and sometimes not.

Removing setting the affinity causes a slight dip in the authoritative
performance around 5% (the measured range was from 3.8% to 7.8%), but
the recursive performance is now consistently good.

(cherry picked from commit a9e6a7ae57)
2021-07-13 15:47:13 +02:00
Matthijs Mekking
4adfe6140a Merge branch '2811-checkds-memleak-shutdown-v9_16' into 'v9_16'
Fix leak in checkds code (9.16)

See merge request isc-projects/bind9!5266
2021-07-13 09:57:59 +00:00
Matthijs Mekking
6323c4e2dd Add change entry for [#2811]
(cherry picked from commit 2ccf342690)
2021-07-13 11:20:51 +02:00
Matthijs Mekking
ed4358da37 Fix leak in checkds code
In 'checkds_send_toaddr' there is a goto bug that causes the TSIG key
and DNS message to not be detached. Remove the offending goto statement.

(cherry picked from commit b676163933)
2021-07-13 11:20:24 +02:00
Mark Andrews
f89c282d73 Merge branch '2703-gcc-10-fanalyzer-reports-dereference-of-null-text-in-server-c-14721-v9_16' into 'v9_16'
Add DBC REQUIRE to check that 'text' is non NULL

See merge request isc-projects/bind9!5259
2021-07-12 06:11:13 +00:00
Mark Andrews
1f36600e5a Add DBC REQUIRE to check that 'text' is non NULL
for all control channel commands.  This should silence
gcc-10-analyzer reporting NULL pointer dereference of 'text'.

(cherry picked from commit ac0fc3c2de)
2021-07-12 14:55:46 +10:00
Mark Andrews
27c1aadb65 Merge branch '2753-timer_test-subtests-are-not-independent-v9_16' into 'v9_16'
Reset errcnt at the start of each subtest

See merge request isc-projects/bind9!5258
2021-07-12 04:26:59 +00:00
Mark Andrews
928af4c424 Reset errcnt at the start of each subtest
(cherry picked from commit 3945c289bb)
2021-07-12 13:57:34 +10:00
Mark Andrews
c27625bddf Merge branch '2808-v9_16-unchecked-returns-in-rbtdb_test-c-and-dnssec-signzone-c' into 'v9_16'
Resolve "v9_16 unchecked returns in rbtdb_test.c and dnssec-signzone.c"

See merge request isc-projects/bind9!5250
2021-07-12 03:23:41 +00:00
Mark Andrews
8538c762cb Fix unchecked returns of dns_name_fromtext 2021-07-12 02:40:25 +00:00
Mark Andrews
bcaf23dd27 Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock 2021-07-12 02:40:25 +00:00
Mark Andrews
f8a0a1d61f Merge branch '2810-silence-untrusted-loop-bound-v9_16' into 'v9_16'
Silence untrusted loop bound on nsec3param.iterations

See merge request isc-projects/bind9!5256
2021-07-12 02:36:05 +00:00
Mark Andrews
5f82841098 Silence untrusted loop bound on nsec3param.iterations
630
   	    1. tainted_argument: Calling function dns_rdata_tostruct taints argument nsec3param.iterations. [show details]
    631        result = dns_rdata_tostruct(nsec3rdata, &nsec3param, NULL);
   	    2. Condition !!(result == 0), taking true branch.
   	    3. Condition !!(result == 0), taking true branch.
    632        RUNTIME_CHECK(result == ISC_R_SUCCESS);
    633
    634        dns_fixedname_init(&fixed);

            CID 281425 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
            4. tainted_data: Passing tainted expression nsec3param.iterations to dns_nsec3_hashname, which uses it as a loop boundary. [show details]
   	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    635        result = dns_nsec3_hashname(&fixed, rawhash, &rhsize, vctx->origin,
    636                                    vctx->origin, nsec3param.hash,
    637                                    nsec3param.iterations, nsec3param.salt,
    638                                    nsec3param.salt_length);

(cherry picked from commit c5e1c35e45)
2021-07-12 12:16:29 +10:00
Mark Andrews
7616ee40df Merge branch '2807-coverity-reports-use-of-tainted-scalar-v9_16' into 'v9_16'
Silence use of tainted scalar

See merge request isc-projects/bind9!5255
2021-07-12 02:13:39 +00:00
Mark Andrews
ac34c3f552 Silence tainted scalar on rdlen
2042        ttl = isc_buffer_getuint32(&j->it.source);
    	    13. tainted_data_transitive: Call to function isc_buffer_getuint16 with tainted argument *j->it.source.base returns tainted data. [show details]
    	    14. var_assign: Assigning: rdlen = isc_buffer_getuint16(&j->it.source), which taints rdlen.
    2043        rdlen = isc_buffer_getuint16(&j->it.source);
    2044
    2045        /*
    2046         * Parse the rdata.
    2047         */
    	    15. Condition j->it.source.used - j->it.source.current != rdlen, taking false branch.
    2048        if (isc_buffer_remaininglength(&j->it.source) != rdlen) {
    2049                FAIL(DNS_R_FORMERR);
    2050        }
    	    16. var_assign_var: Assigning: j->it.source.active = j->it.source.current + rdlen. Both are now tainted.
    2051        isc_buffer_setactive(&j->it.source, rdlen);
    2052        dns_rdata_reset(&j->it.rdata);
    	    17. lower_bounds: Checking lower bounds of unsigned scalar j->it.source.active by taking the true branch of j->it.source.active > j->it.source.current.

    CID 316506 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
    18. tainted_data: Passing tainted expression j->it.source.active to dns_rdata_fromwire, which uses it as a loop boundary. [show details]
    	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2053        CHECK(dns_rdata_fromwire(&j->it.rdata, rdclass, rdtype, &j->it.source,
    2054                                 &j->it.dctx, 0, &j->it.target));

(cherry picked from commit f0fdca90f2)
2021-07-12 10:45:42 +10:00
Mark Andrews
b212d29a71 Silence use of tainted scalar
2607
            43. tainted_argument: Calling function journal_read_xhdr taints argument xhdr.size. [show details]
    2608                        result = journal_read_xhdr(j1, &xhdr);
            44. Condition rewrite, taking true branch.
            45. Condition result == 29, taking false branch.
    2609                        if (rewrite && result == ISC_R_NOMORE) {
    2610                                break;
    2611                        }
            46. Condition result != 0, taking false branch.
    2612                        CHECK(result);
    2613
            47. var_assign_var: Assigning: size = xhdr.size. Both are now tainted.
    2614                        size = xhdr.size;

            CID 331088 (#3 of 3): Untrusted allocation size (TAINTED_SCALAR)
            48. tainted_data: Passing tainted expression size to isc__mem_get, which uses it as an allocation size. [show details]
            Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2615                        buf = isc_mem_get(mctx, size);

(cherry picked from commit 83fd38dd2c)
2021-07-12 10:45:42 +10:00
Evan Hunt
6f4ea63372 Merge branch '2756-rndc-multiple-algorithm-v9_16' into 'v9_16'
allow multiple key algorithms in the same control listener

See merge request isc-projects/bind9!5247
2021-07-06 20:36:07 +00:00
Evan Hunt
331b8aebe9 CHANGES
(cherry picked from commit a605a84b08)
2021-07-06 12:55:30 -07:00
Evan Hunt
68a40622ef allow multiple key algorithms in the same control listener
if a control channel listener was configured with more than one
key algorithm, message verification would be attempted with each
algorithm in turn. if the first key failed due to the wrong
signature length, the entire verification process was aborted,
rather than continuing on to try with another key.

(cherry picked from commit 841b557df8)
2021-07-06 12:55:28 -07:00
Mark Andrews
444585080c Merge branch 'marka-xmllint-html-v9_16' into 'v9_16'
Check for errors in html files

See merge request isc-projects/bind9!5243
2021-07-02 04:28:28 +00:00
Mark Andrews
80bc1b4715 Check for errors in html files
xmllint doesn't know about the HTML 5 <section> tag so filter
those out.

(cherry picked from commit ea0624b214)
2021-07-02 13:42:27 +10:00
Matthijs Mekking
71fc32ce8a Merge branch '2786-keyfile-locking-race-condition-deadlock-v9_16' into 'v9_16'
Fix possible deadlock when locking key files (9.16)

See merge request isc-projects/bind9!5240
2021-07-01 13:56:29 +00:00
Matthijs Mekking
c17010d390 Add release note and change for [#2786]
(cherry picked from commit be87edd249)
2021-07-01 15:45:17 +02:00
Matthijs Mekking
e36b6312de Merge branch '1126-checkds-v9_16' into 'v9_16'
Backport checkds to 9.16

See merge request isc-projects/bind9!5239
2021-07-01 13:44:30 +00:00
Matthijs Mekking
7e9fb5deda Fix CID 332468: Memory - illegal accesses (UNINIT)
*** CID 332468:  Memory - illegal accesses  (UNINIT)
/lib/dns/zone.c: 6613 in dns_zone_getdnsseckeys()
6607                 ISC_LIST_UNLINK(dnskeys, k1, link);
6608                 ISC_LIST_APPEND(*keys, k1, link);
6609             }
6610         }
6611     6612     failure:
>>>     CID 332468:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "keyset.methods" when calling
>>>     "dns_rdataset_isassociated".
6613         if (dns_rdataset_isassociated(&keyset)) {
6614             dns_rdataset_disassociate(&keyset);
6615         }
6616         if (node != NULL) {
6617             dns_db_detachnode(db, &node);
6618         }

Fix by initializing the 'keyset' with 'dns_rdataset_init'.
2021-07-01 14:59:00 +02:00
Matthijs Mekking
e814422e23 Fix windows build
The checkds feature added new functions that required no specific
additional changes for Windows (because the Windows support has been
dropped), but for 9.16 we still need to define them in libdns.def.in.
2021-07-01 14:48:47 +02:00
Matthijs Mekking
d02002321c Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.

(cherry picked from commit c92128eada)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
efb92dd98c Add change and release note for [#1126]
Seems pretty newsworthy.

(cherry picked from commit 22cd63bf81)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
03894a1102 Update documentation
Update ARM and DNSSEC guide with the new checkds feature.

(cherry picked from commit b4c1f3b832)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
dd92a7d5e3 Protect dst key metadata with lock
The DST key metadata can be written by several threads in parralel.
Protect the dst_key_get* and dst_key_set* functions with a mutex.

(cherry picked from commit 39df3f0475)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
099a548340 Replace zone keyflock with zonemgr keymgmt
The old approach where each zone structure has its own mutex that
a thread needs to obtain multiple locks to do safe keyfile I/O
operations lead to a race condition ending in a possible deadlock.

Consider a zone in two views. Each such zone is stored in a separate
zone structure. A thread that needs to read or write the key files for
this zone needs to obtain both mutexes in seperate structures. If
another thread is working on the same zone in a different view, they
race to get the locks. It would be possible that thread1 grabs the
lock of the zone in view1, while thread2 wins the race for the lock
of the zone in view2. Now both threads try to get the other lock,  both
of them are already locked.

Ideally, when a thread wants to do key file operations, it only needs
to lock a single mutex. This commit introduces a key management hash
table, stored in the zonemgr structure. Each time a zone is being
managed, an object is added to the hash table (and removed when the
zone is being released). This object is identified by the zone name
and contains a mutex that needs to be locked prior to reading or
writing key files.

(cherry-picked from commit ef4619366d49efd46f9fae5f75c4a67c246ba2e6)

(cherry picked from commit 28c5179904)
2021-07-01 14:48:46 +02:00
Matthijs Mekking
d565dd6190 Add checkds code
Similar to notify, add code to send and keep track of checkds requests.

On every zone_rekey event, we will check the DS at parental agents
(but we will only actually query parental agents if theree is a DS
scheduled to be published/withdrawn).

On a zone_rekey event, we will first clear the ongoing checkds requests.
Reset the counter, to avoid continuing KSK rollover premature.

This has the risk that if zone_rekey events happen too soon after each
other, there are redundant DS queries to the parental agents. But
if TTLs and the configured durations in the dnssec-policy are sane (as
in not ridiculous short) the chance of this happening is low.

Update: Remove the TLS bits as this is not supported in 9.16

(cherry picked from commit f7872dbd20)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
70cee781a1 Add checkds log notice
When the checkds published/withdrawn is activated, log a notice. Can
be used for testing, but also operationally useful.

(cherry picked from commit 1a50554963)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
96d4f99a8f Add key metadata for DS published/withdrawn
In order to keep track of how many parents have the DS for a given key
published or withdrawn, keep a counter.

(cherry picked from commit 6e2c24be7c)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
2dfd09fa3a Add missing VERIFY export
This makes the 'dnssec-verify' tool visible to the test environment.

(cherry picked from commit 4c337a8e72)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
8ca6571ee9 Slightly improved dnssec tools fatal message
Return the offending key state identifier.

(cherry picked from commit 71d5932a14)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
850aed0219 Add helpful function 'dns_zone_getdnsseckeys'
This code gathers DNSSEC keys from key files and from the DNSKEY RRset.
It is used for the 'rndc dnssec -status' command, but will also be
needed for "checkds". Turn it into a function.

(cherry picked from commit 40331a20c4)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
9c0e252e2b Add "parental-source[-v6]" config option
Similar to "notify-source" and "transfer-source", add options to
set the source address when querying parental agents for DS records.

(manually picked from commit 2872d6a12e)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
884750b66d Add dst_key_role function
Change the static function 'get_ksk_zsk' to a library function that
can be used to determine the role of a dst_key. Add checks if the
boolean parameters to store the role are not NULL. Rename to
'dst_key_role'.

(cherry picked from commit c9b7f62767)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
63582dc778 Parse "parental-agents" configuration
Parse the new "parental-agents" configuration and store it in the zone
structure.

(cherry picked from commit 6f92d4b9a5)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
72d97df483 Make "primaries" config parsing generic
Make the code to parse "primaries" configuration more generic so
it can be reused for "parental-agents".

(cherry picked from commit 6040c71478)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
6369dec812 Remove stray "setup zone" in kasp system setup
(cherry picked from commit 8327cb7839)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
7d877cea14 Add checkds system test
Add a Pytest based system test for the 'checkds' feature. There is
one nameserver (ns9, because it should be started the latest) that
has configured several zones with dnssec-policy. The zones are set
in such a state that they are waiting for DS publication or DS
withdrawal.

Then several other name servers act as parent servers that either have
the DS for these published, or not. Also one server in the mix is
to test a badly configured parental-agent.

There are tests for DS publication, DS publication error handling,
DS withdrawal and DS withdrawal error handling.

The tests ensures that the zone is DNSSEC valid, and that the
DSPublish/DSRemoved key metadata is set (or not in case of the error
handling).

It does not test if the rollover continues, this is already tested in
the kasp system test (that uses 'rndc -dnssec checkds' to set the
DSPublish/DSRemoved key metadata).

(manually picked from commit 56262db9cd)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
514eccf730 Move checkds system test to checkdstool
There is a checkds system test in v9_16 that does not exist in the
main branch. This existing checkds system test checks the behaviour of
the dnssec-checkds tool. Before backporting the new checkds system
test, that tests the feature where BIND checks periodically the
parental agents if the DS for a given KSK has been published, move the
existing checkds system test to checkdstool.
2021-07-01 14:48:23 +02:00
Matthijs Mekking
ab26fc2d66 Check parental-agents config
Add checks for "parental-agents" configuration, checking for the option
being at wrong type of zone (only allowed for primaries and
secondaries), duplicate definitions, duplicate references, and
undefined parental clauses (the name referenced in the zone clause
does not have a matching "parental-agent" clause).

(cherry picked from commit 1e763e582b)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
90ef2b9c81 Add parental-agents configuration
Introduce a way to configure parental agents that can be used to
query DS records to be used in automatic key rollovers.

(manually picked from commit 0311705d4b)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
42da0e7790 Change primaries objects to remote-servers
Change the primaries configuration objects to the more generic
remote-servers, that we can reuse for other purposes (such as
parental-agents).

(manually picked from commit 39a961112f)
2021-07-01 14:48:21 +02:00
Mark Andrews
d9426f1308 Merge branch '2769-journal-rollforward-failed-journal-out-of-sync-with-zone-v9_16' into 'v9_16'
Handle placeholder KEYDATA record

See merge request isc-projects/bind9!5238
2021-07-01 05:20:48 +00:00
Mark Andrews
39028cf9dd Add CHANGES note for [GL #2769]
(cherry picked from commit 4b2b6fc42c)
2021-07-01 15:01:31 +10:00
Mark Andrews
8be9a67aec Handle placeholder KEYDATA record
A placeholder keydata record can appear in a zone file.  Allow them
to be read back in.

(cherry picked from commit c6fa8a1d45)
2021-07-01 15:01:05 +10:00
Ondřej Surý
ef0f010474 Merge branch 'ondrej/fix-some-spelling-v9_16' into 'v9_16'
Fix various typos in the documentation

See merge request isc-projects/bind9!5237
2021-06-29 18:45:02 +00:00
Ondřej Surý
8ea95021ba Fix various typos in the documentation
Generally, the issues fixed here are missing articles, wrong articles
and double articles.  We especially like "the the".

(cherry picked from commit 4ab9bb63ee)
2021-06-29 20:39:21 +02:00
Matthijs Mekking
8089445676 Merge branch '2791-busy-wait-setnsec3param-shutdown-hang-v9_16' into 'v9_16'
Fix setnsec3param shutdown hang (9.16)

See merge request isc-projects/bind9!5236
2021-06-28 09:48:18 +00:00
Matthijs Mekking
964199602b Add changes for [#2791]
(cherry picked from commit 2f270428fc)
2021-06-28 11:07:47 +02:00
Matthijs Mekking
37db953d9d Fix setnsec3param hang on shutdown
When performing the 'setnsec3param' task, zones that are not loaded
will have their task rescheduled. We should do this only if the zone
load is still pending, this prevents zones that failed to load get
stuck in a busy wait and causing a hang on shutdown.

(cherry picked from commit 10055d44e3)
2021-06-28 11:07:31 +02:00
Matthijs Mekking
2fe799f637 Add configuration that causes setnsec3param hang
Add a zone to the configuration file that uses NSEC3 with dnssec-policy
and fails to load. This will cause setnsec3param to go into a busy wait
and will cause a hang on shutdown.

(cherry picked from commit 3631a23c7f)
2021-06-28 11:02:55 +02:00
Matthijs Mekking
5ffc60cba0 Merge branch '2780-checkconf-dnssec-policy-inheritance-v9_16' into 'v9_16'
Fix checkconf dnssec-policy inheritance bug (9.16)

See merge request isc-projects/bind9!5230
2021-06-24 10:44:29 +00:00
Matthijs Mekking
622fdbc2fb Add change and release note for [#2780]
(cherry picked from commit d0668bd4cc)
2021-06-24 10:42:17 +02:00
Matthijs Mekking
068a978ae9 Fix checkconf dnssec-policy inheritance bug
Similar to #2778, the check for 'dnssec-policy' failed to account for
it being inheritable.

(cherry picked from commit 75ec7d1d9f)
2021-06-24 10:41:28 +02:00
Ondřej Surý
a55bdea67a Merge branch '2758-nsupdate-refused-v9_16' into 'v9_16'
nsupdate: try next server on REFUSED

See merge request isc-projects/bind9!5227
2021-06-23 19:50:18 +00:00
Evan Hunt
e26db7cb9d CHANGES
(cherry picked from commit 693eb67af9)
2021-06-23 21:36:53 +02:00
Evan Hunt
fd683b01ce nsupdate: try next server on REFUSED
when nsupdate sends an SOA query to a resolver, if it fails
with REFUSED, nsupdate will now try the next server rather than
aborting the update completely.

(cherry picked from commit 2100331307)
2021-06-23 21:36:37 +02:00
Ondřej Surý
a3983a796e Merge branch '2183-enable-DF-on-old-socket-code-v9_16' into 'v9_16'
Disable the PMTUD also on the old socket UDP code

See merge request isc-projects/bind9!5229
2021-06-23 19:25:29 +00:00
Ondřej Surý
51cf9e2672 Change the safe edns-udp-size from 1400 to 1432
When backporting the Don't Fragment UDP socket option, it was noticed
that the edns-udp-size probing uses 1432 as one of the values to be
probed and the documentation would be recommending 1400 as the safe
value.  As the safe value can be from the 1400-1500 interval, the
documentation has been changed to match the probed value, so we do not
skip it.
2021-06-23 21:06:05 +02:00
Ondřej Surý
d115a9ae2a Disable the PMTUD also on the old socket UDP code
Instead of just disabling the PMTUD mechanism on the UDP sockets, we
now set IP_DONTFRAG (IPV6_DONTFRAG) flag.  That means that the UDP
packets won't get ever fragmented.  If the ICMP packets are lost the
UDP will just timeout and eventually be retried over TCP.
2021-06-23 21:06:05 +02:00
Ondřej Surý
2e09ec0099 Merge branch '2790-properly-handle-oversized-messages-in-isc_nm_send-v9_16' into 'v9_16'
Handle `UV_EMSGSIZE` in the uv_udp_send() callback (v9.16)

See merge request isc-projects/bind9!5226
2021-06-23 16:27:35 +00:00
Ondřej Surý
ae21e00eed Add CHANGES and release note for [GL #2790]
(cherry picked from commit 5d9c0a3721)
2021-06-23 17:59:04 +02:00
Ondřej Surý
66a058838c Disable IP fragmentation on the UDP sockets
In DNS Flag Day 2020, we started setting the DF (Don't Fragment socket
option on the UDP sockets.  It turned out, that this code was incomplete
leading to dropping the outgoing UDP packets.

This has been now remedied, so it is possible to disable the
fragmentation on the UDP sockets again as the sending error is now
handled by sending back an empty response with TC (truncated) bit set.

This reverts commit 66eefac78c.

(cherry picked from commit b941411072)
2021-06-23 17:58:27 +02:00
Evan Hunt
82a81287f9 Handle UDP send errors when sending DNS message larger than MTU
When the fragmentation is disabled on UDP sockets, the uv_udp_send()
call can fail with UV_EMSGSIZE for messages larger than path MTU.
Previously, this error would end with just discarding the response.  In
this commit, a proper handling of such case is added and on such error,
a new DNS response with truncated bit set is generated and sent to the
client.

This change allows us to disable the fragmentation on the UDP
sockets again.

(cherry picked from commit a3ba95116e)
2021-06-23 17:58:27 +02:00
Matthijs Mekking
affd505d4a Merge branch '2765-servestale-intermittent-test-failure-144-v9_16' into 'v9_16'
Resolve intermittent serve-stale test failure (144) (9.16)

See merge request isc-projects/bind9!5222
2021-06-23 15:44:55 +00:00
Matthijs Mekking
1a9293dc71 Bump wait time in servestale test with 1 second
This check intermittently failed:

I:serve-stale:check not in cache longttl.example times out...
I:serve-stale:failed

This corresponds to this query in the test:

$DIG -p ${PORT} +tries=1 +timeout=3  @10.53.0.3 longttl.example TXT

Looking at the dig output for a failed test, the query actually got a
response from the authoritative server (in one specific example the
query time was 2991 msec, close to 3 seconds).

After doing the query for the test, we enable the authoritative
server after a sleep of three seconds. If we bump this sleep to 4
seconds, the race will be more in favor of the query timing out,
making it unlikely that this test will fail intermittently.

Bump the subsequent wait_for_log checks also with one second.

(cherry picked from commit 05e73a24f0)
2021-06-23 15:44:14 +00:00
Ondřej Surý
3a44d0554d Merge branch '2788-add-rbtdb-ownercase-unittest-v9_16' into 'v9_16'
Add rbtdb setownercase/getownercase unit test (v9.16)

See merge request isc-projects/bind9!5225
2021-06-23 15:43:56 +00:00
Ondřej Surý
a12938e183 Add rbtdb setownercase/getownercase unit test
This commit adds a unittest that tests private rdataset_getownercase()
and rdataset_setownercase() methods from rbtdb.c.  The test setups
minimal mock dns_rbtdb_t and dns_rbtdbnode_t data structures.

As the rbtdb methods are generally hidden behind layers and layers, we
include the "rbtdb.c" directly from rbtdb_test.c, and thus we can use
the private methods and data structures directly.  This also opens up
opportunity to add more unittest for the rbtdb private functions without
going through all the layers.

(cherry picked from commit c7a11bd5b4)
2021-06-23 17:31:13 +02:00
Matthijs Mekking
c8b2245314 Merge branch 'matthijs-2778-more-tests-v9_16' into 'v9_16'
Add more test cases for #2778 (9.16)

See merge request isc-projects/bind9!5224
2021-06-23 15:10:04 +00:00
Matthijs Mekking
6f75c74a37 Add more test cases for #2778
Add three more test cases that detect a configuration error if the
key-directory is inherited but has the same value for a zone in a
different view with a deviating DNSSEC policy.

(cherry picked from commit 84cfd95e95722191195cd4b09ce6f19960868597)
2021-06-23 15:31:30 +02:00
Petr Špaček
31e2cc4b5c Merge branch 'v9_16_18-release' into 'v9_16'
Merge 9.16.18 release branch

See merge request isc-projects/bind9!5221
2021-06-23 12:42:26 +00:00
Petr Špaček
73ca01b564 Set up release notes for BIND 9.16.19 2021-06-23 14:08:31 +02:00
Michał Kępień
1960d70759 prep 9.16.18 2021-06-23 13:46:14 +02:00
Michał Kępień
cd3a1536e2 Merge branch 'michal/prepare-documentation-for-bind-9.16.18' into 'v9_16_18-release'
Prepare documentation for BIND 9.16.18

See merge request isc-private/bind9!305
2021-06-23 13:43:53 +02:00
Michał Kępień
9021863afe Prepare release notes for BIND 9.16.18 2021-06-23 13:43:48 +02:00
Michał Kępień
fb3474f967 Tweak and reword release notes 2021-06-23 13:37:52 +02:00
Michał Kępień
b012902e7e Tweak and reword recent CHANGES entries 2021-06-23 13:36:52 +02:00
Ondřej Surý
64f34dddf5 Merge branch '2788-use-tolower-toupper-isupper-from-ctype-h-v9_16' into 'v9_16'
Use tolower(), toupper() and isupper() from ctype.h (v9.16)

See merge request isc-projects/bind9!5218
2021-06-23 11:08:18 +00:00
Ondřej Surý
0167c4a898 Use POSIX tolower(), toupper() and isupper() functions
In the code that rdataset_setownercase() and rdataset_getownercase() we
now use tolower()/toupper()/isupper() functions appropriately instead of
rolling our own code.

(cherry picked from commit 7ccbe52060)
2021-06-23 11:50:11 +02:00
Ondřej Surý
a5e837cfda Don't set locale globally, just use it when needed
Previously, we would set the locale on a global level and that could
possibly lead to different behaviour in underlying functions.  In this
commit, we change to code to use the system locale only when calling the
libidn2 functions and reset the locale back to "POSIX" when exiting the
libidn2 code.

(cherry picked from commit 0d35b3f1a9)
2021-06-23 11:50:09 +02:00
Michał Kępień
b96584ce14 Merge branch '1802-improve-description-of-mirror-zone-validation-v9_16' into 'v9_16'
[v9_16] Improve description of mirror zone validation

See merge request isc-projects/bind9!5216
2021-06-22 21:06:26 +00:00
Michał Kępień
6ae474ebf9 Improve description of mirror zone validation
Expand the description of mirror zones in the ARM by adding a brief
discussion of how the validation process works for AXFR and IXFR.  Move
the paragraph mentioning the "file" option higher up.  Apply minor
stylistic and whitespace-related tweaks to the relevant section of the
ARM.

(cherry picked from commit d877aa9adf)
2021-06-22 22:54:32 +02:00
Michał Kępień
6d2f540e5e Merge branch '2279-expand-description-of-the-max-cache-size-option-v9_16' into 'v9_16'
[v9_16] Rework description of the "max-cache-size" option

See merge request isc-projects/bind9!5214
2021-06-22 19:50:08 +00:00
Petr Špaček
9505dd0c4f Rework description of the "max-cache-size" option
Improve the description of the "max-cache-size" option in the ARM by
focusing on its meaning for multiple views and default values.
Add mention of a hash table preallocation.

(cherry picked from commit a67ceb8dda)
2021-06-22 21:38:52 +02:00
Michał Kępień
09dbebd964 Merge branch '2777-use-minimal-sized-caches-for-non-recursive-views-v9_16' into 'v9_16'
[v9_16] Use minimal-sized caches for non-recursive views

See merge request isc-projects/bind9!5211
2021-06-22 13:56:36 +00:00
Michał Kępień
87aa343424 Add CHANGES entry
(cherry picked from commit f9500f824d)
2021-06-22 15:32:27 +02:00
Michał Kępień
7427da27fa Hardcode "max-cache-size" for the "_bind" view
The built-in "_bind" view does not allow recursion and therefore does
not need a large cache database.  However, as "max-cache-size" is not
explicitly set for that view in the default configuration, it inherits
that setting from global options.  Set "max-cache-size" for the built-in
"_bind" view to a fixed value (2 MB, i.e. the smallest allowed value) to
prevent needlessly preallocating memory for its cache RBT hash table.

(cherry picked from commit 86698ded32)
2021-06-22 15:32:27 +02:00
Michał Kępień
126436cc96 Use minimal-sized caches for non-recursive views
Currently the implicit default for the "max-cache-size" option is "90%".
As this option is inherited by all configured views, using multiple
views can lead to memory exhaustion over time due to overcommitment.
The "max-cache-size 90%;" default also causes cache RBT hash tables to
be preallocated for every configured view, which does not really make
sense for views which do not allow recursion.

To limit this problem's potential for causing operational issues, use a
minimal-sized cache for views which do not allow recursion and do not
have "max-cache-size" explicitly set (either in global configuration or
in view configuration).

For configurations which include multiple views allowing recursion,
adjusting "max-cache-size" appropriately is still left to the operator.

(cherry picked from commit 86541b39d3)
2021-06-22 15:32:27 +02:00
Matthijs Mekking
ff089d73e8 Merge branch '2783-in-view-dnssec-policy-deadlock-v9_16' into 'v9_16'
Fix in-view /w dnssec-policy deadlock at startup (9.16)

See merge request isc-projects/bind9!5204
2021-06-22 08:13:14 +00:00
Matthijs Mekking
b2851b3c5f Add changes and notes for [#2783]
(cherry picked from commit dae42dc9d4)
2021-06-22 09:25:54 +02:00
Matthijs Mekking
bb1f0404ab Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.

(cherry picked from commit 42c601ae14)
2021-06-22 09:25:46 +02:00
Matthijs Mekking
e7401506e4 Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.

(cherry picked from commit acd83881ff)
2021-06-22 09:25:40 +02:00
Michał Kępień
7dc60c5953 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16-v9_16' into 'v9_16'
Checking of key-directory and dnssec-policy was broken

See merge request isc-projects/bind9!5197
2021-06-18 09:50:08 +00:00
Mark Andrews
0df4c40d64 Add release note for [GL #2778]
(cherry picked from commit 85033788d3)
2021-06-18 17:29:41 +10:00
Mark Andrews
01f547b34b Add CHANGES for [GL #2778]
(cherry picked from commit bd1419a9e8)
2021-06-18 17:29:41 +10:00
Mark Andrews
efbf4ed5e1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.

(cherry picked from commit d1e283ede1)
2021-06-18 17:29:41 +10:00
Mark Andrews
d3268ea9ad Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query-v9_16' into 'v9_16'
Add w and W to maptoupper and maptolower tables

See merge request isc-projects/bind9!5196
2021-06-18 07:14:37 +00:00
Mark Andrews
467c795bfe Add release note for [GL #2779]
(cherry picked from commit 7372e9a60d)
2021-06-18 16:36:38 +10:00
Mark Andrews
c3fdbcb1c1 Add CHANGES note for [GL #2779]
(cherry picked from commit 8c60debc18)
2021-06-18 16:36:38 +10:00
Mark Andrews
ab597b8b91 Check wild card expansions by code point
(cherry picked from commit c65dc2f7dc)
2021-06-18 16:36:37 +10:00
Mark Andrews
52cc9ff372 Add w and W to maptoupper and maptolower tables
(cherry picked from commit 08eeebb6a7)
2021-06-18 16:35:19 +10:00
Michal Nowak
ebc6fece77 Merge branch 'mnowak/alpine-3.14-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.14

See merge request isc-projects/bind9!5192
2021-06-17 16:24:54 +00:00
Michal Nowak
387fbbd4df Add Alpine Linux 3.14
(cherry picked from commit 80f828bc37)
2021-06-17 18:19:18 +02:00
Michał Kępień
76cd42fb56 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown-v9_16' into 'v9_16'
[v9_16] Allow hash tables for cache RBTs to be grown

See merge request isc-projects/bind9!5191
2021-06-17 15:44:38 +00:00
Michał Kępień
cc6d89f913 Add CHANGES entry
(cherry picked from commit 0c59f1362c)
2021-06-17 17:17:37 +02:00
Michał Kępień
c745b14203 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.

(cherry picked from commit 6b77583f54)
2021-06-17 17:17:37 +02:00
Michał Kępień
c2d9c14354 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.

(cherry picked from commit c096f91451)
2021-06-17 17:17:37 +02:00
Michał Kępień
b5e164d87a Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test-v9_16' into 'v9_16'
[v9_16] Increase timeout in the rndc deadlock test

See merge request isc-projects/bind9!5190
2021-06-17 10:45:12 +00:00
Michał Kępień
b9c9ed6197 Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.

(cherry picked from commit ac4c58e8ce)
2021-06-17 12:41:01 +02:00
Michał Kępień
65b74626e4 Merge branch 'v9_16_17-release' into 'v9_16'
Merge 9.16.17 release branch

See merge request isc-projects/bind9!5187
2021-06-16 20:38:37 +00:00
Michał Kępień
a6b5004a72 Set up release notes for BIND 9.16.18 2021-06-16 22:29:27 +02:00
Tinderbox User
84cc19b692 Merge branch 'prep-release' into v9_16_17-release 2021-06-16 22:29:27 +02:00
Michał Kępień
043f7b5ec1 Merge branch 'michal/prepare-documentation-for-bind-9.16.17' into 'v9_16_17-release'
Prepare documentation for BIND 9.16.17

See merge request isc-private/bind9!300
2021-06-16 22:29:27 +02:00
Tinderbox User
13b9f23cce prep 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
b926b343ed Prepare release notes for BIND 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
f481179977 Reorder release notes 2021-06-16 22:29:27 +02:00
Michał Kępień
a3bbfaf1ff Tweak and reword release notes 2021-06-16 22:29:27 +02:00
Michał Kępień
e0ba988ac8 Tweak and reword recent CHANGES entries 2021-06-16 22:29:27 +02:00
Mark Andrews
08c27ce967 Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment-v9_16' into 'v9_16'
make it clear algorithm field is a domain name

See merge request isc-projects/bind9!5181
2021-06-16 06:48:46 +00:00
Mark Andrews
1281b4f281 make it clear algorithm field is a domain name
(cherry picked from commit 47ca495108)
2021-06-16 16:12:44 +10:00
Mark Andrews
19df77ca48 Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid-v9_16' into 'v9_16'
Lock access to task->threadid

See merge request isc-projects/bind9!5178
2021-06-15 05:04:28 +00:00
Mark Andrews
2c38ba4670 Lock access to task->threadid
(cherry picked from commit 234ad2d075)
2021-06-15 12:53:13 +10:00
Ondřej Surý
a7b3865eac Merge branch 'ondrej/bump-clang-dependency-to-llvm-12-v9_16' into 'v9_16'
Change the LLVM tools version to 12 (v9.16)

See merge request isc-projects/bind9!5175
2021-06-13 09:01:15 +00:00
Ondřej Surý
b0e7511001 Update the source code formatting using clang-format-12
clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.
2021-06-13 08:19:44 +02:00
Ondřej Surý
8c20738feb Change the LLVM tools version to 12
LLVM 12 stable was released on 15. April 2021, change the default
version to the current stable.

(cherry picked from commit 9f7855322c)
2021-06-12 08:58:22 +02:00
Michał Kępień
cc8624c0f6 Merge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations-v9_16' into 'v9_16'
[v9_16] Fix "no DS" proofs for wildcard+CNAME delegations

See merge request isc-projects/bind9!5169
2021-06-10 09:11:16 +00:00
Michał Kępień
5ca495ad4f Add release note
(cherry picked from commit 16708682ad)
2021-06-10 10:26:51 +02:00
Michał Kępień
46001e4de3 Add CHANGES entry
(cherry picked from commit c223d81691)
2021-06-10 10:26:51 +02:00
Michał Kępień
f88c90f47f Fix "no DS" proofs for wildcard+CNAME delegations
When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).

(cherry picked from commit 7a87bf468b)
2021-06-10 10:26:51 +02:00
Michał Kępień
82b7e6ccef Add AUTHORITY tests for CNAME-sourced delegations
Add a set of system tests which check the contents of the AUTHORITY
section for signed, insecure delegation responses constructed from CNAME
records and wildcards, both for zones using NSEC and NSEC3.

(cherry picked from commit 26ec4b9a89)
2021-06-10 10:26:51 +02:00
Michał Kępień
5b9c25bef8 Merge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion-v9_16' into 'v9_16'
[v9_16] Fix the variable checked by a post-load assertion

See merge request isc-projects/bind9!5168
2021-06-10 08:06:31 +00:00
Mark Andrews
3593651559 Fix the variable checked by a post-load assertion
Instead of checking the value of the variable modified two lines earlier
(the number of SOA records present at the apex of the old version of the
zone), one of the RUNTIME_CHECK() assertions in zone_postload() checks
the number of SOA records present at the apex of the new version of the
zone, which is already checked before.  Fix the assertion by making it
check the correct variable.

(cherry picked from commit 098639dc59)
2021-06-10 10:04:21 +02:00
Mark Andrews
63e1a742ee Merge branch '2760-db-unit-test-failure-v9_16' into 'v9_16'
Adjust acceptable count values

See merge request isc-projects/bind9!5159
2021-06-09 23:20:54 +00:00
Mark Andrews
c7216ae382 Adjust acceptable count values
usleep(100000) can be slightly less than 10ms so allow the count
to reach 11.

(cherry picked from commit 2bc454dc2d)
2021-06-10 08:33:46 +10:00
Mark Andrews
dab8e3fa0e Merge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isepoch-v9_16' into 'v9_16'
Address race between zone_settimer and set_key_expiry_warning by

See merge request isc-projects/bind9!5157
2021-06-09 22:05:28 +00:00
Mark Andrews
edd0fe1dca Address race between zone_settimer and set_key_expiry_warning by
adding missing lock.

    WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: read M1, write M2):
    #0 isc_time_isepoch lib/isc/unix/time.c:110
    #1 zone_settimer lib/dns/zone.c:14649
    #2 dns_zone_maintenance lib/dns/zone.c:6281
    #3 dns_zonemgr_forcemaint lib/dns/zone.c:18190
    #4 view_loaded server.c:9654
    #5 call_loaddone lib/dns/zt.c:301
    #6 doneloading lib/dns/zt.c:575
    #7 zone_asyncload lib/dns/zone.c:2259
    #8 task_run lib/isc/task.c:845
    #9 isc_task_run lib/isc/task.c:938
    #10 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #11 process_netievent lib/isc/netmgr/netmgr.c:934
    #12 process_queue lib/isc/netmgr/netmgr.c:1003
    #13 process_all_queues lib/isc/netmgr/netmgr.c:775
    #14 async_cb lib/isc/netmgr/netmgr.c:804
    #15 <null> <null>
    #16 isc__trampoline_run lib/isc/trampoline.c:191
    #17 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 isc_time_set lib/isc/unix/time.c:93
    #1 set_key_expiry_warning lib/dns/zone.c:6430
    #2 del_sigs lib/dns/zone.c:6711
    #3 zone_resigninc lib/dns/zone.c:7113
    #4 zone_maintenance lib/dns/zone.c:11111
    #5 zone_timer lib/dns/zone.c:14588
    #6 task_run lib/isc/task.c:845
    #7 isc_task_run lib/isc/task.c:938
    #8 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #9 process_netievent lib/isc/netmgr/netmgr.c:934
    #10 process_queue lib/isc/netmgr/netmgr.c:1003
    #11 process_all_queues lib/isc/netmgr/netmgr.c:775
    #12 async_cb lib/isc/netmgr/netmgr.c:804
    #13 <null> <null>
    #14 isc__trampoline_run lib/isc/trampoline.c:191
    #15 <null> <null>

    SUMMARY: ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch

(cherry picked from commit 3d66e97a28)
2021-06-09 23:56:47 +10:00
Matthijs Mekking
35a1a6e5c1 Merge branch '2725-nsec3param-changes-on-restart-v9_16' into 'v9_16'
Fix NSEC3 resalt on restart (9.16)

See merge request isc-projects/bind9!5154
2021-06-09 08:01:25 +00:00
Matthijs Mekking
203652baef Add release note and change entry for [#2725]
(cherry picked from commit d51aed7112)
2021-06-09 09:18:51 +02:00
Matthijs Mekking
7893064f2e Fix NSEC3 resalting upon restart
When named restarts, it will examine signed zones and checks if the
current denial of existence strategy matches the dnssec-policy. If not,
it will schedule to create a new NSEC(3) chain.

However, on startup the zone database may not be read yet, fooling
BIND that the denial of existence chain needs to be created. This
results in a replacement of the previous NSEC(3) chain.

Change the code such that if the NSEC3PARAM lookup failed (the result
did not return in ISC_R_SUCCESS or ISC_R_NOTFOUND), we will try
again later. The nsec3param structure has additional variables to
signal if the lookup is postponed. We also need to save the signal
if an explicit resalt was requested.

In addition to the two added boolean variables, we add a variable to
store the NSEC3PARAM rdata. This may have a yet to be determined salt
value. We can't create the private data yet because there may be a
mismatch in salt length and the NULL salt value.

(cherry picked from commit 0ae3ffdc1c)
2021-06-09 09:18:44 +02:00
Matthijs Mekking
22e5666925 Add test for NSEC3PARAM not changed after restart
Add a test case where 'named' is restarted and ensure that an already
signed zone does not change its NSEC3 parameters.

The test case first tests the current zone and saves the used salt
value. Then after restart it checks if the salt (and other parameters)
are the same as before the restart.

This test case changes 'set_nsec3param'. This will now reset the salt
value, and when checking for NSEC3PARAM we will store the salt and
use it when testing the NXDOMAIN response. This does mean that for
every test case we now have to call 'set_nsec3param' explicitly (and
can not omit it because it is the same as the previous zone).

Finally, slightly changed some echo output to make debugging friendlier.

(cherry picked from commit 08a9e7add1)
2021-06-09 09:18:37 +02:00
Ondřej Surý
4cf637cd9a Merge branch '2732-pause-the-dbiterator-in-dumptostream-v9_16' into 'v9_16'
Pause the dbiterator when dumping the zone to the disk

See merge request isc-projects/bind9!5151
2021-06-04 10:05:36 +00:00
Ondřej Surý
6a43b1e711 Pause the dbiterator when dumping the zone to the disk
When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.

(cherry picked from commit 7e59b8a4a1)
2021-06-04 11:32:31 +02:00
Mark Andrews
884346628d Merge branch '2751-serve-stale-tests-false-negative-v9_16' into 'v9_16'
Address test race condition in serve-stale

See merge request isc-projects/bind9!5145
2021-06-03 09:03:18 +00:00
Mark Andrews
6d84bff565 Address test race condition in serve-stale
the dig.out.test# files could still be being written when the
content greps where being made.

(cherry picked from commit af95cb8ccc)
2021-06-03 18:43:24 +10:00
Mark Andrews
554578e8cb Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing-v9_16' into 'v9_16'
Report which assertion failed when calling set_global_error

See merge request isc-projects/bind9!5144
2021-06-03 08:10:08 +00:00
Mark Andrews
a74b2a4448 Report which assertion failed when calling set_global_error
(cherry picked from commit 66d1df57cb)
2021-06-03 17:36:51 +10:00
Mark Andrews
e2e5e1601a Merge branch '2724-statschannel-system-test-sometimes-hangs-v9_16' into 'v9_16'
Add timeout to url get requests

See merge request isc-projects/bind9!5140
2021-06-02 23:35:16 +00:00
Mark Andrews
3f20e71430 Add timeout to url get requests
to prevent the system test taking forever on failures.

(cherry picked from commit 02726cb66e)
2021-06-03 08:39:12 +10:00
Ondřej Surý
906cd59d88 Merge branch '2746-fix-the-typo-in-setsockopt_off-v9_16' into 'v9_16'
Fix copy&paste error in setsockopt_off

See merge request isc-projects/bind9!5139
2021-06-02 17:23:02 +00:00
Ondřej Surý
bff37dc79b Add CHANGES and release note for [GL #2746]
(cherry picked from commit 22aa929aac)
2021-06-02 18:10:44 +02:00
Ondřej Surý
e528b3241d Fix copy&paste error in setsockopt_off
Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.

(cherry picked from commit f14d870d15)
2021-06-02 18:10:44 +02:00
Michał Kępień
e3de88945c Merge branch '2540-check-dname-resolution-via-itself-v9_16' into 'v9_16'
[v9_16] Check DNAME resolution via itself

See merge request isc-projects/bind9!5136
2021-06-02 13:10:43 +00:00
Mark Andrews
c4410f0f4f Check DNAME resolution via itself
(cherry picked from commit cbdea694e8)
2021-06-02 14:49:30 +02:00
Michał Kępień
74afaa6f2b Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr-v9_16' into 'v9_16'
[v9_16] Add a system test checking a malformed IXFR

See merge request isc-projects/bind9!5133
2021-06-02 11:56:32 +00:00
Mark Andrews
2b73101db6 Add a system test checking a malformed IXFR
Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.

(cherry picked from commit 5547003a3d)
2021-06-02 13:29:05 +02:00
Ondřej Surý
af07340444 Merge branch 'ondrej/fix-uv_udp_connect-detection-v9_16' into 'v9_16'
Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5129
2021-06-02 10:25:58 +00:00
Ondřej Surý
ce0083474e Cleanup the remaining of HAVE_UV_<func> macros
While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.

(cherry picked from commit 67afea6cfc)
2021-06-02 12:01:29 +02:00
Ondřej Surý
e773ec0b6a Merge branch '2732-zone-dumping-is-blocking-the-networking-io-v9_16' into 'v9_16'
Improve the zone dumping impact on the networking (v9.16)

See merge request isc-projects/bind9!5108
2021-05-31 15:39:44 +00:00
Ondřej Surý
6ca678aca3 Add CHANGES and release note for [GL #2732]
(cherry picked from commit 3e433b87fb)
2021-05-31 16:57:20 +02:00
Ondřej Surý
e95dadb40d Indicate to the kernel that we won't be needing the zone dumps
Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.

(cherry picked from commit e83b6569da)
2021-05-31 16:57:20 +02:00
Ondřej Surý
c8eddf4f33 Refactor zone dumping code to use netmgr async threadpools
Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.

(cherry picked from commit 8a5c62de83)
2021-05-31 16:57:19 +02:00
Ondřej Surý
2e849353b3 Add isc_task_getnetmgr() function
Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.

(cherry picked from commit 7670f98377)
2021-05-31 16:57:19 +02:00
Ondřej Surý
1417e39055 Add asynchronous work API to the network manager
The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.

(cherry picked from commit 87fe97ed91)
2021-05-31 16:57:19 +02:00
Ondřej Surý
c1703f5ce6 Use UV_VERSION_HEX to decide whether we need libuv shim functions
Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.

(cherry picked from commit 211bfefbaa)
2021-05-31 16:57:19 +02:00
Ondřej Surý
4db28d79b1 Add uv_os_getenv() and uv_os_setenv() compatibility shims
The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.

(cherry picked from commit 7477d1b2ed)
2021-05-31 16:57:19 +02:00
Ondřej Surý
0ce462ab8e Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.

(cherry picked from commit f752840db3)
2021-05-31 16:57:19 +02:00
Ondřej Surý
68cb38fc60 Cleanup the uv_import check
The uv_import() is not needed anymore, so we can remove the autoconf
check for it.

(cherry picked from commit 7b02848865)
2021-05-31 16:57:19 +02:00
Michał Kępień
2ed9e86580 Merge branch 'michal/regenerate-man-pages-with-docutils-0.16-v9_16' into 'v9_16'
[v9_16] Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5120
2021-05-31 12:55:11 +00:00
Michał Kępień
1d239012a9 Regenerate man pages with docutils 0.16
Commit 070c5fff49 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.

(cherry picked from commit 6a2daddf5b)
2021-05-31 14:36:11 +02:00
Evan Hunt
4a93c54b56 Merge branch 'kchen-servestale-fix-v9_16' into 'v9_16'
Several serve-stale fixes

See merge request isc-projects/bind9!5118
2021-05-30 19:53:54 +00:00
Matthijs Mekking
89b0a0aa52 Reuse rdatset->ttl when dumping ancient RRsets
Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.

(cherry picked from commit f7f543d99b)
2021-05-30 12:30:36 -07:00
Kevin Chen
3924f78748 Several serve-stale improvements
Commit a83c8cb0af updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.

(cherry picked from commit 0cdf85d204)
2021-05-30 12:30:36 -07:00
Evan Hunt
5daa9066d0 Merge branch '2733-serve-stale-prefetch-crash-v9_16' into 'v9_16'
Fix crash with serve-stale in combination with prefetch

See merge request isc-projects/bind9!5117
2021-05-30 07:57:27 +00:00
Matthijs Mekking
8433a39c54 Add CHANGES and notes for [#2733]
(cherry picked from commit 7ca253818e)
2021-05-30 00:33:42 -07:00
Evan Hunt
de480dcbb6 add a system test for the prefetch bug
Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.

(cherry picked from commit 8c047feb3a)
2021-05-30 00:33:42 -07:00
Matthijs Mekking
a2ec3a1e4c Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.

(cherry picked from commit c0dc5937c7)
2021-05-30 00:33:42 -07:00
Michal Nowak
29421ba122 Merge branch 'mnowak/add-fedora-34-v9_16' into 'v9_16'
[v9_16] Add Fedora 34

See merge request isc-projects/bind9!5113
2021-05-28 11:35:38 +00:00
Michal Nowak
f19bdd7fd4 Add Fedora 34
(cherry picked from commit 5f27aaa0ff)
2021-05-28 12:59:02 +02:00
Evan Hunt
7b37091022 Merge branch '2731-servestale-dns64-v9_16' into 'v9_16'
fix a crash when using stale data with dns64

See merge request isc-projects/bind9!5112
2021-05-27 19:54:32 +00:00
Evan Hunt
534b4d8ed3 CHANGES, release note
(cherry picked from commit d8b793760c)
2021-05-27 12:09:43 -07:00
Matthijs Mekking
61214726da Test with stale timeout cache miss, then fetch completes
Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.

(cherry picked from commit c64589bf46)
2021-05-27 12:09:43 -07:00
Evan Hunt
85ca29e5e2 clean up query correctly if already answered by serve-stale
when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.

(cherry picked from commit 8bd8e995f1)
2021-05-27 12:09:43 -07:00
Evan Hunt
74766f68cc add a test of DNS64 processing with a stale negative response
- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c

(cherry picked from commit 453e905d7e)
2021-05-27 12:09:43 -07:00
Ondřej Surý
c4afbb8148 Merge branch '2529-add-__attribute__-malloc-for-isc_mempool_get-v9_16' into 'v9_16'
Add malloc attribute to memory allocation functions

See merge request isc-projects/bind9!5001
2021-05-27 14:19:47 +00:00
Diego Fronza
4ed22937d8 Add malloc attribute to memory allocation functions
The malloc attribute allows compiler to do some optmizations on
functions that behave like malloc/calloc, like assuming that the
returned pointer do not alias other pointers.
2021-05-27 15:42:36 +02:00
Ondřej Surý
adbdde82d7 Merge branch '2536-inline-signing-documentation-doesn-t-match-reality-v9_16' into 'v9_16'
Resolve "inline-signing documentation doesn't match reality" (v9.16)

See merge request isc-projects/bind9!5110
2021-05-27 13:31:39 +00:00
Matthijs Mekking
8079b0ae8c checkconf tests for inline-signing at options/view
(cherry picked from commit a548a450b3)
2021-05-27 15:27:03 +02:00
Mark Andrews
2ef13c984f Add Release note for [GL #2536]
(cherry picked from commit 03978a7881)
2021-05-27 15:27:03 +02:00
Mark Andrews
9f6912e64b Add CHANGES note for [GL #2536]
(cherry picked from commit 475a553e37)
2021-05-27 15:27:03 +02:00
Mark Andrews
0b8cd8f19d inline-signing should have been in zone_only_clauses
(cherry picked from commit b3301da262)
2021-05-27 15:27:03 +02:00
Ondřej Surý
1f44bb5ab1 Merge branch '2708-named-doesn-t-compile-with-gcc-10-v9_16' into 'v9_16'
Remove priority from attribute constructor/destructor

See merge request isc-projects/bind9!5104
2021-05-27 12:55:17 +00:00
Mark Andrews
0340df46ec Remove priority from attribute constructor/destructor
On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.

(cherry picked from commit d68b009cfe)
2021-05-27 08:26:20 +02:00
Mark Andrews
8f63856d4c Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes-v9_16' into 'v9_16'
Handling NoNameservers exception

See merge request isc-projects/bind9!5103
2021-05-27 03:35:21 +00:00
Diego Fronza
65f90f2927 Handling NoNameservers exception
In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.

(cherry picked from commit b19cd2d83b)
2021-05-27 12:58:55 +10:00
Ondřej Surý
622e6e604d Merge branch 'marka-missing-initialisations-v9_16' into 'v9_16'
Add missing initialisations (v9.16)

See merge request isc-projects/bind9!5101
2021-05-26 15:53:06 +00:00
Mark Andrews
9694554b88 Add missing initialisations
configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.

(cherry picked from commit 715a2c7fc1)
2021-05-26 17:19:06 +02:00
Ondřej Surý
81b9c5bc10 Merge branch 'ondrej/require-cmocka-1.1.3-v9_16' into 'v9_16'
Require CMocka >= 1.1.3 to run the unit tests

See merge request isc-projects/bind9!5099
2021-05-26 14:20:52 +00:00
Ondřej Surý
935a5e2095 Require CMocka >= 1.1.3 to run the unit tests
In CMocka versions << 1.1.3, the skip() function would cause the whole
unit test to abort when CMOCKA_TEST_ABORT is set.  As this is problem
only in Debian 9 Stretch and Ubuntu 16.04 Xenial, we just require the
CMocka >= 1.1.3 and disable the unit testing on Debian 9 Stretch until
we can pull the libcmocka-dev from stretch-backports and remove the
Ubuntu 16.04 Xenial from the CI as it is reaching End of Standard
Support at the end of April 2021.
2021-05-26 16:13:20 +02:00
Ondřej Surý
283ccc232f Merge branch '2721-shutdown-race-in-interfacemgr-v9_16' into 'v9_16'
Refactor the interface handling in the netmgr (v9.16)

See merge request isc-projects/bind9!5095
2021-05-26 08:55:43 +00:00
Ondřej Surý
b009b3c50c Refactor the interface handling in the netmgr
The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.

(cherry picked from commit 50270de8a0)
2021-05-26 10:09:47 +02:00
Mark Andrews
1004eb884d Merge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on-bind-9-16-15-v9_16' into 'v9_16'
Correct size calculation in dns_journal_iter_init()

See merge request isc-projects/bind9!5093
2021-05-26 00:52:56 +00:00
Mark Andrews
f6fd4ec407 Add release note for [GL #2685]
(cherry picked from commit 80ca95a95c)
2021-05-26 08:54:27 +10:00
Mark Andrews
8389380bde Add CHANGES note for [GL #2685]
(cherry picked from commit d99c312938)
2021-05-26 08:50:19 +10:00
Mark Andrews
564ab69c57 Consolidate xhdr fixups
(cherry picked from commit 0a45af2e2f)
2021-05-26 08:49:30 +10:00
Mark Andrews
264b31e786 Check that IXFR delta size is correct
(cherry picked from commit 68d203ff1c)
2021-05-26 08:49:30 +10:00
Mark Andrews
d832062986 Correct size calculation in dns_journal_iter_init()
* dns_journal_next() leaves the read point in the journal after the
transaction header so journal_seek() should be inside the loop.
* we need to recover from transaction header inconsistencies

Additionally when correcting for <size, serial0, serial1, 0> the
correct consistency check is isc_serial_gt() rather than
isc_serial_ge().  All instances updated.

(cherry picked from commit 00609f5094)
2021-05-26 08:49:30 +10:00
Michal Nowak
98de7363e7 Merge branch 'mnowak/install-bind-by-setting-DESTDIR-v9_16' into 'v9_16'
[v9_16] Install BIND with "make DESTDIR=<PATH> install"

See merge request isc-projects/bind9!5091
2021-05-25 16:39:41 +00:00
Michal Nowak
d3aa8f4f5a Install BIND with "make DESTDIR=<PATH> install"
BIND installation should be done by setting DESTDIR during "make
install" not by setting prefix via ./configure.

Make sure that installation with DESTDIR=<PATH> works by checking that
named binary and it's respective man page were installed and that
well-known BIND9 directories - and only them - are present in DESTDIR.

Also rename install path variable from BIND_INSTALL_PATH to
INSTALL_PATH to avoid namespace clash in stress tests which use
BIND_INSTALL_PATH variable to configure path to BIND9 binaries.

(cherry picked from commit 823bf3e79b)
2021-05-25 12:03:34 +02:00
Ondřej Surý
1bb7963bbb Merge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic-v9_16' into 'v9_16'
Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI (v9.16)

See merge request isc-projects/bind9!5088
2021-05-24 20:22:21 +00:00
Ondřej Surý
e1725d75c3 Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI
Ubuntu 16.04 (Xenial Xerus) is reaching End of Standard Support in April
2021 thus we are removing it from the list of supported platforms and
replacing it with Ubuntu 18.04 LTS (Bionic Beaver).

(cherry picked from commit 4402a90bb7)
2021-05-24 21:53:57 +02:00
Michal Nowak
4f60a8f06f Merge branch 'mnowak/freebsd-13-v9_16' into 'v9_16'
[v9_16] Add FreeBSD 13.0

See merge request isc-projects/bind9!5086
2021-05-24 18:17:42 +00:00
Michal Nowak
0c3e2e6c42 Run gcc:tarball CI job for merge requests
Running gcc:tarball CI job for merge requests is consistent with how we
run gcc:out-of-tree CI job and should help identify problems with the
build system during the review process, not once merged during daily
runs. For the sake of time, unit and system tests associated with the
gcc:tarball CI job are excluded from merge requests.

Also, make sure that the tarball-create CI job includes the
default_triggering_rules anchor (as it is on the main branch), otherwise
adding the gcc:tarball CI job to merge request-triggered pipeline fails
with:

    Found errors in your .gitlab-ci.yml: 'gcc:tarball' job needs 'tarball-create' job but it was not added to the pipeline

(cherry picked from commit 83617cea9a)
2021-05-24 19:29:23 +02:00
Michal Nowak
582d7fc860 Do not spawn FreeBSD 11 CI jobs in merge requests
(cherry picked from commit 70eccd2952)
2021-05-24 18:37:37 +02:00
Michal Nowak
a496ab42f1 Create an anchor for schedules, tags, and web rules
It's a common pattern to spawn CI jobs only for pipelines triggered by
schedules, tags, and web. There should be an anchor so that the rules
are not repeated.

(cherry picked from commit e4f88c359c)
2021-05-24 18:22:52 +02:00
Michal Nowak
ddf03eb546 Add FreeBSD 13.0
(cherry picked from commit 0714fe6f40)
2021-05-24 18:18:44 +02:00
Ondřej Surý
a5f92c9d99 Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures-v9_16' into 'v9_16'
Use dns_name_copynf() with dns_message_gettempname() when needed

See merge request isc-projects/bind9!5083
2021-05-22 05:42:08 +00:00
Ondřej Surý
ac25fb9439 Use dns_name_copynf() with dns_message_gettempname() when needed
dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.

(cherry picked from commit ce3e1abc1d)
2021-05-22 07:17:01 +02:00
Ondřej Surý
f470e46db0 Merge branch '2515-improve-glue-cache-performance-v9_16' into 'v9_16'
use a fixedname buffer in dns_message_gettempname()

See merge request isc-projects/bind9!5072
2021-05-22 05:15:01 +00:00
Ondřej Surý
9f13e61041 Optimize rdataset_getownercase not to use bitshifts
The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.

(cherry picked from commit 5ee9edc4ce)
2021-05-22 07:13:57 +02:00
Evan Hunt
dccdb492ef use a fixedname buffer in dns_message_gettempname()
dns_message_gettempname() now returns a pointer to an initialized
name associated with a dns_fixedname_t object. it is no longer
necessary to allocate a buffer for temporary names associated with
the message object.

(cherry picked from commit e31cc1eeb4)
2021-05-22 07:13:57 +02:00
Michał Kępień
a8582b8f8f Merge branch 'michal/regenerate-man-pages-with-sphinx-4.0.2-v9_16' into 'v9_16'
[v9_16] Regenerate man pages with Sphinx 4.0.2

See merge request isc-projects/bind9!5078
2021-05-21 09:37:26 +00:00
Michał Kępień
f27685f0d3 Explicitly set "man_make_section_directory"
The default value of the "man_make_section_directory" Sphinx option was
changed in Sphinx 4.0.1, which broke building man pages in maintainer
mode as the shell code in doc/man/Makefile.am expects man pages to be
built in doc/man/_build/man/, not doc/man/_build/man/<section_number>/.
The aforementioned change in defaults was reverted in Sphinx 4.0.2, but
this issue should still be prevented from reoccurring in the future.
Ensure that by explicitly setting the "man_make_section_directory"
option to False.

(cherry picked from commit 9ec83d1f63)
2021-05-21 11:27:32 +02:00
Michał Kępień
070c5fff49 Regenerate man pages with Sphinx 4.0.2
The man pages produced by Sphinx 4.0.2 are slightly different than those
produced by Sphinx 3.5.4.  As Sphinx 4.0.2 is now used in GitLab CI,
update all doc/man/*in files so that they reflect what that version of
Sphinx produces, in order to prevent GitLab CI job failures.

(cherry picked from commit bdb777b2a2)
2021-05-21 11:27:32 +02:00
Michał Kępień
f2c0dfdc19 Merge branch 'v9_16_16-release' into 'v9_16'
Merge 9.16.16 release branch

See merge request isc-projects/bind9!5069
2021-05-20 10:29:48 +00:00
Michał Kępień
2082566018 Set up release notes for BIND 9.16.17 2021-05-20 12:24:21 +02:00
Tinderbox User
57dad292ae Merge branch 'prep-release' into v9_16_16-release 2021-05-20 12:24:21 +02:00
Michał Kępień
2d7ec0c23b Merge branch 'mnowak/prepare-documentation-for-bind-9.16.16' into 'v9_16_16-release'
Prepare documentation for BIND 9.16.16

See merge request isc-private/bind9!294
2021-05-20 12:24:21 +02:00
Tinderbox User
2427e53d97 prep 9.16.16 2021-05-20 12:24:21 +02:00
Michał Kępień
cc503db304 Prepare release notes for BIND 9.16.16 2021-05-20 12:24:21 +02:00
Michał Kępień
6c144f38d9 Add release note for GL #2626 2021-05-20 12:24:21 +02:00
Michał Kępień
22d7ba6d11 Reorder release notes 2021-05-20 12:24:21 +02:00
Michał Kępień
f853ea9b15 Tweak and reword release notes 2021-05-20 12:24:21 +02:00
Michał Kępień
bf54e20580 Tweak and reword recent CHANGES entries 2021-05-20 12:24:21 +02:00
Michal Nowak
d0a0e7ad18 Fix typo in doc/dnssec-guide/recipes.rst 2021-05-20 12:24:21 +02:00
Matthijs Mekking
cc5bd7f1f5 Merge branch '1875-kasp-views-keyfile-race-v9_16' into 'v9_16'
Lock kasp when looking for zone keys (9.16)

See merge request isc-projects/bind9!5067
2021-05-20 08:21:29 +00:00
Matthijs Mekking
01f9b6e9c4 Release notes and changes for [#1875]
(cherry picked from commit fa1cd0a1f1)
2021-05-20 09:53:32 +02:00
Matthijs Mekking
96be6473fc Lock kasp when looking for zone keys
We should also lock kasp when reading key files, because at the same
time the zone in another view may be updating the key file.

(cherry picked from commit 252a1ae0a1)
2021-05-20 09:52:53 +02:00
Michal Nowak
735857bb09 Merge branch 'mnowak/openbsd-6.9-v9_16' into 'v9_16'
[v9_16] Add OpenBSD 6.9

See merge request isc-projects/bind9!5064
2021-05-19 17:33:03 +00:00
Michal Nowak
fec3bc59f5 Add OpenBSD 6.9
(cherry picked from commit 315b8522ba)
2021-05-19 18:25:33 +02:00
Michal Nowak
78189e7d27 Merge branch '2694-drop-seq-command-from-views-tests-sh-v9_16' into 'v9_16'
[v9_16] Replace seq command with POSIX-compliant shell code

See merge request isc-projects/bind9!5062
2021-05-19 14:55:03 +00:00
Michal Nowak
c0d4a11484 Make views system test ShellCheck-clean
Also, add "set -e" to all shell scripts of the views test to exit when
any command fails or is unknown, e.g., this on OpenBSD:

    tests.sh[174]: seq: not found

(cherry picked from commit a4b7eb7188)
2021-05-19 16:01:03 +02:00
Michal Nowak
8cb24ae7a9 Replace seq command with POSIX-compliant shell code
The seq command is not defined in the POSIX standard and is missing on
OpenBSD. Given that the system test code is meant to be POSIX-compliant
replace it with a shell construct.

(cherry picked from commit a08487ec3d)
2021-05-19 15:56:43 +02:00
Michał Kępień
167efc28fc Merge branch '2709-clean-up-the-installdirs-target-in-Makefile.in' into 'v9_16'
Clean up the "installdirs" target in Makefile.in

See merge request isc-projects/bind9!5059
2021-05-19 12:02:40 +00:00
Michał Kępień
4a4d215037 Add CHANGES entry 2021-05-19 09:59:31 +02:00
Michał Kępień
91d0dfd707 Clean up the "installdirs" target in Makefile.in
The isc-config.sh script was removed in 2019 [1], so the top-level
Makefile does not need to create ${bindir} and ${mandir}/man1 any more.

All named options creating files in the ${localstatedir}/run/named
directory are able to automatically create that directory (as well as
its containing directories), so there is no need for the top-level
Makefile to create ${localstatedir}/run.

Clean up the "installdirs" target in the top-level Makefile accordingly.

[1] see commit 4b44351e65
2021-05-19 09:59:31 +02:00
Matthijs Mekking
cc04e5be92 Merge branch '2688-cid331478-forwardnull-v9_16' into 'v9_16'
Fix coverity issue 331478 (9.16)

See merge request isc-projects/bind9!5058
2021-05-19 07:26:09 +00:00
Matthijs Mekking
5ce026d6a1 Fix coverity issue 331478
Move the "cannot start rollover" warning into code block that checks
if 'active_key' is not NULL.

(cherry picked from commit 19395fd168)
2021-05-19 09:05:35 +02:00
Mark Andrews
c8230562e8 Merge branch '2463-kasp-views-different-policy-same-keydirectory-v9_16' into 'v9_16'
Check key-directory duplicates for kasp zones

See merge request isc-projects/bind9!5055
2021-05-19 01:44:59 +00:00
Matthijs Mekking
271bad4362 Release notes and changes for [GL #2463]
Mention the bugfix.

(cherry picked from commit a9f4b074c4)
2021-05-19 00:44:32 +00:00
Matthijs Mekking
4e8dc72717 Add checkconf tests for [#2463]
Add two tests to make sure named-checkconf catches key-directory issues
where a zone in multiple views uses the same directory but has
different dnssec-policies. One test sets the key-directory specifically,
the other inherits the default key-directory (NULL, aka the working
directory).

Also update the good.conf test to allow zones in different views
with the same key-directory if they use the same dnssec-policy.

Also allow zones in different views with different key-directories if
they use different dnssec-policies.

Also allow zones in different views with the same key-directories if
only one view uses a dnssec-policy (the other is set to "none").

Also allow zones in different views with the same key-directories if
no views uses a dnssec-policy (zone in both views has the dnssec-policy
set to "none").

(cherry picked from commit df1aecd5ff)
2021-05-19 00:44:32 +00:00
Matthijs Mekking
d9fa465ff4 Check key-directory duplicates for kasp zones
Don't allow the same zone with different dnssec-policies in separate
views have the same key-directory.

Track zones plus key-directory in a symtab and if there is a match,
check the offending zone's dnssec-policy name. If the name is "none"
(there is no kasp for the offending zone), or if the name is the same
(the zone shares keys), it is fine, otherwise it is an error (zones
in views using different policies cannot share the same key-directory).

(cherry picked from commit 494e8b2cbd)
2021-05-19 00:44:32 +00:00
Mark Andrews
3aac910a01 Merge branch '2550-remove-dns_zone_setflag-v9_16' into 'v9_16'
Remove dns_zone_setflag()

See merge request isc-projects/bind9!5056
2021-05-19 00:43:35 +00:00
Mark Andrews
a417f994b1 Remove dns_zone_setflag()
This function has never been used since it was added to the source tree
by commit 686b27bfd3 back in 1999.  As
the dns_zoneflg_t type is only defined in lib/dns/zone.c, no function
external to that file would be able to use dns_zone_setflag() properly
anyway - the DNS_ZONE_SETFLAG() and DNS_ZONE_CLRFLAG() macros should be
used instead. Zone options that can be set from outside zone.c are set
using dns_zone_setoption().

(cherry picked from commit 314b5362a8)
2021-05-19 09:56:32 +10:00
Mark Andrews
308213ec8a Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t-v9_16' into 'v9_16'
Adjust returned method from dns_updatemethod_date

See merge request isc-projects/bind9!5054
2021-05-18 13:22:12 +00:00
Mark Andrews
ee07fb854a Adjust returned method from dns_updatemethod_date
if dns_updatemethod_date is used do that the returned method is only
set to dns_updatemethod_increment if the new serial does not encode
the current day (YYYYMMDDXX).

(cherry picked from commit 5d21042ed8)
2021-05-18 22:55:35 +10:00
Michał Kępień
a2dad97eb9 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2-v9_16' into 'v9_16'
[v9_16] Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5053
2021-05-18 09:21:45 +00:00
Michał Kępień
e8af7528e1 Use context managers as suggested by PyLint 2.8.2
PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:157:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.

(cherry picked from commit a8163551ed)
2021-05-18 11:02:45 +02:00
Mark Andrews
ba470298e9 Merge branch '2706-worker-cond_prio-needs-to-be-initialised-v9_16' into 'v9_16'
initialise worker->cond_prio

See merge request isc-projects/bind9!5052
2021-05-18 09:02:14 +00:00
Mark Andrews
148ccd06dd initialise worker->cond_prio
(cherry picked from commit 7e83c6df94)
2021-05-18 18:43:25 +10:00
Mark Andrews
a09b816f00 Merge branch '2701-gcc-10-fanalyzer-reports-dereference-of-null-label-in-lib-dns-name-c-1167-v9_16' into 'v9_16'
Silence gcc-10-fanalyzer false positive

See merge request isc-projects/bind9!5049
2021-05-18 07:12:59 +00:00
Mark Andrews
db0c4d079a Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.

(cherry picked from commit 29f1c1e677)
2021-05-18 16:45:56 +10:00
Mark Andrews
3229e4a2ba Merge branch '2702-gcc-10-fanalyzer-reports-v9_16' into 'v9_16'
Silence gcc-10-fanalyzer false positive

See merge request isc-projects/bind9!5044
2021-05-18 06:43:42 +00:00
Mark Andrews
7dd85a71ae Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.

(cherry picked from commit 683ad6e4bd)
2021-05-18 15:48:08 +10:00
Mark Andrews
f7d597544f Merge branch '2689-cid-331477-resource-leaks-resource_leak-v9_16' into 'v9_16'
Address potential resource leak in dst_key_fromnamedfile

See merge request isc-projects/bind9!5042
2021-05-18 02:48:58 +00:00
Mark Andrews
ae9c74a846 Add CHANGES for [GL #2689]
(cherry picked from commit d24ea068c8)
2021-05-18 11:43:14 +10:00
Mark Andrews
1b0c38c416 Address potential resource leak in dst_key_fromnamedfile
(cherry picked from commit 8eed392add)
2021-05-18 11:42:48 +10:00
Michal Nowak
2d4448c53e Merge branch '2692-grep-from-freebsd-13-0-stumbles-on-r-in-digdelv-test' into 'v9_16'
Do not use escape codes for matching with grep

See merge request isc-projects/bind9!5023
2021-05-17 11:12:17 +00:00
Michal Nowak
253ae96bf1 Do not use escape codes for matching with grep
FreeBSD 13.0 replaced GNU grep with BSD grep and removed support for
"redundant escapes for most ordinary characters" from regex(3) library,
therefore the matching sequence in digdelv/tests.sh needs to be
rewritten otherwise it fails with:

    grep: trailing backslash (\)
2021-05-17 13:10:28 +02:00
Ondřej Surý
21f10fa8c8 Merge branch 'ondrej/remove-netmgr-quantum-v9_16' into 'v9_16'
Replace netmgr quantum with loop-preventing barrier

See merge request isc-projects/bind9!5032
2021-05-17 11:05:38 +00:00
Ondřej Surý
fb9a79ffb6 Replace netmgr quantum with loop-preventing barrier
Instead of using fixed quantum, this commit adds atomic counter for
number of items on each queue and uses the number of netievents
scheduled to run as the limit of maximum number of netievents for a
single process_queue() run.

This prevents the endless loops when the netievent would schedule more
netievents onto the same loop, but we don't have to pick "magic" number
for the quantum.

(cherry picked from commit 9e3cb396b2)
2021-05-17 12:06:07 +02:00
Michal Nowak
570c22da13 Merge branch '2693-add-py-test-to-the-list-of-tested-pytest-names-v9_16' into 'v9_16'
[v9_16] Add py.test to the list of tested pytest names

See merge request isc-projects/bind9!5030
2021-05-17 09:57:54 +00:00
Michal Nowak
cfb8cf5294 Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.

(cherry picked from commit 510b4b70e9)
2021-05-17 11:28:31 +02:00
Michal Nowak
a06c737377 Merge branch '2386-check-correct-copyright-dates-in-man-pages-v9_16' into 'v9_16'
[v9_16] Set copyright year to the current year

See merge request isc-projects/bind9!5027
2021-05-14 13:24:39 +00:00
Michal Nowak
56cd1f041c Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.

(cherry picked from commit 7eb44b05c5)
2021-05-14 14:47:35 +02:00
Ondřej Surý
a822caa3f3 Merge branch 'each-backport-netmgr' into 'v9_16'
Full backport of netmgr/taskmgr to 9.16

See merge request isc-projects/bind9!5018
2021-05-14 11:17:56 +00:00
Evan Hunt
4c9c6a8823 CHANGES, release notes 2021-05-14 12:52:48 +02:00
Ondřej Surý
4d027ab945 Remove TLSDNS, TLS and HTTP protocols from netmgr
For further stabilization of the 9.16 branch, we are removing the unused
protocols from the netmgr.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6a1dba7232 Fix nanosleep and usleep
- Add POSIX nanosleep() and usleep() shim implementation for Windows
  to help implementors use less #ifdef _WIN32 in the code.
- Use uv_sleep when possible in the netmgr code and define usleep based
  shim for libuv << 1.34.0.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6da96c61f8 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.

(cherry picked from commit cd413234f7)
2021-05-14 12:52:48 +02:00
Evan Hunt
e4c9652382 hacks to get dyndb working without libtool
- memory tracing failed if the driver didn't have access
  to the isc_mem_debugging variable.
- remove RTLD_DEEPBIND from dlopen() flags as it causes
  shared libraries to be unable to access thread-local storage,
  which is needed when enqueuing tasks.
2021-05-14 12:52:48 +02:00
Evan Hunt
ef1d909fa9 backport of netmgr/taskmgr to 9.16
this rolls up numerous changes that have been applied to the
main branch, including moving isc_task operations into the
netmgr event loops, and other general stabilization.
2021-05-14 12:52:48 +02:00
Ondřej Surý
d98ad30c0d Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims-v9_16' into 'v9_16'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!5026
2021-05-14 10:21:36 +00:00
Ondřej Surý
a09822b624 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.

(cherry picked from commit c37ff5d188)
2021-05-14 12:19:48 +02:00
Ondřej Surý
906cca09dc Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create-v9_16' into 'v9_16'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!5025
2021-05-14 10:16:00 +00:00
Ondřej Surý
7e8f4b1df6 Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.

(cherry picked from commit cd54bbbd9a)
2021-05-14 12:14:23 +02:00
Mark Andrews
5feb6f79b8 Merge branch '2528-check-soa-rdata-v9_16' into 'v9_16'
Check that the first and last SOA of an AXFR are consistent

See merge request isc-projects/bind9!5015
2021-05-13 13:35:48 +00:00
Evan Hunt
6f6ac57cb5 system test
Attempt a zone transfer with mismatched SOA records.

(cherry picked from commit 4d94f82232)
2021-05-13 23:17:06 +10:00
Mark Andrews
eded531bee Add CHANGES entry for [GL #2528]
(cherry picked from commit 7e54d8d2cb)
2021-05-13 16:01:51 +10:00
Mark Andrews
0ec28efe86 Check that the first and last SOA of an AXFR are consistent
(cherry picked from commit e86508708d)
2021-05-13 16:01:27 +10:00
Matthijs Mekking
43dbce7f0b Merge branch '2603-test-dnssec-policy-none-v9_16' into 'v9_16'
dnssec-policy check for duplicate writable file (9.16)

See merge request isc-projects/bind9!5000
2021-05-05 17:12:50 +00:00
Matthijs Mekking
72deed194d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.

(cherry picked from commit 1998ad6c776a9c17c27788b17765dee90d9e25df)
2021-05-05 18:23:53 +02:00
Matthijs Mekking
353161bd3c Changes and release notes for [#2603]
(cherry picked from commit 7663c17f3b3d2b1600a6864bec90bb045763a96a)
2021-05-05 18:23:51 +02:00
Matthijs Mekking
861b2a14bb Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.

(cherry picked from commit 0b5fc0afcfd1a0bb7c1f16b63872b7ee26fb2777)
2021-05-05 18:22:42 +02:00
Matthijs Mekking
f42234fef0 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).

(cherry picked from commit 5246c16f43e6fda7587193a4dd801951cf87db14)
2021-05-05 18:22:32 +02:00
Mark Andrews
9bb1adb347 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal-v9_16' into 'v9_16'
Allow named-journalprint to compact journals at a given serial

See merge request isc-projects/bind9!4999
2021-05-05 13:52:52 +00:00
Mark Andrews
054c2c6490 Add release note for [GL #2670]
(cherry picked from commit a60b54e1df)
2021-05-05 23:36:06 +10:00
Mark Andrews
84dbaad15a Add CHANGES note for [GL #2670]
(cherry picked from commit 79da175a76)
2021-05-05 23:36:06 +10:00
Mark Andrews
966bcfb89d Check journal compaction
(cherry picked from commit ae1ae07b03)
2021-05-05 23:36:06 +10:00
Mark Andrews
c659fed6ad Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.

(cherry picked from commit 4a8e33b9f0)
2021-05-05 23:36:06 +10:00
Mark Andrews
f10645f21d Allow named-journalprint to compact journals at a given serial
(cherry picked from commit 71df4fb84c)
2021-05-05 23:36:06 +10:00
Matthijs Mekking
d15e4dbc6e Merge branch '2596-dnssec-policy-keys-inaccessiblev9_16' into 'v9_16'
Don't roll keys when private key is offline (9.16)

See merge request isc-projects/bind9!4998
2021-05-05 12:13:17 +00:00
Matthijs Mekking
68bdca4730 No longer need to strcmp for "none"
When we introduced "dnssec-policy insecure" we could have removed the
'strcmp' check for "none", because if it was set to "none", the 'kasp'
variable would have been set to NULL.

(cherry picked from commit 636ff1e15c)
2021-05-05 12:54:05 +02:00
Matthijs Mekking
1d16443fde Changes and release notes for [#2596]
(cherry picked from commit 366ed047dd)
2021-05-05 12:54:05 +02:00
Matthijs Mekking
bc641fc965 Add kasp tests for offline keys
Add a test for default.kasp that if we remove the private key file,
no successor key is created for it. We need to update the kasp script
to deal with a missing private key. If this is the case, skip checks
for private key files.

Add a test with a zone for which the private key of the ZSK is missing.

Add a test with a zone for which the private key of the KSK is missing.

(cherry picked from commit 4a8ad0a77f)
2021-05-05 12:50:07 +02:00
Matthijs Mekking
23b85a4679 Update smart signing when key is offline
BIND 9 is smart about when to sign with what key. If a key is offline,
BIND will delete the old signature anyway if there is another key to
sign the RRset with.

With KASP we don't want to fallback to the KSK if the ZSK is missing,
only for the SOA RRset. If the KSK is missing, but we do have a ZSK,
deleting the signature is fine. Otherwise it depends on if we use KASP
or not. Update the 'delsig_ok' function to reflect that.

(cherry picked from commit 6a60bf637d)
2021-05-05 12:50:00 +02:00
Matthijs Mekking
4e87664fef Don't roll offline keys
When checking the current DNSSEC state against the policy, consider
offline keys. If we didn't found an active key, check if the key is
offline by checking the public key list. If there is a match in the
public key list (the key data is retrieved from the .key and the
.state files), treat the key as offline and don't create a successor
key for it.

(cherry picked from commit 3e6fc49c16)
2021-05-05 12:49:49 +02:00
Matthijs Mekking
ff4930951c rndc dnssec -status should include offline keys
The rndc command 'dnssec -status' only considered keys from
'dns_dnssec_findmatchingkeys' which only includes keys with accessible
private keys. Change it so that offline keys are also listed in the
status.

(cherry picked from commit b3a5859a9b)
2021-05-05 12:49:38 +02:00
Matthijs Mekking
ebb793bfd5 Try to read state when reading keylist from rdata
The function 'dns_dnssec_keylistfromrdataset()' creates a keylist from
the DNSKEY RRset. If we attempt to read the private key, we also store
the key state. However, if the private key is offline, the key state
will not be stored. To fix this, first attempt to read the public key
file. If then reading the private key file fails, and we do have a
public key, add that to the keylist, with appropriate state. If we
also failed to read the public key file, add the DNSKEY to the keylist,
as we did before.

(cherry picked from commit 7ed089576f)
2021-05-05 12:49:30 +02:00
Matthijs Mekking
87e90f27a8 When reading public key from file, also read state
The 'dst_key_fromnamedfile()' function did not read and store the
key state from the .state file when reading a public key file.

(cherry picked from commit fa05c1b8da)
2021-05-05 12:49:22 +02:00
Matthijs Mekking
03e90aa50a Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.

(cherry picked from commit cf17698f87)
2021-05-05 12:49:12 +02:00
Ondřej Surý
4c2c75a806 Merge branch '2671-change-default-for-max-ixfr-ratio-to-unlimited-on-bind-9-16' into 'v9_16'
Change the max-ixfr-ratio default value to unlimited

See merge request isc-projects/bind9!4993
2021-05-05 09:10:34 +00:00
Ondřej Surý
ce5f036cff Add CHANGES and release note for [GL #2671] 2021-05-05 10:24:42 +02:00
Ondřej Surý
8d92112de9 Change the max-ixfr-ratio default value to unlimited
When the feature was backported, we should have leave it disabled by
default, it turns out the default `100%` is producing some unexpected
results (under investigation), so for the time being, we are going to to
disable the max-ixfr-ratio.
2021-05-05 10:24:42 +02:00
Mark Andrews
059358c494 Merge branch '2678-named-checkconf-doesn-t-catch-redefinition-of-dnssec-policy-insecure-v9_16' into 'v9_16'
named-checkconf now detects redefinition of dnssec-policy 'insecure'

See merge request isc-projects/bind9!4995
2021-05-05 07:29:44 +00:00
Mark Andrews
cb77a8efed named-checkconf now detects redefinition of dnssec-policy 'insecure'
(cherry picked from commit dba13d280a)
2021-05-05 17:05:17 +10:00
Michal Nowak
7cc68a9def Merge branch 'mnowak/use-sigabrt-from-start.pl-v9_16' into 'v9_16'
[v9_16] Use SIGABRT instead of SIGKILL to produce cores on failed start

See merge request isc-projects/bind9!4991
2021-05-04 15:54:08 +00:00
Ondřej Surý
82c9e477a1 Use SIGABRT instead of SIGKILL to produce cores on failed start
When the `named` would hang on startup it would be killed with SIGKILL
leaving us with no information about the state the process was in.
This commit changes the start.pl script to send SIGABRT instead, so we
can properly collect and process the coredump from the hung named
process.

(cherry picked from commit 861a236937)
2021-05-04 17:18:45 +02:00
Matthijs Mekking
d627c63f2d Merge branch '2624-kasp-test-failure-job-1630205-v9_16' into 'v9_16'
Fix intermittent kasp test failure

See merge request isc-projects/bind9!4986
2021-05-04 08:59:28 +00:00
Matthijs Mekking
cced7fdaf4 Fix intermittent kasp test failure
The kasp system test performs for each zone a couple of checks to make
sure the zone is signed correctly. To avoid test failures caused by
timing issues, there is first a check to ensure the zone is done
signing, 'wait_for_done_signing'. This function waits with the DNSSEC
checks until a "zone_rekey done" log message is seen for a specific
key.

Unfortunately this is not sufficient to avoid test failures due to
timing issues, because there is a small amount of time in between this
log message and the newly signed zone actually being served.

Therefore, in 'check_apex', retry for three seconds the DNSKEY query
check. After that, additional checks should pass without retries,
because at that point we know for sure the zone has been resigned with
the expected keys.

Also reduce the number of redundant 'check_signatures'

(cherry picked from commit 572f421df4)
2021-05-04 10:25:25 +02:00
Mark Andrews
50a4b15835 Merge branch '2621-pull-request-to-fix-rdnc-addzone-doc-v9_16' into 'v9_16'
Remove spurious $ and \ in addzone example

See merge request isc-projects/bind9!4984
2021-05-04 03:02:45 +00:00
Mark Andrews
18f710c438 Remove spurious $ and \ in addzone example
(cherry picked from commit 205d1bb762)
2021-05-04 12:44:22 +10:00
Matthijs Mekking
733fb98cf4 Merge branch 'matthijs-nsupdate-update_test-v9_16' into 'v9_16'
Update nsupdate test (9.16)

See merge request isc-projects/bind9!4978
2021-04-30 14:28:42 +00:00
Matthijs Mekking
fd01889b8a Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.

(cherry picked from commit 5b31811b5f)
2021-04-30 14:28:30 +02:00
Matthijs Mekking
75277fc825 Merge branch '2645-dnssec-polic-insecure-v9_16' into 'v9_16'
Add built-in dnssec-policy "insecure"

See merge request isc-projects/bind9!4976
2021-04-30 12:02:22 +00:00
Matthijs Mekking
8db61e976a Add kasp test policy goes straight to "none"
Add a test case when a dnssec-policy is reconfigured to "none",
without setting it to "insecure" first. This is unsupported behavior,
but we want to make sure the behavior is somewhat expected. The
zone should remain signed (but will go bogus once the signatures
expire).

(cherry picked from commit 287428e0aa)
2021-04-30 13:58:22 +02:00
Matthijs Mekking
305fc213a0 Release notes and changes for [#2645]
The feature "going insecure gracefully" has been changed.

(cherry picked from commit 75024736a4)
2021-04-30 13:58:22 +02:00
Matthijs Mekking
3ce9e6424b Update documentation with "insecure" policy
Update the ARM to mention the new built-in "insecure" policy.  Update
the DNSSEC guide recipe "Revert to unsigned" to add the additional
step of reconfiguring the zone to "insecure" (instead of immediately
set it to "none").

(cherry picked from commit fadc57d3d0)
2021-04-30 13:58:22 +02:00
Matthijs Mekking
9f8af9a0e1 Add test for "insecure" policy
While it is meant to be used for transitioning a zone to insecure,
add a test case where a zone uses the "insecure" policy immediately.

The zone will go through DNSSEC maintenance, but the outcome should
be the same as 'dnssec-policy none;', that is the zone should be
unsigned.

(cherry picked from commit 9c6ff463fd)
2021-04-30 13:58:22 +02:00
Matthijs Mekking
e5ae856c6c Update kasp tests to "insecure" policy
The tests for going insecure should be changed to use the built-in
"insecure" policy.

The function that checks dnssec status output should again check
for the special case "none".

(cherry picked from commit 17e3b056c8)
2021-04-30 13:58:22 +02:00
Matthijs Mekking
375112a623 Add built-in dnssec-policy "insecure"
Add a new built-in policy "insecure", to be used to gracefully unsign
a zone. Previously you could just remove the 'dnssec-policy'
configuration from your zone statement, or remove it.

The built-in policy "none" (or not configured) now actually means
no DNSSEC maintenance for the corresponding zone. So if you
immediately reconfigure your zone from whatever policy to "none",
your zone will temporarily be seen as bogus by validating resolvers.

This means we can remove the functions 'dns_zone_use_kasp()' and
'dns_zone_secure_to_insecure()' again. We also no longer have to
check for the existence of key state files to figure out if a zone
is transitioning to insecure.

(cherry picked from commit 2710d9a11d)
2021-04-30 13:58:22 +02:00
Petr Špaček
fdf7be247d Merge branch 'pspacek/rtd-sphinx-fix-v9_16' into 'v9_16'
Fix ARM build on readthedocs.org

See merge request isc-projects/bind9!4977
2021-04-30 11:17:25 +00:00
Petr Špaček
28f104f1fd Fix ARM build on readthedocs.org
By default readthedocs.org uses Sphinx 1.8.5, but MR !4563 has
introduced depedency on ReferenceRole class which is available only in
Sphinx 2.0.0.

Path to doc/arm/requirements.txt needs to be configured in
readthedocs.org.
2021-04-30 13:02:22 +02:00
Matthijs Mekking
1df2c4a429 Merge branch '2445-nsec3-iterations-resolver-v9_16' into 'v9_16'
Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure (9.16)

See merge request isc-projects/bind9!4962
2021-04-30 10:13:01 +00:00
Mark Andrews
205738f941 Add release note for [GL #2445]
(cherry picked from commit ad236976fc)
2021-04-30 11:17:01 +02:00
Mark Andrews
501008c510 Add CHANGES for [GL #2445]
(cherry picked from commit fd1f7b6480)
2021-04-30 11:17:00 +02:00
Mark Andrews
15111ab0db Check insecure responses returned with too many NSEC3 iterations
(cherry picked from commit e6e0e29fbb)
2021-04-30 11:16:45 +02:00
Mark Andrews
9170275738 Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure
(cherry picked from commit af02bbcdd6)
2021-04-30 11:16:45 +02:00
Michal Nowak
c169f96f1e Merge branch 'mnowak/configure-with-enable-dnstap-by-default-v9_16' into 'v9_16'
[v9_16] Configure with --enable-dnstap by default

See merge request isc-projects/bind9!4965
2021-04-30 08:06:28 +00:00
Michal Nowak
11681a90a1 Update options{,.active} files with dnstap configured 2021-04-30 10:03:21 +02:00
Michal Nowak
06bddc8882 Suppress TSAN errors from libfstrm.so
dnstap_test produces TSAN errors which originate in libfstrm.so. Unless
libfstrm is TSAN clean or a workaround is placed in libfstrm sources,
suppressing TSAN coming from libfstrm is necessary to test DNSTAP under
TSAN.

(cherry picked from commit c97c6fbfea)
2021-04-30 10:03:21 +02:00
Michal Nowak
c1103b72c7 Configure with --enable-dnstap by default
All platforms but OpenBSD have dnstap dependencies readily in their
respective repositories, and dnstap thus can be tested there. Given that
majority of images have dnstap dependencies available, it seems fitting
to make dnstap enabled by default.

(cherry picked from commit deff0ae317)
2021-04-30 10:03:21 +02:00
Mark Andrews
691299c8df Merge branch '2668-handle-net-dns-versions-that-don-t-support-nsec3param-v9_16' into 'v9_16'
NSEC3PARAM support was added to Net::DNS in 1.00_06

See merge request isc-projects/bind9!4972
2021-04-30 06:50:10 +00:00
Mark Andrews
f9425a9ae6 NSEC3PARAM support was added to Net::DNS in 1.00_06
Require 1.01 or later to when adding a NSEC3PARAM records.

(cherry picked from commit 044933756a)
2021-04-30 16:29:41 +10:00
Mark Andrews
7b8e81a968 Merge branch '2658-update-zonemd-now-that-rfc-8976-has-been-issued-v9_16' into 'v9_16'
Update ZONEMD to match RFC 8976

See merge request isc-projects/bind9!4969
2021-04-30 02:19:16 +00:00
Mark Andrews
53d755966e Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).

(cherry picked from commit 8510ccaa54)
2021-04-30 11:21:19 +10:00
Michal Nowak
8019eb19cd Merge branch 'mnowak/disable-pytest-cacheprovider-plugin-v9_16' into 'v9_16'
[v9_16] Disable pytest cacheprovider plugin in CI

See merge request isc-projects/bind9!4964
2021-04-29 14:22:44 +00:00
Michal Nowak
a4ef2de0c7 Disable pytest cacheprovider plugin in CI
The pytest "cacheprovider" plugin produces a .cache/v/cache/lastfailed
file, which holds a Python dictionary structure with failed tests.
However, on Ubuntu 16.04 (Xenial) the file is created even though the
test passed and the file contains just an empty dictionary ("{}").

Given that we are not interested in this feature, disabling the
"cacheprovider" plugin globally and removing per-test removals of the
.cache directory seems like the best course of action.

(cherry picked from commit e1c3034107)
2021-04-29 15:49:44 +02:00
Matthijs Mekking
b63c90a09c Merge branch 'matthijs-follow-up-2642-nsec3-iter-kasp-9_16' into 'v9_16'
dnssec-policy: reduce NSEC3 iterations to 150

See merge request isc-projects/bind9!4954
2021-04-29 13:01:20 +00:00
Matthijs Mekking
c2225cde3e dnssec-policy: reduce NSEC3 iterations to 150
When reducing the number of NSEC3 iterations to 150, commit
aa26cde2ae added tests for dnssec-policy
to check that a too high iteration count is a configuration failure.

The test is not sufficient because 151 was always too high for
ECDSAP256SHA256. The test should check for a different algorithm.

There was an existing test case that checks for NSEC3 iterations.
Update the test with the new maximum values.

Update the code in 'kaspconf.c' to allow at most 150 iterations.

(cherry picked from commit efa5d84dcf)
2021-04-29 14:31:16 +02:00
Michał Kępień
44f5121078 Merge branch '2372-add-hyperlink-to-gl-xxxx-labels-in-documentation-v9_16' into 'v9_16'
[v9_16] Resolve "Add hyperlink to [GL XXXX] labels in documentation"

See merge request isc-projects/bind9!4959
2021-04-29 12:00:37 +00:00
Michal Nowak
c424aa3bc2 Update Danger check for GitLab references
Release notes now employ a custom :gl: Sphinx role for linking to GitLab
issues/MRs.  Tweak the relevant Danger checks to account for that.

(cherry picked from commit fe1dea6572)
2021-04-29 13:35:05 +02:00
Michał Kępień
902e4482e0 Add a Sphinx role for linking GitLab issues/MRs
Define a :gl: Sphinx role that takes a GitLab issue/MR number as an
argument and creates a hyperlink to the relevant ISC GitLab URL.  This
makes it easy to reach ISC GitLab pages directly from the release notes.

Make all GitLab references in the release notes use the new Sphinx role.

(cherry picked from commit 2fadf29e6b)
2021-04-29 13:35:05 +02:00
Michal Nowak
c7fc3445c2 Make use of the :rfc: role in the ARM consistent
Make sure all RFC references in the ARM use the stock :rfc: Sphinx role.

(cherry picked from commit aeb43a45ac)
2021-04-29 13:35:05 +02:00
Michał Kępień
9bba57c939 Merge branch 'v9_16_15-release' into 'v9_16'
Merge 9.16.15 release branch

See merge request isc-projects/bind9!4955
2021-04-29 09:44:20 +00:00
Michał Kępień
41d18279e4 Regenerate configure 2021-04-29 11:39:56 +02:00
Michał Kępień
cdc086a4f4 Set up release notes for BIND 9.16.16 2021-04-29 11:12:38 +02:00
Tinderbox User
e2316224a4 Merge branch 'prep-release' into v9_16_15-release 2021-04-29 11:12:38 +02:00
Michał Kępień
a02bc2ff64 Merge branch 'michal/prepare-documentation-for-bind-9.16.15' into 'v9_16_15-release'
Prepare documentation for BIND 9.16.15

See merge request isc-private/bind9!288
2021-04-29 11:12:38 +02:00
Tinderbox User
b0f44204fa prep 9.16.15 2021-04-29 11:12:38 +02:00
Tinderbox User
5937b49154 Merge branch 'prep-release' into v9_16_14-release 2021-04-29 11:12:38 +02:00
Michał Kępień
e8e1e9102d Prepare release notes for BIND 9.16.15 2021-04-29 11:12:38 +02:00
Michał Kępień
dd7c2b0436 Merge branch 'michal/prepare-documentation-for-bind-9.16.14' into 'security-v9_16'
Prepare documentation for BIND 9.16.14

See merge request isc-private/bind9!285
2021-04-29 11:12:38 +02:00
Tinderbox User
4999118246 prep 9.16.14 2021-04-29 11:12:38 +02:00
Michał Kępień
0a6543fe21 Tweak and reword release notes 2021-04-29 11:12:38 +02:00
Michał Kępień
154d2aa770 Merge branch '2604-confidential-issue-spnego' into 'security-v9_16'
[CVE-2021-25216] Documentation for ZDI-CAN-13347: ISC BIND TKEY Query Integer Overflow Remote Code Execution Vulnerability

See merge request isc-private/bind9!283
2021-04-29 11:12:38 +02:00
Michał Kępień
e5b8f25f69 Prepare release notes for BIND 9.16.14 2021-04-29 11:12:38 +02:00
Michał Kępień
109f840ba2 Tweak and reword recent CHANGES entries 2021-04-29 11:12:38 +02:00
Michał Kępień
65de43945d Merge branch '2540-confidential-issue-existing-dname-v9_16' into 'security-v9_16'
[CVE-2021-25215] [v9_16] Properly answer queries for DNAME records that require the DNAME to be processed to resolve itself

See merge request isc-private/bind9!281
2021-04-29 11:12:38 +02:00
Michał Kępień
7990f642f9 Add release note for [GL #2604] 2021-04-29 11:12:38 +02:00
Michał Kępień
7e5afc921f Add release note for GL #2623 2021-04-29 11:12:38 +02:00
Michał Kępień
5c6273200e Merge branch '2467-confidential-issue-ixfr-checks-v9_16' into 'security-v9_16'
[CVE-2021-25214] [v9_16] Prevent malformed incoming zone transfers from producing a zone without an SOA record

See merge request isc-private/bind9!262
2021-04-29 11:12:38 +02:00
Mark Andrews
55d6e544b6 Add Release Notes entry for [GL #2540] 2021-04-29 11:12:38 +02:00
Michał Kępień
84007b700f Add CHANGES entry for [GL #2604] 2021-04-29 11:12:38 +02:00
Michał Kępień
5c407e8f62 Add release note for GL #2490 2021-04-29 11:12:38 +02:00
Mark Andrews
0551ebf5cc Add release note for [GL #2467] 2021-04-29 11:12:38 +02:00
Mark Andrews
3c611b3682 Add CHANGES entry for [GL #2540] 2021-04-29 11:12:38 +02:00
Michał Kępień
9474ed9d53 Reorder release notes 2021-04-29 11:12:38 +02:00
Mark Andrews
51b533bdd5 Add CHANGES entry for [GL #2467] 2021-04-29 11:12:38 +02:00
Mark Andrews
ea443fa9ba Handle DNAME lookup via itself
When answering a query, named should never attempt to add the same RRset
to the ANSWER section more than once.  However, such a situation may
arise when chasing DNAME records: one of the DNAME records placed in the
ANSWER section may turn out to be the final answer to a client query,
but there is no way to know that in advance.  Tweak the relevant INSIST
assertion in query_respond() so that it handles this case properly.
qctx->rdataset is freed later anyway, so there is no need to clean it up
in query_respond().
2021-04-29 11:12:38 +02:00
Michał Kępień
797956b55e Tweak and reword release notes 2021-04-29 11:12:38 +02:00
Mark Andrews
c4fa9ba303 Unload a zone if a transfer breaks its SOA record
If a zone transfer results in a zone not having any NS records, named
stops serving it because such a zone is broken.  Do the same if an
incoming zone transfer results in a zone lacking an SOA record at the
apex or containing more than one SOA record.
2021-04-29 11:12:38 +02:00
Michał Kępień
bdeea86101 Tweak and reword recent CHANGES entries 2021-04-29 11:12:38 +02:00
Mark Andrews
ea56069ae0 Address inconsistencies in checking added RRsets
loading_addrdataset() rejects SOA RRsets which are not at top of zone.
addrdataset() should similarly reject such RRsets.
2021-04-29 11:12:38 +02:00
Mark Andrews
ae96ca98f7 Check SOA owner names in zone transfers
An IXFR containing SOA records with owner names different than the
transferred zone's origin can result in named serving a version of that
zone without an SOA record at the apex.  This causes a RUNTIME_CHECK
assertion failure the next time such a zone is refreshed.  Fix by
immediately rejecting a zone transfer (either an incremental or
non-incremental one) upon detecting an SOA record not placed at the apex
of the transferred zone.
2021-04-29 11:12:38 +02:00
Mark Andrews
d7ce222c47 Merge branch '2642-reduce-the-maximum-nsec3-iterations-that-can-be-configured-v9_16' into 'v9_16'
Reduce nsec3 max iterations to 150

See merge request isc-projects/bind9!4951
2021-04-29 08:18:31 +00:00
Mark Andrews
4c7c2bd6a6 Add Release Note for [GL #2642]
(cherry picked from commit ca07b8e414)
2021-04-29 17:56:01 +10:00
Mark Andrews
08ceb7daa7 Add CHANGES for [GL #2642]
5625.   [func]          Reduce the supported maximum number of iterations
                        that can be configured in an NSEC3 zones to 150.
                        [GL #2642]

(cherry picked from commit e04f06873f)
2021-04-29 17:56:00 +10:00
Mark Andrews
e87748a909 Check that excessive iterations in logged by named when
loading an existing zone or transfering from the primary.

(cherry picked from commit 46eb21c546)
2021-04-29 17:55:40 +10:00
Mark Andrews
a7c8c1cde0 Check NSEC3 iterations with dnssec-signzone
(cherry picked from commit 8ec16c378d)
2021-04-29 17:55:40 +10:00
Mark Andrews
5546c7959c Check that named rejects excessive iterations via UPDATE
(cherry picked from commit 4ce8437a6e)
2021-04-29 17:55:39 +10:00
Mark Andrews
b8708ebfa1 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations
(cherry picked from commit 3fe75d9809)
2021-04-29 17:55:35 +10:00
Mark Andrews
be211cbf95 Warn if there is excessive NSEC3 iterations
(cherry picked from commit c9f5f8a059)
2021-04-29 17:44:47 +10:00
Mark Andrews
8e3c963172 Check dnssec-policy nsec3param iterations limit
(cherry picked from commit aa26cde2ae)
2021-04-29 17:44:46 +10:00
Mark Andrews
9324d2d295 Reduce nsec3 max iterations to 150
(cherry picked from commit 29126500d2)
2021-04-29 17:44:46 +10:00
Matthijs Mekking
1050d18664 Merge branch 'matthijs-nit-serve-stale-fixesv9_16' into 'v9_16'
Serve-stale nit fixes (9.16)

See merge request isc-projects/bind9!4950
2021-04-28 13:31:14 +00:00
Matthijs Mekking
4615cbb597 Serve-stale nit fixes
While working on the serve-stale backports, I noticed the following
oddities:

1. In the serve-stale system test, in one case we keep track of the
   time how long it took for dig to complete. In commit
   aaed7f9d8c, the code removed the
   exception to check for result == ISC_R_SUCCESS on stale found
   answers, and adjusted the test accordingly. This failed to update
   the time tracking accordingly. Move the t1/t2 time track variables
   back around the two dig commands to ensure the lookups resolved
   faster than the resolver-query-timeout.

2. We can remove the setting of NS_QUERYATTR_STALEOK and
   DNS_RDATASETATTR_STALE_ADDED on the "else if (stale_timeout)"
   code path, because they are added later when we know we have
   actually found a stale answer on a stale timeout lookup.

3. We should clear the NS_QUERYATTR_STALEOK flag from the client
   query attributes instead of DNS_RDATASETATTR_STALE_ADDED (that
   flag is set on the rdataset attributes).

4. In 'bin/named/config.c' we should set the configuration options
   in alpabetical order.

5. In the ARM, in the backports we have added "(stale)" between
   "cached" and "RRset" to make more clear a stale RRset may be
   returned in this scenario.

(cherry picked from commit 104b676235)
2021-04-28 13:53:52 +02:00
Michał Kępień
99157e2220 Merge branch 'michal/limit-logging-for-verbose-system-tests-v9_16' into 'v9_16'
[v9_16] Limit logging for verbose system tests

See merge request isc-projects/bind9!4948
2021-04-28 07:23:22 +00:00
Michał Kępień
c0b15db6da Warn when log files grow too big in system tests
Exerting excessive I/O load on the host running system tests should be
avoided in order to limit the number of false positives reported by the
system test suite.  In some cases, running named with "-d 99" (which is
the default for system tests) results in a massive amount of logs being
generated, most of which are useless.  Implement a log file size check
to draw developers' attention to overly verbose named instances used in
system tests.  The warning threshold of 200,000 lines was chosen
arbitrarily.

(cherry picked from commit 241e85ef0c)
2021-04-28 08:36:56 +02:00
Michał Kępień
13e97eb3c4 Prevent useless logging in the "tcp" system test
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.

(cherry picked from commit 17e5c2a50e)
2021-04-28 08:36:56 +02:00
Michał Kępień
966ab29e32 Limit logging for verbose system tests
The system test framework starts all named instances with the "-d 99"
command line option (unless it is overridden by a named.args file in a
given instance's working directory).  This causes a lot of log messages
to be written to named.run files - currently over 5 million lines for a
single test suite run.  While debugging information preserved in the log
files is essential for troubleshooting intermittent test failures, some
system tests involve sending hundreds or even thousands of queries,
which causes the relevant log files to explode in size.  When multiple
tests (or even multiple test suites) are run in parallel, excessive
logging contributes considerably to the I/O load on the test host,
increasing the odds of intermittent test failures getting triggered.

Decrease the debug level for the seven most verbose named instances:

  - use "-d 3" for ns2 in the "cacheclean" system test (it is the lowest
    logging level at which the test still passes without the need to
    apply any changes to tests.sh),

  - use "-d 1" for the other six named instances.

This roughly halves the number of lines logged by each test suite run
while still leaving enough information in the logs to allow at least
basic troubleshooting in case of test failures.

This approach was chosen as it results in a greater decrease in the
number of lines logged than running all named instances with "-d 3",
without causing any test failures.

(cherry picked from commit 4a8d404876)
2021-04-28 08:36:56 +02:00
Diego dos Santos Fronza
daf5f2becb Merge branch '2626-deadlock-with-concurrent-rndc-addzone-rndc-delzone-commands-bp-v9_16' into 'v9_16'
Fix deadlock between rndc addzone/delzone/modzone

See merge request isc-projects/bind9!4944
2021-04-26 15:45:05 +00:00
Diego Fronza
8bd7b2e31d Add CHANGES note for GL #2626 2021-04-26 11:38:28 -03:00
Diego Fronza
6b37d3ac53 Add system test for the deadlock fix
The test spawns 4 parallel workers that keep adding, modifying and
deleting zones, the main thread repeatedly checks wheter rndc
status responds within a reasonable period.

While environment and timing issues may affect the test, in most
test cases the deadlock that was taking place before the fix used to
trigger in less than 7 seconds in a machine with at least 2 cores.
2021-04-26 11:35:48 -03:00
Diego Fronza
942b83d392 Fix deadlock between rndc addzone/delzone/modzone
It follows a description of the steps that were leading to the deadlock:

1. `do_addzone` calls `isc_task_beginexclusive`.

2. `isc_task_beginexclusive` waits for (N_WORKERS - 1) halted tasks,
   this blocks waiting for those (no. workers -1) workers to halt.
...
isc_task_beginexclusive(isc_task_t *task0) {
    ...
	while (manager->halted + 1 < manager->workers) {
		wake_all_queues(manager);
		WAIT(&manager->halt_cond, &manager->halt_lock);
	}
```

3. It is possible that in `task.c / dispatch()` a worker is running a
   task event, if that event blocks it will not allow this worker to
   halt.

4. `do_addzone` acquires `LOCK(&view->new_zone_lock);`,

5. `rmzone` event is called from some worker's `dispatch()`, `rmzone`
   blocks waiting for the same lock.

6. `do_addzone` calls `isc_task_beginexclusive`.

7. Deadlock triggered, since:
	- `rmzone` is wating for the lock.
	- `isc_task_beginexclusive` is waiting for (no. workers - 1) to
	   be halted
	- since `rmzone` event is blocked it won't allow the worker to halt.

To fix this, we updated do_addzone code to call isc_task_beginexclusive
before the lock is acquired, we postpone locking to the nearest required
place, same for isc_task_beginexclusive.

The same could happen with rndc modzone, so that was addressed as well.
2021-04-26 11:35:18 -03:00
Michał Kępień
a6f6e01881 Merge branch '2650-handle-soa-rrsigs-not-at-zone-apex-v9_16' into 'v9_16'
[v9_16] Handle RRSIG(SOA) RRsets not at zone apex

See merge request isc-projects/bind9!4943
2021-04-26 11:27:50 +00:00
Michał Kępień
ae5a84c82b Add CHANGES entry
(cherry picked from commit 47a7b042e5)
2021-04-26 12:45:28 +02:00
Michał Kępień
82a5b915de Test handling of non-apex RRSIG(SOA) RRsets
Add a check to the "dnssec" system test which ensures that RRSIG(SOA)
RRsets present anywhere else than at the zone apex are automatically
removed after a zone containing such RRsets is loaded.

(cherry picked from commit 24bf4b946a)
2021-04-26 12:45:28 +02:00
Mark Andrews
b25a1943ee Be more precise with the stopping conditions in zone_resigninc
If there happens to be a RRSIG(SOA) that is not at the zone apex
for any reason it should not be considered as a stopping condition
for incremental zone signing.

(cherry picked from commit b7cdc3583e)
2021-04-26 12:45:28 +02:00
Matthijs Mekking
b28c90ad79 Merge branch '2628-kasp-create-multiple-key-keyid-conflict-v9_16' into 'v9_16'
Check for keyid conflicts between new keys

See merge request isc-projects/bind9!4942
2021-04-26 09:32:19 +00:00
Matthijs Mekking
c599fb85a6 Changes and release notes for [#2628]
(cherry picked from commit b99ec65745)
2021-04-26 10:49:00 +02:00
Matthijs Mekking
f82d4f0474 Check for keyid conflicts between new keys
When the keymgr needs to create new keys, it is possible it needs to
create multiple keys. The keymgr checks for keyid conflicts with
already existing keys, but it should also check against that it just
created.

(cherry picked from commit 668301f138)
2021-04-26 10:48:06 +02:00
Michał Kępień
fd24d057a8 Merge branch '2634-test-tkey-gssapi-credential-conditionally-v9_16' into 'v9_16'
[v9_16] Test "tkey-gssapi-credential" conditionally

See merge request isc-projects/bind9!4939
2021-04-26 08:23:09 +00:00
Michał Kępień
fb90a34fd7 Test "--without-gssapi" in GitLab CI
GitLab CI pipelines do not currently include a Linux job that would have
GSSAPI support disabled.  Add the "--without-gssapi" option to the
./configure invocation on Debian 9 to address that deficiency and also
to continuously test that build-time switch.

(cherry picked from commit a3957af864)
2021-04-26 09:27:31 +02:00
Michał Kępień
cce29c3929 Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.

(cherry picked from commit 6feac68b50)
2021-04-26 09:27:31 +02:00
Mark Andrews
b010acdb52 Merge branch 'marka-shutdown-sync-v9_16' into 'v9_16'
Wait for named to start

See merge request isc-projects/bind9!4937
2021-04-25 23:15:42 +00:00
Mark Andrews
585e3543ca Wait for named to start
If we don't wait for named to finish starting, 'rndc stop' may
fail due to the listen limit being reached in named leading
to a false negative test

(cherry picked from commit 8d5870f9df)
2021-04-26 08:57:22 +10:00
Petr Špaček
da0f436512 Merge branch '2634-test-tkey-gssapi-credential-v9_16' into 'v9_16'
Add tests for the "tkey-gssapi-credential" option (v9.16)

See merge request isc-projects/bind9!4933
2021-04-23 08:13:07 +00:00
Petr Špaček
1d4fbe2511 Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.

(cherry picked from commit 1746d2e84a)
2021-04-23 09:19:45 +02:00
Mark Andrews
d4513539ff Merge branch '2625-the-shutdown-system-test-is-not-capturing-enough-v9_16' into 'v9_16'
Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown

See merge request isc-projects/bind9!4932
2021-04-23 06:49:10 +00:00
Mark Andrews
4e36debc73 Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown
(cherry picked from commit c3c7f5849c)
2021-04-23 15:14:57 +10:00
Ondřej Surý
d4dad8fe21 Merge branch '2637-threadsanitizer-lock-order-inversion-potential-deadlock-in-zone_refreshkeys-v9_16' into 'v9_16'
Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch

See merge request isc-projects/bind9!4920
2021-04-19 20:32:45 +00:00
Ondřej Surý
4bae6d8d73 Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch
There's a lock-order-inversion when running `zone_maintenance()` from
the timer while shutting down the server `shutdown_server()`.  This only
happens when the taskmgr scheduling is more relaxed and paralellized,
but the issue is real nevertheless.

The associated ThreadSanitizer warning:

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
      Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

      Mutex M2 acquired here while holding mutex M1 in thread T1:
	#0 pthread_mutex_lock <null>
	#1 dns_view_findzonecut lib/dns/view.c:1326:2
	#2 fctx_create lib/dns/resolver.c:5144:13
	#3 dns_resolver_createfetch lib/dns/resolver.c:10977:12
	#4 zone_refreshkeys lib/dns/zone.c:10830:13
	#5 zone_maintenance lib/dns/zone.c:11065:5
	#6 zone_timer lib/dns/zone.c:14652:2
	#7 task_run lib/isc/task.c:857:5
	#8 isc_task_run lib/isc/task.c:944:10
	#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#10 process_netievent lib/isc/netmgr/netmgr.c
	#11 process_queue lib/isc/netmgr/netmgr.c:885:8
	#12 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#13 process_queues lib/isc/netmgr/netmgr.c:772:7
	#14 async_cb lib/isc/netmgr/netmgr.c:671:2
	#15 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#16 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#17 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#18 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#19 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 zone_refreshkeys lib/dns/zone.c:10717:2
	#2 zone_maintenance lib/dns/zone.c:11065:5
	#3 zone_timer lib/dns/zone.c:14652:2
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 acquired here while holding mutex M2 in thread T2:
	#0 pthread_mutex_lock <null>
	#1 dns_zone_flush lib/dns/zone.c:11443:2
	#2 view_flushanddetach lib/dns/view.c:657:5
	#3 dns_view_flushanddetach lib/dns/view.c:690:2
	#4 shutdown_server bin/named/server.c:10056:4
	#5 task_run lib/isc/task.c:857:5
	#6 isc_task_run lib/isc/task.c:944:10
	#7 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#8 process_netievent lib/isc/netmgr/netmgr.c
	#9 process_queue lib/isc/netmgr/netmgr.c:885:8
	#10 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#11 process_queues lib/isc/netmgr/netmgr.c:772:7
	#12 async_cb lib/isc/netmgr/netmgr.c:671:2
	#13 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#14 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#15 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#16 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#17 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M2 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 view_flushanddetach lib/dns/view.c:645:3
	#2 dns_view_flushanddetach lib/dns/view.c:690:2
	#3 shutdown_server bin/named/server.c:10056:4
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in __interceptor_pthread_mutex_lock

(cherry picked from commit 25d27851d8)
2021-04-19 22:31:37 +02:00
Ondřej Surý
bb926e36c8 Merge branch 'ondrej/cleanup-double-createinctx-constructors-v9_16' into 'v9_16'
Cleanup the isc_<*>mgr_createinc() constructors (v9.16)

See merge request isc-projects/bind9!4912
2021-04-19 14:19:39 +00:00
Ondřej Surý
97a5559ae3 Cleanup the isc_<*>mgr_createinc() constructors
Previously, the taskmgr, timermgr and socketmgr had a constructor
variant, that would create the mgr on top of existing appctx.  This was
no longer true and isc_<*>mgr was just calling isc_<*>mgr_create()
directly without any extra code.

This commit just cleans up the extra function.

(cherry picked from commit 3388ef36b3)
2021-04-19 15:57:40 +02:00
Ondřej Surý
3cdf026023 Merge branch 'ondrej/cleanup-ISCAPI-remnants-v9_16' into 'v9_16'
Cleanup the public vs private ISCAPI remnants (v9.16)

See merge request isc-projects/bind9!4917
2021-04-19 13:57:07 +00:00
Ondřej Surý
08055b742c Cleanup the public vs private ISCAPI remnants
Since all the libraries are internal now, just cleanup the ISCAPI remnants
in isc_socket, isc_task and isc_timer APIs.  This means, there's one less
layer as following changes have been done:

 * struct isc_socket and struct isc_socketmgr have been removed
 * struct isc__socket and struct isc__socketmgr have been renamed
   to struct isc_socket and struct isc_socketmgr
 * struct isc_task and struct isc_taskmgr have been removed
 * struct isc__task and struct isc__taskmgr have been renamed
   to struct isc_task and struct isc_taskmgr
 * struct isc_timer and struct isc_timermgr have been removed
 * struct isc__timer and struct isc__timermgr have been renamed
   to struct isc_timer and struct isc_timermgr
 * All the associated code that dealt with typing isc_<foo>
   to isc__<foo> and back has been removed.

(cherry picked from commit 16fe0d1f41)
2021-04-19 15:24:10 +02:00
Ondřej Surý
f4cf25618e Merge branch 'each-cleanup-dns_client-v9_16' into 'v9_16'
remove dns_client_update() and related code (v9.16)

See merge request isc-projects/bind9!4914
2021-04-19 13:21:22 +00:00
Evan Hunt
49d9c1abd6 Add CHANGES note for [GL !4835]
(cherry picked from commit 07e349de3c)
2021-04-19 14:32:53 +02:00
Mark Andrews
9d85c56772 properly initialise resarg->lock 2021-04-19 14:32:53 +02:00
Ondřej Surý
579b8bec75 Fixup win32 paths for moved bin/tests/system/resolve
When resolve.c was moved from lib/samples to bin/tests/system, the
resolve.vcxproj.in would still contain old paths to the directory
root. This commit adds one more ..\ to match the directory depth.

Additionally, fixup the path in BINDInstall.vcxproj.in to be
bin/tests/system and not bin/tests/samples.

(cherry picked from commit f14e678624)
2021-04-19 14:32:53 +02:00
Evan Hunt
28511bfcfd move samples/resolve.c to bin/tests/system
"resolve" is used by the resolver system tests, and I'm not
certain whether delv exercises the same code, so rather than
remove it, I moved it to bin/tests/system.

(cherry picked from commit d0ec7d1f33)
2021-04-19 14:32:53 +02:00
Ondřej Surý
dac0950381 Merge branch '2636-timing-race-in-setnsec3param-task-v9_16' into 'v9_16'
Fix task timing race in setnsec3param() (v9.16)

See merge request isc-projects/bind9!4915
2021-04-19 11:26:35 +00:00
Evan Hunt
65777fcdf4 remove sample-async
sample code for export libraries is no longer needed and
this code is not used for any internal tests. also, sample-gai.c
had already been removed but there were some dangling references.

(cherry picked from commit 056afe7bdc)
2021-04-19 13:25:48 +02:00
Evan Hunt
2f7f47bd99 rename dns_client_createx() to dns_client_create()
there's no longer a need to use an alternate name.

(cherry picked from commit 568d455c99)
2021-04-19 13:25:48 +02:00
Evan Hunt
b4aaf6b83d remove dns_client_request() and related code
continues the cleanup of dns_client started in the previous commit.

(cherry picked from commit 1beb05f3e2)
2021-04-19 13:25:48 +02:00
Evan Hunt
131bbb9bbe remove dns_client_update() and related code
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.

(cherry picked from commit fb2a352e7c)
2021-04-19 13:25:48 +02:00
Ondřej Surý
cb6bfd1e9c Fix task timing race in setnsec3param()
When setnsec3param() is schedule from zone_postload() there's no
guarantee that `zone->db` is not `NULL` yet.  Thus when the
setnsec3param() is called, we need to check for `zone->db` existence and
reschedule the task, because calling `rss_post()` on a zone with empty
`.db` ends up with no-op (the function just returns).

(cherry picked from commit 0127ba6472)
2021-04-19 11:48:39 +02:00
Michał Kępień
60c8ace726 Merge branch '2634-fix-handling-undefined-GSS_SPNEGO_MECHANISM-macro' into 'v9_16'
Fix handling undefined GSS_SPNEGO_MECHANISM macro

See merge request isc-projects/bind9!4902
2021-04-16 12:50:53 +00:00
Michał Kępień
381202629e Add CHANGES entry 2021-04-16 14:40:06 +02:00
Michał Kępień
648ef3a2b4 Fix handling undefined GSS_SPNEGO_MECHANISM macro
BIND 9 attempts to look up GSSAPI OIDs for the Kerberos 5 and SPNEGO
mechanisms in the relevant header files provided by the Kerberos/GSSAPI
library used.  Due to the differences between various Kerberos/GSSAPI
implementations, if any of the expected preprocessor macros
(GSS_KRB5_MECHANISM, GSS_SPNEGO_MECHANISM) is not defined in the header
files provided by the library used, the code in lib/dns/gssapictx.c
defines its own version of each missing macro, so that BIND 9 can
attempt to use the relevant security mechanisms anyway.

Commit a875dcc669, which contains a
partial backport of the changes introduced in commit
978c7b2e89, left a block of code in the
lib/dns/dst_internal.h header which defines the GSS_SPNEGO_MECHANISM
preprocessor macro to NULL if it is not defined by any header file
provided by the Kerberos/GSSAPI library used.  This causes the
gss_add_oid_set_member() call in the mech_oid_set_create() helper
function to always return an error.  This in turn causes the
dst_gssapi_acquirecred() function to also always return an error, which
ultimately prevents any named instance whose configuration includes the
"tkey-gssapi-credential" option from starting.

Remove the offending conditional definition of the GSS_SPNEGO_MECHANISM
preprocessor macro from lib/dns/dst_internal.h, so that a proper GSSAPI
OID is assigned to that macro in lib/dns/gssapictx.c when the
Kerberos/GSSAPI library used does not define it.
2021-04-16 14:40:06 +02:00
Michał Kępień
87f1db2ce4 Roll back unnecessary libtool updates
Commit a875dcc669 inadvertently included
libtool updates which were unrelated to the removal of custom SPNEGO
code.  Roll these updates back to avoid confusion.
2021-04-16 14:40:06 +02:00
Ondřej Surý
b6b891c407 Merge branch '2623-9-16-13-overwrites-master-files-if-old-format-jnl-files-are-present-v9_16' into 'v9_16'
Fixing a recoverable journal should not result in the zone being written [v9.16]

See merge request isc-projects/bind9!4900
2021-04-16 12:35:25 +00:00
Mark Andrews
382f915175 Add CHANGES and release note for [GL #2623]
(cherry picked from commit 3df637fb83)
2021-04-16 13:50:21 +02:00
Ondřej Surý
83c79a0b1e Refactor dns_journal_rollforward() to work over opened journal
Too much logic was cramped inside the dns_journal_rollforward() that
made it harder to follow.  The dns_journal_rollforward() was refactored
to work over already opened journal and some of the previous logic was
moved to new static zone_journal_rollforward() that separates the
journal "rollforward" logic from the "zone" logic.

(cherry picked from commit 55b942b4a0)
2021-04-16 13:50:20 +02:00
Mark Andrews
875366565c Fixing a recoverable journal should not result in the zone being written
when dns_journal_rollforward returned ISC_R_RECOVERABLE the distintion
between 'up to date' and 'success' was lost, as a consequence
zone_needdump() was called writing out the zone file when it shouldn't
have been.   This change restores that distintion.  Adjust system
test to reflect visible changes.

(cherry picked from commit ec7a9af381)
2021-04-16 13:50:20 +02:00
Matthijs Mekking
55f7f13ea1 Merge branch 'matthijs-keymgr2kasp-rework-v9_16' into 'v9_16'
Fix view-related issues in the "keymgr2kasp" test

See merge request isc-projects/bind9!4896
2021-04-15 13:19:54 +00:00
Matthijs Mekking
ecc7d6b4bc Fix view-related issues in the "keymgr2kasp" test
Due to the lack of "match-clients" clauses in ns4/named2.conf.in, the
same view is incorrectly chosen for all queries received by ns4 in the
"keymgr2kasp" system test.  This causes only one version of the
"view-rsasha256.kasp" zone to actually be checked.  Add "match-clients"
clauses to ns4/named2.conf.in to ensure the test really checks what it
claims to.

Use identical view names ("ext", "int") in ns4/named.conf.in and
ns4/named2.conf.in so that it is easier to quickly identify the
differences between these two files.

Update tests.sh to account for the above changes.  Also fix a copy-paste
error in a comment to prevent confusion.

(cherry picked from commit 0de5a576c5)
2021-04-15 14:57:14 +02:00
Matthijs Mekking
84948ef445 Merge branch '1100-inline-signing-include-v9_16' into 'v9_16'
Add inline-signing with $INCLUDE test

See merge request isc-projects/bind9!4892
2021-04-14 09:50:45 +00:00
Matthijs Mekking
b9db975a6d Document relative path of $INCLUDE
Add to the ARM from where relative paths are searched.

(cherry picked from commit bad5c3cf7c)
2021-04-14 11:49:02 +02:00
Matthijs Mekking
3e2b6bee17 Fix inline test with missing $INCLUDE
The test case for a zone with a missing include file was wrong for two
reasons:
1. It was loading the wrong file (master5 instead of master6)
2. It did actually not set the $ret variable to 1 if the test failed
   (it should default to ret=1 and clear the variable if the
   appropriate log is found).

(cherry picked from commit 96583e7c40)
2021-04-14 11:48:54 +02:00
Matthijs Mekking
304f5eac7f Add inline-signing with $INCLUDE test
Add a test case for inline-signing for a zone with an $INCLUDE
statement. There is already a test for a missing include file, this
one adds a test for a zone with an include file that does exist.

Test if the record in the included file is loaded.

(cherry picked from commit 6463ee0f40)
2021-04-14 11:48:46 +02:00
Matthijs Mekking
d8c75125bd Merge branch '2347-draft-vandijk-dnsop-nsec-ttl-v9_16' into 'v9_16'
Implement draft-vandijk-dnsop-nsec-ttl (9.16)

See merge request isc-projects/bind9!4890
2021-04-13 15:23:11 +00:00
Matthijs Mekking
3e7c6a6fe8 Small refactor lib/dns/zone.c
Introduce some macros that can be reused in 'zone_load_soa_rr()' and
'zone_get_from_db()' to make those functions more readable.

(cherry picked from commit 8fcbef2423)
2021-04-13 14:19:52 +02:00
Matthijs Mekking
b0fb734079 Use designated initializer in dns_zone_create
Shorten the code and make it less prone to initialisation errors
(it is still easy to forget adding an initializer, but it now defaults
to 0).

(cherry picked from commit 032110bd2e)
2021-04-13 14:19:32 +02:00
Matthijs Mekking
8d0a5775cc Add change entry and release note for [#2347]
(cherry picked from commit 3b68dd426f)
2021-04-13 14:18:42 +02:00
Matthijs Mekking
e5736de60d Implement draft-vandijk-dnsop-nsec-ttl
The draft says that the NSEC(3) TTL must have the same TTL value
as the minimum of the SOA MINIMUM field and the SOA TTL. This was
always the intended behaviour.

Update the zone structure to also track the SOA TTL. Whenever we
use the MINIMUM value to determine the NSEC(3) TTL, use the minimum
of MINIMUM and SOA TTL instead.

There is no specific test for this, however two tests need adjusting
because otherwise they failed: They were testing for NSEC3 records
including the TTL. Update these checks to use 600 (the SOA TTL),
rather than 3600 (the SOA MINIMUM).

(cherry picked from commit 9af8caa733)
2021-04-13 14:18:33 +02:00
Matthijs Mekking
bb90cb2619 Merge branch '2289-cache-dump-stale-ttl-weird-values-9_16' into 'v9_16'
Fix nonsensical stale TTL values in cache dump (9.16)

See merge request isc-projects/bind9!4889
2021-04-13 09:43:07 +00:00
Matthijs Mekking
0d47f9f20f Use stale TTL as RRset TTL in dumpdb
It is more intuitive to have the countdown 'max-stale-ttl' as the
RRset TTL, instead of 0 TTL. This information was already available
in a comment "; stale (will be retained for x more seconds", but
Support suggested to put it in the TTL field instead.

(cherry picked from commit a83c8cb0af)
2021-04-13 10:59:17 +02:00
Matthijs Mekking
7b17cc080e Check staleness in bind_rdataset
Before binding an RRset, check the time and see if this record is
stale (or perhaps even ancient). Marking a header stale or ancient
happens only when looking up an RRset in cache, but binding an RRset
can also happen on other occasions (for example when dumping the
database).

Check the time and compare it to the header. If according to the
time the entry is stale, but not ancient, set the STALE attribute.
If according to the time is ancient, set the ANCIENT attribute.

We could mark the header stale or ancient here, but that requires
locking, so that's why we only compare the current time against
the rdh_ttl.

Adjust the test to check the dump-db before querying for data. In the
dumped file the entry should be marked as stale, despite no cache
lookup happened since the initial query.

(cherry picked from commit debee6157b)
2021-04-13 10:59:10 +02:00
Matthijs Mekking
dcf6e3e58a Fix nonsensical stale TTL values in cache dump
When introducing change 5149, "rndc dumpdb" started to print a line
above a stale RRset, indicating how long the data will be retained.

At that time, I thought it should also be possible to load
a cache from file. But if a TTL has a value of 0 (because it is stale),
stale entries wouldn't be loaded from file. So, I added the
'max-stale-ttl' to TTL values, and adjusted the $DATE accordingly.

Since we actually don't have a "load cache from file" feature, this
is premature and is causing confusion at operators. This commit
changes the 'max-stale-ttl' adjustments.

A check in the serve-stale system test is added for a non-stale
RRset (longttl.example) to make sure the TTL in cache is sensible.

Also, the comment above stale RRsets could have nonsensical
values. A possible reason why this may happen is when the RRset was
marked a stale but the 'max-stale-ttl' has passed (and is actually an
RRset awaiting cleanup). This would lead to the "will be retained"
value to be negative (but since it is stored in an uint32_t, you would
get a nonsensical value (e.g. 4294362497).

To mitigate against this, we now also check if the header is not
ancient. In addition we check if the stale_ttl would be negative, and
if so we set it to 0. Most likely this will not happen because the
header would already have been marked ancient, but there is a possible
race condition where the 'rdh_ttl + serve_stale_ttl' has passed,
but the header has not been checked for staleness.

(cherry picked from commit 2a5e0232ed)
2021-04-13 10:59:00 +02:00
Mark Andrews
7c2b5495e0 Merge branch '2597-make-calling-generic-rdata-methods-consistent-v9_16' into 'v9_16'
Make calling generic rdata methods consistent

See merge request isc-projects/bind9!4843
2021-04-13 03:04:20 +00:00
Mark Andrews
f4331a48fa Make calling generic rdata methods consistent
add matching macros to pass arguments from called methods
to generic methods.  This will reduce the amount of work
required when extending methods.

Also cleanup unnecessary UNUSED declarations.

(cherry picked from commit a88d3963e2)
2021-04-13 01:54:29 +00:00
Mark Andrews
2adee41fce Merge branch '2622-command-line-option-l-not-shown-with-usage-message-v9_16' into 'v9_16'
Update named's usage description

See merge request isc-projects/bind9!4887
2021-04-13 01:53:26 +00:00
Mark Andrews
4864b69e95 Update named's usage description
(cherry picked from commit 38449de93b)
2021-04-13 11:35:13 +10:00
Michal Nowak
b3bebad281 Merge branch 'mnowak/gdb-for-killed-named-v9_16' into 'v9_16'
Run GDB for crashed named servers

See merge request isc-projects/bind9!4848
2021-04-08 10:28:19 +00:00
Michal Nowak
45bb2ae5f6 Run GDB for crashed named servers
When a core file was generated after named crashed during a system test
on 9.16, it wasn't processed by GDB, and no backtrace report was
created. This is now fixed. There are also a few white-space changes.
2021-04-08 11:53:32 +02:00
Michal Nowak
e00b69d2ee Merge branch 'mnowak/fix-missing-fromhex.pl-in-out-of-tree-v9_16' into 'v9_16'
[v9_16] Move fromhex.pl script to bin/tests/system/

See merge request isc-projects/bind9!4877
2021-04-08 09:51:14 +00:00
Michal Nowak
98d91e3024 Move fromhex.pl script to bin/tests/system/
The fromhex.pl script needs to be copied from the source directory to
the build directory before any test is run, otherwise the out-of-tree
fails to find it. Given that the script is used only in system test,
move it to bin/tests/system/.

(cherry picked from commit cd0a34df1b)
2021-04-08 11:11:23 +02:00
Michał Kępień
e02df06d8e Merge branch '2620-free-resources-when-gss_accept_sec_context-fails-v9_16' into 'v9_16'
[v9_16] Free resources when gss_accept_sec_context() fails

See merge request isc-projects/bind9!4874
2021-04-08 09:04:09 +00:00
Michał Kępień
ef4460949f Add CHANGES entry
(cherry picked from commit 7eb87270a4)
2021-04-08 10:41:09 +02:00
Michał Kępień
363902ce2c Free resources when gss_accept_sec_context() fails
Even if a call to gss_accept_sec_context() fails, it might still cause a
GSS-API response token to be allocated and left for the caller to
release.  Make sure the token is released before an early return from
dst_gssapi_acceptctx().

(cherry picked from commit d954e152d9)
2021-04-08 10:41:08 +02:00
Michał Kępień
21b0eac026 Merge branch 'michal/fix-triggering-rules-for-the-tarball-create-job' into 'v9_16'
Fix triggering rules for the "tarball-create" job

See merge request isc-projects/bind9!4871
2021-04-07 20:34:01 +00:00
Michał Kępień
233294d750 Fix triggering rules for the "tarball-create" job
Commit fd8ce68189 (a backport of commit
4d5d3b75da) did not account for the fact
that the "tarball-create" GitLab CI job is not created for manually
triggered pipelines.  This prevents manual pipeline creation from
succeeding as it causes the "gcc:tarball" job to have unsatisfied
dependencies.  Make sure the "tarball-create" job is created for
manually triggered pipelines to allow such pipelines to be started
again.
2021-04-07 22:31:09 +02:00
Ondřej Surý
66e243e64d Merge branch '2600-general-error-managed-keys-zone-dns_journal_compact-failed-no-more-v9_16' into 'v9_16'
Resolve "general: error: managed-keys-zone: dns_journal_compact failed: no more" (v9.16)

See merge request isc-projects/bind9!4870
2021-04-07 20:00:32 +00:00
Mark Andrews
2840fca4c5 Add CHANGES and release note for [GL #2600]
(cherry picked from commit 0174098aca)
2021-04-07 21:30:01 +02:00
Mark Andrews
dd2c7a3c8e Check that upgrade of managed-keys.bind.jnl succeeded
Update the system to include a recoverable managed.keys journal created
with <size,serial0,serial1,0> transactions and test that it has been
updated as part of the start up process.

(cherry picked from commit bb6f0faeed)
2021-04-07 21:29:07 +02:00
Mark Andrews
7b93ff93d6 Rewrite managed-key journal immediately
Both managed keys and regular zone journals need to be updated
immediately when a recoverable error is discovered.

(cherry picked from commit 0fbdf189c7)
2021-04-07 21:29:07 +02:00
Mark Andrews
511ea2d3f3 Update dns_journal_compact() to handle bad transaction headers
Previously, dns_journal_begin_transaction() could reserve the wrong
amount of space.  We now check that the transaction is internally
consistent when upgrading / downgrading a journal and we also handle the
bad transaction headers.

(cherry picked from commit 83310ffd92)
2021-04-07 21:29:06 +02:00
Mark Andrews
6da2e05df9 Compute transaction size based on journal/transaction type
previously the code assumed that it was a new transaction.

(cherry picked from commit 520509ac7e)
2021-04-07 21:29:06 +02:00
Mark Andrews
d9ad7ccf2d Use journal_write_xhdr() to write the dummy transaction header
Instead of journal_write(), use correct format call journal_write_xhdr()
to write the dummy transaction header which looks at j->header_ver1 to
determine which transaction header to write instead of always writing a
zero filled journal_rawxhdr_t header.

(cherry picked from commit 5a6112ec8f)
2021-04-07 21:29:06 +02:00
Diego dos Santos Fronza
25750e6436 Merge branch '2582-threadsanitizer-data-race-lib-dns-zone-c-10272-7-in-zone_maintenance-v9_16' into 'v9_16'
Resolve TSAN data race in zone_maintenance

See merge request isc-projects/bind9!4866
2021-04-07 13:25:17 +00:00
Diego Fronza
5d391f07c0 Resolve TSAN data race in zone_maintenance
Fix race between zone_maintenance and dns_zone_notifyreceive functions,
zone_maintenance was attempting to read a zone flag calling
DNS_ZONE_FLAG(zone, flag) while dns_zone_notifyreceive was updating
a flag in the same zone calling DNS_ZONE_SETFLAG(zone, ...).

The code reading the flag in zone_maintenance was not protected by the
zone's lock, to avoid a race the zone's lock is now being acquired
before an attempt to read the zone flag is made.
2021-04-07 13:22:36 +00:00
Matthijs Mekking
834379b807 Merge branch '2608-stale-answer-client-timeout-default-off-v9_16' into 'v9_16'
Change default stale-answer-client-timeout to off (9.16)

See merge request isc-projects/bind9!4867
2021-04-07 13:16:03 +00:00
Matthijs Mekking
c63b533690 Change default stale-answer-client-timeout to off
Using "stale-answer-client-timeout" turns out to have unforeseen
negative consequences, and thus it is better to disable the feature
by default for the time being.

(cherry picked from commit e443279bbf)
2021-04-07 14:46:55 +02:00
Matthijs Mekking
cae34f759a Merge branch '2594-servestale-staleonly-recursion-race-v9_16' into 'v9_16'
Serve-stale "staleonly" recursion race condition

See merge request isc-projects/bind9!4860
2021-04-02 12:05:27 +00:00
Matthijs Mekking
194a72b3f1 If RPZ config'd, bail stale-answer-client-timeout
When we are recursing, RPZ processing is not allowed. But when we are
performing a lookup due to "stale-answer-client-timeout", we are still
recursing. This effectively means that RPZ processing is disabled on
such a lookup.

In this case, bail the "stale-answer-client-timeout" lookup and wait
for recursion to complete, as we we can't perform the RPZ rewrite
rules reliably.

(cherry picked from commit 3d3a6415f7)
2021-04-02 13:29:27 +02:00
Matthijs Mekking
29bcd113ea Rename "staleonly"
The dboption DNS_DBFIND_STALEONLY caused confusion because it implies
we are looking for stale data **only** and ignore any active RRsets in
the cache. Rename it to DNS_DBFIND_STALETIMEOUT as it is more clear
the option is related to a lookup due to "stale-answer-client-timeout".

Rename other usages of "staleonly", instead use "lookup due to...".
Also rename related function and variable names.

(cherry picked from commit 839df94190)
2021-04-02 13:29:17 +02:00
Matthijs Mekking
34dd6521b1 Restore the RECURSIONOK attribute after staleonly
When doing a staleonly lookup we don't want to fallback to recursion.
After all, there are obviously problems with recursion, otherwise we
wouldn't do a staleonly lookup.

When resuming from recursion however, we should restore the
RECURSIONOK flag, allowing future required lookups for this client
to recurse.

(cherry picked from commit 3f81d79ffb)
2021-04-02 13:29:09 +02:00
Matthijs Mekking
114dc7888a Remove result exception on staleonly lookup
When implementing "stale-answer-client-timeout", we decided that
we should only return positive answers prematurely to clients. A
negative response is not useful, and in that case it is better to
wait for the recursion to complete.

To do so, we check the result and if it is not ISC_R_SUCCESS, we
decide that it is not good enough. However, there are more return
codes that could lead to a positive answer (e.g. CNAME chains).

This commit removes the exception and now uses the same logic that
other stale lookups use to determine if we found a useful stale
answer (stale_found == true).

This means we can simplify two test cases in the serve-stale system
test: nodata.example is no longer treated differently than data.example.

(cherry picked from commit aaed7f9d8c)
2021-04-02 13:28:59 +02:00
Matthijs Mekking
4b25333037 Add notes and changes for [#2594]
Pretty newsworthy.

(cherry picked from commit e44bcc6f53)
2021-04-02 13:28:48 +02:00
Matthijs Mekking
06823aa255 Remove INSIST on NS_QUERYATTR_ANSWERED
The NS_QUERYATTR_ANSWERED attribute is to prevent sending a response
twice. Without the attribute, this may happen if a staleonly lookup
found a useful answer and sends a response to the client, and later
recursion ends and also tries to send a response.

The attribute was also used to mask adding a duplicate RRset. This is
considered harmful. When we created a response to the client with a
stale only lookup (regardless if we actually have send the response),
we should clear the rdatasets that were added during that lookup.

Mark such rdatasets with the a new attribute,
DNS_RDATASETATTR_STALE_ADDED. Set a query attribute
NS_QUERYATTR_STALEOK if we may have added rdatasets during a stale
only lookup. Before creating a response on a normal lookup, check if
we can expect rdatasets to have been added during a staleonly lookup.
If so, clear the rdatasets from the message with the attribute
DNS_RDATASETATTR_STALE_ADDED set.

(cherry picked from commit 3d5429f61f)
2021-04-02 13:28:08 +02:00
Matthijs Mekking
33d61b9651 Simplify when to detach the client
With stale-answer-client-timeout, we may send a response to the client,
but we may want to hold on to the network manager handle, because
recursion is going on in the background, or we need to refresh a
stale RRset.

Simplify the setting of 'nodetach':
* During a staleonly lookup we should not detach the nmhandle, so just
  set it prior to 'query_lookup()'.
* During a staleonly "stalefirst" lookup set the 'nodetach' to true
  if we are going to refresh the RRset.

Now there is no longer the need to clear the 'nodetach' if we go
through the "dbfind_stale", "stale_refresh_window", or "stale_only"
paths.

(cherry picked from commit 48b0dc159b)
2021-04-02 13:28:01 +02:00
Matthijs Mekking
b1496d19d5 Refactor stale lookups, ignore active RRsets
When doing a staleonly lookup, ignore active RRsets from cache. If we
don't, we may add a duplicate RRset to the message, and hit an
assertion failure in query.c because adding the duplicate RRset to the
ANSWER section failed.

This can happen on a race condition. When a client query is received,
the recursion is started. When 'stale-answer-client-timeout' triggers
around the same time the recursion completes, the following sequence
of events may happen:
1. Queue the "try stale" fetch_callback() event to the client task.
2. Add the RRsets from the authoritative response to the cache.
3. Queue the "fetch complete" fetch_callback() event to the client task.
4. Execute the "try stale" fetch_callback(), which retrieves the
   just-inserted RRset from the database.
5. In "ns_query_done()" we are still recursing, but the "staleonly"
   query attribute has already been cleared. In other words, the
   query will resume when recursion ends (it already has ended but is
   still on the task queue).
6. Execute the "fetch complete" fetch_callback(). It finds the answer
   from recursion in the cache again and tries to add the duplicate to
   the answer section.

This commit changes the logic for finding stale answers in the cache,
such that on "stale_only" lookups actually only stale RRsets are
considered. It refactors the code so that code paths for "dbfind_stale",
"stale_refresh_window", and "stale_only" are more clear.

First we call some generic code that applies in all three cases,
formatting the domain name for logging purposes, increment the
trystale stats, and check if we actually found stale data that we can
use.

The "dbfind_stale" lookup will return SERVFAIL if we didn't found a
usable answer, otherwise we will continue with the lookup
(query_gotanswer()). This is no different as before the introduction of
"stale-answer-client-timeout" and "stale-refresh-time".

The "stale_refresh_window" lookup is similar to the "dbfind_stale"
lookup: return SERVFAIL if we didn't found a usable answer, otherwise
continue with the lookup (query_gotanswer()).

Finally the "stale_only" lookup.

If the "stale_only" lookup was triggered because of an actual client
timeout (stale-answer-client-timeout > 0), and if database lookup
returned a stale usable RRset, trigger a response to the client.
Otherwise return and wait until the recursion completes (or the
resolver query times out).

If the "stale_only" lookup is a "stale-anwer-client-timeout 0" lookup,
preferring stale data over a lookup. In this case if there was no stale
data, or the data was not a positive answer, retry the lookup with the
stale options cleared, a.k.a. a normal lookup. Otherwise, continue
with the lookup (query_gotanswer()) and refresh the stale RRset. This
will trigger a response to the client, but will not detach the handle
because a fetch will be created to refresh the RRset.

(cherry picked from commit 92f7a67892)
2021-04-02 13:27:52 +02:00
Matthijs Mekking
fcf8fb4f39 Keep track of allow client detach
The stale-answer-client-timeout feature introduced a dependancy on
when a client may be detached from the handle. The dboption
DNS_DBFIND_STALEONLY was reused to track this attribute. This overloads
the meaning of this database option, and actually introduced a bug
because the option was checked in other places. In particular, in
'ns_query_done()' there is a check for 'RECURSING(qctx->client) &&
(!QUERY_STALEONLY(&qctx->client->query) || ...' and the condition is
satisfied because recursion has not completed yet and
DNS_DBFIND_STALEONLY is already cleared by that time (in
query_lookup()), because we found a useful answer and we should detach
the client from the handle after sending the response.

Add a new boolean to the client structure to keep track of client
detach from handle is allowed or not. It is only disallowed if we are
in a staleonly lookup and we didn't found a useful answer.

(cherry picked from commit fee164243f)
2021-04-02 13:27:43 +02:00
Ondřej Surý
bcae8ec0ef Merge branch '2607-remove-custom-spnego-v9_16' into 'v9_16'
Remove custom ISC SPNEGO implementation (v9.16)

See merge request isc-projects/bind9!4855
2021-04-01 14:14:13 +00:00
Mark Andrews
99132eda0e Add CHANGES and release note for GL #2607 2021-04-01 16:11:25 +02:00
Ondřej Surý
565a6a5679 Move the dummy shims to single ifndef GSSAPI block
Previously, every function had it's own #ifdef GSSAPI #else #endif block
that defined shim function in case GSSAPI was not being used.  Now the
dummy shim functions have be split out into a single #else #endif block
at the end of the file.

This makes the gssapictx.c similar to 9.17.x code, making the backports
and reviews easier.
2021-04-01 10:42:32 +02:00
Mark Andrews
3fd30e1634 Add Heimdal compatibility support
The Heimdal Kerberos library handles the OID sets in a different manner.
Unify the handling of the OID sets between MIT and Heimdal
implementations by dynamically creating the OID sets instead of using
static predefined set.  This is how upstream recommends to handle the
OID sets.
2021-04-01 10:42:32 +02:00
Mark Andrews
6b0b0c6aba Request krb5 CFLAGS and LIBS from $KRB5_CONFIG
The GSSAPI now needs both gssapi and krb5 libraries, so we need to
request both CFLAGS and LIBS from the configure script.
2021-04-01 10:42:32 +02:00
Mark Andrews
a875dcc669 Remove custom ISC SPNEGO implementation
The custom ISC SPNEGO mechanism implementation is no longer needed on
the basis that all major Kerberos 5/GSSAPI (mit-krb5, heimdal and
Windows) implementations support SPNEGO mechanism since 2006.

This commit removes the custom ISC SPNEGO implementation, and removes
the option from both autoconf and win32 Configure script.  Unknown
options are being ignored, so this doesn't require any special handling.
2021-04-01 10:42:32 +02:00
Mark Andrews
216a97188d Handle expected signals in tsiggss authsock.pl script
When the authsock.pl script would be terminated with a signal,
it would leave the pidfile around.  This commit adds a signal
handler that cleanups the pidfile on signals that are expected.
2021-04-01 09:58:19 +02:00
Michal Nowak
f8c6872beb Merge branch 'mnowak/web-run-gcc-tarball-ci-job-v9_16' into 'v9_16'
[v9_16] Run gcc:tarball CI job in web-triggered pipelines

See merge request isc-projects/bind9!4852
2021-03-31 15:03:57 +00:00
Michal Nowak
fd8ce68189 Run gcc:tarball CI job in web-triggered pipelines
The gcc:tarball CI job may identify problems with tarballs created by
"make dist" of the tarball-create CI job. Enabling the gcc:tarball CI
job in web-triggered pipelines provides developers with a test vector.

(cherry picked from commit 4d5d3b75da)
2021-03-31 16:53:51 +02:00
Ondřej Surý
6e4eaa780d Merge branch 'cherry-pick-19b69e9a' into 'v9_16'
Do not require config.h to use isc/util.h (v9.16)

See merge request isc-projects/bind9!4842
2021-03-26 19:00:03 +00:00
Ondřej Surý
ee7283b3ee Merge branch 'bind-dyndb-ldap-v9.16.13' into 'main'
Do not require config.h to use isc/util.h

See merge request isc-projects/bind9!4840

(cherry picked from commit 19b69e9a3b)

81eb3396 Do not require config.h to use isc/util.h
2021-03-26 18:48:06 +00:00
Diego dos Santos Fronza
1c7b15151b Merge branch '2490-dig-tcp-does-not-honor-tries-1-nor-retry-0-v9_16' into 'v9_16'
Resolve "dig +tcp does not honor +tries=1 nor +retry=0"

See merge request isc-projects/bind9!4839
2021-03-25 17:59:37 +00:00
Diego Fronza
ec83e02ed2 Add CHANGES note for [GL #2490] 2021-03-25 14:35:16 -03:00
Diego Fronza
db2c180feb Update dig's man page
Adjusted man page entries for +tries and +retry options to reflect the
fact that now those options apply to TCP as well.
2021-03-25 14:33:50 -03:00
Diego Fronza
9c2d52bcdb Added tests for tries=1 and retry=0 on TCP EOF
Added tests to ensure that dig won't retry sending a query over tcp
(+tcp) when a TCP connection is closed prematurely (EOF is read) if
either +tries=1 or retry=0 is specified on the command line.
2021-03-25 14:33:08 -03:00
Diego Fronza
d299f0e9ab Adjusted dig system tests
Now that premature EOF on tcp connections take +tries and +retry into
account, the dig system tests handling TCP EOF with +tries=1 were
expecting dig to do a second attempt in handling the tcp query, which
doesn't happen anymore.

To make the test work as expected +tries value was adjusted to 2, to
make it behave as before after the new update on dig.
2021-03-25 14:32:46 -03:00
Diego Fronza
1e5f3e6fa3 Don't retry +tcp queries on failure if tries=1 or retries=0
Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
connections.
2021-03-25 14:32:37 -03:00
Matthijs Mekking
b813eab387 Merge branch '2488-refresh-keys-after-rndc-rollover-v9_16' into 'v9_16'
Resolve "Update key refresh timer after 'rndc dnssec -rollover'"

See merge request isc-projects/bind9!4833
2021-03-22 15:27:29 +00:00
Matthijs Mekking
a36257ea60 Fix some intermittent kasp failures
When calling "rndc dnssec -checkds", it may take some milliseconds
before the appropriate changes have been written to the state file.
Add retry_quiet mechanisms to allow the write operation to finish.

Also retry_quiet the check for the next key event. A "rndc dnssec"
command may trigger a zone_rekey event and this will write out
a new "next key event" log line, but it may take a bit longer than
than expected in the tests.

(cherry picked from commit 82d667e1d5)
2021-03-22 15:35:22 +01:00
Matthijs Mekking
d12b40f6fb Rekey immediately after rndc checkds/rollover
Call 'dns_zone_rekey' after a 'rndc dnssec -checkds' or 'rndc dnssec
-rollover' command is received, because such a command may influence
the next key event. Updating the keys immediately avoids unnecessary
rollover delays.

The kasp system test no longer needs to call 'rndc loadkeys' after
a 'rndc dnssec -checkds' or 'rndc dnssec -rollover' command.

(cherry picked from commit 82f72ae249)
2021-03-22 15:35:22 +01:00
Matthijs Mekking
a5c402b67d Merge branch '2517-cds-dnskey-delete-records-prevent-loading-unsigned-zone-v9_16' into 'v9_16'
Resolve "CDS and CDNSKEY DELETE records prevent (re-)loading unsigned zone"

See merge request isc-projects/bind9!4832
2021-03-22 13:27:36 +00:00
Matthijs Mekking
3156c0d103 Add CHANGES and notes for [#2517]
(cherry picked from commit 841e90c6fc)
2021-03-22 13:57:10 +01:00
Matthijs Mekking
1f8c5786f8 Delete CDS/CDNSKEY records when zone is unsigned
CDS/CDNSKEY DELETE records are only useful if they are signed,
otherwise the parent cannot verify these RRsets anyway. So once the DS
has been removed (and signaled to BIND), we can remove the DNSKEY and
RRSIG records, and at this point we can also remove the CDS/CDNSKEY
records.

(cherry picked from commit 6f31f62d69)
2021-03-22 13:57:10 +01:00
Matthijs Mekking
7882c7fbea Allow CDS/CDNSKEY DELETE records in unsigned zone
While not useful, having a CDS/CDNSKEY DELETE record in an unsigned
zone is not an error and "named-checkzone" should not complain.

(cherry picked from commit f211c7c2a1)
2021-03-22 13:31:02 +01:00
Matthijs Mekking
62592d59cb Merge branch 'matthijs-test-keymgr2kasp-v9_16' into 'v9_16'
Test keymgr2kasp (9.16)

See merge request isc-projects/bind9!4830
2021-03-22 11:40:59 +00:00
Matthijs Mekking
fe09becc7e Retry quiet check keys
Change the 'check_keys' function to try three times. Some intermittent
kasp test failures are because we are inspecting the key files
before the actual change has happen. The 'retry_quiet' approach allows
for a bit more time to let the write operation finish.

(cherry picked from commit d5531df79a)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
b24a0da8f4 Update copyrights for keymgr2kasp
This MR introduces a new system test 'keymgr2kasp' to test
migration to 'dnssec-policy'. It moves some existing tests from
the 'kasp' system test to here.

Also a common script 'kasp.sh', to be used in kasp specific tests,
is introduced.

(manually picked from commit 923c2a07bf)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
b81502f4ae Fix keymgr key init bug
The 'keymgr_key_init()' function initializes key states if they have
not been set previously. It looks at the key timing metadata and
determines using the given times whether a state should be set to
RUMOURED or OMNIPRESENT.

However, the DNSKEY and ZRRSIG states were mixed up: When looking
at the Activate timing metadata we should set the ZRRSIG state, and
when looking at the Published timing metadata we should set the
DNSKEY state.

(cherry picked from commit 27e7d5f698)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
68e9603ed8 Test keymgr2kasp state from timing metadata
Add two test zones that migrate to dnssec-policy. Test if the key
states are set accordingly given the timing metadata.

The rumoured.kasp zone has its Publish/Active/SyncPublish times set
not too long ago so the key states should be set to RUMOURED. The
omnipresent.kasp zone has its Publish/Active/SyncPublish times set
long enough to set the key states to OMNIPRESENT.

Slightly change the init_migration_keys function to set the
key lifetime to "none" (legacy keys don't have lifetime). Then in the
test case set the expected key lifetime explicitly.

(cherry picked from commit c40c1ebcb1)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
177ceb6cda Editorial commit keymgr2kasp test
This commit is somewhat editorial as it does not introduce something
new nor fixes anything.

The layout in keymgr2kasp/tests.sh has been changed, with the
intention to make more clear where a test scenario ends and begins.

The publication time of some ZSKs has been changed. It makes a more
clear distinction between publication time and activation time.

(cherry picked from commit f6fa254256)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
e91f53cc6e Introduce kasp.sh
Add a script similar to conf.sh to include common functions and
variables for testing KASP. Currently used in kasp, keymgr2kasp, and
nsec3.

(cherry picked from commit ecb073bdd6)
2021-03-22 11:24:55 +01:00
Matthijs Mekking
2fa68d985f Move kasp migration tests to different directory
The kasp system test was getting pretty large, and more tests are on
the way. Time to split up. Move tests that are related to migrating
to dnssec-policy to a separate directory 'keymgr2kasp'.

(cherry picked from commit 5389172111)
2021-03-22 11:24:55 +01:00
Evan Hunt
885524ed38 Merge branch '2592-dig-clock-realtime-v9_16' into 'v9_16'
Resolve "dig -u is extremely inaccurate, especially on machines with the kernel timer tick set at 100Hz"

See merge request isc-projects/bind9!4827
2021-03-20 19:28:45 +00:00
Evan Hunt
0c74340e76 CHANGES 2021-03-20 12:02:23 -07:00
Patrick McLean
702edde73a dig: Use high resolution clocks when microsecond accuracy is requested
The TIME_NOW macro calls isc_time_now which uses CLOCK_REALTIME_COARSE
for getting the current time. This is perfectly fine for millisecond,
however when the user request microsecond resolutiuon, they are going
to get very inaccurate results. This is especially true on a server
class machine where the clock ticks may be set to 100HZ.

This changes dig to use the new TIME_NOW_HIRES macro that uses the
CLOCK_MONOTONIC_RAW that is more expensive, but gets the *actual*
current time rather than the at the last kernel time tick.

(cherry picked from commit 56cef1495f)
2021-03-20 12:00:59 -07:00
Patrick McLean
c5c9c9b83f Add isc_time_now_hires function to get current time with high resolution
The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
on a timer tick. This clock is generally fine for millisecond accuracy,
but on servers with 100hz clocks, this clock is nowhere near accurate
enough for microsecond accuracy.

This commit adds a new isc_time_now_hires function that uses
CLOCK_REALTIME, which gives the current time, though it is somewhat
expensive to call. When microsecond accuracy is required, it may be
required to use extra resources for higher accuracy.

(cherry picked from commit ebced74b19)
2021-03-20 11:59:21 -07:00
Michal Nowak
a0db1ac26c Merge branch 'v9_16_13-release' into 'v9_16'
Merge 9.16.13 release branch

See merge request isc-projects/bind9!4821
2021-03-19 09:36:09 +00:00
Michal Nowak
63cb814f3c Set up release notes for BIND 9.16.14 2021-03-19 10:10:59 +01:00
Tinderbox User
cfb6cca52d Merge branch 'prep-release' into v9_16_13-release 2021-03-19 09:57:51 +01:00
Michal Nowak
4bbc3587e0 Merge branch 'mnowak/prepare-documentation-for-bind-9.16.13' into 'v9_16_13-release'
Prepare documentation for BIND 9.16.13

See merge request isc-private/bind9!267
2021-03-19 09:57:51 +01:00
Tinderbox User
0525112928 prep 9.16.13 2021-03-19 09:57:51 +01:00
Michal Nowak
d0444472d8 Prepare release notes for BIND 9.16.13 2021-03-19 09:57:51 +01:00
Michal Nowak
7ce5609e8b Add release note for GL #2041 2021-03-19 09:57:51 +01:00
Michal Nowak
ed42c89938 Reorder release notes 2021-03-19 09:57:51 +01:00
Michal Nowak
4af8825c27 Tweak and reword release notes 2021-03-19 09:57:36 +01:00
Michal Nowak
3ef42ca6db Tweak and reword recent CHANGES entries 2021-03-19 09:54:30 +01:00
Diego dos Santos Fronza
706c8c6a12 Merge branch '2575-memory-leak-when-named-attempts-to-listen-on-freebsd-virtual-interface' into 'v9_16'
Resolve "memory leak when named attempts to listen on FreeBSD virtual interface"

See merge request isc-projects/bind9!4823
2021-03-18 21:40:49 +00:00
Diego Fronza
392a08bc95 Add CHANGES and release notes 2021-03-18 18:20:18 -03:00
Witold Kręcicki
a6c4702796 Fix a startup/shutdown crash in ns_clientmgr_create 2021-03-18 15:33:28 -03:00
Witold Kręcicki
dd564da286 Shutdown interface if we can't listen on it to avoid shutdown hang 2021-03-18 15:27:28 -03:00
Ondřej Surý
2d2ac820ef Merge branch '2573-dont-timeout-when-sending-data-v9_16' into 'v9_16'
Resolve "Fix TCPDNS and TLSDNS timers" (v9.16)

See merge request isc-projects/bind9!4819
2021-03-18 15:59:48 +00:00
Ondřej Surý
121641686c Temporarily disable tlsdns_test until it gets refactored
The tlsdns API is not yet used in the 9.16 branch and the tlsdns_test
fails too often.  Temporarily disable running the test until it is
actually needed.
2021-03-18 15:42:03 +01:00
Ondřej Surý
e822b77dc0 Add CHANGES and release note for GL #2573 2021-03-18 15:16:13 +01:00
Ondřej Surý
db49ffca20 Change the isc_nm_(get|set)timeouts() to work with milliseconds
The RFC7828 specifies the keepalive interval to be 16-bit, specified in
units of 100 milliseconds and the configuration options tcp-*-timeouts
are following the suit.  The units of 100 milliseconds are very
unintuitive and while we can't change the configuration and presentation
format, we should not follow this weird unit in the API.

This commit changes the isc_nm_(get|set)timeouts() functions to work
with milliseconds and convert the values to milliseconds before passing
them to the function, not just internally.
2021-03-18 15:16:13 +01:00
Ondřej Surý
5d0647e067 Merge the common parts between udp, tcpdns and tlsdns protocol
The udp, tcpdns and tlsdns contained lot of cut&paste code or code that
was very similar making the stack harder to maintain as any change to
one would have to be copied to the the other protocols.

In this commit, we merge the common parts into the common functions
under isc__nm_<foo> namespace and just keep the little differences based
on the socket type.
2021-03-18 15:16:13 +01:00
Ondřej Surý
a017ba2615 Fix TCPDNS and TLSDNS timers
After the TCPDNS refactoring the initial and idle timers were broken and
only the tcp-initial-timeout was always applied on the whole TCP
connection.

This broke any TCP connection that took longer than tcp-initial-timeout,
most often this would affect large zone AXFRs.

This commit changes the timeout logic in this way:

  * On TCP connection accept the tcp-initial-timeout is applied
    and the timer is started
  * When we are processing and/or sending any DNS message the timer is
    stopped
  * When we stop processing all DNS messages, the tcp-idle-timeout
    is applied and the timer is started again
2021-03-18 15:16:13 +01:00
Ondřej Surý
94a32eaf29 Add TCP timeouts system test
The system tests were missing a test that would test tcp-initial-timeout
and tcp-idle-timeout.

This commit adds new "timeouts" system test that adds:

  * Test that waits longer than tcp-initial-timeout and then checks
    whether the socket was closed

  * Test that sends and receives DNS message then waits longer than
    tcp-initial-timeout but shorter time than tcp-idle-timeout than
    sends DNS message again than waits longer than tcp-idle-timeout
    and checks whether the socket was closed

  * Similar test, but bursting 25 DNS messages than waiting longer than
    tcp-initial-timeout and shorter than tcp-idle-timeout than do second
    25 DNS message burst

  * Check whether transfer longer than tcp-initial-timeout succeeds
2021-03-18 15:16:13 +01:00
Mark Andrews
30f749cdf3 Merge branch '2580-does-not-compile-without-deprecated-openssl-apis-v9_16' into 'v9_16'
Stop using deprecated calls in lib/isc/tls.c

See merge request isc-projects/bind9!4815
2021-03-17 23:39:13 +00:00
Mark Andrews
3f9d7227b3 Stop using deprecated calls in lib/isc/tls.c
from Rosen Penev @neheb

(cherry picked from commit a9f883cbc2)
2021-03-18 10:15:44 +11:00
Matthijs Mekking
bcfdb0a6f6 Merge branch '2523-thaw-dnssec-policy-zone-v9_16' into 'v9_16'
Resolve "Unable to thaw a frozen dynamic zone when KASP is configured."

See merge request isc-projects/bind9!4811
2021-03-17 10:56:19 +00:00
Matthijs Mekking
937e10a5f4 Add test for thaw dynamic kasp zone
Add a test for freezing, manually updating, and then thawing a dynamic
zone with "dnssec-policy". In the kasp system test we add parameters
to the "update_is_signed" check to signal the indicated IP addresses
for the labels "a" and "d". If set to '-', the test is skipped.

After nsupdating the dynamic.kasp zone, we revert the update (with
nsupdate) and update the zone again, but now with the freeze/thaw
approach.

(cherry picked from commit 0cae3249e3)
2021-03-17 11:12:48 +01:00
Matthijs Mekking
1a29d7ae7d Fully sign a thawed zone
When thawing a zone, we don't know what changes have been made. If we
do DNSSEC maintenance on this zone, schedule a full sign.

(cherry picked from commit b90846f222)
2021-03-17 11:12:39 +01:00
Matthijs Mekking
3ae16d0480 Fix "unable to thaw dynamic kasp zone"
Dynamic zones with dnssec-policy could not be thawed because KASP
zones were considered always dynamic. But a dynamic KASP zone should
also check whether updates are disabled.

(cherry picked from commit b518ed9f46)
2021-03-17 11:12:29 +01:00
Matthijs Mekking
aba7f9856b Merge branch '2561-dnssec-guide-signing-type-v9_16' into 'v9_16'
Fix typo in DNSSEC Guide

See merge request isc-projects/bind9!4808
2021-03-17 08:00:06 +00:00
Matthijs Mekking
8bcb642049 Fix typo in DNSSEC Guide
The "dnssec-policy" example should say "keys" instead of "key".

(cherry picked from commit d45af8877a)
2021-03-16 14:38:25 +01:00
Mark Andrews
17e7f3643f Merge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected-v9_16' into 'v9_16'
Ignore the actual error code returned by getaddrinfo

See merge request isc-projects/bind9!4805
2021-03-16 00:37:51 +00:00
Mark Andrews
8dc5d63e1d Ignore the actual error code returned by getaddrinfo
when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.

(cherry picked from commit 25d1276170)
2021-03-16 11:12:47 +11:00
Michal Nowak
9d9f8e4436 Merge branch '2565-servestale-fetchlimits-crash-v9_16' into 'v9_16'
[v9_16] Fix servestale fetchlimits crash

See merge request isc-projects/bind9!4798
2021-03-11 13:16:54 +00:00
Matthijs Mekking
96953fc293 Fix servestale fetchlimits crash
When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'v9_16' by commit
2afaff75ed.

(cherry picked from commit 87591de6f7)
2021-03-11 13:47:20 +01:00
Michał Kępień
f31291d885 Merge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option-v9_16' into 'v9_16'
[v9_16] Fix documentation for the "max-ixfr-ratio" option

See merge request isc-projects/bind9!4790
2021-03-08 11:35:32 +00:00
Michał Kępień
f78ce6ebb4 Fix documentation for the "max-ixfr-ratio" option
Commit 9fb6d11abb (which converted BIND 9
documentation from DocBook to Sphinx) inadvertently removed a paragraph
from the description of the "max-ixfr-ratio" option.  Add the missing
paragraph back.

(cherry picked from commit 3878cf4ac5)
2021-03-08 12:29:10 +01:00
Ondřej Surý
5207d07852 Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows-v9_16' into 'v9_16'
Resolve "journal test fails on Windows"

See merge request isc-projects/bind9!4786
2021-03-08 09:45:27 +00:00
Evan Hunt
401642cbb4 fix automatic journal upgrade on windows
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.

(cherry picked from commit 990dd9dbff)
2021-03-08 09:43:00 +01:00
Evan Hunt
2aed5c5954 add start and end serial numbers to 'named-printjournal -x'
add the starting and ending serial number from the journal
header to the output of dns_journal_print().

(cherry picked from commit 46c11726d4)
2021-03-08 09:43:00 +01:00
Mark Andrews
b5aaacf77a Merge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c-v9_16' into 'v9_16'
Silence CID 329159: Logically dead code in lib/dns/journal.c

See merge request isc-projects/bind9!4783
2021-03-08 07:20:27 +00:00
Mark Andrews
898e9989f9 Silence CID 329159: Logically dead code in lib/dns/journal.c
*** CID 329159:    (DEADCODE)
    /lib/dns/journal.c: 1719 in dns_journal_print()
    1713     		}
    1714     		CHECK(dns_difftuple_create(
    1715     			diff.mctx, n_soa == 1 ? DNS_DIFFOP_DEL : DNS_DIFFOP_ADD,
    1716     			name, ttl, rdata, &tuple));
    1717     		dns_diff_append(&diff, &tuple);
    1718
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach the expression "printxhdr" inside this statement: "if (++n_put != 0U || printx...".
    1719     		if (++n_put != 0 || printxhdr) {
    1720     			result = dns_diff_print(&diff, file);
    1721     			dns_diff_clear(&diff);
    1722     			n_put = 0;
    1723     			if (result != ISC_R_SUCCESS) {
    1724     				break;
    /lib/dns/journal.c: 1734 in dns_journal_print()
    1728     	if (result == ISC_R_NOMORE) {
    1729     		result = ISC_R_SUCCESS;
    1730     	}
    1731     	CHECK(result);
    1732
    1733     	if (!printxhdr && n_put != 0) {
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach this statement: "result = dns_diff_print(&di...".
    1734     		result = dns_diff_print(&diff, file);
    1735     		dns_diff_clear(&diff);
    1736     	}
    1737     	goto cleanup;
    1738
    1739     failure:

(cherry picked from commit 848e336db4)
2021-03-08 16:44:43 +11:00
Mark Andrews
33c925476d Merge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c-v9_16' into 'v9_16'
Silence CID 329157: Dereference before null check in lib/dns/journal.c

See merge request isc-projects/bind9!4782
2021-03-08 05:43:12 +00:00
Mark Andrews
fb7e38cca2 Silence CID 329157: Dereference before null check in lib/dns/journal.c
*** CID 329157:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/journal.c: 754 in journal_open()
    748     			    j->header.index_size * sizeof(journal_rawpos_t));
    749     	}
    750     	if (j->index != NULL) {
    751     		isc_mem_put(j->mctx, j->index,
    752     			    j->header.index_size * sizeof(journal_pos_t));
    753     	}
       CID 329157:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "j->filename" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    754     	if (j->filename != NULL) {
    755     		isc_mem_free(j->mctx, j->filename);
    756     	}
    757     	if (j->fp != NULL) {
    758     		(void)isc_stdio_close(j->fp);
    759     	}

(cherry picked from commit 4054405909)
2021-03-08 16:12:01 +11:00
Ondřej Surý
ccb21b3f79 Merge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer-clean-v9_16' into 'v9_16'
Resolve "Add ThreadSanitizer core dumping flags when we are ThreadSanitizer-clean"

See merge request isc-projects/bind9!4775
2021-03-04 15:58:32 +00:00
Ondřej Surý
74c537adb9 Disable allow_failure for ThreadSanitizer jobs
Since the main branch is now TSAN-clean, it's a good opportunity to
enable hard failures for the TSAN system test jobs.

(cherry picked from commit 4072cc2b93)
2021-03-04 16:25:50 +01:00
Michal Nowak
13bf49fd5d Add ThreadSanitizer core dumping flags
This should let us have core dumps from crashed system test when
ThreadSanitizer is enabled.

(cherry picked from commit a730bc47f5)
2021-03-04 16:25:50 +01:00
Ondřej Surý
d714c48be0 Merge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type-uint64_t-v9_16' into 'v9_16'
Assigning uint64_t from buffer might be misaligned in netmgr tests

See merge request isc-projects/bind9!4773
2021-03-04 15:09:01 +00:00
Ondřej Surý
1c2e018962 Assigning uint64_t from buffer might be misaligned in netmgr tests
Resolve possible 8-byte unaligned access when assigning the magic
value from the received buffer.

(cherry picked from commit a55bdb28f9)
2021-03-04 15:29:44 +01:00
Ondřej Surý
c196779f53 Merge branch '2533-mdig-move-cleanup-v9_16' into 'v9_16'
Move cleanup of queries to later in the shutdown sequence

See merge request isc-projects/bind9!4772
2021-03-04 14:29:07 +00:00
Mark Andrews
ce5dc75e48 Move cleanup of queries to later in the shutdown sequence
to avoid TSAN report

    WARNING: ThreadSanitizer: data race
      Write of size 8 at 0x000000000001 by main thread:
        #0 free <null>
        #1 default_memfree lib/isc/mem.c:440
        #2 mem_put lib/isc/mem.c:363
        #3 isc__mem_free lib/isc/mem.c:1012
        #4 main bin/tools/mdig.c:2231

      Previous read of size 1 at 0x000000000005 by thread T1:
        #0 dns_name_fromtext lib/dns/name.c:1121
        #1 sendquery bin/tools/mdig.c:596
        #2 sendqueries bin/tools/mdig.c:779
        #3 dispatch lib/isc/task.c:1153
        #4 run lib/isc/task.c:1345
        #5 isc__trampoline_run lib/isc/trampoline.c:184
        #6 <null> <null>

      Thread T1 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create pthreads/thread.c:79
        #2 isc_taskmgr_create lib/isc/task.c:1435
        #3 main bin/tools/mdig.c:2148

    SUMMARY: ThreadSanitizer: data race in __interceptor_free

(cherry picked from commit 4015af02d8)
2021-03-04 15:02:07 +01:00
Michal Nowak
d86578674e Merge branch '2357-add-CHANGES-entry-v9_16' into 'v9_16'
[v9_16] Add CHANGES entry for GL #2357

See merge request isc-projects/bind9!4771
2021-03-04 12:22:17 +00:00
Michal Nowak
588dae8e2b Add CHANGES entry for GL #2357
(cherry picked from commit d98f72de25)
2021-03-04 13:16:26 +01:00
Ondřej Surý
2f48007d18 Merge branch '2298-multiple-definition-of-librpz_dnsrpzd_path-v9_16' into 'v9_16'
Resolve "multiple definition of `librpz_dnsrpzd_path'"

See merge request isc-projects/bind9!4764
2021-03-04 11:00:12 +00:00
Mark Andrews
a33d603cff Add CHANGES for [GL #2298]
(cherry picked from commit e12cf5eb57)
2021-03-04 11:28:49 +01:00
Mark Andrews
985566fea5 Fixed librpz_dnsrpzd_path being a duplicate symbol
librpz_dnsrpzd_path should have been declared extern in dns/librpz.h

(cherry picked from commit 8f016dd57a)
2021-03-04 11:28:49 +01:00
Ondřej Surý
6f975dc810 Merge branch '2551-char-is-unsigned-on-arm64-v9_16' into 'v9_16'
Use int type to store result from isc_commandline_parse()

See merge request isc-projects/bind9!4767
2021-03-04 10:24:56 +00:00
Ondřej Surý
7a8193efba Use int type to store result from isc_commandline_parse()
The C standard actually doesn't define char as signed or unsigned, and
it could be either according to underlying architecture.  It turns out
that while it's usually signed type, it isn't on arm64 where it's
unsigned.

isc_commandline_parse() return int, just use that instead of the char.

(cherry picked from commit 8153729d3a)
2021-03-04 11:21:26 +01:00
Evan Hunt
31cbf73bd4 Merge branch '2505-journal-compatibility-v9_16' into 'v9_16'
allow dns_journal_rollforward() to read old journal files

See merge request isc-projects/bind9!4763
2021-03-04 04:13:21 +00:00
Evan Hunt
c7d5329ae0 CHANGES, release note
(cherry picked from commit 82b82bb821)
2021-03-03 19:21:19 -08:00
Evan Hunt
bda028e0ee create 'journal' system test
tests that version 1 journal files containing version 1 transaction
headers are rolled forward correctly on server startup, then updated
into version 2 journals. also checks journal file consistency and
'max-journal-size' behavior.

(cherry picked from commit a0aefa1de6)
2021-03-03 19:21:16 -08:00
Evan Hunt
9f1f5abe0e print journal index data and test for consistency
'named-journalprint -x' now prints the journal's index table and
the offset of each transaction in the journal, so that index consistency
can be confirmed.

(cherry picked from commit a4972324a6)
2021-03-03 19:19:50 -08:00
Mark Andrews
5aea511e1b extend named-journalprint to be able to force the journal version
named-journalprint can now upgrade or downgrade a journal file
in place; the '-u' option upgrades and the '-d' option downgrades.

(cherry picked from commit fb2d0e2897)
2021-03-03 19:19:50 -08:00
Evan Hunt
47a274e9f1 allow dns_journal_rollforward() to read old journal files
when the 'max-ixfr-ratio' option was added, journal transaction
headers were revised to include a count of RR's in each transaction.
this made it impossible to read old journal files after an upgrade.

this branch restores the ability to read version 1 transaction
headers. when rolling forward, printing journal contents, if
the wrong transaction header format is found, we can switch.

when dns_journal_rollforward() detects a version 1 transaction
header, it returns DNS_R_RECOVERABLE.  this triggers zone_postload()
to force a rewrite of the journal file in the new format, and
also to schedule a dump of the zone database with minimal delay.
journal repair is done by dns_journal_compact(), which rewrites
the entire journal, ignoring 'max-journal-size'. journal size is
corrected later.

newly created journal files now have "BIND LOG V9.2" in their headers
instead of "BIND LOG V9". files with the new version string cannot be
read using the old transaction header format. note that this means
newly created journal files will be rejected by older versions of named.

named-journalprint now takes a "-x" option, causing it to print
transaction header information before each delta, including its
format version.

(cherry picked from commit ee19966326)
2021-03-03 19:19:50 -08:00
Matthijs Mekking
079294bd28 Merge branch '2443-cid-316608-memory-corruptions-overrun-v9_16' into 'v9_16'
Address theoretical buffer overrun in recent change

See merge request isc-projects/bind9!4761
2021-03-03 10:34:26 +00:00
Mark Andrews
7a703244ed Address theoretical buffer overrun in recent change
The strlcat() call was wrong.

    *** CID 316608:  Memory - corruptions  (OVERRUN)
    /lib/dns/resolver.c: 5017 in fctx_create()
    5011     	 * Make fctx->info point to a copy of a formatted string
    5012     	 * "name/type".
    5013     	 */
    5014     	dns_name_format(name, buf, sizeof(buf));
    5015     	dns_rdatatype_format(type, typebuf, sizeof(typebuf));
    5016     	p = strlcat(buf, "/", sizeof(buf));
    >>>     CID 316608:  Memory - corruptions  (OVERRUN)
    >>>     Calling "strlcat" with "buf + p" and "1036UL" is suspicious because "buf" points into a buffer of 1036 bytes and the function call may access "(char *)(buf + p) + 1035UL". [Note: The source code implementation of the function has been overridden by a builtin model.]
    5017     	strlcat(buf + p, typebuf, sizeof(buf));
    5018     	fctx->info = isc_mem_strdup(mctx, buf);
    5019
    5020     	FCTXTRACE("create");
    5021     	dns_name_init(&fctx->name, NULL);
    5022     	dns_name_dup(name, mctx, &fctx->name);

(cherry picked from commit 59bf6e71e2)
2021-03-03 10:55:38 +01:00
Ondřej Surý
2cc4e15788 Merge branch 'ondrej/call-isc__initialize-shutdown-from-DllMain-v9_16' into 'v9_16'
Call isc__initialize()/isc__shutdown() from win32 DllMain

See merge request isc-projects/bind9!4760
2021-03-02 08:23:26 +00:00
Ondřej Surý
59d92c8af8 Call isc__initialize()/isc__shutdown() from win32 DllMain
Call the libisc isc__initialize() constructor and isc__shutdown()
destructor from DllMain instead of having duplicate code between
those and DllMain() code.

(cherry picked from commit a50f5d0cf5)
2021-03-02 08:50:29 +01:00
Ondřej Surý
5ab6d1b30e Merge branch '2396-add-thread-trampoline-for-thread-accounting-v9_16' into 'v9_16'
Resolve "BIND 9.16 unit tests failing reliably on x86_64 NUMA machines"

See merge request isc-projects/bind9!4756
2021-02-26 20:39:25 +00:00
Ondřej Surý
ccc76ded78 Add CHANGES note for GL #2396
(cherry picked from commit 4f2ca15201)
2021-02-26 21:19:33 +01:00
Ondřej Surý
86298fd112 Make linker include library ctor/dtor in statically linked libisc
Under normal situation, the linker throws out all symbols from
compilation unit when no symbols are used in the final binary, which is
the case for lib/isc/lib.c.  This commit adds empty function to lib.c
that's being called from different CU (mem.c in this case) and that
makes the linker to include all the symbols including the normally
unreferenced isc__initialize() and isc__shutdown() in the final binary.
2021-02-26 21:19:33 +01:00
Ondřej Surý
f92b77ff0d Change the isc_thread_self() return type to uintptr_t
The pthread_self(), thrd_current() or GetCurrentThreadId() could
actually be a pointer, so we should rather convert the value into
uintptr_t instead of unsigned long.

(cherry picked from commit a0181056a8)
2021-02-26 21:14:17 +01:00
Ondřej Surý
0e90858d99 Use globally assigned thread_id in the isc_hp API
Convert the isc_hp API to use the globally available isc_tid_v instead
of locally defined tid_v.  This should solve most of the problems on
machines with many number of cores / CPUs.

(cherry picked from commit bea333f7c9)
2021-02-26 21:14:17 +01:00
Ondřej Surý
45c55b1e7e Add isc_trampoline API to have simple accounting around threads
The current isc_hp API uses internal tid_v variable that gets
incremented for each new thread using hazard pointers.  This tid_v
variable is then used as a index to global shared table with hazard
pointers state.  Since the tid_v is only incremented and never
decremented the table could overflow very quickly if we create set of
threads for short period of time, they finish the work and cease to
exist.  Then we create identical set of threads and so on and so on.
This is not a problem for a normal `named` operation as the set of
threads is stable, but the problematic place are the unit tests where we
test network manager or other APIs (task, timer) that create threads.

This commits adds a thin wrapper around any function called from
isc_thread_create() that adds unique-but-reusable small digit thread id
that can be used as index to f.e. hazard pointer tables.  The trampoline
wrapper ensures that the thread ids will be reused, so the highest
thread_id number doesn't grow indefinitely when threads are created and
destroyed and then created again.  This fixes the hazard pointer table
overflow on machines with many cores. [GL #2396]

(cherry picked from commit cbbecfcc82)
2021-02-26 21:14:17 +01:00
Evan Hunt
1fbdc8b45a Merge branch 'ondrej/improve-mempool-AddressSanitizer-integration-v9_16' into 'v9_16'
Improve allocation-deallocation tracking with AddressSanitizer (v9.16)

See merge request isc-projects/bind9!4750
2021-02-26 18:53:00 +00:00
Ondřej Surý
0bd834856e Enforce disabling internal memory allocator for AddressSanitizer
Disable the internal memory allocator when AddressSanitizer is in use.
The basic blocks in the internal memory allocator prevents
AddressSanitizer from properly tracking the allocations and
deallocations, so we need to ensure it has been disabled for any build
that has AddressSanitizer enabled.
2021-02-26 10:13:56 -08:00
Ondřej Surý
1cd14c4dec Add mempool get/put tracking with AddressSanitizer
When AddressSanitizer is in use, disable the internal mempool
implementation and redirect the isc_mempool_get to isc_mem_get
(and similarly for isc_mempool_put). This is the method recommended
by the AddressSanitizer authors for tracking allocations and
deallocations instead of custom poison/unpoison code (see
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning).
2021-02-26 10:13:17 -08:00
Ondřej Surý
4649bc04d7 Merge branch '2433-cherry-pick-fixes' into 'v9_16'
Pull fixes TLS and initialization fixes

See merge request isc-projects/bind9!4755
2021-02-26 17:08:15 +00:00
Ondřej Surý
2011efa99d Disable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH
The BIND 9 libraries on Windows define DllMain() optional entry point
into a dynamic-link library (DLL).  When the system starts or terminates
a process or thread, it calls the entry-point function for each loaded
DLL using the first thread of the process.

When the DLL is being loaded into the virtual address space of the
current process as a result of the process starting up, we make a call
to DisableThreadLibraryCalls() which should disable the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified
dynamic-link library (DLL).

This seems not be the case because we never check the return value of
the DisableThreadLibraryCalls() call, and it could in fact fail.  The
DisableThreadLibraryCalls() function fails if the DLL specified by
hModule has active static thread local storage, or if hModule is an
invalid module handle.

In this commit, we remove the safe-guard assertion put in place for the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH events and we just ignore them.
BIND 9 doesn't create/destroy enough threads for it actually to make any
difference, and in fact we do use static thread local storage in the
code.
2021-02-26 17:18:06 +01:00
Ondřej Surý
2f0f531ee8 Use library constructor/destructor to initialize OpenSSL
Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
2021-02-26 17:18:06 +01:00
Ondřej Surý
59d51cdeb6 Disable calling DllMain() on thread creation/destruction
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for
the specified dynamic-link library (DLL).  This can reduce the size of
the working set for some applications.
2021-02-26 17:07:15 +01:00
Ondřej Surý
6883d4bd08 Fix the invalid condition variable
Although harmless, the memmove() in tlsdns and tcpdns was guarded by a
current message length variable that was always bigger than 0 instead of
correct current buffer length remainder variable.
2021-02-26 17:07:09 +01:00
Ondřej Surý
6da91bf16c Move most of the OpenSSL initialization to isc_tls
Since we now require both libcrypto and libssl to be initialized for
netmgr, we move all the OpenSSL initialization code except the engine
initialization to isc_tls API.

The isc_tls_initialize() and isc_tls_destroy() has been made idempotent,
so they could be called multiple time.  However when isc_tls_destroy()
has been called, the isc_tls_initialize() could not be called again.
2021-02-26 17:07:01 +01:00
Ondřej Surý
19fb228782 Merge branch '2335-tlsdns-refactoring-v9_16' into 'v9_16'
Resolve "TLSDNS refactoring"

See merge request isc-projects/bind9!4754
2021-02-26 16:03:41 +00:00
Evan Hunt
e9abe76117 Add CHANGES note for #2335
(cherry picked from commit f472390bc2)
2021-02-26 16:14:50 +01:00
Ondřej Surý
effe3ee595 Refactor TLSDNS module to work with libuv/ssl directly
* Following the example set in 634bdfb16d, the tlsdns netmgr
  module now uses libuv and SSL primitives directly, rather than
  opening a TLS socket which opens a TCP socket, as the previous
  model was difficult to debug.  Closes #2335.

* Remove the netmgr tls layer (we will have to re-add it for DoH)

* Add isc_tls API to wrap the OpenSSL SSL_CTX object into libisc
  library; move the OpenSSL initialization/deinitialization from dstapi
  needed for OpenSSL 1.0.x to the isc_tls_{initialize,destroy}()

* Add couple of new shims needed for OpenSSL 1.0.x

* When LibreSSL is used, require at least version 2.7.0 that
  has the best OpenSSL 1.1.x compatibility and auto init/deinit

* Enforce OpenSSL 1.1.x usage on Windows

(cherry picked from commit e493e04c0f)
2021-02-26 16:14:50 +01:00
Matthijs Mekking
7537430847 Merge branch '2503-stale-answer-client-timeout-crash-v9_16' into 'v9_16'
Resolve "New stale-answer-client-timeout crashes BIND 9.16 and 9.17"

See merge request isc-projects/bind9!4747
2021-02-25 11:48:18 +00:00
Matthijs Mekking
bcadb31f44 Add CHANGES and release notes for GL #2503
(cherry picked from commit a404eaaffd)
2021-02-25 12:07:43 +01:00
Matthijs Mekking
acc95d4e1d Don't servfail on staleonly lookups
When a staleonly lookup doesn't find a satisfying answer, it should
not try to respond to the client.

This is not true when the initial lookup is staleonly (that is when
'stale-answer-client-timeout' is set to 0), because no resolver fetch
has been created at this point. In this case continue with the lookup
normally.

(cherry picked from commit f8b7b597e9)
2021-02-25 12:07:34 +01:00
Matthijs Mekking
84deb57bc3 Don't allow recursion on staleonly lookups
Fix a crash that can happen in the following scenario:

A client request is received. There is no data for it in the cache,
(not even stale data). A resolver fetch is created as part of
recursion.

Some time later, the fetch still hasn't completed, and
stale-answer-client-timeout is triggered. A staleonly lookup is
started. It will also find no data in the cache.

So 'query_lookup()' will call 'query_gotanswer()' with ISC_R_NOTFOUND,
so this will call 'query_notfound()' and this will start recursion.

We will eventually end up in 'ns_query_recurse()' and that requires
the client query fetch to be NULL:

    REQUIRE(client->query.fetch == NULL);

If the previously started fetch is still running this assertion
fails.

The crash is easily prevented by not requiring recursion for
staleonly lookups.

Also remove a redundant setting of the staleonly flag at the end of
'query_lookup_staleonly()' before destroying the query context.

Add a system test to catch this case.

(cherry picked from commit 9e061faaae)
2021-02-25 12:07:27 +01:00
Matthijs Mekking
c4c8f78b0a Merge branch '2498-nsec3-dynamic-update-dnssec-policy-v9_16' into 'v9_16'
Resolve "Regression in BIND 9.16.10, DNSSEC fails due to improper NSEC3 creation witihin named"

See merge request isc-projects/bind9!4746
2021-02-25 11:02:00 +00:00
Matthijs Mekking
8475d0bd61 Add changes and notes for [#2498]
(cherry picked from commit 89c47b3b42)
2021-02-25 10:56:46 +01:00
Matthijs Mekking
d51df34995 Fix dnssec-policy NSEC3 on dynamic zones
When applying dnssec-policy on a dynamic zone (e.g. that allows Dynamic
Updates), the NSEC3 parameters were put on the queue, but they were
not being processed (until a reload of the zone or reconfiguration).

Process the NSEC3PARAM queue on zone postload when handling a
dynamic zone.

(cherry picked from commit 4b176c850b)
2021-02-25 10:56:00 +01:00
Matthijs Mekking
ddfb9ea8c1 Add tests for NSEC3 on dynamic zones
GitLab issue #2498 is a bug report on NSEC3 with dynamic zones. Tests
for it in the nsec3 system test directory were missing.

(cherry picked from commit 0c0f10b53f)
2021-02-25 10:55:51 +01:00
Michal Nowak
a88846c664 Merge branch '2446-query-c-5430-16-runtime-error-v9_16' into 'v9_16'
[v9_16] Initialize checknames field in dns_view_create()

See merge request isc-projects/bind9!4735
2021-02-23 16:48:35 +00:00
Michal Nowak
b36690e750 Initialize checknames field in dns_view_create()
The 'checknames' field wasn't initialized in dns_view_create(), but it
should otherwise AddressSanitizer identifies the following runtime error
in query_test.c.

    runtime error: load of value 190, which is not a valid value for type '_Bool'

(cherry picked from commit 0c6fa16477)
2021-02-23 16:45:36 +01:00
Michal Nowak
da2a647ee1 Merge branch 'mnowak/alpine-3.13-fix-PLATFORMS' into 'v9_16'
Update Alpine Linux version in PLATFORMS file

See merge request isc-projects/bind9!4734
2021-02-23 15:19:55 +00:00
Michal Nowak
57112addf5 Update Alpine Linux version in PLATFORMS file
Commit 76cfefe3fc updated PLATFORMS.md
file, but failed to update the plain-text PLATFORMS file.
2021-02-23 16:11:13 +01:00
Michal Nowak
6b75d201c4 Merge branch 'mnowak/alpine-3.13-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.13

See merge request isc-projects/bind9!4732
2021-02-23 14:53:37 +00:00
Michal Nowak
76cfefe3fc Add Alpine Linux 3.13
(cherry picked from commit 909c85f7a9)
2021-02-23 15:46:42 +01:00
Michal Nowak
cc2db3a4a3 Merge branch 'mnowak/pairwise-pict-keep-stderr-v9_16' into 'v9_16'
[v9_16] Do not remove stderr from pict output

See merge request isc-projects/bind9!4730
2021-02-23 14:32:31 +00:00
Michal Nowak
2038d087bf Do not remove stderr from pict output
Removing stderr from the pict tool serves no purpose and drops valuable
information, we might use when debugging failed pairwise CI job, such
as:

    Input Error: A parameter names must be unique

(cherry picked from commit 079debaa10)
2021-02-23 15:26:19 +01:00
Mark Andrews
a64c68fe9f Merge branch '2508-cid-320481-null-pointer-dereferences-reverse_inull-v9_16' into 'v9_16'
Silence CID 320481: Null pointer dereferences

See merge request isc-projects/bind9!4729
2021-02-23 13:31:25 +00:00
Mark Andrews
c5ad174129 Silence CID 320481: Null pointer dereferences
*** CID 320481:  Null pointer dereferences  (REVERSE_INULL)
    /bin/tests/wire_test.c: 261 in main()
    255     			process_message(input);
    256     		}
    257     	} else {
    258     		process_message(input);
    259     	}
    260
       CID 320481:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "input" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    261     	if (input != NULL) {
    262     		isc_buffer_free(&input);
    263     	}
    264
    265     	if (printmemstats) {
    266     		isc_mem_stats(mctx, stdout);

(cherry picked from commit 658c950d7b)
2021-02-24 00:08:57 +11:00
Matthijs Mekking
cd87bdf77c Merge branch '2408-dnssec-policy-purge-keys-v9_16' into 'v9_16'
Resolve "kasp: Purge deleted keys"

See merge request isc-projects/bind9!4726
2021-02-23 09:31:57 +00:00
Matthijs Mekking
a3e9c05bfb Add changes and notes for [#2408]
(cherry picked from commit 5a99a124fb)
2021-02-23 09:20:20 +01:00
Matthijs Mekking
9b4e067206 Minor kasp test fixes
Two minor fixes in the kasp system test:

1. A wrong comment in ns3/setup.sh (we are subtracting 2 hours, not
   adding them).
2. 'get_keyids' used bad parameters "$1" "$2" when 'check_numkeys'
   failed. Also, 'check_numkeys' can use $DIR, $ZONE, and $NUMKEYS
   directly, no need to pass them.

(cherry picked from commit 5be26898c0)
2021-02-23 09:19:23 +01:00
Matthijs Mekking
fc9dcbf419 Test purge-keys option
Add some more zones to the kasp system test to test the 'purge-keys'
option. Three zones test that the predecessor key files are removed
after the purge keys interval, one test checks that the key files
are retained if 'purge-keys' is disabled. For that, we change the
times to 90 days in the past (the default value for 'purge-keys').

(cherry picked from commit 6333ff15f0)
2021-02-23 09:19:11 +01:00
Matthijs Mekking
8e4d0d51be Purge keys implementation
On each keymgr run, we now also check if key files can be removed.
The 'purge-keys' interval determines how long keys should be retained
after they have become completely hidden.

Key files should not be removed if it has a state that is set to
something else then HIDDEN, if purge-keys is 0 (disabled), if
the key goal is set to OMNIPRESENT, or if the key is unused (a key is
unused if no timing metadata set, and no states are set or if set,
they are set to HIDDEN).

If the last changed timing metadata plus the purge-keys interval is
in the past, the key files may be removed.

Add a dst_key_t variable 'purge' to signal that the key file should
not be written to file again.

(cherry picked from commit 8c526cb67f)
2021-02-23 09:19:03 +01:00
Matthijs Mekking
45dcabf411 Add purge-keys config option
Add a new option 'purge-keys' to 'dnssec-policy' that will purge key
files for deleted keys. The option determines how long key files
should be retained prior to removing the corresponding files from
disk.

If set to 0, the option is disabled and 'named' will not remove key
files from disk.

(cherry picked from commit 313de3a7e2)
2021-02-23 09:18:55 +01:00
Mark Andrews
772cad50a1 Merge branch '2509-cid-281489-resource-leaks-resource_leak-v9_16' into 'v9_16'
Address theoretical resource leak in dns_dt_open()

See merge request isc-projects/bind9!4725
2021-02-22 23:24:14 +00:00
Mark Andrews
4e192d2fe7 Address theoretical resource leak in dns_dt_open()
dns_dt_open() is not currently called with mode dns_dtmode_unix.

    *** CID 281489:  Resource leaks  (RESOURCE_LEAK)
    /lib/dns/dnstap.c: 983 in dns_dt_open()
    977
    978     		if (!dnstap_file(handle->reader)) {
    979     			CHECK(DNS_R_BADDNSTAP);
    980     		}
    981     		break;
    982     	case dns_dtmode_unix:
       CID 281489:  Resource leaks  (RESOURCE_LEAK)
       Variable "handle" going out of scope leaks the storage it points to.
    983     		return (ISC_R_NOTIMPLEMENTED);
    984     	default:
    985     		INSIST(0);
    986     		ISC_UNREACHABLE();
    987     	}
    988

(cherry picked from commit 003dd8cc70)
2021-02-23 09:41:15 +11:00
Mark Andrews
31da81d82b Merge branch '2499-a-loc-record-with-a-invalid-direction-field-triggers-an-insist-v9_16' into 'v9_16'
Resolve "A LOC record with a invalid direction field triggers an INSIST"

See merge request isc-projects/bind9!4711
2021-02-19 01:14:00 +00:00
Mark Andrews
65013e5c32 Add release note for [GL #2499]
(cherry picked from commit 3d340ecfd2)
2021-02-19 11:39:47 +11:00
Mark Andrews
c4f1b8762b Add CHANGES for [GL #2499]
(cherry picked from commit 6f47e0956c)
2021-02-19 11:39:43 +11:00
Mark Andrews
d68b85e555 Correctly detect when get_direction failed
(cherry picked from commit 009358d77d)
2021-02-19 11:39:12 +11:00
Mark Andrews
0cea486327 Test a LOC record with an invalid direction field
(cherry picked from commit 07902d9f9d)
2021-02-19 11:39:12 +11:00
Michal Nowak
6b35244573 Merge branch 'mnowak/fix-feature-test-tool-location-v9_16' into 'v9_16'
[v9_16] Use FEATURETEST variable instead of a path

See merge request isc-projects/bind9!4707
2021-02-18 14:56:58 +00:00
Michal Nowak
5ded078daa Use FEATURETEST variable instead of a path
feature-test tool location needs to be determined by its associated
variable; otherwise, the tool is not found on Windows:

    setup.sh: line 22: ../feature-test: No such file or directory

(cherry picked from commit 102f012631)
2021-02-18 15:47:57 +01:00
Michal Nowak
e68b63c813 Merge branch 'mnowak/make-kyua-report-html-less-verbose' into 'v9_16'
Make "kyua report-html" less verbose on stdout

See merge request isc-projects/bind9!4688
2021-02-18 14:47:39 +00:00
Michal Nowak
74fa196286 Make "kyua report-html" less verbose on stdout
"kyua report-html" command in CI generates more than two pages of output
to stdout, which is nothing but which HTML pages Kyua generated, e.g.:

  Generating kyua_html/context.html
  Generating kyua_html/lib_dns_tests_acl_test_main.html
  ...
  Generating kyua_html/lib_ns_tests_query_test_main.html
  Generating kyua_html/report.css
  Generating kyua_html/index.html

This is seldomly useful and requires the user to scroll three pages
upwards to get to unit test results.
2021-02-18 15:39:04 +01:00
Matthijs Mekking
ad1e9c3709 Merge branch '1810-followup-9_16' into 'v9_16'
Fix backport "Refactor ecdsa and eddsa tests after testcrypto.sh changes" (9.16)

See merge request isc-projects/bind9!4695
2021-02-18 09:40:59 +00:00
Matthijs Mekking
1ffe0accf5 Fix eddsa system test
Use the correct conf.sh setup commands in ns3/sign.sh
2021-02-18 08:37:48 +00:00
Michal Nowak
61acd2a664 Merge branch 'mnowak/system-test-check-for-file-not-removed-v9_16' into 'v9_16'
[v9_16] Check for "file not removed" in system test output

See merge request isc-projects/bind9!4698
2021-02-18 08:04:17 +00:00
Michal Nowak
c65c3d5153 Prevent Git to expand $systest
CentOS 8 "git status" unexpectedly expands search directory "tsig" to
also search in the "tsiggss" directory, thus incorrectly identifying
files as "not removed" in the "tsig" directory:

$ git status -su --ignored tsig
$ touch tsiggss/ns1/{named.run,named.memstats}
$ git status -su --ignored tsig
!! tsiggss/ns1/named.memstats
!! tsiggss/ns1/named.run

(cherry picked from commit f310b75250)
2021-02-18 08:20:54 +01:00
Michal Nowak
78c5a80817 Clean omitted files from system tests
Any CI job:
- I:dnssec:file dnssec/ns1/trusted.keys not removed
- I:rpzrecurse:file rpzrecurse/ns3/named.run.prev not removed

system:gcc:sid:amd64:
- I:mirror:file mirror/ns3/_default.nzf not removed

system:gcc:xenial:amd64:
- I:shutdown:file shutdown/.cache/v/cache/lastfailed not removed

(cherry picked from commit 14a104d121)
2021-02-18 08:20:54 +01:00
Michal Nowak
f3f77fa4fc Check for "file not removed" in system test output
Run this check only when in Git repository, because run.sh produces the
"file not removed" warnings only when in Git repository.

(cherry picked from commit 4a2778abdf)
2021-02-18 08:20:54 +01:00
Michal Nowak
382ace6db6 Add system test name to "file not removed" info
(cherry picked from commit 10bf725ee2)
2021-02-18 08:20:54 +01:00
Michał Kępień
e7cdb6eb9b Merge branch 'v9_16_12-release' into 'v9_16'
Merge 9.16.12 release branch

See merge request isc-projects/bind9!4700
2021-02-17 21:48:47 +00:00
Michał Kępień
f08646ea4d Set up release notes for BIND 9.16.13 2021-02-17 22:39:53 +01:00
Tinderbox User
9148895f56 Merge branch 'prep-release' into security-v9_16 2021-02-17 22:36:08 +01:00
Michał Kępień
eafb2ae202 Merge branch 'michal/prepare-documentation-for-bind-9.16.12' into 'security-v9_16'
Prepare documentation for BIND 9.16.12

See merge request isc-private/bind9!240
2021-02-17 22:36:08 +01:00
Tinderbox User
2ffb627d30 prep 9.16.12 2021-02-17 22:36:08 +01:00
Michał Kępień
4f5c5c67ee Merge branch '2354-security-off-by-one-error-in-spnego-v9_16' into 'security-v9_16'
[v9_16] [CVE-2020-8625] Fix off-by-one bug in ISC SPNEGO implementation

See merge request isc-private/bind9!235
2021-02-17 22:36:08 +01:00
Michał Kępień
84708ad977 Prepare release notes for BIND 9.16.12 2021-02-17 22:36:08 +01:00
Ondřej Surý
55e103dfe0 Add CHANGES and release note for GL #2354 2021-02-17 22:36:08 +01:00
Michał Kępień
996c9135ca Add release note for GL #2073 2021-02-17 22:36:08 +01:00
Ondřej Surý
b04cb88462 Fix off-by-one bug in ISC SPNEGO implementation
The ISC SPNEGO implementation is based on mod_auth_kerb code.  When
CVE-2006-5989 was disclosed, the relevant fix was not applied to the
BIND 9 codebase, making the latter vulnerable to the aforementioned flaw
when "tkey-gssapi-keytab" or "tkey-gssapi-credential" is set in
named.conf.

The original description of CVE-2006-5989 was:

    Off-by-one error in the der_get_oid function in mod_auth_kerb 5.0
    allows remote attackers to cause a denial of service (crash) via a
    crafted Kerberos message that triggers a heap-based buffer overflow
    in the component array.

Later research revealed that this flaw also theoretically enables remote
code execution, though achieving the latter in real-world conditions is
currently deemed very difficult.

This vulnerability was responsibly reported as ZDI-CAN-12302 ("ISC BIND
TKEY Query Heap-based Buffer Overflow Remote Code Execution
Vulnerability") by Trend Micro Zero Day Initiative.
2021-02-17 22:36:08 +01:00
Michał Kępień
3bfc7756e4 Reorder release notes 2021-02-17 22:36:08 +01:00
Michał Kępień
70d8f9182c Tweak and reword release notes 2021-02-17 22:36:08 +01:00
Michał Kępień
6141505a72 Tweak and reword recent CHANGES entries 2021-02-17 22:36:08 +01:00
Michał Kępień
dcf5204f7a Use :rfc:<number> references in release notes 2021-02-17 22:36:08 +01:00
Ondřej Surý
9c90c95774 Merge branch '2487-rollback-setting-dontfrag-option-v9_16' into 'v9_16'
Rollback setting IP_DONTFRAG option on the UDP sockets (v9.16)

See merge request isc-projects/bind9!4697
2021-02-17 14:25:38 +00:00
Ondřej Surý
c1292e126f Add CHANGES and release notes for GL #2487
(cherry picked from commit 6d442e9c04)
2021-02-17 14:42:53 +01:00
Ondřej Surý
d7b3a6a016 Rollback setting IP_DONTFRAG option on the UDP sockets
In DNS Flag Day 2020, the development branch started setting the
IP_DONTFRAG option on the UDP sockets.  It turned out, that this
code was incomplete leading to dropping the outgoing UDP packets.
Henceforth this commit rolls back this setting until we have a
proper fix that would send back empty response with TC flag set.

(cherry picked from commit 66eefac78c)
2021-02-17 14:41:56 +01:00
Michal Nowak
d997a5f1f2 Merge branch 'mnowak/enable-dh-unit-test-to-run-under-pkcs11-v9_16' into 'v9_16'
[v9_16] Drop USE_OPENSSL constraint from dh_test

See merge request isc-projects/bind9!4696
2021-02-17 11:54:23 +00:00
Michal Nowak
f483b102dd Drop USE_OPENSSL constraint from dh_test
The USE_OPENSSL constraint in dh_test does not seems to be necessary
anymore, the test runs with PKCS#11 as well.

(cherry picked from commit c341e7f740)
2021-02-17 12:46:25 +01:00
Michal Nowak
1378c88784 Merge branch 'mnowak/consistent-use-of-SKIPPED_TEST_EXIT_CODE-v9_16' into 'v9_16'
[v9_16] Ensure dnstap_test returns SKIPPED_TEST_EXIT_CODE

See merge request isc-projects/bind9!4686
2021-02-17 11:21:04 +00:00
Michal Nowak
ed38e32b69 Ensure dnstap_test returns SKIPPED_TEST_EXIT_CODE
Make sure lib/dns/tests/dnstap_test returns an exit code that indicates
a skipped test when dnstap is not enabled.

(cherry picked from commit c286341703)
2021-02-17 12:15:18 +01:00
Michal Nowak
4e00019644 Merge branch 'mnowak/merge-skipped-and-untested-system-test-results-v9_16' into 'v9_16'
[v9_16] Merge UNTESTED and SKIPPED system test results

See merge request isc-projects/bind9!4681
2021-02-17 11:15:05 +00:00
Michal Nowak
4d57587528 Add CHANGES note for [GL !4517]
(cherry picked from commit 3cc3f1712b)
2021-02-17 12:09:25 +01:00
Michal Nowak
04aff208fb Use BIND 9.17 preprocessor macro to skip unit test
BIND 9.17 changed exit code of skipped test to meet Automake
expectations in fa505bfb0e. BIND 9.16 was
not rewritten to Automake, but for consistency reasons, the same
SKIPPED_TEST_EXIT_CODE preprocessor macro is used (though the actual
exit code differs from the one in BIND 9.17).

(cherry picked from commit fa505bfb0e)
2021-02-17 12:09:25 +01:00
Michal Nowak
59499ecc3a Merge UNTESTED and SKIPPED system test results
Descriptions of UNTESTED and SKIPPED system test results are very
similar to one another and it may be confusing when to pick one and
when the other. Merging these two system test results removes the
confusion.

(cherry picked from commit 29d7c6e449)
2021-02-17 12:06:33 +01:00
Evan Hunt
3f7959b1d5 Merge branch 'each-note-cleanup-v9_16' into 'v9_16'
some release note corrections

See merge request isc-projects/bind9!4692
2021-02-17 01:04:18 +00:00
Evan Hunt
df541c63c6 some release note corrections
(cherry picked from commit 3126eb652d)
2021-02-16 17:00:21 -08:00
Mark Andrews
aba3053409 Merge branch '2402-bind-9-16-11-build-fails-with-static-openssl-library-v9_16' into 'v9_16'
Resolve "BIND 9.16.11 build fails with static OpenSSL library"

See merge request isc-projects/bind9!4691
2021-02-17 00:27:12 +00:00
Mark Andrews
21de92f2cd Add CHANGES for [GL #2402]
(cherry picked from commit 98dc47d351)
2021-02-17 10:38:26 +11:00
Mark Andrews
0bcf09fe45 Fix linking order for OpenSSL libraries
As libssl depends on libcrypto, -lssl needs to precede -lcrypto in
linker invocations or else the build will fail with static OpenSSL
libraries.  Adjust m4/ax_check_openssl.m4 to prevent this issue from
getting triggered when pkg-config files for OpenSSL are not available.

(cherry picked from commit 9223c7d599)
2021-02-17 10:38:25 +11:00
Ondřej Surý
24ed8d78e2 Merge branch '2357-cannot-compile-current-versions-on-macos-catalina' into 'v9_16'
Resolve "Cannot compile current versions on macOS "Catalina""

See merge request isc-projects/bind9!4508
2021-02-16 12:21:07 +00:00
Mark Andrews
d51b78c85b Stop including <gssapi.h> from <dst/gssapi.h> header
The only reason for including the gssapi.h from the dst/gssapi.h header
was to get the typedefs of gss_cred_id_t and gss_ctx_id_t.  Instead of
using those types directly this commit introduces dns_gss_cred_id_t and
dns_gss_ctx_id_t types that are being used in the public API and
privately retyped to their counterparts when we actually call the gss
api.

This also conceals the gssapi headers, so users of the libdns library
doesn't have to add GSSAPI_CFLAGS to the Makefile when including libdns
dst API.
2021-02-16 12:08:21 +11:00
Ondřej Surý
4bbe3e75de Stop including dnstap headers from <dns/dnstap.h>
The <fstrm.h> and <protobuf-c/protobuf-c.h> headers are only directly
included where used and we stopped exposing those headers from libdns
headers.
2021-02-16 12:08:21 +11:00
Mark Andrews
bf5aac225b Stop including <lmdb.h> from <dns/lmdb.h>
The lmdb.h header doesn't have to be included from the dns/lmdb.h
header as it can be separately included where used.  This stops
exposing the inclusion of lmdb.h from the libdns headers.
2021-02-16 12:08:21 +11:00
Mark Andrews
b8fc8742e5 Re-order include directories
${FSTRM_CFLAGS} ${PROTOBUF_C_CFLAGS} ${OPENSSL_CFLAGS} ${LMDB_CFLAGS}
need to appear after all directories in the build tree.
2021-02-16 12:08:21 +11:00
Diego dos Santos Fronza
f24ad1eec7 Merge branch '2041-bug-reconfig-auto-dnssec-high-thread-number-leak-resources-and-crash-named-v9_16' into 'v9_16'
Resolve "BUG reconfig+auto-dnssec+high thread number leak resources and crash named"

See merge request isc-projects/bind9!4677
2021-02-15 20:45:57 +00:00
Diego Fronza
f4aa840f52 Add CHANGES note for [GL #2041] 2021-02-15 12:04:29 -03:00
Diego Fronza
80c1a44643 Test reconfig after adding inline signed zones won't crash named
This test ensures that named won't crash after many inline-signed zones
are added to configurarion, followed by a rndc reconfig.
2021-02-15 11:53:24 -03:00
Diego Fronza
d89a8bf696 Fix dangling references to outdated views after reconfig
This commit fix a leak which was happening every time an inline-signed
zone was added to the configuration, followed by a rndc reconfig.

During the reconfig process, the secure version of every inline-signed
zone was "moved" to a new view upon a reconfig and it "took the raw
version along", but only once the secure version was freed (at shutdown)
was prev_view for the raw version detached from, causing the old view to
be released as well.

This caused dangling references to be kept for the previous view, thus
keeping all resources used by that view in memory.
2021-02-15 11:52:50 -03:00
Petr Špaček
87717f4006 Merge branch 'pspacek/ci-python-allthetime-v9_16' into 'v9_16'
[v9_16]  Run Python linters in CI even outside of merge requests

See merge request isc-projects/bind9!4675
2021-02-15 08:58:12 +00:00
Petr Špaček
441d2e310e Run Python linters in CI even outside of merge requests
Previously it did not get run on scheduled CI pipelines.

(cherry picked from commit 74d7cddc4c)
2021-02-12 15:51:05 +01:00
Michal Nowak
9a80a1b17e Merge branch 'mnowak/check-for-unrecognized-options-v9_16' into 'v9_16'
[v9_16] Check for unrecognized configure options

See merge request isc-projects/bind9!4568
2021-02-12 13:31:39 +00:00
Michal Nowak
ec278d628d Add --enable-option-checking=fatal to ./configure in CI
The --enable-option-checking=fatal option prevents ./configure from
proceeding when an unknown option is used in the ./configure step in CI.
This change will avoid adding unsupported ./configure options or options
with typo or typo in pairwise testing "# [pairwise: ...]" marker.

(cherry picked from commit 4295c82e45)
2021-02-12 14:16:26 +01:00
Michal Nowak
3e22c588ae Merge branch '2312-lint-generated-manual-pages-v9_16' into 'v9_16'
[v9_16] Lint manual pages

See merge request isc-projects/bind9!4673
2021-02-12 12:21:55 +00:00
Michal Nowak
69a51f311a Lint manual pages
As we generate manual pages from reStructuredText sources, we don't have
absolute control on manual page output and therefore 'mandoc -Tlint' may
always report warnings we can't eliminate. In light of this some mandoc
warnings need to be ignored.

(cherry picked from commit 22fdcb30db)
2021-02-12 12:58:18 +01:00
Mark Andrews
6bd42bc124 Merge branch '2421-cid-316509-untrusted-value-as-argument-tainted_scalar-v9_16' into 'v9_16'
Resolve "CID 316509: Untrusted value as argument (TAINTED_SCALAR)"

See merge request isc-projects/bind9!4671
2021-02-12 00:01:28 +00:00
Mark Andrews
6e30caed57 Silence Insecure data handling (TAINTED_SCALAR)
Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3PARAM records in wire
form and iterations is byte swapped the memory holding the record
is marked as tainted.  nsec3->salt_length is marked as tainted
transitively. To remove the taint the value need to be range checked.
For a correctly formatted record region.length should match
nsec3->salt_length and provides a convenient value to check the field
against.

    *** CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3param_51.c: 241 in tostruct_nsec3param()
    235     	region.length = rdata->length;
    236     	nsec3param->hash = uint8_consume_fromregion(&region);
    237     	nsec3param->flags = uint8_consume_fromregion(&region);
    238     	nsec3param->iterations = uint16_consume_fromregion(&region);
    239
    240     	nsec3param->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3param->salt_length" to "mem_maybedup", which uses it as an offset.
    241     	nsec3param->salt = mem_maybedup(mctx, region.base,
    242     					nsec3param->salt_length);
    243     	if (nsec3param->salt == NULL) {
    244     		return (ISC_R_NOMEMORY);
    245     	}
    246     	isc_region_consume(&region, nsec3param->salt_length);

(cherry picked from commit c40133d840)
2021-02-12 10:43:19 +11:00
Mark Andrews
8302e9fb69 Silence Untrusted value as argument (TAINTED_SCALAR)
Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3 records in wire form
and iterations is byte swapped the memory holding the record is
marked as tainted.  nsec3->salt_length and nsec3->next_length are
marked as tainted transitively. To remove the taint the values need
to be range checked.  Valid values for these should never exceed
region.length so that is becomes a reasonable value to check against.

    *** CID 316509:    (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3_50.c: 312 in tostruct_nsec3()
    306     	if (nsec3->salt == NULL) {
    307     		return (ISC_R_NOMEMORY);
    308     	}
    309     	isc_region_consume(&region, nsec3->salt_length);
    310
    311     	nsec3->next_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->next_length" to "mem_maybedup", which uses it as an offset.
    312     	nsec3->next = mem_maybedup(mctx, region.base, nsec3->next_length);
    313     	if (nsec3->next == NULL) {
    314     		goto cleanup;
    315     	}
    316     	isc_region_consume(&region, nsec3->next_length);
    317
    /lib/dns/rdata/generic/nsec3_50.c: 305 in tostruct_nsec3()
    299     	region.length = rdata->length;
    300     	nsec3->hash = uint8_consume_fromregion(&region);
    301     	nsec3->flags = uint8_consume_fromregion(&region);
    302     	nsec3->iterations = uint16_consume_fromregion(&region);
    303
    304     	nsec3->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->salt_length" to "mem_maybedup", which uses it as an offset.
    305     	nsec3->salt = mem_maybedup(mctx, region.base, nsec3->salt_length);
    306     	if (nsec3->salt == NULL) {
    307     		return (ISC_R_NOMEMORY);
    308     	}
    309     	isc_region_consume(&region, nsec3->salt_length);
    310

(cherry picked from commit fd8d1337a5)
2021-02-12 10:43:19 +11:00
Michal Nowak
d52e67211a Merge branch 'mnowak/enable-libns-tests-to-run-under-asan-v9_16' into 'v9_16'
[v9_16] Drop AddressSanitizer constraint from libns unit tests

See merge request isc-projects/bind9!4667
2021-02-10 10:37:12 +00:00
Michal Nowak
001413ed50 Drop AddressSanitizer constraint from libns unit tests
The AddressSanitizer constraint in some libns unit tests does not seem
to be necessary anymore, these tests run fine under AddressSanitizer.

(cherry picked from commit 613be8706e)
2021-02-10 11:03:27 +01:00
Matthijs Mekking
33ef49d828 Merge branch '1810-refactor-ecdsa-eddsa-system-tests-v9_16' into 'v9_16'
Resolve "Refactor ecdsa and eddsa tests after testcrypto.sh changes"

See merge request isc-projects/bind9!4666
2021-02-09 16:07:55 +00:00
Matthijs Mekking
1a32cf543b Update copyrights for [#1810]
(cherry picked from commit 51827ddcd3)
2021-02-09 16:06:50 +01:00
Matthijs Mekking
40e56b0dcc Refactor ecdsa system test
Similar to eddsa system test.

(cherry picked from commit 650b0d4691)
2021-02-09 16:06:50 +01:00
Matthijs Mekking
4538d8ddf2 Refactor eddsa system test
Test for Ed25519 and Ed448. If both algorithms are not supported, skip
test. If only one algorithm is supported, run test, skip the
unsupported algorithm. If both are supported, run test normally.

Create new ns3. This will test Ed448 specifically, while now ns2 only
tests Ed25519. This moves some files from ns2/ to ns3/.

(cherry picked from commit 8bf31d0592)
2021-02-09 16:06:50 +01:00
Matthijs Mekking
5af3a46ac0 Fix testcrypto.sh
Testing Ed448 was actually testing Ed25519.

(cherry picked from commit 572d7ec3b7)
2021-02-09 15:25:25 +01:00
Michal Nowak
49947b65ed Merge branch 'mnowak/check-asan-errors-in-configure-v9_16' into 'v9_16'
[v9_16] Check config.log for ASAN errors

See merge request isc-projects/bind9!4664
2021-02-09 11:12:10 +00:00
Michal Nowak
2fa5727446 Check config.log for ASAN errors
./configure checks might produce a false negative error due to ASAN
errors and thus disable some options.

(cherry picked from commit 0db934d401)
2021-02-09 12:06:05 +01:00
Matthijs Mekking
28e802a0e4 Merge branch '2434-fetch-limit-serve-stale-v9_16' into 'v9_16'
Resolve "Serve stale when fetch limits are hit" (9.16)

See merge request isc-projects/bind9!4627
2021-02-08 16:37:39 +00:00
Matthijs Mekking
70fbbedc24 Adjust serve-stale test
The number of queries to use in the burst can be reduced, as we have
a very low fetch limit of 1.

The dig command in 'wait_for_fetchlimits()' should time out sooner as
we expect a SERVFAIL to be returned promptly.

Enabling serve-stale can be done before hitting fetch-limits. This
reduces the chance that the resolver queries time out and fetch count
is reset. The chance of that happening is already slim because
'resolver-query-timeout' is 10 seconds, but better to first let the
data become stale rather than doing that while attempting to resolve.

(cherry picked from commit 00f575e7ef)
2021-02-08 16:10:12 +01:00
Matthijs Mekking
2afaff75ed Use stale on error also when unable to recurse
The 'query_usestale()' function was only called when in
'query_gotanswer()' and an unexpected error occurred. This may have
been "quota reached", and thus we were in some cases returning
stale data on fetch-limits (and if serve-stale enabled of course).

But we can also hit fetch-limits when recursing because we are
following a referral (in 'query_notfound()' and
'query_delegation_recurse()'). Here we should also check for using
stale data in case an error occurred.

Specifically don't check for using stale data when refetching a
zero TTL RRset from cache.

Move the setting of DNS_DBFIND_STALESTART into the 'query_usestale()'
function to avoid code duplication.

(cherry picked from commit 8bcd7fe69e)
2021-02-08 16:10:03 +01:00
Matthijs Mekking
e02ce9e833 Add notes and change entry for [#2434]
This concludes the serve-stale improvements.

(cherry picked from commit ed8421693c)
2021-02-08 16:09:36 +01:00
Matthijs Mekking
2e28e5587e Add test for serve-stale /w fetch-limits
Add a test case when fetch-limits are reached and we have stale data
in cache.

This test starts with a positive answer for 'data.example/TXT' in
cache.

1. Reload named.conf to set fetch limits.
2. Disable responses from the authoritative server.
3. Now send a batch of queries to the resolver, until hitting the
   fetch limits. We can detect this by looking at the response RCODE,
   at some point we will see SERVFAIL responses.
4. At that point we will turn on serve-stale.
5. Clients should see stale answers now.
6. An incoming query should not set the stale-refresh-time window,
   so a following query should still get a stale answer because of a
   resolver failure (and not because it was in the stale-refresh-time
   window).

(cherry picked from commit 11b74fc176)
2021-02-08 16:07:43 +01:00
Matthijs Mekking
dbf5428629 Only start stale refresh window when resuming
If we did not attempt a fetch due to fetch-limits, we should not start
the stale-refresh-time window.

Introduce a new flag DNS_DBFIND_STALESTART to differentiate between
a resolver failure and unexpected error. If we are resuming, this
indicates a resolver failure, then start the stale-refresh-time window,
otherwise don't start the stale-refresh-time window, but still fall
back to using stale data.

(This commit also wraps some docstrings to 80 characters width)

(cherry picked from commit aabdedeae3)
2021-02-08 16:07:43 +01:00
Matthijs Mekking
809ec0a224 Use stale data also if we are not resuming
Before this change, BIND will only fallback to using stale data if
there was an actual attempt to resolve the query. Then on a timeout,
the stale data from cache becomes eligible.

This commit changes this so that on any unexpected error stale data
becomes eligble (you would still have to have 'stale-answer-enable'
enabled of course).

If there is no stale data, this may return in an error again, so don't
loop on stale data lookup attempts. If the DNS_DBFIND_STALEOK flag is
set, this means we already tried to lookup stale data, so if that is
the case, don't use stale again.

(cherry picked from commit c6fd02aed5)
2021-02-08 16:07:43 +01:00
Mark Andrews
6642078698 Merge branch '2468-cid-318094-null-pointer-dereferences-reverse_inull-v9_16' into 'v9_16'
Remove redundant 'version == NULL' check

See merge request isc-projects/bind9!4663
2021-02-08 05:39:01 +00:00
Mark Andrews
8092b7eec6 Remove redundant 'version == NULL' check
*** CID 318094:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/rbtdb.c: 1389 in newversion()
    1383     	version->xfrsize = rbtdb->current_version->xfrsize;
    1384     	RWUNLOCK(&rbtdb->current_version->rwlock, isc_rwlocktype_read);
    1385     	rbtdb->next_serial++;
    1386     	rbtdb->future_version = version;
    1387     	RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
    1388
       CID 318094:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "version" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1389     	if (version == NULL) {
    1390     		return (result);
    1391     	}
    1392
    1393     	*versionp = version;
    1394

(cherry picked from commit 456d53d1fb)
2021-02-08 16:17:52 +11:00
Mark Andrews
6781bf3eac Merge branch '1697-isc_rwlock_init-can-no-longer-fail-in-master-clean-up-calls-v9_16' into 'v9_16'
Cleanup redundant isc_rwlock_init() result checks

See merge request isc-projects/bind9!4662
2021-02-08 05:13:40 +00:00
Mark Andrews
a900d79ea8 Cleanup redundant isc_rwlock_init() result checks
(cherry picked from commit 3b11bacbb7)
2021-02-08 15:13:49 +11:00
Mark Andrews
7358a58db4 Merge branch '2469-cid-281461-untrusted-loop-bound-v9_16' into 'v9_16'
Attempt to silence untrusted loop bound

See merge request isc-projects/bind9!4661
2021-02-08 03:59:47 +00:00
Mark Andrews
c2a5b88275 Attempt to silence untrusted loop bound
Assign hit_len + key_len to len and test the result
rather than recomputing and letting the compiler simplify.

    213        isc_region_consume(&region, 2); /* hit length + algorithm */
        9. tainted_return_value: Function uint16_fromregion returns tainted data. [show details]
        10. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        11. tainted_return_value: Function uint16_fromregion returns tainted data.
        12. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        13. var_assign: Assigning: key_len = uint16_fromregion(&region), which taints key_len.
    214        key_len = uint16_fromregion(&region);
        14. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        15. Condition key_len == 0, taking false branch.
    215        if (key_len == 0) {
    216                RETERR(DNS_R_FORMERR);
    217        }
        16. Condition !!(_r->length >= _l), taking true branch.
        17. Condition !!(_r->length >= _l), taking true branch.
    218        isc_region_consume(&region, 2);
        18. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        19. Condition region.length < (unsigned int)(hit_len + key_len), taking false branch.
    219        if (region.length < (unsigned)(hit_len + key_len)) {
    220                RETERR(DNS_R_FORMERR);
    221        }
    222
        20. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        21. Condition _r != 0, taking false branch.
    223        RETERR(mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
        22. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        23. var_assign_var: Compound assignment involving tainted variable 4 + hit_len + key_len to variable source->current taints source->current.
    224        isc_buffer_forward(source, 4 + hit_len + key_len);
    225
    226        dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);

    CID 281461 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
        24. tainted_data: Using tainted variable source->active - source->current as a loop boundary.
    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    227        while (isc_buffer_activelength(source) > 0) {
    228                dns_name_init(&name, NULL);
    229                RETERR(dns_name_fromwire(&name, source, dctx, options, target));
    230        }

(cherry picked from commit 2f946c831a)
2021-02-08 14:05:11 +11:00
Michal Nowak
aa98a53cc0 Merge branch 'mnowak/check-arm-pdf-validity-v9_16' into 'v9_16'
[v9_16] Check PDF file structure with QPDF

See merge request isc-projects/bind9!4651
2021-02-03 17:01:43 +00:00
Michal Nowak
9f7669cab3 Check PDF file structure with QPDF
"qpdf --check" checks file structure of generated ARM PDF.

(cherry picked from commit 359708b9d6)
2021-02-03 17:50:08 +01:00
Matthijs Mekking
241c4bd613 Merge branch '2377-allow-a-records-below-an-_spf-label-as-a-check-names-exception-v9_16' into 'v9_16'
Resolve "Allow A records below an '_spf' label as a check-names exception"

See merge request isc-projects/bind9!4650
2021-02-03 16:48:58 +00:00
Mark Andrews
4bd8bcf236 Add release note entry
(cherry picked from commit 1294918702)
2021-02-03 16:32:43 +01:00
Mark Andrews
86f7b64408 Add CHANGES
(cherry picked from commit 2b5091ac17)
2021-02-03 16:26:40 +01:00
Mark Andrews
7976a7264a Check that A record is accepted with _spf label present
(cherry picked from commit a3b2b86e7f)
2021-02-03 16:26:32 +01:00
Mark Andrews
6da9f238d4 Allow A records below '_spf' labels as recommend by RFC7208
(cherry picked from commit 63c16c8506)
2021-02-03 16:26:25 +01:00
Matthijs Mekking
5710207191 Merge branch '2375-dnssec-policy-three-is-a-crowd-rollover-bug-v9_16' into 'v9_16'
Resolve "three is a crowd" dnssec-policy key rollover bug (9.16)

See merge request isc-projects/bind9!4649
2021-02-03 15:11:10 +00:00
Matthijs Mekking
76f7f598b3 Add kasp test todo for [#2375]
This bugfix has been manually verified but is missing a unit test.
Created GL #2471 to track this.

(cherry picked from commit 189f5a3f28)
2021-02-03 15:48:29 +01:00
Matthijs Mekking
ce2a37a990 Use NUM_KEYSTATES constant where appropriate
We use the number 4 a lot when working on key states. Better to use
the NUM_KEYSTATES constant instead.

(cherry picked from commit 98ace6d97d)
2021-02-03 15:48:20 +01:00
Matthijs Mekking
c0e98d8adb Add change and release note for [#2375]
News worthy.

(cherry picked from commit 7947f7f9c6)
2021-02-03 15:48:09 +01:00
Matthijs Mekking
a8fba11da9 Cleanup keymgr.c
Three small cleanups:

1. Remove an unused keystr/dst_key_format.
2. Initialize a dst_key_state_t state with NA.
3. Update false comment about local policy (local policy only adds
   barrier on transitions to the RUMOURED state, not the UNRETENTIVE
   state).

(cherry picked from commit 189d9a2d21)
2021-02-03 15:47:40 +01:00
Matthijs Mekking
ceac392e19 Fix DS/DNSKEY hidden or chained functions
There was a bug in function 'keymgr_ds_hidden_or_chained()'.

The funcion 'keymgr_ds_hidden_or_chained()' implements (3e) of rule2
as defined in the "Flexible and Robust Key Rollover" paper. The rules
says: All DS records need to be in the HIDDEN state, or if it is not
there must be a key with its DNSKEY and KRRSIG in OMNIPRESENT, and
its DS in the same state as the key in question. In human langauge,
if all keys have their DS in HIDDEN state you can do what you want,
but if a DS record is available to some validators, there must be
a chain of trust for it.

Note that the barriers on transitions first check if the current
state is valid, and then if the next state is valid too. But
here we falsely updated the 'dnskey_omnipresent' (now 'dnskey_chained')
with the next state. The next state applies to 'key' not to the state
to be checked. Updating the state here leads to (true) always, because
the key that will move its state will match the falsely updated
expected state. This could lead to the assumption that Key 2 would be
a valid chain of trust for Key 1, while clearly the presence of any
DS is uncertain.

The fix here is to check if the DNSKEY and KRRSIG are in OMNIPRESENT
state for the key that does not have its DS in the HIDDEN state, and
only if that is not the case, ensure that there is a key with the same
algorithm, that provides a valid chain of trust, that is, has its
DNSKEY, KRRSIG, and DS in OMNIPRESENT state.

The changes in 'keymgr_dnskey_hidden_or_chained()' are only cosmetical,
renaming 'rrsig_omnipresent' to 'rrsig_chained' and removing the
redundant initialization of the DST_KEY_DNSKEY expected state to NA.

(cherry picked from commit 291bcc3721)
2021-02-03 15:47:30 +01:00
Matthijs Mekking
6ff0e99fa7 Update keymgr_key_is_successor() calls
The previous commit changed the function definition of
'keymgr_key_is_successor()', this commit updates the code where
this function is called.

In 'keymgr_key_exists_with_state()' the logic is also updated slightly
to become more readable. First handle the easy cases:
- If the key does not match the state, continue with the next key.
- If we found a key with matching state, and there is no need to
  check the successor relationship, return (true).
- Otherwise check the successor relationship.

In 'keymgr_key_has_successor()' it is enough to check if a key has
a direct successor, so instead of calling 'keymgr_key_is_successor()',
we can just check 'keymgr_direct_dep()'.

In 'dns_keymgr_run()', we want to make sure that there is no
dependency on the keys before retiring excess keys, so replace
'keymgr_key_is_successor()' with 'keymgr_dep()'.

(cherry picked from commit 600915d1b2)
2021-02-03 15:47:23 +01:00
Matthijs Mekking
5e40515671 Implement Equation(2) of "Flexible Key Rollover"
So far the key manager could only deal with two keys in a rollover,
because it used a simplified version of the successor relationship
equation from "Flexible and Robust Key Rollover" paper. The simplified
version assumes only two keys take part in the key rollover and it
for that it is enough to check the direct relationship between two
keys (is key x the direct predecessor of key z and is key z the direct
successor of key x?).

But when a third key (or more keys) comes into the equation, the key
manager would assume that one key (or more) is redundant and removed
it from the zone prematurely.

Fix by implementing Equation(2) correctly, where we check for
dependencies on keys:

z ->T x: Dep(x, T) = ∅ ∧
         (x ∈ Dep(z, T) ∨
          ∃ y ∈ Dep(z, T)(y != z ∧ y ->T x ∧ DyKyRySy = DzKzRzSz))

This says: key z is a successor of key x if:
- key x depends on key z if z is a direct successor of x,
- or if there is another key y that depends on key z that has identical
  key states as key z and key y is a successor of key x.
- Also, key x may not have any other keys depending on it.

This is still a simplified version of Equation(2) (but at least much
better), because the paper allows for a set of keys to depend on a
key. This is defined as the set Dep(x, T). Keys in the set Dep(x, T)
have a dependency on key x for record type T. The BIND implementation
can only have one key in the set Dep(x, T). The function
'keymgr_dep()' stores this key in 'uint32_t *dep' if there is a
dependency.

There are two scenarios where multiple keys can depend on a single key:

1. Rolling keys is faster than the time required to finish the
   rollover procedure. This scenario is covered by the recursive
   implementation, and checking for a chain of direct dependencies
   will suffice.

2. Changing the policy, when a zone is requested to be signed with
   a different key length for example. BIND 9 will not mark successor
   relationships in this case, but tries to move towards the new
   policy. Since there is no successor relationship, the rules are
   even more strict, and the DNSSEC reconfiguration is actually slower
   than required.

Note: this commit breaks the build, because the function definition
of 'keymgr_key_is_successor' changed. This will be fixed in the
following commit.

(cherry picked from commit cc38527b63)
2021-02-03 15:47:14 +01:00
Michał Kępień
84911f53f1 Merge branch '2448-tweak-sphinx-build-invocations-v9_16' into 'v9_16'
[v9_16] Tweak sphinx-build invocations

See merge request isc-projects/bind9!4646
2021-02-03 12:04:36 +00:00
Michał Kępień
36ea46fbe0 Explicitly specify sphinx-build cache directories
When sphinx-build is invoked without the -d command line switch, the
default path to the directory in which cached environment and doctree
files are placed is OUTPUTDIR/.doctrees.  This causes the contents of
such cache directories to needlessly be included in BIND release
directories.  Avoid that by employing the -d command line switch to make
each sphinx-build process use a cache directory outside the output
directory.  Make sure these cache directories are separate from each
other as well, to prevent multiple sphinx-build processes running in
parallel from interfering with each other.
2021-02-03 12:18:45 +01:00
Michał Kępień
7e0c374d83 Make sphinx-build warnings fatal
In order to prevent documentation building issues from being glossed
over, pass the -W command line switch to all sphinx-build invocations.
This causes the latter to return with a non-zero exit code whenever any
Sphinx warnings are triggered.

(cherry picked from commit 51479ed9a3)
2021-02-03 12:18:45 +01:00
Matthijs Mekking
ffc5e54fd8 Merge branch '2406-kasp-init-inactive-delete-metadata-v9_16' into 'v9_16'
Resolve "kasp: look at Inactive/Delete when initializing state files" (9.16)

See merge request isc-projects/bind9!4643
2021-02-03 08:55:18 +00:00
Matthijs Mekking
3f6dafe1f4 Remove initialize goal code
Since keys now have their goals initialized in 'keymgr_key_init()',
remove this redundant piece of code in 'keymgr_key_run()'.

(cherry picked from commit 82632fa6d9)
2021-02-03 08:42:51 +01:00
Matthijs Mekking
4170288a91 Correctly initialize old key with state file
The 'key_init()' function is used to initialize a state file for keys
that don't have one yet. This can happen if you are migrating from a
'auto-dnssec' or 'inline-signing' to a 'dnssec-policy' configuration.

It did not look at the "Inactive" and "Delete" timing metadata and so
old keys left behind in the key directory would also be considered as
a possible active key. This commit fixes this and now explicitly sets
the key goal to OMNIPRESENT for keys that have their "Active/Publish"
timing metadata in the past, but their "Inactive/Delete" timing
metadata in the future. If the "Inactive/Delete" timing metadata is
also in the past, the key goal is set to HIDDEN.

If the "Inactive/Delete" timing metadata is in the past, also the
key states are adjusted to either UNRETENTIVE or HIDDEN, depending on
how far in the past the metadata is set.

(cherry picked from commit 76cf72e65a)
2021-02-03 08:42:32 +01:00
Matthijs Mekking
314accf7ef Update legacy-keys kasp test
The 'legacy-keys.kasp' test checks that a zone with key files but not
yet state files is signed correctly. This test is expanded to cover
the case where old key files still exist in the key directory. This
covers bug #2406 where keys with the "Delete" timing metadata are
picked up by the keymgr as active keys.

Fix the 'legacy-keys.kasp' test, by creating the right key files
(for zone 'legacy-keys.kasp', not 'legacy,kasp').

Use a unique policy for this zone, using shorter lifetimes.

Create two more keys for the zone, and use 'dnssec-settime' to set
the timing metadata in the past, long enough ago so that the keys
should not be considered by the keymgr.

Update the 'key_unused()' test function, and consider keys with
their "Delete" timing metadata in the past as unused.

Extend the test to ensure that the keys to be used are not the old
predecessor keys (with their "Delete" timing metadata in the past).

Update the test so that the checks performed are consistent with the
newly configured policy.

(cherry picked from commit d4b2b7072d)
2021-02-03 08:41:00 +01:00
Mark Andrews
9448cb15c9 Merge branch '2093-tsan-files-are-not-being-captured-by-unit-tests-2' into 'v9_16'
Resolve "tsan files are not being captured by unit tests"

See merge request isc-projects/bind9!4470
2021-02-02 13:02:06 +00:00
Mark Andrews
48715f6ad4 Look for tsan files in the top build directory 2021-02-02 12:33:19 +00:00
Michal Nowak
5fd71c560e Merge branch 'mnowak/add-rsabigexponent-README-v9_16' into 'v9_16'
[v9_16] Add README.md file to rsabigexponent system test

See merge request isc-projects/bind9!4631
2021-01-29 14:54:57 +00:00
Michal Nowak
7aa33bf5e4 Add README.md file to rsabigexponent system test
This README.md describes why is bigkey needed.

(cherry picked from commit a247f24dfa)
2021-01-29 15:54:07 +01:00
Matthijs Mekking
49f6324f2c Merge branch '2442-tsan-error-lib-dns-rbtdb-c-v9_16' into 'v9_16'
Fix race condition on check_stale_header

See merge request isc-projects/bind9!4630
2021-01-29 14:50:22 +00:00
Diego Fronza
51663408bc Fix race condition on check_stale_header
This commit fix a race that could happen when two or more threads have
failed to refresh the same RRset, the threads could simultaneously
attempt to update the header->last_refresh_fail_ts field in
check_stale_header, a field used to implement stale-refresh-time.

By making this field atomic we avoid such race.

(cherry picked from commit c75575e350)
2021-01-29 15:29:00 +01:00
Matthijs Mekking
5d83066455 Merge branch '2247-add-serve-stale-option-to-set-client-timeout-v9_16' into 'v9_16'
Resolve "Add serve-stale option to set client timeout"

See merge request isc-projects/bind9!4625
2021-01-29 10:31:06 +00:00
Matthijs Mekking
dba01187e3 Rewrap comments to 80 char width serve-stale test
(cherry picked from commit d8c6655d7d)
2021-01-29 10:43:51 +01:00
Matthijs Mekking
99c72bf5da Update code flow in query.c wrt stale data
First of all, there was a flaw in the code related to the
'stale-refresh-time' option. If stale answers are enabled, and we
returned stale data, then it was assumed that it was because we were
in the 'stale-refresh-time' window. But now we could also have returned
stale data because of a 'stale-answer-client-timeout'. To fix this,
introduce a rdataset attribute DNS_RDATASETATTR_STALE_WINDOW to
indicate whether the stale cache entry was returned because the
'stale-refresh-time' window is active.

Second, remove the special case handling when the result is
DNS_R_NCACHENXRRSET. This can be done more generic in the code block
when dealing with stale data.

Putting all stale case handling in the code block when dealing with
stale data makes the code more easy to follow.

Update documentation to be more verbose and to match then new code
flow.

(cherry picked from commit fa0c9280d2)
2021-01-29 10:43:41 +01:00
Diego Fronza
0e62c53c5b Extracted common function from query_lookup and query_refresh_rrset
Both functions employed the same code lines to allocate query context
buffers, which are used to store query results, so this shared portion
of code was extracted out to a new function, qctx_prepare_buffers.

Also, this commit uses qctx_init to initialize the query context whitin
query_refresh_rrset function.

(cherry picked from commit 966060c03b)
2021-01-29 10:43:27 +01:00
Diego Fronza
5cbb28a40e Small optimization in query_usestale
This commit makes the code in query_usestale easier to follow, it also
doesn't attach/detach to the database if stale answers are not enabled.

(cherry picked from commit f89ac07b28)
2021-01-29 10:41:39 +01:00
Diego Fronza
fe4e0b889c Add CHANGES note for [GL #2247]
(cherry picked from commit 42c789c763)
2021-01-29 10:41:28 +01:00
Diego Fronza
b89fc52cd1 Add documentation for stale-answer-client-timeout
(cherry picked from commit 6ab9070457)
2021-01-29 10:39:31 +01:00
Diego Fronza
bea63000db Add system tests for stale-answer-client-timeout
This commit add 4 tests for the new option:
	1. Test default configuration of stale-answer-client-timeout, a
	   value of 1.8 seconds, with stale-refresh-time disabled.

	2. Test disabling of stale-answer-client-timeout.

	3. Test stale-answer-client-timeout with a value of zero, in this
	   case we take advantage of a log entry which shows that a stale
	   answer was promptly used before an attempt to refresh the RRset
	   is made. We also check, by activating a disabled authoritative
	   server, that the RRset was successfully refreshed after that.

	4. Test stale-answer-client-timeout 0 with stale-refresh-time 4, in
	   this test we want to ensure a couple things:

	   - If we have a stale RRSet entry in cache, a request must be
		 promptly answered with this data, while BIND must also attempt
		 to refresh the RRSet in background.

	   - If the attempt to refresh the RRSet times out, the RRSet must
		 have its stale-refresh-time window activated.

	   - If a new request for the same RRSet arrives, it must be
		 promptly answered with stale data due to stale-refresh-time
		 being active for this RRSet, in this case no attempt to refresh
		 the RRSet is made.

	   - Enable authoritative server, ensure that the RRSet was not
		 refreshed, to honor stale-refresh-time.

	   - Wait for stale-refresh-window time pass, send another request
		 for the same RRSet, this time we expect the answer to be the
		 stale entry in cache being hit due to
		 stale-answer-client-timeout 0.

	    - Send another request, this time we expect the answer to be an
		  active RRSet, since it must have been refreshed during the
		  previous request.

(cherry picked from commit 35fd039d03)
2021-01-29 10:39:20 +01:00
Diego Fronza
8324c3ddfe Allow stale data to be used before name resolution
This commit allows stale RRset to be used (if available) for responding
a query, before an attempt to refresh an expired, or otherwise resolve
an unavailable RRset in cache is made.

For that to work, a value of zero must be specified for
stale-answer-client-timeout statement.

To better understand the logic implemented, there are three flags being
used during database lookup and other parts of code that must be
understood:

. DNS_DBFIND_STALEOK: This flag is set when BIND fails to refresh a
  RRset due to timeout (resolver-query-timeout), its intent is to
  try to look for stale data in cache as a fallback, but only if
  stale answers are enabled in configuration.

  This flag is also used to activate stale-refresh-time window, since it
  is the only way the database knows that a resolution has failed.

. DNS_DBFIND_STALEENABLED: This flag is used as a hint to the database
  that it may use stale data. It is always set during query lookup if
  stale answers are enabled, but only effectively used during
  stale-refresh-time window. Also during this window, the resolver will
  not try to resolve the query, in other words no attempt to refresh the
  data in cache is made when the stale-refresh-time window is active.

. DNS_DBFIND_STALEONLY: This new introduced flag is used when we want
  stale data from the database, but not due to a failure in resolution,
  it also doesn't require stale-refresh-time window timer to be active.
  As long as there is a stale RRset available, it should be returned.
  It is mainly used in two situations:

    1. When stale-answer-client-timeout timer is triggered: in that case
       we want to know if there is stale data available to answer the
       client.
    2. When stale-answer-client-timeout value is set to zero: in that
       case, we also want to know if there is some stale RRset available
       to promptly answer the client.

We must also discern between three situations that may happen when
resolving a query after the addition of stale-answer-client-timeout
statement, and how to handle them:

	1. Are we running query_lookup() due to stale-answer-client-timeout
       timer being triggered?

       In this case, we look for stale data, making use of
       DNS_DBFIND_STALEONLY flag. If a stale RRset is available then
       respond the client with the data found, mark this query as
       answered (query attribute NS_QUERYATTR_ANSWERED), so when the
       fetch completes the client won't be answered twice.

       We must also take care of not detaching from the client, as a
       fetch will still be running in background, this is handled by the
       following snippet:

       if (!QUERY_STALEONLY(&client->query)) {
           isc_nmhandle_detach(&client->reqhandle);
       }

       Which basically tests if DNS_DBFIND_STALEONLY flag is set, which
       means we are here due to a stale-answer-client-timeout timer
       expiration.

    2. Are we running query_lookup() due to resolver-query-timeout being
       triggered?

       In this case, DNS_DBFIND_STALEOK flag will be set and an attempt
       to look for stale data will be made.
       As already explained, this flag is algo used to activate
       stale-refresh-time window, as it means that we failed to refresh
       a RRset due to timeout.
       It is ok in this situation to detach from the client, as the
       fetch is already completed.

    3. Are we running query_lookup() during the first time, looking for
       a RRset in cache and stale-answer-client-timeout value is set to
       zero?

       In this case, if stale answers are enabled (probably), we must do
       an initial database lookup with DNS_DBFIND_STALEONLY flag set, to
       indicate to the database that we want stale data.

       If we find an active RRset, proceed as normal, answer the client
       and the query is done.

       If we find a stale RRset we respond to the client and mark the
       query as answered, but don't detach from the client yet as an
       attempt in refreshing the RRset will still be made by means of
       the new introduced function 'query_resolve'.

       If no active or stale RRset is available, begin resolution as
       usual.

(cherry picked from commit e219422575)
2021-01-29 10:39:09 +01:00
Diego Fronza
0aebad96b5 Added option for disabling stale-answer-client-timeout
This commit allows to specify "disabled" or "off" in
stale-answer-client-timeout statement. The logic to support this
behavior will be added in the subsequent commits.

This commit also ensures an upper bound to stale-answer-client-timeout
which equals to one second less than 'resolver-query-timeout'.

(cherry picked from commit 0ad6f594f6)
2021-01-29 10:38:58 +01:00
Diego Fronza
93ca968644 Adjusted serve-stale test
After the addition of stale-answer-client-timeout a test was broken due
to the following behavior expected by the test.

1. Prime cache data.example txt.
2. Disable authoritative server.
3. Send a query for data.example txt.
4. Recursive server will timeout and answer from cache with stale RRset.
5. Recursive server will activate stale-refresh-time due to the previous
   failure in attempting to refresh the RRset.
6. Send a query for data.example txt.
7. Expect stale answer from cache due to stale-refresh-time
window being active, even if authoritative server is up.

Problem is that in step 4, due to the new option
stale-answer-client-timeout, recursive server will answer with stale
data before the actual fetch completes.

Since the original fetch is still running in background, if we re-enable
the authoritative server during that time, the RRset will actually be
successfully refreshed, and stale-refresh-window will not be activated.

The next queries will fail because they expect the TTL of the RRset to
match the one in the stale cache, not the one just refreshed.

To solve this, we explicitly disable stale-answer-client-timeout for
this test, as it's not the feature we are interested in testing here
anyways.

(cherry picked from commit a12bf4b61b)
2021-01-29 10:38:47 +01:00
Diego Fronza
3478794a5d Add stale-answer-client-timeout option
The general logic behind the addition of this new feature works as
folows:

When a client query arrives, the basic path (query.c / ns_query_recurse)
was to create a fetch, waiting for completion in fetch_callback.

With the introduction of stale-answer-client-timeout, a new event of
type DNS_EVENT_TRYSTALE may invoke fetch_callback, whenever stale
answers are enabled and the fetch took longer than
stale-answer-client-timeout to complete.

When an event of type DNS_EVENT_TRYSTALE triggers fetch_callback, we
must ensure that the folowing happens:

1. Setup a new query context with the sole purpose of looking up for
   stale RRset only data, for that matters a new flag was added
   'DNS_DBFIND_STALEONLY' used in database lookups.

    . If a stale RRset is found, mark the original client query as
      answered (with a new query attribute named NS_QUERYATTR_ANSWERED),
      so when the fetch completion event is received later, we avoid
      answering the client twice.

    . If a stale RRset is not found, cleanup and wait for the normal
      fetch completion event.

2. In ns_query_done, we must change this part:
	/*
	 * If we're recursing then just return; the query will
	 * resume when recursion ends.
	 */
	if (RECURSING(qctx->client)) {
		return (qctx->result);
	}

   To this:

	if (RECURSING(qctx->client) && !QUERY_STALEONLY(qctx->client)) {
		return (qctx->result);
	}

   Otherwise we would not proceed to answer the client if it happened
   that a stale answer was found when looking up for stale only data.

When an event of type DNS_EVENT_FETCHDONE triggers fetch_callback, we
proceed as before, resuming query, updating stats, etc, but a few
exceptions had to be added, most important of which are two:

1. Before answering the client (ns_client_send), check if the query
   wasn't already answered before.

2. Before detaching a client, e.g.
   isc_nmhandle_detach(&client->reqhandle), ensure that this is the
   fetch completion event, and not the one triggered due to
   stale-answer-client-timeout, so a correct call would be:
   if (!QUERY_STALEONLY(client)) {
        isc_nmhandle_detach(&client->reqhandle);
   }

Other than these notes, comments were added in code in attempt to make
these updates easier to follow.

(cherry picked from commit 171a5b7542)
2021-01-29 10:38:32 +01:00
Diego Fronza
7bf8950a0a Added dns_view_staleanswerenabled() function
Since it takes a couple lines of code to check whether stale answers
are enabled for a given view, code was extracted out to a proper
function.

(cherry picked from commit 74840ec50b)
2021-01-29 10:35:26 +01:00
Diego Fronza
f3bd27373d Avoid iterating name twice when constructing fctx->info
This is a minor performance improvement, we store the result of the
first call to strlcat to use as an offset in the next call when
constructing fctx->info string.

(cherry picked from commit 49c40827f6)
2021-01-29 10:35:17 +01:00
Mark Andrews
443e743156 Merge branch '2420-xmlfreetextwriter-could-be-called-twice-v9_16' into 'v9_16'
Resolve "CID 316510: Memory - corruptions (USE_AFTER_FREE)"

See merge request isc-projects/bind9!4617
2021-01-28 22:40:11 +00:00
Mark Andrews
73abc2e09c Add CHANGES entry for [GL #2420]
(cherry picked from commit 95114f7d60)
2021-01-28 21:42:44 +00:00
Mark Andrews
f217a0cbae Stop xmlFreeTextWriter being called twice
xmlFreeTextWriter could be called twice if xmlDocDumpFormatMemoryEnc
failed.

(cherry picked from commit b5cf54252a)
2021-01-28 21:42:44 +00:00
Michał Kępień
c2856d8ee4 Merge branch '1515-fix-backported-changes-entry' into 'v9_16'
Fix backported CHANGES entry for GL #1515

See merge request isc-projects/bind9!4619
2021-01-28 13:41:51 +00:00
Michał Kępień
085704d780 Fix backported CHANGES entry for GL #1515
Backported changes should reuse the original CHANGES entry rather than
add a new one.  As the change addressing GL #1515 was originally
described in CHANGES entry 5362, make its backport reuse that entry.
2021-01-28 14:38:21 +01:00
Mark Andrews
0e6c0df91b Merge branch 'marka-changes-line-length-v9_16' into 'v9_16'
Marka changes line length v9 16

See merge request isc-projects/bind9!4615
2021-01-28 05:16:53 +00:00
Mark Andrews
bcb5af3666 fix overly long line
(cherry picked from commit 28449acded)
2021-01-28 15:08:41 +11:00
Mark Andrews
0dd5483cb0 Detect overly long CHANGES lines
(cherry picked from commit b1ecab6383)
2021-01-28 15:08:09 +11:00
Mark Andrews
5647c7a86b Merge branch '2413-after-upgrade-to-bind9-9-16-11-named-is-killed-with-status-11-segv-v9_16' into 'v9_16'
Resolve "after upgrade to bind9 9.16.11 named is killed with status=11/SEGV"

See merge request isc-projects/bind9!4614
2021-01-28 03:09:17 +00:00
Mark Andrews
4d08f4aa4f Add release note for [GL #2413]
(cherry picked from commit 79fad620a2)
2021-01-28 13:43:48 +11:00
Mark Andrews
cc1d9c6e7e Add CHANGES for [GL #2413]
(cherry picked from commit 5ec9999b28)
2021-01-28 13:43:47 +11:00
Mark Andrews
abb2eb9d97 Add a named acl example
(cherry picked from commit 3dee62cfa5)
2021-01-28 13:43:47 +11:00
Mark Andrews
6a0b751555 Require 'ctx' to be non-NULL in cfg_acl_fromconfig{,2}
(cherry picked from commit a8b55992a8)
2021-01-28 13:43:47 +11:00
Mark Andrews
85318b521d Pass an afg_aclconfctx_t structure to cfg_acl_fromconfig
in named_zone_inlinesigning.  A NULL pointer does not work.

(cherry picked from commit 2b3fcd7156)
2021-01-28 13:43:47 +11:00
Mark Andrews
9cd1271c2f Merge branch '2391-check-nsupdate-y-for-all-hmac-algorithms-v9_16' into 'v9_16'
Check that 'nsupdate -y' works for all HMAC algorithms

See merge request isc-projects/bind9!4612
2021-01-28 02:33:53 +00:00
Mark Andrews
a30675998b Check that 'nsupdate -y' works for all HMAC algorithms
(cherry picked from commit 4b01ba44ea)
2021-01-28 12:57:03 +11:00
Mark Andrews
2e28d06e18 Merge branch '2073-dnssec-verify-tries-all-keys-which-results-in-poor-performance-v9_16' into 'v9_16'
Resolve "dnssec-verify tries all keys which results in poor performance"

See merge request isc-projects/bind9!4611
2021-01-28 01:52:29 +00:00
Mark Andrews
63d22d4a57 Add CHANGES note
(cherry picked from commit 3f0859d223)
2021-01-28 12:18:31 +11:00
Mark Andrews
afc75de0cc Optimise dnssec-verify
dns_dnssec_keyfromrdata() only needs to be called once per DNSKEY
rather than once per verification attempt.

(cherry picked from commit c75b325832)
2021-01-28 12:18:31 +11:00
Mark Andrews
e5229a9c36 Merge branch '2342-rndc-retransfer-issues-misleading-diagnostic-on-primary-zone-v9_16' into 'v9_16'
Resolve "rndc retransfer issues misleading diagnostic on primary zone"

See merge request isc-projects/bind9!4610
2021-01-28 00:06:10 +00:00
Mark Andrews
008de80f5a Add CHANGES
(cherry picked from commit 1f55f49f21)
2021-01-28 09:44:26 +11:00
Mark Andrews
52b73db20b Check 'rndc retransfer' of primary error message
(cherry picked from commit 8f36b8567a)
2021-01-28 09:44:26 +11:00
Mark Andrews
b416d8fcdf Improve the diagnostic 'rndc retransfer' error message
(cherry picked from commit dd3520ae41)
2021-01-28 09:44:26 +11:00
Matthijs Mekking
59d78bf729 Merge branch '2178-dnssec-fromlabel-ec_crash-v9_16' into 'v9_16'
Resolve "dnssec-keyfromlabel  ECDSAP256SHA256 error on AEP Keypers HSM"

See merge request isc-projects/bind9!4602
2021-01-26 15:08:07 +00:00
Matthijs Mekking
4a36b6d918 Make opensslecdsa_parse use fromlabel
When 'opensslecdsa_parse()' encounters a label tag in the private key
file, load the private key with 'opensslecdsa_fromlabel()'. Otherwise
load it from the private structure.

This was attempted before with 'load_privkey()' and 'uses_engine()',
but had the same flaw as 'opensslecdsa_fromlabel()' had previously,
that is getting the private and public key separately, juggling with
pointers between EC_KEY and EVP_PKEY, did not create a valid
cryptographic key that could be used for signing.

(cherry picked from commit 57ac70ad46)
2021-01-26 15:04:59 +01:00
Matthijs Mekking
97185ecac2 Simplify opensslecdsa_fromlabel
The 'opensslecdsa_fromlabel()' function does not need to get the
OpenSSL engine twice to load the private and public key. Also no need
to call 'dst_key_to_eckey()' as the EC_KEY can be derived from the
loaded EVP_PKEY's.

Add some extra checks to ensure the key has the same base id and curve
(group nid) as the dst key.

Since we already have the EVP_PKEY, no need to call 'finalize_eckey()',
instead just set the right values in the key structure.

(cherry picked from commit 393052d6ff)
2021-01-26 15:04:51 +01:00
Matthijs Mekking
f555cec0af Replace EVP_DigestFinal with EVP_DigestFinal_ex
The openssl docs claim that EVP_DigestFinal() is obsolete and that
one should use EVP_DigestFinal_ex() instead.

(cherry picked from commit 1fcd0ef8bd)
2021-01-26 15:04:38 +01:00
Matthijs Mekking
56b0861049 Add notes and changes for [#2178]
(cherry picked from commit 37d11f5be0)
2021-01-26 15:04:30 +01:00
Matthijs Mekking
9e2ea5efb1 Don't set pubkey if eckey already has public key
The 'ecdsa_check()' function tries to correctly set the public key
on the eckey, but this should be skipped if the public key is
retrieved via the private key.

(cherry picked from commit 06b9724152)
2021-01-26 15:04:21 +01:00
Matthijs Mekking
e3acfb44d5 ECDSA code should not use RSA label
The 'opensslecdsa_tofile()' function tags the label as an RSA label,
that is a copy paste error and should be of course an ECDSA label.

(cherry picked from commit 46afeca8bf)
2021-01-26 15:04:11 +01:00
Matthijs Mekking
8b25d3ab57 Correctly update pointers to pubkey and privkey
The functions 'load_pubkey_from_engine()' and
'load_privkey_from_engine()' did not correctly store the pointers.

Update both functions to add 'EC_KEY_set_public_key()' and
'EC_KEY_set_private_key()' respectively, so that the pointers to
the public and private keys survive the "load from engine" functions.

(cherry picked from commit 01239691a1)
2021-01-26 15:04:03 +01:00
Matthijs Mekking
f66df9f1b7 load_pubkey_from_engine() should load public key
The 'function load_pubkey_from_engine()' made a call to the libssl
function 'ENGINE_load_private_key'.  This is a copy paste error and
should be 'ENGINE_load_public_key'.

(cherry picked from commit 370285a62d)
2021-01-26 15:03:43 +01:00
Ondřej Surý
d77ac5c767 Merge branch '2403-dig-has-a-fit-with-option-multi-typo-on-multi-v9_16' into 'v9_16'
Report unknown dash option during the pre-parse phase (v9.16)

See merge request isc-projects/bind9!4600
2021-01-26 13:26:47 +00:00
Mark Andrews
77ae42b68c Add CHANGES note for [GL #2403]
(cherry picked from commit 0b6da18f31)
2021-01-26 14:19:12 +01:00
Mark Andrews
702a00d10e Report unknown dash option during the pre-parse phase
(cherry picked from commit 3361c0d6f8)
2021-01-26 14:18:54 +01:00
Ondřej Surý
2bcb00919f Merge branch '2349-backport-max-ixfr-ration-v9_16' into 'v9_16'
Backport max-ixfr-ratio to BIND 9.16

See merge request isc-projects/bind9!4598
2021-01-26 12:10:22 +00:00
Evan Hunt
f5362ed135 CHANGES and release note 2021-01-26 12:38:32 +01:00
Evan Hunt
62202b0e6d prevent ixfr/ns1 being removed 2021-01-26 12:38:32 +01:00
Evan Hunt
077e2c2a74 add serial number to "transfer ended" log messages 2021-01-26 12:38:32 +01:00
Evan Hunt
9529d1ed0d add a system test for AXFR fallback when max-ixfr-ratio is exceeded
also cleaned up the ixfr system test:

- use retry_quiet when applicable
- use scripts to generate test zones
- improve consistency
2021-01-26 12:38:32 +01:00
Evan Hunt
2df6ffc051 check size ratio when responding to IXFR requests 2021-01-26 12:38:32 +01:00
Evan Hunt
9950247c78 improve calculation of database transfer size
- change name of 'bytes' to 'xfrsize' in dns_db_getsize() parameter list
  and related variables; this is a more accurate representation of what
  the function is doing
- change the size calculations in dns_db_getsize() to more accurately
  represent the space needed for a *XFR message or journal file to contain
  the data in the database. previously we returned the sizes of all
  rdataslabs, including header overhead and offset tables, which
  resulted in the database size being reported as much larger than the
  equivalent *XFR or journal.
- map files caused a particular problem here: the fullname can't be
  determined from the node while a file is being deserialized, because
  the uppernode pointers aren't set yet. so we store "full name length"
  in the dns_rbtnode structure while serializing, and clear it after
  deserialization is complete.
2021-01-26 12:38:32 +01:00
Evan Hunt
70df95e9f5 dns_journal_iter_init() can now return the size of the delta
the call initailizing a journal iterator can now optionally return
to the caller the size in bytes of an IXFR message (not including
DNS header overhead, signatures etc) containing the differences from
the beginning to the ending serial number.

this is calculated by scanning the journal transaction headers to
calculate the transfer size. since journal file records contain a length
field that is not included in IXFR messages, we subtract out the length
of those fields from the overall transaction length.

this necessitated adding an "RR count" field to the journal transaction
header, so we know how many length fields to subract. NOTE: this will
make existing journal files stop working!
2021-01-26 12:38:32 +01:00
Evan Hunt
57aadd6cea add syntax and setter/getter functions to configure max-ixfr-ratio 2021-01-26 12:38:32 +01:00
Michał Kępień
80a4effee2 Merge branch '2387-use--release-for-SONAME-v9.16' into 'v9_16'
Use -release instead of -version-info for internal library SONAMEs

See merge request isc-projects/bind9!4553
2021-01-25 14:45:49 +00:00
Ondřej Surý
88c098b467 Add CHANGES and release note for GL #2387
(cherry picked from commit b30aaa3748)
2021-01-25 15:28:09 +01:00
Ondřej Surý
0e25af628c Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1608 (as an example) the library
will now be named libisc-9.16.10.so.

(cherry picked from commit c605d75ea5)
2021-01-25 15:28:09 +01:00
Michal Nowak
d74d23c88a Merge branch '2415-update-coverity-scan-ci-job-to-2020-09-v9_16' into 'v9_16'
[v9_16] Update Coverity Scan CI job to 2020.09

See merge request isc-projects/bind9!4594
2021-01-25 11:35:58 +00:00
Michal Nowak
13b6a3837f Update Coverity Scan CI job to 2020.09
(cherry picked from commit 7d428be79b)
2021-01-25 12:33:35 +01:00
Michał Kępień
e3b338c31c Merge branch 'v9_16_11-release' into 'v9_16'
Merge 9.16.11 release branch

See merge request isc-projects/bind9!4587
2021-01-21 08:35:39 +00:00
Michał Kępień
0847e40635 Set up release notes for BIND 9.16.12 2021-01-21 09:33:16 +01:00
Michał Kępień
48864361e6 Bump BIND_BASELINE_VERSION for ABI checks 2021-01-21 09:33:16 +01:00
Tinderbox User
3a53c2ae37 Merge branch 'prep-release' into v9_16_11-release 2021-01-21 09:11:54 +01:00
Michał Kępień
f641d69333 Merge branch 'michal/prepare-documentation-for-bind-9.16.11' into 'v9_16_11-release'
Prepare documentation for BIND 9.16.11

See merge request isc-private/bind9!231
2021-01-21 09:11:54 +01:00
Tinderbox User
536bc1163a prep 9.16.11 2021-01-21 09:11:54 +01:00
Michał Kępień
2e8eb485e9 Prepare release notes for BIND 9.16.11 2021-01-21 09:11:54 +01:00
Michał Kępień
19bd23df6a Add release note for GL #2091 2021-01-21 09:11:54 +01:00
Michał Kępień
db3380e5ee Reorder release notes 2021-01-21 09:11:54 +01:00
Michał Kępień
9396f3ef13 Tweak and reword release notes 2021-01-21 09:11:54 +01:00
Michał Kępień
d17c8903cf Restore release note for GL #2245 2021-01-21 09:11:54 +01:00
Michał Kępień
7d857376a4 Tweak and reword recent CHANGES entries 2021-01-21 09:11:54 +01:00
Evan Hunt
62547cd6d9 Merge branch 'each-fix-cpu-test-v9_16' into 'v9_16'
check whether taskset works before running cpu test

See merge request isc-projects/bind9!4585
2021-01-21 03:01:25 +00:00
Evan Hunt
0a1e1ead94 check whether taskset works before running cpu test
the taskset command used for the cpu system test seems
to be failing under vmware, causing a test failure. we
can try the taskset command and skip the test if it doesn't
work.

(cherry picked from commit a8a49bb783)
2021-01-20 15:44:31 -08:00
Michal Nowak
9c45a221e5 Merge branch 'mnowak/drop-issue-1941-workaround-v9_16' into 'v9_16'
[v9_16] Drop #1941 workaround

See merge request isc-projects/bind9!4581
2021-01-19 10:49:06 +00:00
Michal Nowak
4f2dffee99 Drop #1941 workaround
Workaround for issue #1941 is not needed anymore as the underlying
performance issue which manifested on FreeBSD was addressed.

(cherry picked from commit fe5978f5ba)
2021-01-19 11:47:19 +01:00
Matthijs Mekking
c1ac134376 Merge branch '2380-doc-engine-pkcs11-v9_16' into 'v9_16'
Resolve "Documentation  update - use of "-E pkcs11""

See merge request isc-projects/bind9!4574
2021-01-19 08:58:52 +00:00
Matthijs Mekking
87b44b59c8 Update documentation on -E option
The -E option does not default to pkcs11 if --with-pkcs11 is set,
but always needs to be set explicitly.

(cherry picked from commit 0536375d4cf61c9b570a32e808dde78a7ef859bf)
2021-01-19 09:06:01 +01:00
Matthijs Mekking
6eebd79bf0 Merge branch '2364-cid314969-coverity-deadcode-zoneconf-v9_16' into 'v9_16'
Fix control flow issue CID 314969 in zoneconf.c

See merge request isc-projects/bind9!4576
2021-01-18 15:54:48 +00:00
Matthijs Mekking
57c6017d91 Fix control flow issue CID 314969 in zoneconf.c
Coverity Scan identified the following issue in bin/named/zoneconf.c:

    *** CID 314969:  Control flow issues  (DEADCODE)
    /bin/named/zoneconf.c: 2212 in named_zone_inlinesigning()

    if (!inline_signing && !zone_is_dynamic &&
        cfg_map_get(zoptions, "dnssec-policy", &signing) == ISC_R_SUCCESS &&
        signing != NULL)
    {
        if (strcmp(cfg_obj_asstring(signing), "none") != 0) {
            inline_signing = true;
    >>>     CID 314969:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression ""no"" inside this statement: "dns_zone_log(zone, 1, "inli...".
            dns_zone_log(
                zone, ISC_LOG_DEBUG(1), "inline-signing: %s",
                inline_signing
                ? "implicitly through dnssec-policy"
                : "no");
        } else {
                ...
        }
    }

This is because we first set 'inline_signing = true' and then check
its value in 'dns_zone_log'.

(cherry picked from commit 8df629d0b2)
2021-01-18 14:40:26 +00:00
Michał Kępień
9d8ed6962b Merge branch 'michal/improve-danger-checks-v9_16' into 'v9_16'
[v9_16] Improve Danger checks

See merge request isc-projects/bind9!4577
2021-01-18 14:15:34 +00:00
Michał Kępień
ab8f013194 Skip subject line length check for merge commits
Some merge requests (e.g. those created for release branches) include
merge commits.  Prevent Danger from warning about excessive subject line
length for merge commits.  (While the proper way to detect a merge
commit would be to check the 'parents' attribute of a commit object,
Danger Python does not seem to populate that attribute, so a simple
string search is performed on the commit subject instead.)

(cherry picked from commit bc42690c99)
2021-01-18 15:13:34 +01:00
Michał Kępień
4aaab7a792 Skip length check for lines containing references
The Danger GitLab CI job currently flags excessively long lines in
commit log messages.  Exclude lines containing references (i.e. starting
with "[1]", "[2]", etc.) from this check.  This allows e.g. long URLs to
be included in commit log messages without triggering Danger warnings.

(cherry picked from commit 09964e8085)
2021-01-18 15:13:34 +01:00
Michał Kępień
c3341d3a85 Only warn about fixup commits once per run
The Danger GitLab CI job currently generates a separate error message
about fixup commits being present in a merge request for every such
commit found.  Prevent that by making it only log that error message
once per run.

(cherry picked from commit 801d13f62f)
2021-01-18 15:13:34 +01:00
Michał Kępień
bc6e0cd2b7 Flag trailing dots in commit subject lines
Make the Danger GitLab CI job fail when the subject line for any commit
belonging to a merge request contains a trailing dot.

(cherry picked from commit 953c810f41)
2021-01-18 15:13:34 +01:00
Michał Kępień
0c5612f399 Flag missing pairwise testing markers
Make the Danger GitLab CI job fail when a merge request adds a new
./configure switch without also adding a "# [pairwise: ...]" marker that
the relevant GitLab CI job uses for preparing the pairwise testing
model.  This helps to ensure that any newly added ./configure switches
are tested by the pairwise testing GitLab CI job.

(cherry picked from commit ff58ec8cef)
2021-01-18 15:13:34 +01:00
Michał Kępień
98a8970d39 Suggest adding release notes for customer issues
Make Danger suggest adding a release note to a merge request if the
latter is marked with the "Customer" label but not with the "Release
Notes" label.

(cherry picked from commit d81ad454cc)
2021-01-18 15:13:34 +01:00
Michał Kępień
f4e62d7102 Handle [placeholder] CHANGES entries
Make the Danger GitLab CI job fail when a merge request targeting a
branch different than "main" adds any [placeholder] entries to the
CHANGES file.  Prevent Danger from flagging missing GitLab identifiers
for [placeholder] CHANGES entries.

(cherry picked from commit 2f77c7680a)
2021-01-18 15:13:34 +01:00
Michał Kępień
7e86197136 Flag missing CVE identifiers
Make Danger ensure that if a merge request fixes a security issue then
that merge request includes a CHANGES entry and a release note, both of
which contain a CVE identifier.

(cherry picked from commit 97364f5518)
2021-01-18 15:13:34 +01:00
Matthijs Mekking
04584895ab Merge branch '2248-serve-stale-config-defaults-v9_16' into 'v9_16'
Resolve "Update serve-stale configuration defaults"

See merge request isc-projects/bind9!4570
2021-01-15 10:45:49 +00:00
Matthijs Mekking
f77ec3cf58 Update serve-stale system test with new defaults
(cherry picked from commit 3be65246f8)
2021-01-15 10:38:45 +01:00
Matthijs Mekking
4d48df7f97 Update serve-stale config defaults
Change the serve-stale configuration defaults so that they match the
recommendations from RFC 8767.

(cherry picked from commit e15a433b23)
2021-01-15 10:38:30 +01:00
Michał Kępień
fa81b9c981 Merge branch 'michal/regenerate-doc-misc-options' into 'v9_16'
Regenerate doc/misc/options{,.active}

See merge request isc-projects/bind9!4562
2021-01-12 15:06:08 +00:00
Michał Kępień
86a326e761 Regenerate doc/misc/options{,.active}
Make the "docs" GitLab CI job pass again after backporting documentation
changes.
2021-01-12 16:00:38 +01:00
Michał Kępień
89edbcb4ce Merge branch '1925-additional-text-edits-to-bind-arm-v9_16' into 'v9_16'
[v9_16] Resolve "Additional text edits to BIND ARM"

See merge request isc-projects/bind9!4561
2021-01-12 14:47:02 +00:00
Suzanne Goldlust
016f603419 Add missing named.conf man page
(cherry picked from commit 4cd6be18d3)
2021-01-12 15:45:09 +01:00
Suzanne Goldlust
14439e3c96 Final text edits to BIND 9 ARM in this round of updates
(cherry picked from commit 056f12eb34)
2021-01-12 15:45:09 +01:00
Michał Kępień
db07e0fcf6 Merge branch '1883-text-edits-in-pkcs11-rst-v9_16' into 'v9_16'
[v9_16] "Text edits in pkcs11.rst"

See merge request isc-projects/bind9!4560
2021-01-12 14:44:08 +00:00
Suzanne Goldlust
6bee0b80a1 Content and grammar edits to pkcs11.rst
(cherry picked from commit 28be579424)
2021-01-12 15:42:31 +01:00
Michał Kępień
295c90da33 Merge branch 'ondrej/1915-update-input-files-for-manpages-v9_16' into 'v9_16'
[v9_16] Update the generated files after the source manpages update

See merge request isc-projects/bind9!4559
2021-01-12 14:41:24 +00:00
Ondřej Surý
d49a882292 Update the generated files after the source manpages update
(cherry picked from commit 9ab86d0da2)
2021-01-12 15:40:00 +01:00
Michał Kępień
eeead1b98f Merge branch 'sgoldlust-1915-edits-to-man-pages-for-bind-arm-patch-16656-v9_16' into 'v9_16'
[v9_16] Edits to man pages for BIND 9 ARM

See merge request isc-projects/bind9!4558
2021-01-12 14:39:13 +00:00
Suzanne Goldlust
aee0570309 Text edits to manual paages
This commit updates the wording in following man pages:

* ddns-confgen.rst
* delv.rst
* dig.rst
* dnssec-dsfromkey.rst
* dnssec-importkey.rst
* dnssec-keyfromlabel.rst
* dnssec-keygen.rst
* dnssec-revoke.rst
* dnssec-settime.rst
* dnssec-signzone.rst
* dnssec-verify.rst
* dnstap-read.rst
* filter-aaaa.rst
* host.rst
* mdig.rst
* named-checkconf.rst
* named-checkzone.rst
* named-nzd2nzf.rst
* named.conf.rst
* named.rst
* nsec3hash.rst
* nsupdate.rst
* pkcs11-destroy.rst
* pkcs11-keygen.rst
* pkcs11-list.rst
* pkcs11-tokens.rst
* rndc-confgen.rst
* rndc.rst

(cherry picked from commit 78af7e54e6)
2021-01-12 15:37:47 +01:00
Michał Kępień
5942670d1b Merge branch '1915-edits-to-man-pages-for-bind-arm-v9_16' into 'v9_16'
[v9_16] Resolve "Edits to man pages for BIND ARM"

See merge request isc-projects/bind9!4557
2021-01-12 14:36:55 +00:00
Suzanne Goldlust
c7e22b3ac4 Text and formatting edits to various manual pages.
Follwing manual pages have been updated: rndc.conf.rst, rndc.rst
nsec3hash.rst, dnstap-read.rst, named-nzd2nzf.rst, mdig.rst,
named-rrchecker.rst, dnssec-revoke.rst, dnssec-cds.rst,
dnssec-keyfromlabel.rst, and dnssec-keygen.rst

(cherry picked from commit 1efa88cf09)
2021-01-12 15:35:14 +01:00
Michał Kępień
3fe7e43fc3 Merge branch '1940-removing-more-references-to-master-and-slave-in-bind-arm-v9_16' into 'v9_16'
[v9_16] Resolve "Removing more references to "master" and "slave" in BIND ARM"

See merge request isc-projects/bind9!4556
2021-01-12 14:34:20 +00:00
Suzanne Goldlust
4ba472ab21 Updates to .rst files to remove more references to "master" and "slave"
(cherry picked from commit 42386f3d9f)
2021-01-12 15:31:44 +01:00
Michał Kępień
52627eb9d3 Merge branch '1925-additional-text-edits-to-bind-arm-v9_16' into 'v9_16'
[v9_16] Resolve "Additional text edits to BIND ARM"

See merge request isc-projects/bind9!4555
2021-01-12 14:30:46 +00:00
Suzanne Goldlust
55636ab510 Various text edits and fixes to the documentation
(cherry picked from commit 5aa5ad5abc)
2021-01-12 15:26:59 +01:00
Michał Kępień
b47ee8faea Merge branch '1948-primaries-synonym-v9_16' into 'v9_16'
[v9_16] Resolve "add synonym for "masters""

See merge request isc-projects/bind9!4554
2021-01-12 14:24:06 +00:00
Evan Hunt
aa13408757 CHANGES, release note
(cherry picked from commit 565f99f9e5)
2021-01-12 15:21:14 +01:00
Evan Hunt
7b2880d191 further tidying of primary/secondary terminology in system tests
this changes most visble uses of master/slave terminology in tests.sh
and most uses of 'type master' or 'type slave' in named.conf files.
files in the checkconf test were not updated in order to confirm that
the old syntax still works. rpzrecurse was also left mostly unchanged
to avoid interference with DNSRPS.

(cherry picked from commit e43b3c1fa1)
2021-01-12 15:21:14 +01:00
Evan Hunt
85530bdd23 use primary/secondary terminology in 'rndc zonestatus'
(cherry picked from commit 68c384e118)
2021-01-12 15:21:14 +01:00
Evan Hunt
1a32a4d001 prevent "primaries" lists from having duplicate names
it is now an error to have two primaries lists with the same
name. this is true regardless of whether the "primaries" or
"masters" keywords were used to define them.

(cherry picked from commit f619708bbf)
2021-01-12 15:21:14 +01:00
Evan Hunt
746aa2581c add "primary-only" as a synonym for "master-only"
update the "notify" option to use RFC 8499 terminology as well.

(cherry picked from commit 424a3cf3cc)
2021-01-12 15:21:14 +01:00
Evan Hunt
04b9cdb53c add "primaries" as a synonym for "masters" in named.conf
as "type primary" is preferred over "type master" now, it makes
sense to make "primaries" available as a synonym too.

added a correctness check to ensure "primaries" and "masters"
cannot both be used in the same zone.

(cherry picked from commit 16e14353b1)
2021-01-12 15:21:14 +01:00
Matthijs Mekking
fa29c95992 Merge branch '2383-kasp-sig-validity-dnskey-bug-v9_16' into 'v9_16'
Fix signatures-validity config option (9.16)

See merge request isc-projects/bind9!4551
2021-01-12 12:40:47 +00:00
Matthijs Mekking
c4520620dc Fix signatures-validity config option
KASP was using 'signatures-validity-dnskey' instead of
'signatures-validity'.

(cherry picked from commit ad63e9e4f8)
2021-01-12 13:13:05 +01:00
Michal Nowak
e7b7c12a9a Merge branch 'mnowak/fix-copyright-date-in-man-pages-v9_16' into 'v9_16'
[v9_16] Update copyright date in man pages

See merge request isc-projects/bind9!4550
2021-01-11 12:06:46 +00:00
Michal Nowak
883e1cb4df Update copyright date in man pages
(cherry picked from commit 358c133ee2)
2021-01-11 12:54:46 +01:00
Michał Kępień
1100f13186 Merge branch '606-add-the-isc-dnssec-guide-as-a-bind-9-arm-appendix-v9_16' into 'v9_16'
[v9_16] Add the ISC DNSSEC Guide as a BIND 9 ARM appendix

See merge request isc-projects/bind9!4547
2021-01-08 12:58:02 +00:00
Michał Kępień
22bec45f9c Add the ISC DNSSEC Guide as a BIND 9 ARM appendix
Add the ISC DNSSEC Guide to the BIND 9 ARM in order to include the
former in every BIND release.

(cherry picked from commit f96e6a1e1d)
2021-01-08 13:53:52 +01:00
Michał Kępień
ec25a534b6 Merge branch '2366-add-CHANGES-entry-v9_16' into 'v9_16'
[v9_16] Add CHANGES entry for GL #2366

See merge request isc-projects/bind9!4545
2021-01-08 11:53:20 +00:00
Michał Kępień
a799a536fe Add CHANGES entry for GL #2366
(cherry picked from commit 995b72d2b7)
2021-01-08 12:51:40 +01:00
Mark Andrews
f31978efd0 Merge branch '2366-bind-9-16-10-build-fails-with-libmaxminddb-1-4-3' into 'v9_16'
Resolve "BIND 9.16.10 build fails with libmaxminddb-1.4.3"

See merge request isc-projects/bind9!4531
2021-01-06 08:04:25 +00:00
Mark Andrews
cafb021b2a Fix 'configure --with-maxminddb=<path>' 2021-01-06 17:53:10 +11:00
Mark Andrews
4c3fc7c4a0 Merge branch '2355-incorrect-increment-of-inactive-in-rbtdb-c-maybe_free_rbtdb-v9_16' into 'v9_16'
Resolve "Incorrect increment of inactive in rbtdb.c:maybe_free_rbtdb()"

See merge request isc-projects/bind9!4530
2021-01-06 05:51:10 +00:00
Mark Andrews
5874c04d13 Add release note
(cherry picked from commit 584e589d84)
2021-01-06 16:33:32 +11:00
Mark Andrews
0836e97d94 Add CHANGES
(cherry picked from commit 65702896bd)
2021-01-06 16:33:32 +11:00
Mark Andrews
07e899f616 Inactive incorrectly incremented
It is possible to have two threads destroying an rbtdb at the same
time when detachnode() executes and removes the last reference to
a node between exiting being set to true for the node and testing
if the references are zero in maybe_free_rbtdb().  Move NODE_UNLOCK()
to after checking if references is zero to prevent detachnode()
changing the reference count too early.

(cherry picked from commit 859d2fdad6)
2021-01-06 16:33:32 +11:00
Matthijs Mekking
dda76b7b5c Merge branch '2359-too-many-newlines-dnssec-signzone-verify-v9_16' into 'v9_16'
Fix dnssec-signzone and -verify logging (again)

See merge request isc-projects/bind9!4525
2021-01-05 13:00:25 +00:00
Matthijs Mekking
63e58f09a5 Fix dnssec-signzone and -verify logging (again)
While fixing #2359, 'report()' was changed so that it would print the
newline.

Newlines were missing from the output of 'dnssec-signzone'
and 'dnssec-verify' because change
664b8f04f5 moved the printing from
newlines to the library.

This had to be reverted because this also would print redundant
newlines in logfiles.

While doing the revert, some newlines in 'lib/dns/zoneverify.c'
were left in place, now making 'dnssec-signzone' and 'dnssec-verify'
print too many newlines.

This commit removes those newlines, so that the output looks nice
again.

(cherry picked from commit 18c62a077e)
2021-01-05 13:41:49 +01:00
Mark Andrews
29b2e1cd48 Merge branch '2359-missing-newlines-in-log-messages-dnssec-signzone-dnssec-verify-c-v9_16' into 'v9_16'
Resolve "missing newlines in log messages dnssec-signzone/dnssec-verify"

See merge request isc-projects/bind9!4522
2021-01-05 01:47:26 +00:00
Mark Andrews
70efdc9d1d Add CHANGES
(cherry picked from commit 244525a303)
2021-01-05 11:53:24 +11:00
Mark Andrews
76a08eef9d Fix dnssec-signzone and dnssec-verify logging
The newlines need to be appended to the messages generated by report
in a atomic manner.

(cherry picked from commit c36bd83822)
2021-01-05 11:52:59 +11:00
Mark Andrews
ad2f32a2e3 Merge branch '2361-the-additional-system-test-fails-on-system-gcc-mutexatomics' into 'v9_16'
Resolve "The additional system test fails on system:gcc:mutexatomics"

See merge request isc-projects/bind9!4520
2021-01-05 00:32:03 +00:00
Mark Andrews
f116975670 add CHANGES 2021-01-05 11:30:47 +11:00
Mark Andrews
72fa03a1e9 Use atomic_init when initalising server->reload_status 2021-01-04 05:16:16 +00:00
Mark Andrews
5a8410dcf6 Merge branch 'marka-copyrights' into 'v9_16'
update for 2021

See merge request isc-projects/bind9!4519
2021-01-04 04:35:20 +00:00
Mark Andrews
4222429b28 update for 2021 2021-01-04 15:14:44 +11:00
Matthijs Mekking
538d7d5f81 Merge branch '1750-dnssec-policy-none-v9_16' into 'v9_16'
Resolve "dnssec-policy graceful transition to insecure"

See merge request isc-projects/bind9!4513
2020-12-23 12:25:06 +00:00
Matthijs Mekking
7fdd0f7be9 Add notes for [#2341]
Mention the bugfix in the release.

(cherry picked from commit 08b6e8c2c9)
2020-12-23 12:06:35 +01:00
Matthijs Mekking
decdd1d3e1 Add documentation and notes for [#1750]
(cherry picked from commit 7825d8f916)
2020-12-23 12:06:09 +01:00
Matthijs Mekking
e4f4977c1e Fix a quirky mkeys test failure
The mkeys system test started to fail after introducing support for
zones transitioning to unsigned without going bogus. This is because
there was actually a bug in the code: if you reconfigure a zone and
remove the "auto-dnssec" option, the zone is actually still DNSSEC
maintained. This is because in zoneconf.c there is no call
to 'dns_zone_setkeyopt()' if the configuration option is not used
(cfg_map_get(zoptions, "auto-dnssec", &obj) will return an error).

The mkeys system test implicitly relied on this bug: initially the
root zone is being DNSSEC maintained, then at some point it needs to
reset the root zone in order to prepare for some tests with bad
signatures. Because it needs to inject a bad signature, 'auto-dnssec'
is removed from the configuration.

The test pass but for the wrong reasons:

I:mkeys:reset the root server
I:mkeys:reinitialize trust anchors
I:mkeys:check positive validation (18)

The 'check positive validation' test works because the zone is still
DNSSEC maintained: The DNSSEC records in the signed root zone file on
disk are being ignored.

After fixing the bug/introducing graceful transition to insecure,
the root zone is no longer DNSSEC maintained after the reconfig.

The zone now explicitly needs to be reloaded because otherwise the
'check positive validation' test works against an old version of the
zone (the one with all the revoked keys), and the test will obviously
fail.

(cherry picked from commit 2fc42b598b)
2020-12-23 11:57:03 +01:00
Matthijs Mekking
d564ad5f52 Update keymgr to allow transition to insecure mode
The keymgr prevented zones from going to insecure mode. If we
have a policy with an empty key list this is a signal that the zone
wants to go back to insecure mode. In this case allow one extra state
transition to be valid when checking for DNSSEC safety.

(cherry picked from commit 9134100069)
2020-12-23 11:56:54 +01:00
Matthijs Mekking
6da379d844 Publish CDS/CDNSKEY Delete Records
Check if zone is transitioning from secure to insecure. If so,
delete the CDS/CDNSKEY records, otherwise make sure they are not
part of the RRset.

(cherry picked from commit 68d715a229)
2020-12-23 11:56:44 +01:00
Matthijs Mekking
cf0439cd5f Treat dnssec-policy "none" as a builtin zone
Configure "none" as a builtin policy. Change the 'cfg_kasp_fromconfig'
api so that the 'name' will determine what policy needs to be
configured.

When transitioning a zone from secure to insecure, there will be
cases when a zone with no DNSSEC policy (dnssec-policy none) should
be using KASP. When there are key state files available, this is an
indication that the zone once was DNSSEC signed but is reconfigured
to become insecure.

If we would not run the keymgr, named would abruptly remove the
DNSSEC records from the zone, making the zone bogus. Therefore,
change the code such that a zone will use kasp if there is a valid
dnssec-policy configured, or if there are state files available.

(cherry picked from commit cf420b2af0)
2020-12-23 11:56:33 +01:00
Matthijs Mekking
6ff69ee8ba Add function to see if dst key uses kasp
For purposes of zones transitioning back to insecure mode, it is
practical to see if related keys have a state file associated.

(cherry picked from commit 8f2c5e45da)
2020-12-23 11:56:25 +01:00
Matthijs Mekking
63b72ad5e9 Small adjustments to kasp rndc_checkds function
Slightly better test output, and only call 'load keys' if the
'rndc checkds' call succeeded.

(cherry picked from commit 756674f6d1)
2020-12-23 11:56:16 +01:00
Matthijs Mekking
c3d2843915 Add tests for going from secure to insecure
Add two test zones that will be reconfigured to go insecure, by
setting the 'dnssec-policy' option to 'none'.

One zone was using inline-signing (implicitly through dnssec-policy),
the other is a dynamic zone.

Two tweaks to the kasp system test are required: we need to set
when to except the CDS/CDS Delete Records, and we need to know
when we are dealing with a dynamic zone (because the logs to look for
are slightly different, inline-signing prints "(signed)" after the
zone name, dynamic zones do not).

(cherry picked from commit fa2e4e66b0)
2020-12-23 11:56:07 +01:00
Mark Andrews
b5db21f80b Merge branch '2245-bind-9-16-8-does-not-honor-cpu-affinity-v9_16' into 'v9_16'
Resolve "bind 9.16.8 does not honor CPU affinity"

See merge request isc-projects/bind9!4510
2020-12-22 23:13:49 +00:00
Mark Andrews
b8c44c8e1f Add CHANGES and release notes for [GL #2245]
(cherry picked from commit fc4af548e7)
2020-12-23 09:26:50 +11:00
Matthijs Mekking
ba75744331 Add test for cpu affinity
Add a test to check BIND 9 honors CPU affinity mask. This requires
some changes to the start script, to construct the named command.

(cherry picked from commit f1a097964c)
2020-12-23 09:25:48 +11:00
Mark Andrews
4d003dd0f8 Only pick CPUs that are part of the existing CPU affinity set when
assigning a thread to a CPU.

(cherry picked from commit 698d9285d4)
2020-12-23 09:21:29 +11:00
Mark Andrews
107ca22258 Merge branch '2348-bin-tools-mdig-compile-link-failure-because-of-missing-isccfg-dependency' into 'v9_16'
Resolve "bin/tools/mdig: compile/link failure because of missing isccfg dependency"

See merge request isc-projects/bind9!4493
2020-12-20 21:54:45 +00:00
Mark Andrews
b278d91680 Handle shared library platforms that don't support inter library dependancies 2020-12-20 21:36:09 +00:00
Mark Andrews
afbc6f41d9 Fixup library link lists 2020-12-20 21:36:09 +00:00
Michał Kępień
2dfe130936 Merge branch 'v9_16_10-release' into 'v9_16'
Merge 9.16.10 release branch

See merge request isc-projects/bind9!4501
2020-12-16 21:29:31 +00:00
Michał Kępień
797974c7c3 Set up release notes for BIND 9.16.11 2020-12-16 22:21:19 +01:00
Michał Kępień
bfdce48781 Bump BIND_BASELINE_VERSION for ABI checks 2020-12-16 22:21:19 +01:00
Michal Nowak
05dfd2a90a Merge branch 'mnowak/fix-program-name-in-dnssec-keymgr-8' into 'v9_16'
[v9_16] Man page fixes (named.rst & dnssec-keymgr.rst)

See merge request isc-projects/bind9!4479
2020-12-14 12:21:06 +00:00
Michal Nowak
5f0e9c8645 Fix program name reference in dnssec-keymgr(8) 2020-12-14 13:17:27 +01:00
Michal Nowak
c77c96133d Fix a reference to rndc(8) in named(8) manual page
(cherry picked from commit befcbcac28)
2020-12-14 13:17:27 +01:00
Ondřej Surý
df315cd8fc Merge branch '2058-print-warning-when-fallback-to-soaserial-increment-v9_16' into 'v9_16'
Resolve "`dnssec-signzone -N unixtime` behaves like `increment`"

See merge request isc-projects/bind9!4492
2020-12-12 07:37:24 +00:00
Ondřej Surý
66bb0a1e80 Add CHANGES and release notes for GL #2058
(cherry picked from commit ba887a688c)
2020-12-12 08:08:49 +01:00
Mark Andrews
151500b522 Update dnssec-signzone -N soa-serial-format description
document the autoincrement when the serial would go backwards.

(cherry picked from commit eb1b29b19e)
2020-12-12 08:07:51 +01:00
Ondřej Surý
04f9f45c54 Print warning when falling back to increment soa serial method
When using the `unixtime` or `date` method to update the SOA serial,
`named` and `dnssec-signzone` would silently fallback to `increment`
method to prevent the new serial number to be smaller than the old
serial number (using the serial number arithmetics).  Add a warning
message when such fallback happens.

(cherry picked from commit ef685bab5c)
2020-12-12 07:55:29 +01:00
Ondřej Surý
5e27492302 Merge branch '2321-netmgr-v2-v9_16' into 'v9_16'
Synchronize netmgr sub-library with main branch

See merge request isc-projects/bind9!4455
2020-12-09 16:04:21 +00:00
Ondřej Surý
645701afb0 Merge branch 'ondrej/release-notes-doesnt-need-copyright-v9_16' into 'v9_16'
Remove the requirement for the release notes to have copyright

See merge request isc-projects/bind9!4484
2020-12-09 09:51:20 +00:00
Ondřej Surý
fcfb3e77bb Remove the requirement for the release notes to have copyright
The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.

(cherry picked from commit cb30d9892d)
2020-12-09 10:50:15 +01:00
Ondřej Surý
099fc1fdf8 Add CHANGES and release notes 2020-12-09 10:46:16 +01:00
Ondřej Surý
2c04299eb1 Fix HAVE_SO_REUSEPORT_LB macro name definition
A typo in macro definition caused the load-balanced sockets to be
disabled even on platforms with existing support for load-balanced
sockets.

(cherry picked from commit 5caf33feda)
2020-12-09 10:46:16 +01:00
Ondřej Surý
90979a79e2 Sync the func() -> func(void) in netmgr 2020-12-09 10:46:16 +01:00
Ondřej Surý
bb9b55dfba Use sock->nchildren instead of mgr->nworkers when initializing NM
On Windows, we were limiting the number of listening children to just 1,
but we were then iterating on mgr->nworkers.  That lead to scheduling
more async_*listen() than actually allocated and out-of-bound read-write
operation on the heap.

(cherry picked from commit 87c5867202)
2020-12-09 10:46:16 +01:00
Ondřej Surý
857704b879 Explicitly link the netmgr tests with -luv 2020-12-09 10:46:16 +01:00
Ondřej Surý
7ec4ec3a81 Fix datarace when UDP/TCP connect fails and we are in nmthread
When we were in nmthread, the isc__nm_async_<proto>connect() function
executes in the same thread as the isc__nm_<proto>connect() and on a
failure, it would block indefinitely because the failure branch was
setting sock->active to false before the condition around the wait had a
chance to skip the WAIT().

This also fixes the zero system test being stuck on FreeBSD 11, so we
re-enable the test in the commit.
2020-12-09 10:46:16 +01:00
Ondřej Surý
90a9b0611a Add FreeBSD connection timeout socket option
On FreeBSD, the option to configure connection timeout is called
TCP_KEEPINIT, use it to configure the connection timeout there.

This also fixes the dangling socket problems in the unit test, so
re-enable them.
2020-12-09 10:46:16 +01:00
Ondřej Surý
0ee8672692 Distribute queries among threads even on platforms without lb sockets
On platforms without load-balancing socket all the queries would be
handle by a single thread.  Currently, the support for load-balanced
sockets is present in Linux with SO_REUSEPORT and FreeBSD 12 with
SO_REUSEPORT_LB.

This commit adds workaround for such platforms that:

1. setups single shared listening socket for all listening nmthreads for
   UDP, TCP and TCPDNS netmgr transports

2. Calls uv_udp_bind/uv_tcp_bind on the underlying socket just once and
   for rest of the nmthreads only copy the internal libuv flags (should
   be just UV_HANDLE_BOUND and optionally UV_HANDLE_IPV6).

3. start reading on UDP socket or listening on TCP socket

The load distribution among the nmthreads is uneven, but it's still
better than utilizing just one thread for processing all the incoming
queries
2020-12-09 10:46:16 +01:00
Ondřej Surý
4c70100ce0 Don't use stack allocated buffer for uv_write()
On FreeBSD, the stack is destroyed more aggressively than on Linux and
that revealed a bug where we were allocating the 16-bit len for the
TCPDNS message on the stack and the buffer got garbled before the
uv_write() sendback was executed.  Now, the len is part of the uvreq, so
we can safely pass it to the uv_write() as the req gets destroyed after
the sendcb is executed.

(cherry picked from commit 94afea9325)
2020-12-09 10:46:16 +01:00
Michał Kępień
12fa8a7aed Make netmgr initialize and cleanup Winsock itself
On Windows, WSAStartup() needs to be called to initialize Winsock before
any sockets are created or else socket() calls will return error code
10093 (WSANOTINITIALISED).  Since BIND's Network Manager is intended to
work as a reusable networking library, it should take care of calling
WSAStartup() - and its cleanup counterpart, WSACleanup() - itself rather
than relying on external code to do it.  Add the necessary WSAStartup()
and WSACleanup() calls to isc_nm_start() and isc_nm_destroy(),
respectively.

(cherry picked from commit 88f96faba8)
2020-12-09 10:46:16 +01:00
Michał Kępień
216fc34490 Extend log message for unexpected socket() errors
Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.

(cherry picked from commit dc2e1dea86)
2020-12-09 10:46:16 +01:00
Ondřej Surý
e8e8ed7fb9 Adjust the nstests for isc_nmhandle_{attach,detach} name change
Due to the added attach/detach tracing in the netmgr-v2 code, the
libns tests needs to be adjusted as the real function names have
changed from isc_nmhandle_* to isc__nmhandle_*.
2020-12-09 10:46:16 +01:00
Ondřej Surý
9b2184893d The cmocka.h header MUST be included before isc/util.h gets included
The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...)  to
be cmocka "fake" assertions.  However that means that cmocka.h needs to
be included after UNIT_TESTING is defined but before isc/util.h is
included.  Because isc/util.h is included in most of the project headers
this means that the sequence MUST be:

    #define UNIT_TESTING
    #include <cmocka.h>

    #include <isc/_anything_.h>

See !2204 for other header requirements for including cmocka.h.

(cherry picked from commit 0ba697fe8c)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
012946eadc autoconf: link with libssl
This is prerequisite to adding DoT and DoH support to BIND 9.
2020-12-09 10:46:16 +01:00
Ondřej Surý
7fc62f829d Add libssl libraries to Windows build
This commit extends the perl Configure script to also check for libssl
in addition to libcrypto and change the vcxproj source files to link
with both libcrypto and libssl.
2020-12-09 10:46:16 +01:00
Ondřej Surý
48759bd047 Fix the data race in accessing the isc_nm_t timers
The following TSAN report about accessing the mgr timers (mgr->init,
mgr->idle, mgr->keepalive and mgr->advertised) has been fixed in this
commit:

    ==================
    WARNING: ThreadSanitizer: data race (pid=2746)
    Read of size 4 at 0x7b440008a948 by thread T18:
    #0 isc__nm_tcpdns_read /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 (libisc.so.1706+0x2ba0f)
    #1 isc_nm_read /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1679:3 (libisc.so.1706+0x22258)
    #2 tcpdns_connect_connect_cb /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:363:2 (tcpdns_test+0x4bc5fb)
    #3 isc__nm_async_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1816:2 (libisc.so.1706+0x228c9)
    #4 isc__nm_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1791:3 (libisc.so.1706+0x22713)
    #5 tcpdns_connect_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:343:2 (libisc.so.1706+0x2d89d)
    #6 uv__stream_connect /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1381:5 (libuv.so.1+0x27c18)
    #7 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1298:5 (libuv.so.1+0x25977)
    #8 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11 (libuv.so.1+0x2e795)
    #9 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 (libuv.so.1+0x158ec)
    #10 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:530:11 (libisc.so.1706+0x1c94a)

    Previous write of size 4 at 0x7b440008a948 by main thread:
    #0 isc_nm_settimeouts /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:490:12 (libisc.so.1706+0x1dda5)
    #1 tcpdns_recv_two /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:601:2 (tcpdns_test+0x4bad0e)
    #2 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70be)
    #3 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Location is heap block of size 281 at 0x7b440008a840 allocated by main thread:
    #0 malloc <null> (tcpdns_test+0x42864b)
    #1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:713:8 (libisc.so.1706+0x6d261)
    #2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:622:8 (libisc.so.1706+0x69b9c)
    #3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1044:9 (libisc.so.1706+0x6d379)
    #4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2432:10 (libisc.so.1706+0x6889e)
    #5 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:203:8 (libisc.so.1706+0x1c219)
    #6 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #7 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #8 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Thread T18 'isc-net-0000' (tid=3513, running) created by main thread at:
    #0 pthread_create <null> (tcpdns_test+0x429e7b)
    #1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:73:8 (libisc.so.1706+0x8476a)
    #2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:271:3 (libisc.so.1706+0x1c66a)
    #3 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #4 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #5 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 in isc__nm_tcpdns_read
    ==================
    ThreadSanitizer: reported 1 warnings

(cherry picked from commit 2e1dd56d0b)
2020-12-09 10:46:16 +01:00
Ondřej Surý
a61b7294c2 Avoid netievent allocations when the callbacks can be called directly
After turning the users callbacks to be asynchronous, there was a
visible performance drop.  This commit prevents the unnecessary
allocations while keeping the code paths same for both asynchronous and
synchronous calls.

The same change was done to the isc__nm_udp_{read,send} as those two
functions are in the hot path.

(cherry picked from commit d6d2fbe0e9)
2020-12-09 10:46:16 +01:00
Ondřej Surý
7b9c8b9781 Refactor netmgr and add more unit tests
This is a part of the works that intends to make the netmgr stable,
testable, maintainable and tested.  It contains a numerous changes to
the netmgr code and unfortunately, it was not possible to split this
into smaller chunks as the work here needs to be committed as a complete
works.

NOTE: There's a quite a lot of duplicated code between udp.c, tcp.c and
tcpdns.c and it should be a subject to refactoring in the future.

The changes that are included in this commit are listed here
(extensively, but not exclusively):

* The netmgr_test unit test was split into individual tests (udp_test,
  tcp_test, tcpdns_test and newly added tcp_quota_test)

* The udp_test and tcp_test has been extended to allow programatic
  failures from the libuv API.  Unfortunately, we can't use cmocka
  mock() and will_return(), so we emulate the behaviour with #define and
  including the netmgr/{udp,tcp}.c source file directly.

* The netievents that we put on the nm queue have variable number of
  members, out of these the isc_nmsocket_t and isc_nmhandle_t always
  needs to be attached before enqueueing the netievent_<foo> and
  detached after we have called the isc_nm_async_<foo> to ensure that
  the socket (handle) doesn't disappear between scheduling the event and
  actually executing the event.

* Cancelling the in-flight TCP connection using libuv requires to call
  uv_close() on the original uv_tcp_t handle which just breaks too many
  assumptions we have in the netmgr code.  Instead of using uv_timer for
  TCP connection timeouts, we use platform specific socket option.

* Fix the synchronization between {nm,async}_{listentcp,tcpconnect}

  When isc_nm_listentcp() or isc_nm_tcpconnect() is called it was
  waiting for socket to either end up with error (that path was fine) or
  to be listening or connected using condition variable and mutex.

  Several things could happen:

    0. everything is ok

    1. the waiting thread would miss the SIGNAL() - because the enqueued
       event would be processed faster than we could start WAIT()ing.
       In case the operation would end up with error, it would be ok, as
       the error variable would be unchanged.

    2. the waiting thread miss the sock->{connected,listening} = `true`
       would be set to `false` in the tcp_{listen,connect}close_cb() as
       the connection would be so short lived that the socket would be
       closed before we could even start WAIT()ing

* The tcpdns has been converted to using libuv directly.  Previously,
  the tcpdns protocol used tcp protocol from netmgr, this proved to be
  very complicated to understand, fix and make changes to.  The new
  tcpdns protocol is modeled in a similar way how tcp netmgr protocol.
  Closes: #2194, #2283, #2318, #2266, #2034, #1920

* The tcp and tcpdns is now not using isc_uv_import/isc_uv_export to
  pass accepted TCP sockets between netthreads, but instead (similar to
  UDP) uses per netthread uv_loop listener.  This greatly reduces the
  complexity as the socket is always run in the associated nm and uv
  loops, and we are also not touching the libuv internals.

  There's an unfortunate side effect though, the new code requires
  support for load-balanced sockets from the operating system for both
  UDP and TCP (see #2137).  If the operating system doesn't support the
  load balanced sockets (either SO_REUSEPORT on Linux or SO_REUSEPORT_LB
  on FreeBSD 12+), the number of netthreads is limited to 1.

* The netmgr has now two debugging #ifdefs:

  1. Already existing NETMGR_TRACE prints any dangling nmsockets and
     nmhandles before triggering assertion failure.  This options would
     reduce performance when enabled, but in theory, it could be enabled
     on low-performance systems.

  2. New NETMGR_TRACE_VERBOSE option has been added that enables
     extensive netmgr logging that allows the software engineer to
     precisely track any attach/detach operations on the nmsockets and
     nmhandles.  This is not suitable for any kind of production
     machine, only for debugging.

* The tlsdns netmgr protocol has been split from the tcpdns and it still
  uses the old method of stacking the netmgr boxes on top of each other.
  We will have to refactor the tlsdns netmgr protocol to use the same
  approach - build the stack using only libuv and openssl.

* Limit but not assert the tcp buffer size in tcp_alloc_cb
  Closes: #2061

(cherry picked from commit 634bdfb16d)
2020-12-09 10:46:16 +01:00
Ondřej Surý
fa9ca83862 Turn all the callback to be always asynchronous
When calling the high level netmgr functions, the callback would be
sometimes called synchronously if we catch the failure directly, or
asynchronously if it happens later.  The synchronous call to the
callback could create deadlocks as the caller would not expect the
failed callback to be executed directly.

(cherry picked from commit a49d88568f)
2020-12-09 10:46:16 +01:00
Ondřej Surý
bcc9ad98ea netmgr: Add additional safeguards to netmgr/tls.c
This commit adds couple of additional safeguards against running
sends/reads on inactive sockets.  The changes was modeled after the
changes we made to netmgr/tcpdns.c

(cherry picked from commit fa424225af)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
b83dff0585 isc_nm_tls_create_server_ctx can create ephemeral certs
In-memory ephemeral certs creation for easy DoT/DoH deployment.

(cherry picked from commit 3c00fb71db)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
d7fa046a69 Add DoT support to bind
Parse the configuration of tls objects into SSL_CTX* objects.  Listen on
DoT if 'tls' option is setup in listen-on directive.  Use DoT/DoH ports
for DoT/DoH.

(cherry picked from commit 38b78f59a0)
2020-12-09 10:46:16 +01:00
Evan Hunt
0f5fff5c1e report peer address in TLS mode, and specify protocol
- peer address was not being reported correctly by "dig +tls"
- the protocol used is now reported in the dig output: UDP, TCP, or TLS.

(cherry picked from commit 8886569e9d)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
4a854da141 netmgr: server-side TLS support
Add server-side TLS support to netmgr - that includes moving some of the
isc_nm_ functions from tcp.c to a wrapper in netmgr.c calling a proper
tcp or tls function, and a new isc_nm_listentls() function.

Add DoT support to tcpdns - isc_nm_listentlsdns().

(cherry picked from commit b2ee0e9dc3)
2020-12-09 10:46:16 +01:00
Evan Hunt
6f6f0e26ab address some possible shutdown races in xfrin
there were two failures during observed in testing, both occurring
when 'rndc halt' was run rather than 'rndc stop' - the latter dumps
zone contents to disk and presumably introduced enough delay to
prevent the races:

- a failure when the zone was shut down and called dns_xfrin_detach()
  before the xfrin had finished connecting; the connect timeout
  terminated without detaching its handle
- a failure when the tcpdns socket timer fired after the outerhandle
  had already been cleared.

this commit incidentally addresses a failure observed in mutexatomic
due to a variable having been initialized incorrectly.
2020-12-09 10:46:16 +01:00
Ondřej Surý
c4dcedd2dc netmgr: Don't crash if socket() returns an error in udpconnect
socket() call can return an error - e.g. EMFILE, so we need to handle
this nicely and not crash.

Additionally wrap the socket() call inside a platform independent helper
function as the Socket data type on Windows is unsigned integer:

> This means, for example, that checking for errors when the socket and
> accept functions return should not be done by comparing the return
> value with –1, or seeing if the value is negative (both common and
> legal approaches in UNIX). Instead, an application should use the
> manifest constant INVALID_SOCKET as defined in the Winsock2.h header
> file.

(cherry picked from commit 8af7f81d6c)
2020-12-09 10:46:16 +01:00
Ondřej Surý
21daa258a2 netmgr: Always load the result from async socket
Because we use result earlier for setting the loadbalancing on the
socket, we could be left with a ISC_R_NOTIMPLEMENTED value stored in the
variable and when the UDP connection would succeed, we would
errorneously return this value instead of ISC_R_SUCCESS.

(cherry picked from commit 050258bda4)
2020-12-09 10:46:16 +01:00
Evan Hunt
70e08cab6b dig: use new netmgr timeout mechanism
use isc_nmhandle_settimeout() to set read/recv timeouts, and get rid
of connect_timeout() and related functions in dighost.c.

(cherry picked from commit ea2b04c361)
2020-12-09 10:46:16 +01:00
Evan Hunt
4598d7b30d add isc_nmhandle_settimeout() function
this function sets the read timeout for the socket associated
with a netmgr handle and, if the timer is running, resets it.
for TCPDNS sockets it also sets the read timeout and resets the
timer on the outer TCP socket.

(cherry picked from commit 4be63c5b00)
2020-12-09 10:46:16 +01:00
Ondřej Surý
5877befb51 fix nmhandle attach/detach errors in tcpdnsconnect_cb()
we need to attach to the statichandle when connecting TCPDNS sockets,
same as with UDP.

(cherry picked from commit 2191d2bf44)
2020-12-09 10:46:16 +01:00
Mark Andrews
574e0d9f6e Incorrect result code passed to failed_connect_cb
*** CID 312970:  Incorrect expression  (COPY_PASTE_ERROR) /lib/isc/netmgr/tcp.c: 282 in tcp_connect_cb()
    276     	}
    277
    278     	isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
    279     	r = uv_tcp_getpeername(&sock->uv_handle.tcp, (struct sockaddr *)&ss,
    280     			       &(int){ sizeof(ss) });
    281     	if (r != 0) {
    >>>     CID 312970:  Incorrect expression  (COPY_PASTE_ERROR)
    >>>     "status" in "isc___nm_uverr2result(status, true, "netmgr/tcp.c", 282U)" looks like a copy-paste error.
    282     		failed_connect_cb(sock, req, isc__nm_uverr2result(status));
    283     		return;
    284     	}
    285
    286     	atomic_store(&sock->connecting, false);
    287

(cherry picked from commit 0073cb7356)
2020-12-09 10:46:16 +01:00
Ondřej Surý
268e111546 Put up additional safe guards to not use inactive/closed tcpdns socket
When we are operating on the tcpdns socket, we need to double check
whether the socket or its outerhandle or its listener or its mgr is
still active and when not, bail out early.

(cherry picked from commit c14c1fdd2c)
2020-12-09 10:46:16 +01:00
Witold Kręcicki
fb19091a32 Fix improper closed connection handling in tcpdns.
If dnslisten_readcb gets a read callback it needs to verify that the
outer socket wasn't closed in the meantime, and issue a CANCELED callback
if it was.

(cherry picked from commit 3ab3d90de0)
2020-12-09 10:46:16 +01:00
Evan Hunt
80de62645c check return value from uv_tcp_getpeername() when connecting
if we can't determine the peer, the connect should fail.

(cherry picked from commit 8fcad58ea6)
2020-12-09 10:46:16 +01:00
Evan Hunt
12b1ae64ff set REUSEPORT and REUSEADDR on TCP sockets if needed
When binding a TCP socket, if bind() fails with EADDRINUSE,
try again with REUSEPORT/REUSEADDR (or the equivalent options).

(cherry picked from commit 26a3a22895)
2020-12-09 10:46:16 +01:00
Ondřej Surý
e35b8db249 Fix more races between connect and shutdown
There were more races that could happen while connecting to a
socket while closing or shutting down the same socket.  This
commit introduces a .closing flag to guard the socket from
being closed twice.

(cherry picked from commit ed3ab63f74)
2020-12-09 10:46:16 +01:00
Ondřej Surý
d8c3e48970 Fix a race between isc__nm_async_shutdown() and new sends/reads
There was a data race where a new event could be scheduled after
isc__nm_async_shutdown() had cleaned up all the dangling UDP/TCP
sockets from the loop.

(cherry picked from commit 6cfadf9db0)
2020-12-09 10:46:16 +01:00
Ondřej Surý
c4816ce34f Refactor udp_recv_cb()
- more logical code flow.
- propagate errors back to the caller.
- add a 'reading' flag and call the callback from failed_read_cb()
  only when it the socket was actively reading.

(cherry picked from commit 5fcd52209a)
2020-12-09 10:46:16 +01:00
Ondřej Surý
7945fb0c90 Fix netmgr read/connect timeout issues
- don't bother closing sockets that are already closing.
- UDP read timeout timer was not stopped after reading.
- improve handling of TCP connection failures.

(cherry picked from commit cdccac4993)
2020-12-09 10:46:16 +01:00
Ondřej Surý
e9354e7bfe Add isc__nm_udp_shutdown() function
This function will be called during isc_nm_closedown() to ensure
that all UDP sockets are closed and detached.

(cherry picked from commit 7a6056bc8f)
2020-12-09 10:46:16 +01:00
Evan Hunt
c919a3338f add netmgr functions to support outgoing DNS queries
- isc_nm_tcpdnsconnect() sets up up an outgoing TCP DNS connection.
- isc_nm_tcpconnect(), _udpconnect() and _tcpdnsconnect() now take a
  timeout argument to ensure connections time out and are correctly
  cleaned up on failure.
- isc_nm_read() now supports UDP; it reads a single datagram and then
  stops until the next time it's called.
- isc_nm_cancelread() now runs asynchronously to prevent assertion
  failure if reading is interrupted by a non-network thread (e.g.
  a timeout).
- isc_nm_cancelread() can now apply to UDP sockets.
- added shim code to support UDP connection in versions of libuv
  prior to 1.27, when uv_udp_connect() was added

all these functions will be used to support outgoing queries in dig,
xfrin, dispatch, etc.

(cherry picked from commit 5dcdc00b93)
2020-12-09 10:46:16 +01:00
Tinderbox User
7406ea925a prep 9.16.10 2020-12-09 10:46:16 +01:00
Michał Kępień
a01961260d Prepare release notes for BIND 9.16.10 2020-12-09 10:46:16 +01:00
Michał Kępień
2ef1784b85 Reorder release notes 2020-12-09 10:45:49 +01:00
Michał Kępień
3f6f0b9f66 Tweak and reword release notes 2020-12-09 10:45:49 +01:00
Michał Kępień
9f270783ac Tweak and reword recent CHANGES entries 2020-12-09 10:45:49 +01:00
Michał Kępień
d902dc611f Fix formatting of "dnssec-policy" documentation 2020-12-09 10:45:49 +01:00
Michal Nowak
19197034fb Miscellaneous minor documentation updates 2020-12-09 10:45:49 +01:00
Ondřej Surý
2e879edb8c Merge branch 'ondrej/clang-format-11-v9_16' into 'v9_16'
Bump the clang version to 11 (v9.16)

See merge request isc-projects/bind9!4480
2020-12-08 19:14:15 +00:00
Ondřej Surý
908f167a5d Bump the clang version to 11 (stable)
(cherry picked from commit c1eb385fdf)
2020-12-08 19:34:12 +01:00
Ondřej Surý
a35a666a7c Reformat sources using clang-format-11
(cherry picked from commit 7ba18870dc)
2020-12-08 19:34:05 +01:00
Ondřej Surý
504969cb63 Explicitly configure new clang-format-11 options
(cherry picked from commit 6c28834354)
2020-12-08 19:30:55 +01:00
Ondřej Surý
dc548b2e83 Merge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size-v9_16' into 'v9_16'
Resolve "DNS Flag Day 2020 - EDNS buffer size configuring does not work anymore"

See merge request isc-projects/bind9!4456
2020-12-02 15:33:06 +00:00
Ondřej Surý
9d35c9b96d Add CHANGES and release not for GL #2250
(cherry picked from commit c7d81f12f8)
2020-12-02 12:02:10 +01:00
Ondřej Surý
5d34daaf78 Change the default value for nocookie-udp-size back to 4096
The DNS Flag Day 2020 reduced all the EDNS buffer sizes to 1232.  In
this commit, we revert the default value for nocookie-udp-size back to
4096 because the option is too obscure and most people don't realize
that they also need to change this configuration option in addition to
max-udp-size.

(cherry picked from commit 79c196fc77)
2020-12-02 12:01:50 +01:00
Mark Andrews
0d3ba105bb Merge branch '2305-adjust-recursion-limits-v9_16' into 'v9_16'
Adjust default value of "max-recursion-queries"

See merge request isc-projects/bind9!4447
2020-12-01 14:13:40 +00:00
Mark Andrews
5c10b5a4e8 Adjust default value of "max-recursion-queries"
Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.

(cherry picked from commit ab0bf49203)
2020-12-02 00:53:49 +11:00
Mark Andrews
c4178b7d8d Merge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11-v9_16' into 'v9_16'
Resolve "BIND 9.11.22 - 9.11.25 fails to build for AEP HSM native pkcs11"

See merge request isc-projects/bind9!4445
2020-12-01 13:50:49 +00:00
Mark Andrews
45719ff249 Add release note for [GL #2315]
(cherry picked from commit 356243aaec)
2020-12-01 23:29:43 +11:00
Mark Andrews
a07754cf69 Add CHANGES
(cherry picked from commit 11a3545e32)
2020-12-01 23:19:20 +11:00
Mark Andrews
4926888306 Fix misplaced declaration
(cherry picked from commit 49b9219bb3)
2020-12-01 23:19:20 +11:00
Michal Nowak
d765d024ea Merge branch '2274-drop-centos-6-support-after-november-30-2020' into 'v9_16'
Remove CentOS 6 from GitLab CI

See merge request isc-projects/bind9!4392
2020-11-30 13:29:02 +00:00
Michal Nowak
b908cc9c79 Remove CentOS 6 from GitLab CI
CentOS 6 reaches EOL on November 30, 2020 and will not be officially
supported by the CentOS project.
2020-11-27 13:29:38 +01:00
Mark Andrews
fe07671c9b Merge branch '2275-tighten-dns-cookie-response-handling-v9_16' into 'v9_16'
Resolve "Tighten DNS COOKIE response handling"

See merge request isc-projects/bind9!4438
2020-11-26 22:25:42 +00:00
Mark Andrews
e98edb871d Add release note for [GL #2275]
(cherry picked from commit d0dd71380b)
2020-11-27 08:44:00 +11:00
Mark Andrews
a9c791dfef Add CHANGES note for [GL #2275]
(cherry picked from commit 15e7a4b047)
2020-11-27 08:44:00 +11:00
Mark Andrews
7e85b2cd22 Add comment about cookie sizes
(cherry picked from commit 304df53991)
2020-11-27 08:44:00 +11:00
Mark Andrews
2898f530cd Check that missing cookies are handled
(cherry picked from commit bd9155590e)
2020-11-27 08:44:00 +11:00
Mark Andrews
df5f076a02 Tighten DNS COOKIE response handling
Fallback to TCP when we have already seen a DNS COOKIE response
from the given address and don't have one in this UDP response. This
could be a server that has turned off DNS COOKIE support, a
misconfigured anycast server with partial DNS COOKIE support, or a
spoofed response. Falling back to TCP is the correct behaviour in
all 3 cases.

(cherry picked from commit 0e3b1f5a25)
2020-11-27 08:15:11 +11:00
Michal Nowak
0e5276f9d2 Merge branch '2224-fixup-core-back-traces-v9_16' into 'v9_16'
[v9_16] Resolve "Fixup core back traces."

See merge request isc-projects/bind9!4435
2020-11-26 17:40:11 +00:00
Michal Nowak
f48b221ffa Write traceback file to the same directory as core file
The traceback files could overwrite each other on systems which do not
use different core dump file names for different processes.  Prevent
that by writing the traceback file to the same directory as the core
dump file.

These changes still do not prevent the operating system from overwriting
a core dump file if the same binary crashes multiple times in the same
directory and core dump files are named identically for different
processes.

(cherry picked from commit 6428fc26af)
2020-11-26 18:29:41 +01:00
Mark Andrews
a50ce1bd43 Unify whitespace in bin/tests/system/run.sh
Replace tabs with spaces to make whitespace consistent across the entire
bin/tests/system/run.sh script.

(cherry picked from commit 0f0a006c7e)
2020-11-26 18:29:33 +01:00
Diego dos Santos Fronza
4c8330cb91 Merge branch '2281-cid-313104-error-handling-issues-in-lib-ns-query-c-v9_16' into 'v9_16'
Resolve "CID 313104: Error handling issues in lib/ns/query.c"

See merge request isc-projects/bind9!4418
2020-11-26 14:57:49 +00:00
Diego Fronza
5c28451949 Silence coverity warnings in query.c
Return value of dns_db_getservestalerefresh() and
dns_db_getservestalettl() functions were previously unhandled.

This commit purposefully ignore those return values since there is
no side effect if those results are != ISC_R_SUCCESS, it also supress
Coverity warnings.
2020-11-26 14:56:22 +00:00
Matthijs Mekking
6e945ae520 Merge branch '1620-dnssec-policy-nsec3-saltlen-v9_16' into 'v9_16'
Resolve "dnssec-policy NSEC3 support" (9.16)

See merge request isc-projects/bind9!4423
2020-11-26 14:15:41 +00:00
Matthijs Mekking
2f0b924ce6 Add NSEC3PARAM unit test, refactor zone.c
Add unit test to ensure the right NSEC3PARAM event is scheduled in
'dns_zone_setnsec3param()'.  To avoid scheduling and managing actual
tasks, split up the 'dns_zone_setnsec3param()' function in two parts:

1. 'dns__zone_lookup_nsec3param()' that will check if the requested
   NSEC3 parameters already exist, and if a new salt needs to be
   generated.

2. The actual scheduling of the new NSEC3PARAM event (if needed).

(cherry picked from commit 64db30942d)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
6db879160f Detect NSEC3 salt collisions
When generating a new salt, compare it with the previous NSEC3
paremeters to ensure the new parameters are different from the
previous ones.

This moves the salt generation call from 'bin/named/*.s' to
'lib/dns/zone.c'. When setting new NSEC3 parameters, you can set a new
function parameter 'resalt' to enforce a new salt to be generated. A
new salt will also be generated if 'salt' is set to NULL.

Logging salt with zone context can now be done with 'dnssec_log',
removing the need for 'dns_nsec3_log_salt'.

(cherry picked from commit 6b5d7357df)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
734865e110 Add zone context to "generated salt" logs
(cherry picked from commit 3b4c764b43)
2020-11-26 14:15:05 +00:00
Matthijs Mekking
93f9d3b812 Move logging of salt in separate function
There may be a desire to log the salt without losing the context
of log module, level, and category.

(cherry picked from commit 7878f300ff)
2020-11-26 14:15:04 +00:00
Matthijs Mekking
52d3bf5f31 Change nsec3param salt config to saltlen
Upon request from Mark, change the configuration of salt to salt
length.

Introduce a new function 'dns_zone_checknsec3aram' that can be used
upon reconfiguration to check if the existing NSEC3 parameters are
in sync with the configuration. If a salt is used that matches the
configured salt length, don't change the NSEC3 parameters.

(cherry picked from commit 6f97bb6b1f)
2020-11-26 14:15:04 +00:00
Matthijs Mekking
d35dab3db8 Add check for NSEC3 and key algorithms
NSEC3 is not backwards compatible with key algorithms that existed
before the RFC 5155 specification was published.

(cherry picked from commit 00c5dabea3)
2020-11-26 14:15:03 +00:00
Matthijs Mekking
00d7cc5144 Disable one nsec3 test due to GL #2216
This known bug makes the test fail. There is no trivial fix so disable
test case for now.

(cherry picked from commit f10790b02d)
2020-11-26 14:15:03 +00:00
Matthijs Mekking
c993bc19a0 Add changes and notes for kasp NSEC3 support
This feature is news worthy.

(cherry picked from commit 9adad77ac3)
2020-11-26 14:15:03 +00:00
Matthijs Mekking
cf79e6ccc1 Add some NSEC3 optout tests
Make sure that just changing the optout value recreates the chain.

(cherry picked from commit a5b45bdd03)
2020-11-26 14:15:03 +00:00
Matthijs Mekking
2a1793a2be Check nsec3param configuration values
Check 'nsec3param' configuration for the number of iterations.  The
maximum number of iterations that are allowed are based on the key
size (see https://tools.ietf.org/html/rfc5155#section-10.3).

Check 'nsec3param' configuration for correct salt. If the string is
not "-" or hex-based, this is a bad salt.

(cherry picked from commit 7039c5f805)
2020-11-26 14:15:03 +00:00
Matthijs Mekking
b6cf88333a Don't use 'rndc signing' with kasp
The 'rndc signing' command allows you to manipulate the private
records that are used to store signing state. Don't use these with
'dnssec-policy' as such manipulations may violate the policy (if you
want to change the NSEC3 parameters, change the policy and reconfig).

(cherry picked from commit eae9a6d297)
2020-11-26 14:15:02 +00:00
Matthijs Mekking
d13786d583 Fix a reconfig bug wrt inline-signing
When doing 'rndc reconfig', named may complain about a zone not being
reusable because it has a raw version of the zone, and the new
configuration has not set 'inline-signing'. However, 'inline-signing'
may be implicitly true if a 'dnssec-policy' is used for the zone, and
the zone is not dynamic.

Improve the check in 'named_zone_reusable'.  Create a new function for
checking 'inline-signing' configuration that matches existing code in
'bin/named/server.c'.

(cherry picked from commit ba8128ea00)
2020-11-26 14:15:02 +00:00
Matthijs Mekking
008e84e965 Support for NSEC3 in dnssec-policy
Implement support for NSEC3 in dnssec-policy.  Store the configuration
in kasp objects. When configuring a zone, call 'dns_zone_setnsec3param'
to queue an nsec3param event. This will ensure that any previous
chains will be removed and a chain according to the dnssec-policy is
created.

Add tests for dnssec-policy zones that uses the new 'nsec3param'
option, as well as changing to new values, changing to NSEC, and
changing from NSEC.

(cherry picked from commit 114af58ee2)
2020-11-26 14:15:02 +00:00
Matthijs Mekking
5dfd3b2d7b Add kasp nsec3param configuration
Add configuration and documentation on how to enable NSEC3 when
using dnssec-policy for signing your zones.

(cherry picked from commit f7ca96c805)
2020-11-26 14:15:02 +00:00
Matthijs Mekking
9b9ac92fd0 Move generate_salt function to lib/dns/nsec3
We will be using this function also on reconfig, so it should have
a wider availability than just bin/named/server.

(cherry picked from commit 84a4273074)
2020-11-26 14:14:56 +00:00
Michal Nowak
e5dc276c65 Merge branch '1770-review-how-we-use-sys-un-h' into 'v9_16'
Fix typo in ISC_PLAFORM_HAVESYSUNH

See merge request isc-projects/bind9!4417
2020-11-26 14:04:55 +00:00
Michal Nowak
8885f4a6f7 Fix typo in ISC_PLAFORM_HAVESYSUNH 2020-11-26 14:17:17 +01:00
Michał Kępień
ae73b62ea9 Merge branch 'michal/use-proper-cmocka-macros-for-pointer-checks-v9_16' into 'v9_16'
[v9_16] Use proper cmocka macros for pointer checks

See merge request isc-projects/bind9!4429
2020-11-26 12:19:39 +00:00
Michał Kępień
a6f2e36ee6 Use proper cmocka macros for pointer checks
Make sure pointer checks in unit tests use cmocka assertion macros
dedicated for use with pointers instead of those dedicated for use with
integers or booleans.

(cherry picked from commit f440600126)
2020-11-26 13:13:21 +01:00
Michał Kępień
614d860c99 Merge branch 'v9_16_9-release' into 'v9_16'
Merge 9.16.9 release branch

See merge request isc-projects/bind9!4427
2020-11-26 11:31:46 +00:00
Michał Kępień
ce18f66336 Set up release notes for BIND 9.16.10 2020-11-26 12:30:25 +01:00
Michał Kępień
d29339750e Bump BIND_BASELINE_VERSION for ABI checks 2020-11-26 12:30:25 +01:00
Tinderbox User
12e9a1143e Merge branch 'prep-release' into v9_16_9-release 2020-11-26 12:25:53 +01:00
Michał Kępień
65f9517463 Merge branch 'michal/prepare-release-notes-for-bind-9.16.9' into 'v9_16_9-release'
Prepare release notes for BIND 9.16.9

See merge request isc-private/bind9!221
2020-11-26 12:25:53 +01:00
Tinderbox User
14620951cc prep 9.16.9 2020-11-26 12:25:53 +01:00
Michał Kępień
259bcc5cc2 Prepare release notes for BIND 9.16.9 2020-11-26 12:25:53 +01:00
Michał Kępień
d857435c02 Add release note for GL #2244 2020-11-26 12:25:53 +01:00
Michał Kępień
6a99a2f5e0 Add release note for GL #2236 2020-11-26 12:25:53 +01:00
Michał Kępień
9d847cb96b Add release note for GL #1736 2020-11-26 12:25:53 +01:00
Michał Kępień
10459b8151 Reorder release notes 2020-11-26 12:25:53 +01:00
Michał Kępień
51a5b64993 Tweak and reword release notes 2020-11-26 12:25:53 +01:00
Michał Kępień
72bd351694 Tweak and reword recent CHANGES entries 2020-11-26 12:25:53 +01:00
Michał Kępień
66f0c9ab6e Merge branch 'michal/fix-cppcheck-2.2-issues-v9_16' into 'v9_16'
[v9_16] Fix cppcheck 2.2 issues

See merge request isc-projects/bind9!4413
2020-11-25 12:43:01 +00:00
Mark Andrews
328e7474d2 Remove now redundant check for state != NULL
(cherry picked from commit ee135d8946)
2020-11-25 13:21:58 +01:00
Michał Kępień
a452798af4 Convert add_quota() to a function
cppcheck 2.2 reports the following false positive:

    lib/isc/tests/quota_test.c:71:21: error: Array 'quotas[101]' accessed at index 110, which is out of bounds. [arrayIndexOutOfBounds]
     isc_quota_t *quotas[110];
                        ^

The above is not even an array access, so this report is obviously
caused by a cppcheck bug.  Yet, it seems to be triggered by the presence
of the add_quota() macro, which should really be a function.  Convert
the add_quota() macro to a function in order to make the code cleaner
and to prevent the above cppcheck 2.2 false positive from being
triggered.

(cherry picked from commit ea54a932d2)
2020-11-25 13:21:58 +01:00
Michał Kępień
3158a2aead Silence cppcheck 2.2 false positive in udp_recv()
cppcheck 2.2 reports the following false positive:

    lib/dns/dispatch.c:1241:14: warning: Either the condition 'resp==NULL' is redundant or there is possible null pointer dereference: resp. [nullPointerRedundantCheck]
     if (disp != resp->disp) {
                 ^
    lib/dns/dispatch.c:1212:11: note: Assuming that condition 'resp==NULL' is not redundant
     if (resp == NULL) {
              ^
    lib/dns/dispatch.c:1241:14: note: Null pointer dereference
     if (disp != resp->disp) {
                 ^

Apparently this version of cppcheck gets confused about conditional
"goto" statements because line 1241 can never be reached if 'resp' is
NULL.

Move a code block to prevent the above false positive from being
reported without affecting the processing logic.

(cherry picked from commit 0b6216d1c7)
2020-11-25 13:21:58 +01:00
Michał Kępień
e395ff54e5 Teach cppcheck that fatal() does not return
cppcheck is not aware that the bin/dnssec/dnssectool.c:fatal() function
does not return.  This triggers certain cppcheck 2.2 false positives,
for example:

    bin/dnssec/dnssec-signzone.c:3470:13: warning: Either the condition 'ndskeys==8' is redundant or the array 'dskeyfile[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond]
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^
    bin/dnssec/dnssec-signzone.c:3467:16: note: Assuming that condition 'ndskeys==8' is not redundant
       if (ndskeys == MAXDSKEYS) {
                   ^
    bin/dnssec/dnssec-signzone.c:3470:13: note: Array index out of bounds
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^

    bin/dnssec/dnssec-signzone.c:771:20: warning: Either the condition 'l->hashbuf==NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^
    bin/dnssec/dnssec-signzone.c:767:18: note: Assuming that condition 'l->hashbuf==NULL' is not redundant
      if (l->hashbuf == NULL) {
                     ^
    bin/dnssec/dnssec-signzone.c:771:20: note: Null pointer addition
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^

Instead of suppressing all such warnings individually, conditionally
define a preprocessor macro which prevents them from being triggered.

(cherry picked from commit d9701e22b5)
2020-11-25 13:21:58 +01:00
Michał Kępień
ea33d1749c Remove cppcheck 2.0 false positive workarounds
The cppcheck bug which commit 4c2c93c821
works around was fixed in cppcheck 2.2.  Drop the relevant hack from the
definition of the cppcheck GitLab CI job.

(cherry picked from commit f06dfe0397)
2020-11-25 13:21:58 +01:00
Michal Nowak
aa83569975 Merge branch '1730-clean-up-no-op-ac_subst-calls-v9_16' into 'v9_16'
[v9_16] Remove unused Autoconf variables

See merge request isc-projects/bind9!4403
2020-11-24 17:38:56 +00:00
Michal Nowak
d28aca8448 Remove unused Autoconf variables 2020-11-24 18:35:40 +01:00
Michał Kępień
ec423f5c0b Merge branch 'michal/enable-stress-tests-to-be-run-on-demand-v9_16' into 'v9_16'
[v9_16] Enable "stress" tests to be run on demand

See merge request isc-projects/bind9!4408
2020-11-23 10:54:24 +00:00
Michał Kępień
b02919c4f9 Enable "stress" tests to be run on demand
The "stress" test can be run in different ways, depending on:

  - the tested scenario (authoritative, recursive),
  - the operating system used (Linux, FreeBSD),
  - the architecture used (amd64, arm64).

Currently, all supported "stress" test variants are automatically
launched for all scheduled pipelines and for pipelines started for tags;
there is no possibility of running these tests on demand, which could be
useful in certain circumstances.

Employ the "only:variables" key to enable fine-grained control over the
list of "stress" test jobs to be run for a given pipeline.  Three CI
variables are used to specify the list of "stress" test jobs to create:

  - BIND_STRESS_TEST_MODE: specifies the test mode to use; must be
    explicitly set in order for any "stress" test job to be created;
    allowed values are: "authoritative", "recursive",

  - BIND_STRESS_TEST_OS: specifies the operating system to run the test
    on; allowed values are: "linux", "freebsd"; defaults to "linux", may
    be overridden at pipeline creation time,

  - BIND_STRESS_TEST_ARCH: specifies the architecture to run the test
    on; allowed values are: "amd64", "arm64"; defaults to "amd64", may
    be overridden at pipeline creation time.

Since case-insensitive regular expressions are used for determining
which jobs to run, every variable described above may contain multiple
values.  For example, setting the BIND_STRESS_TEST_MODE variable to
"authoritative,recursive" will cause the "stress" test to be run in both
supported scenarios (either on the default OS/architecture combination,
i.e. Linux/amd64, or, if the relevant variables are explicitly
specified, the requested OS/architecture combinations).

(cherry picked from commit f23094223e)
2020-11-23 11:52:20 +01:00
Mark Andrews
f9aa84c533 Merge branch 'matthijs-fix-echo_i-in-auth-test-v9_16' into 'v9_16'
Fix syntax in echo_i messages

See merge request isc-projects/bind9!4404
2020-11-20 00:27:58 +00:00
Matthijs Mekking
259db79579 Fix syntax in echo_i messages
It's either "record returns" or "records return".

(cherry picked from commit 53188daf5b)
2020-11-20 10:43:21 +11:00
Mark Andrews
81eaf51c15 Merge branch '2280-check-dname-handling-when-qtype-is-cname-any-v9_16' into 'v9_16'
Fix DNAME when QTYPE is CNAME or ANY

See merge request isc-projects/bind9!4398
2020-11-19 01:07:54 +00:00
Mark Andrews
b3d259107f Fix DNAME when QTYPE is CNAME or ANY
The synthesised CNAME is not supposed to be followed when the
QTYPE is CNAME or ANY as the lookup is satisfied by the CNAME
record.

(cherry picked from commit e980affba0)
2020-11-19 10:52:29 +11:00
Matthijs Mekking
449d8bfa4f Merge branch '2066-fix-serve-stale-v9_16' into 'v9_16'
Resolve "Fix serve-stale so that it is usable when needed"

See merge request isc-projects/bind9!4387
2020-11-12 09:46:31 +00:00
Diego Fronza
10860b09be Update ARM and other documents 2020-11-12 10:13:04 +01:00
Diego Fronza
af45a64f86 Add CHANGES and release notes entry 2020-11-11 16:09:15 -03:00
Diego Fronza
f321d95464 Adjusted test to match new rndc serve-stale status output 2020-11-11 16:06:36 -03:00
Diego Fronza
4905c2e24a Output 'stale-refresh-time' value on rndc serve-stale status 2020-11-11 16:06:30 -03:00
Diego Fronza
73c199dec7 Check 'stale-refresh-time' when sharing cache between views
This commit ensures that, along with previous restrictions, a cache is
shareable between views only if their 'stale-refresh-time' value are
equal.
2020-11-11 16:06:23 -03:00
Matthijs Mekking
4d52ddbd15 Add two more system tests for stale-refresh-time
Add one test that checks the behavior when serve-stale is enabled
via configuration (as opposed to enabled via rndc).

Add one test that checks the behavior when stale-refresh-time is
disabled (set to 0).
2020-11-11 16:06:16 -03:00
Matthijs Mekking
276c912953 Change serve-stale test stale-answer-ttl
Using a 'stale-answer-ttl' the same value as the authoritative ttl
value makes it hard to differentiate between a response from the
stale cache and a response from the authoritative server.

Change the stale-answer-ttl from 2 to 4, so that it differs from the
authoritative ttl.
2020-11-11 16:06:07 -03:00
Diego Fronza
8383621ba8 Wait for multiple parallel dig commands to fully finish
The strategy of running many dig commands in parallel and
waiting for the respective output files to be non empty was
resulting in random test failures, hard to reproduce, where
it was possible that the subsequent reading of the files could
have been failing due to the file's content not being fully flushed.

Instead of checking if output files are non empty, we now wait
for the dig processes to finish.
2020-11-11 16:05:30 -03:00
Diego Fronza
0123a0f44f Added system test for stale-refresh-time
This test works as follow:
- Query for data.example rrset.
- Sleep until its TTL expires (2 secs).
- Disable authoritative server.
- Query for data.example again.
- Since server is down, answer come from stale cache, which has
  a configured stale-answer-ttl of 3 seconds.
- Enable authoritative server.
- Query for data.example again
- Since last query before activating authoritative server failed, and
  since 'stale-refresh-time' seconds hasn't elapsed yet, answer should
  come from stale cache and not from the authoritative server.
2020-11-11 16:01:59 -03:00
Diego Fronza
e8c3d538d5 Adjusted ancient rrset system test
Before the stale-refresh-time feature, the system test for ancient rrset
was somewhat based on the average time the previous tests and queries
were taking, thus not very precise.

After the addition of stale-refresh-time the system test for ancient
rrset started to fail since the queries for stale records (low
max-stale-ttl) were not taking the time to do a full resolution
anymore, since the answers now were coming from the cache (because the
rrset were stale and within stale-refresh-time window after the
previous resolution failure).

To handle this, the correct time to wait before rrset become ancient is
calculated from max-stale-ttl configuration plus the TTL set in the
rrset used in the tests (ans2/ans.pl).

Then before sending queries for ancient rrset, we check if we need to
sleep enough to ensure those rrset will be marked as ancient.
2020-11-11 16:01:51 -03:00
Diego Fronza
24ec021e50 Warn if 'stale-refresh-time' < 30 (default)
RFC 8767 recommends that attempts to refresh to be done no more
frequently than every 30 seconds.

Added check into named-checkconf, which will warn if values below the
default are found in configuration.

BIND will also log the warning during loading of configuration in the
same fashion.
2020-11-11 16:00:22 -03:00
Diego Fronza
8cc5abff23 Add stale-refresh-time option
Before this update, BIND would attempt to do a full recursive resolution
process for each query received if the requested rrset had its ttl
expired. If the resolution fails for any reason, only then BIND would
check for stale rrset in cache (if 'stale-cache-enable' and
'stale-answer-enable' is on).

The problem with this approach is that if an authoritative server is
unreachable or is failing to respond, it is very unlikely that the
problem will be fixed in the next seconds.

A better approach to improve performance in those cases, is to mark the
moment in which a resolution failed, and if new queries arrive for that
same rrset, try to respond directly from the stale cache, and do that
for a window of time configured via 'stale-refresh-time'.

Only when this interval expires we then try to do a normal refresh of
the rrset.

The logic behind this commit is as following:

- In query.c / query_gotanswer(), if the test of 'result' variable falls
  to the default case, an error is assumed to have happened, and a call
  to 'query_usestale()' is made to check if serving of stale rrset is
  enabled in configuration.

- If serving of stale answers is enabled, a flag will be turned on in
  the query context to look for stale records:
  query.c:6839
  qctx->client->query.dboptions |= DNS_DBFIND_STALEOK;

- A call to query_lookup() will be made again, inside it a call to
  'dns_db_findext()' is made, which in turn will invoke rbdb.c /
  cache_find().

- In rbtdb.c / cache_find() the important bits of this change is the
  call to 'check_stale_header()', which is a function that yields true
  if we should skip the stale entry, or false if we should consider it.

- In check_stale_header() we now check if the DNS_DBFIND_STALEOK option
  is set, if that is the case we know that this new search for stale
  records was made due to a failure in a normal resolution, so we keep
  track of the time in which the failured occured in rbtdb.c:4559:
  header->last_refresh_fail_ts = search->now;

- In check_stale_header(), if DNS_DBFIND_STALEOK is not set, then we
  know this is a normal lookup, if the record is stale and the query
  time is between last failure time + stale-refresh-time window, then
  we return false so cache_find() knows it can consider this stale
  rrset entry to return as a response.

The last additions are two new methods to the database interface:
- setservestale_refresh
- getservestale_refresh

Those were added so rbtdb can be aware of the value set in configuration
option, since in that level we have no access to the view object.
2020-11-11 15:59:56 -03:00
Mark Andrews
d44390d2ac Merge branch '2211-tsan-error-previous_closest_nsec-dns_rbt_findnode-vs-subtractrdataset-v9_16' into 'v9_16'
Address TSAN error between dns_rbt_findnode() and subtractrdataset().

See merge request isc-projects/bind9!4384
2020-11-10 21:41:31 +00:00
Mark Andrews
30c96198e8 Address TSAN error between dns_rbt_findnode() and subtractrdataset().
Having dns_rbt_findnode() in previous_closest_nsec() check of
node->data is a optimisation that triggers a TSAN error with
subtractrdataset().  find_closest_nsec() still needs to check if
the NSEC record are active or not and look for a earlier NSEC records
if it isn't.  Set DNS_RBTFIND_EMPTYDATA so node->data isn't referenced
without the node lock being held.

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: read M1, read M2):
    #0 dns_rbt_findnode lib/dns/rbt.c:1708
    #1 previous_closest_nsec lib/dns/rbtdb.c:3760
    #2 find_closest_nsec lib/dns/rbtdb.c:3942
    #3 zone_find lib/dns/rbtdb.c:4091
    #4 dns_db_findext lib/dns/db.c:536
    #5 query_lookup lib/ns/query.c:5582
    #6 ns__query_start lib/ns/query.c:5505
    #7 query_setup lib/ns/query.c:5229
    #8 ns_query_start lib/ns/query.c:11380
    #9 ns__client_request lib/ns/client.c:2166
    #10 processbuffer netmgr/tcpdns.c:230
    #11 dnslisten_readcb netmgr/tcpdns.c:309
    #12 read_cb netmgr/tcp.c:832
    #13 <null> <null>
    #14 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M3):
    #0 subtractrdataset lib/dns/rbtdb.c:7133
    #1 dns_db_subtractrdataset lib/dns/db.c:742
    #2 diff_apply lib/dns/diff.c:368
    #3 dns_diff_apply lib/dns/diff.c:459
    #4 do_one_tuple lib/dns/update.c:247
    #5 update_one_rr lib/dns/update.c:275
    #6 delete_if_action lib/dns/update.c:689
    #7 foreach_rr lib/dns/update.c:471
    #8 delete_if lib/dns/update.c:716
    #9 dns_update_signaturesinc lib/dns/update.c:1948
    #10 receive_secure_serial lib/dns/zone.c:15637
    #11 dispatch lib/isc/task.c:1152
    #12 run lib/isc/task.c:1344
    #13 <null> <null>

    Location is heap block of size 130 at 0x000000000028 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 create_node lib/dns/rbt.c:2239
    #9 dns_rbt_addnode lib/dns/rbt.c:1202
    #10 dns_rbtdb_create lib/dns/rbtdb.c:8668
    #11 dns_db_create lib/dns/db.c:118
    #12 receive_secure_db lib/dns/zone.c:16154
    #13 dispatch lib/isc/task.c:1152
    #14 run lib/isc/task.c:1344
    #15 <null> <null>

    Mutex M1 (0x000000000040) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8527
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M2 (0x000000000044) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M3 (0x000000000046) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/rbt.c:1708 in dns_rbt_findnode

(cherry picked from commit 244f84a84b)
2020-11-11 08:21:39 +11:00
Michal Nowak
49daa32601 Merge branch 'mnowak/test-with-DDEBUG-v9_16' into 'v9_16'
[v9_16] Enable debug build on Tumbleweed in CI

See merge request isc-projects/bind9!4371
2020-11-10 19:05:38 +00:00
Michal Nowak
3b0a93c5c8 Enable debug build on Tumbleweed in CI
(cherry picked from commit 59a09b5db8)
2020-11-10 17:29:48 +01:00
Matthijs Mekking
1782d51626 Merge branch 'matthijs-query-header-cleanup-v9_16' into 'v9_16'
Cleanup query.h duplicate definitions (9.16)

See merge request isc-projects/bind9!4382
2020-11-10 15:33:43 +00:00
Matthijs Mekking
a6755ce7f8 Cleanup duplicate definitions in query.h
(cherry picked from commit 31692744cc47eef7ad6b41aeb53f5566ca6e7efe)
2020-11-10 15:50:20 +01:00
Mark Andrews
197845f7d0 Merge branch '2252-ns_client_sendraw-is-missing-dnstap-support-v9_16' into 'v9_16'
Resolve "ns_client_sendraw() is missing DNSTAP support."

See merge request isc-projects/bind9!4379
2020-11-10 07:41:14 +00:00
Mark Andrews
572e9c0b20 Add CHANGES not for [GL #2252]
(cherry picked from commit 157e3a98f2)
2020-11-10 17:59:28 +11:00
Mark Andrews
23d2d95d28 Check that DNSTAP captures forwarded UPDATE responses
(cherry picked from commit 2b7128fede)
2020-11-10 17:59:04 +11:00
Mark Andrews
14fe29b76d Implement DNSTAP support in ns_client_sendraw()
ns_client_sendraw() is currently only used to relay UPDATE
responses back to the client.  dns_dt_send() is called with
this assumption.

(cherry picked from commit b09727a765)
2020-11-10 17:59:04 +11:00
Mark Andrews
100ef8a63d Merge branch '2259-zone_namerd_tostr-called-w-o-lock-being-held-v9_16' into 'v9_16'
Lock zone before calling zone_namerd_tostr()

See merge request isc-projects/bind9!4377
2020-11-10 06:52:38 +00:00
Mark Andrews
5340176c36 Lock zone before calling zone_namerd_tostr()
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 inline_raw lib/dns/zone.c:1375
    #1 zone_namerd_tostr lib/dns/zone.c:15316
    #2 dns_zone_name lib/dns/zone.c:15391
    #3 xfrin_log lib/dns/xfrin.c:1605
    #4 xfrin_destroy lib/dns/xfrin.c:1477
    #5 dns_xfrin_detach lib/dns/xfrin.c:739
    #6 xfrin_connect_done lib/dns/xfrin.c:970
    #7 tcpdnsconnect_cb netmgr/tcpdns.c:786
    #8 tcp_connect_cb netmgr/tcp.c:292
    #9 <null> <null>
    #10 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M1):
    #0 zone_shutdown lib/dns/zone.c:14462
    #1 dispatch lib/isc/task.c:1152
    #2 run lib/isc/task.c:1344
    #3 <null> <null>

    Location is heap block of size 2769 at 0x000000000013 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 dns_zone_create lib/dns/zone.c:984
    #9 configure_zone bin/named/server.c:6502
    #10 do_addzone bin/named/server.c:13391
    #11 named_server_changezone bin/named/server.c:13788
    #12 named_control_docommand bin/named/control.c:207
    #13 control_command bin/named/controlconf.c:392
    #14 dispatch lib/isc/task.c:1152
    #15 run lib/isc/task.c:1344
    #16 <null> <null>

(cherry picked from commit 84f43903da)
2020-11-10 17:16:31 +11:00
Mark Andrews
ccfcd55fa4 Merge branch '2239-fctx-id-is-uninitialized-and-effectively-unused-2' into 'v9_16'
Resolve "fctx:id is uninitialized and effectively unused"

See merge request isc-projects/bind9!4347
2020-11-09 22:12:40 +00:00
Mark Andrews
e554daa76c fctx->id was not initalised 2020-11-09 21:48:22 +00:00
Artem Boldariev
2ef19fbcf1 Merge branch 'artem/fix-DEBUG-build-backport' into 'v9_16'
Fix build with DEBUG defined (-DDEBUG) (Backport of !4351)

See merge request isc-projects/bind9!4365
2020-11-06 11:06:46 +00:00
Artem Boldariev
e8106afe43 Fix build with DEBUG defined (-DDEBUG)
The problem was introduced by commit 98b55eb4.
2020-11-06 12:58:19 +02:00
Michał Kępień
39467188d2 Merge branch 'michal/miscellaneous-windows-tweaks-v9_16' into 'v9_16'
[v9_16] Miscellaneous Windows tweaks

See merge request isc-projects/bind9!4360
2020-11-05 14:09:58 +00:00
Michał Kępień
1f26fa2588 Fix detection of CMake-built libuv on Windows
As of libuv 1.36.0, CMake is the only supported build method for libuv
on Windows.  Account for that fact by adjusting the relevant paths and
DLL file names used in the win32utils/Configure script.  Update
Windows-specific documentation accordingly.

(cherry picked from commit 64a091d587)
2020-11-05 15:07:01 +01:00
Michał Kępień
e5c88a590d Use "image" key in Windows GitLab CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key for
determining the Windows Docker image to use for a given CI job.  Update
.gitlab-ci.yml to reflect that change.

(cherry picked from commit 004ca913f2)
2020-11-05 15:07:00 +01:00
Michał Kępień
3e082ef7dc Merge branch 'michal/rpz-system-test-fix-fast-expire-v9_16' into 'v9_16'
[v9_16] "rpz" system test: fix intermittent false positive (expired RPZ zone)

See merge request isc-projects/bind9!4359
2020-11-05 07:19:43 +00:00
Michał Kępień
64ca2e0061 Wait for the "fast-expire" zone to be transferred
In order for a "fast-expire/IN: response-policy zone expired" message to
be logged in ns3/named.run, the "fast-expire" zone must first be
transferred in by that server.  However, with unfavorable timing, ns3
may be stopped before it manages to fetch the "fast-expire" zone from
ns5 and after the latter has been reconfigured to no longer serve that
zone.  In such a case, the "rpz" system test will report a false
positive for the relevant check.  Prevent that from happening by
ensuring ns3 manages to transfer the "fast-expire" zone before getting
shut down.

(cherry picked from commit 39191052ad)
2020-11-05 07:55:36 +01:00
Matthijs Mekking
1e8cab780b Merge branch 'matthijs-test-multi-signer-model-v9_16' into 'v9_16'
Test multi signer model (v9.16)

See merge request isc-projects/bind9!4358
2020-11-04 14:54:45 +00:00
Matthijs Mekking
67b9e80b1e kasp test: Use DEFAULT_ALGORITHM in tests.sh
Some setup scripts uses DEFAULT_ALGORITHM in their dnssec-policy
and/or initial signing. The tests still used the literal values
13, ECDSAP256SHA256, and 256. Replace those occurrences where
appropriate.

(cherry picked from commit 518dd0bb17)
2020-11-04 14:28:19 +01:00
Matthijs Mekking
a0a4f7e318 Add a test for RFC 8901 signer model 2
The new 'dnssec-policy' was already compatible with multi-signer
model 2, now we also have a test for it.

(cherry picked from commit 7e0ec9f624)
2020-11-04 14:28:10 +01:00
Mark Andrews
80ae731b0e Merge branch '2244-nta-related-crash-after-reconfiguring-views-v9_16' into 'v9_16'
Resolve "NTA-related crash after reconfiguring views"

See merge request isc-projects/bind9!4352
2020-11-03 13:13:17 +00:00
Mark Andrews
8a180af667 Add CHANGES for [GL #2244]
(cherry picked from commit 2ef0f252a8)
2020-11-03 23:50:02 +11:00
Mark Andrews
b0f477df87 Call nta_detach() before dns_view_weakdetach() so view is available.
(cherry picked from commit ea956976d1)
2020-11-03 23:49:24 +11:00
Michał Kępień
711d954789 Merge branch '2237-fix-cross-compilation' into 'v9_16'
Fix cross-compilation

See merge request isc-projects/bind9!4312
2020-11-02 11:31:27 +00:00
Michał Kępień
f522a10801 Add CHANGES entry 2020-11-02 12:27:55 +01:00
Michał Kępień
35ca6df072 Fix cross-compilation
Using AC_RUN_IFELSE() in configure.ac breaks cross-compilation:

    configure: error: cannot run test program while cross compiling

Commit 978c7b2e89 caused AC_RUN_IFELSE()
to be used instead of AC_LINK_IFELSE() because the latter had seemingly
been causing the check for --wrap support in the linker to not work as
expected.  However, it later turned out that the problem lied elsewhere:
a minus sign ('-') was missing from the LDFLAGS variable used in the
relevant check [1].

Revert to using AC_LINK_IFELSE() for checking whether the linker
supports the --wrap option in order to make cross-compilation possible
again.

[1] see commit cfa4ea64bc
2020-11-02 12:27:55 +01:00
Michał Kępień
9ba5a4f6f8 Merge branch 'michal/sync-PLATFORMS-with-PLATFORMS.md' into 'v9_16'
Sync PLATFORMS with PLATFORMS.md

See merge request isc-projects/bind9!4339
2020-10-30 11:03:47 +00:00
Michał Kępień
188d130cc2 Sync PLATFORMS with PLATFORMS.md 2020-10-30 11:50:14 +01:00
Michał Kępień
74888fc997 Merge branch 'mnowak/OpenBSD_6.8-v9_16' into 'v9_16'
[v9_16] Update to OpenBSD 6.8

See merge request isc-projects/bind9!4336
2020-10-30 10:03:13 +00:00
Michal Nowak
f1066b3b41 Update to OpenBSD 6.8
(cherry picked from commit 773649f413)
2020-10-30 10:39:59 +01:00
Michał Kępień
2111bd5bc5 Merge branch '2231-miscellaneous-backtrace-fixes' into 'v9_16'
Miscellaneous backtrace fixes

See merge request isc-projects/bind9!4325
2020-10-30 08:16:30 +00:00
Michał Kępień
923c443389 Fix getrbp()
The following compiler warning is emitted for the BACKTRACE_X86STACK
part of lib/isc/backtrace.c:

    backtrace.c: In function ‘getrbp’:
    backtrace.c:142:1: warning: no return statement in function returning non-void [-Wreturn-type]

While getrbp() stores the value of the RBP register in the RAX register
and thus does attempt to return a value, this is not enough for an
optimizing compiler to always produce the expected result.  With -O2,
the following machine code may be generated in isc_backtrace_gettrace():

    0x00007ffff7b0ff7a <+10>:	mov    %rbp,%rax
    0x00007ffff7b0ff7d <+13>:	mov    $0x17,%eax
    0x00007ffff7b0ff82 <+18>:	retq

The above is equivalent to:

    sp = (void **)getrbp();
    return (ISC_R_NOTFOUND);

and results in the backtrace never getting printed.

Fix by using an intermediate variable.  With this change in place, the
machine code generated with -O2 becomes something like:

    0x00007ffff7af5638 <+24>:	mov    $0x17,%eax
    0x00007ffff7af563d <+29>:	mov    %rbp,%rdx
    0x00007ffff7af5640 <+32>:	test   %rdx,%rdx
    0x00007ffff7af5643 <+35>:	je     0x7ffff7af56bd <isc_backtrace_gettrace+157>
    ...
    0x00007ffff7af56bd <+157>:	retq

(Note that this method of grabbing a stack trace is finicky anyway
because in order for RBP to be relied upon, -fno-omit-stack-frame must
be present among CFLAGS.)
2020-10-30 09:12:50 +01:00
Michał Kępień
10d7055791 Check for _Unwind_Backtrace() support
Some operating systems (e.g. Linux, FreeBSD) provide the
_Unwind_Backtrace() function in libgcc_s.so, which is automatically
linked into any binary using the functions provided by that library.  On
OpenBSD, though, _Unwind_Backtrace() is provided by libc++abi.so, which
is not automatically linked into binaries produced by the stock system C
compiler.

Meanwhile, lib/isc/backtrace.c assumes that any GNU-compatible toolchain
allows _Unwind_Backtrace() to be used without any extra provisions in
the build system.  This causes build failures on OpenBSD (and possibly
other systems).

Instead of making assumptions, actually check for _Unwind_Backtrace()
support in the toolchain if the backtrace() function is unavailable.
2020-10-30 09:12:50 +01:00
Michał Kępień
1d0269a2a7 Merge branch '2228-fix-the-make-depend-check-in-gitlab-ci' into 'v9_16'
Fix the "make depend" check in GitLab CI

See merge request isc-projects/bind9!4316
2020-10-30 07:55:30 +00:00
Michał Kępień
1b5a8a914c Do not test "make depend" for out-of-tree builds
The make/mkdep script does not understand the concept of generated
source files (like lib/dns/dnstap.pb-c.c), which prevents it from
working correctly for out-of-tree builds.  As "make depend" is not
required for building BIND and the "depend" make target was removed
altogether in the development branch, just prevent the "make depend"
check from being performed for out-of-tree builds in GitLab CI instead
of trying to add support for handling generated source files to
make/mkdep.
2020-10-30 08:49:16 +01:00
Michał Kępień
0ab099ca09 Fix the "make depend" check in GitLab CI
"make depend" prints errors to stderr, not to stdout.  This means that
the check for "make depend" errors currently used in the definition of
every build job in GitLab CI could never fail.  Fix that check by
redirecting stderr to stdout.  Also employ tee to prevent the output of
"make depend" from being hidden in the job log.  (While using tee hides
the exit code of "make depend" itself, the next line still checks for
errors anyway.)
2020-10-30 08:49:16 +01:00
Mark Andrews
0a0ef9a9b3 Merge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey-as-bogus-v9_16' into 'v9_16'
Resolve "Resolver sometimes treats signed, insecure zone with broken DNSKEY as bogus"

See merge request isc-projects/bind9!4332
2020-10-29 22:44:20 +00:00
Mark Andrews
d598da406d Add CHANGES note for [GL #2236]
(cherry picked from commit decf117eb6)
2020-10-30 09:19:12 +11:00
Mark Andrews
939e735e2c Check that a zone in the process of being signed resolves
ans10 simulates a local anycast server which has both signed and
unsigned instances of a zone.  'A' queries get answered from the
signed instance.  Everything else gets answered from the unsigned
instance.  The resulting answer should be insecure.

(cherry picked from commit d7840f4b93)
2020-10-30 09:19:12 +11:00
Mark Andrews
903c1136ef Handle DNS_R_NCACHENXRRSET in fetch_callback_{dnskey,validator}()
DNS_R_NCACHENXRRSET can be return when zones are in transition state
from being unsigned to signed and signed to unsigned.  The validation
should be resumed and should result in a insecure answer.

(cherry picked from commit 718e597def)
2020-10-30 08:21:43 +11:00
Michal Nowak
01bc68bc72 Merge branch 'mnowak/add-freebsd12.2-v9_16' into 'v9_16'
[v9_16] Update to FreeBSD 12.2

See merge request isc-projects/bind9!4329
2020-10-29 15:52:49 +00:00
Michal Nowak
283f0c1e75 Update to FreeBSD 12.2
(cherry picked from commit 11ab0528d9)
2020-10-29 16:28:01 +01:00
Michal Nowak
58a8873228 Merge branch 'mnowak/add-fedora-33-v9_16' into 'v9_16'
[v9_16] Add Fedora 33

See merge request isc-projects/bind9!4327
2020-10-29 15:18:42 +00:00
Michal Nowak
91e28d1fb4 Add Fedora 33
(cherry picked from commit 914be61ff8c5a3e0395acd980486c1b4cd656d20)
2020-10-29 14:00:19 +01:00
Ondřej Surý
02bdaa48fe Merge branch '2227-tcp-connection-closed-fix-v9_16' into 'v9_16'
Resolve "BIND 9.16.8 assertion failure"

See merge request isc-projects/bind9!4324
2020-10-29 12:51:38 +00:00
Witold Kręcicki
0f1810efb2 Add CHANGES and release note for GL #2227
(cherry picked from commit cd3117b747)
2020-10-29 13:23:25 +01:00
Witold Kręcicki
e1c75d00b7 Properly handle outer TCP connection closed in TCPDNS.
If the connection is closed while we're processing the request
we might access TCPDNS outerhandle which is already reset. Check
for this condition and call the callback with ISC_R_CANCELED result.

(cherry picked from commit c41ce8e0c9)
2020-10-29 13:21:55 +01:00
Evan Hunt
0ba073a1b8 Merge branch 'each-rpz-test-typo-v9_16' into 'v9_16'
fix a typo in rpz test

See merge request isc-projects/bind9!4321
2020-10-29 06:15:14 +00:00
Evan Hunt
bc9a1b0b2d fix a typo in rpz test
"tcp-only" was not being tested correctly in the RPZ system test
because the option to the "digcmd" function that causes queries to
be sent via TCP was misspelled in one case, and was being interpreted
as a query name.

the "ckresult" function has also been changed to be case sensitive
for consistency with "digcmd".

(cherry picked from commit 78af071c11)
2020-10-28 22:38:55 -07:00
Michal Nowak
f2a228d2fa Merge branch 'mnowak/test-coverage-visualization-v9_16' into 'v9_16'
Enable Test Coverage Visualization for merge requests

See merge request isc-projects/bind9!4314
2020-10-27 14:57:36 +00:00
Michal Nowak
2c9892ed1d Enable Test Coverage Visualization for merge requests
This feature allows GitLab to visualize test coverage information in the
file diff view of merge requests.

This commit makes the gcov CI job depend on the following chain of jobs:

    gcc:buster:amd64 → unit:gcc:buster:amd64 → system:gcc:buster:amd64

The reason for running the last two jobs above sequentially rather than
in parallel is that both of them create *.gcda files (containing
coverage data) in the same locations.  While some way of merging these
files from different job artifact archives could probably be designed
with the help of additional tools, the simplest thing to do is not to
run unit test and system test jobs in parallel, carrying *.gcda files
over between jobs as gcov knows how to append coverage data to existing
*.gcda files.

Also note that test coverage will not be visualized if any of the jobs
in the above dependency chain fails (because the gcov job will not be
run).

(cherry picked from commit 2dabf328c4)
2020-10-27 15:57:06 +01:00
Michal Nowak
93efe7685c Merge branch 'mnowak/enhanced-test-portability-v9_16' into 'v9_16'
[v9_16] POSIX compatibility fixes to system test

See merge request isc-projects/bind9!4311
2020-10-27 14:25:34 +00:00
Michal Nowak
175f03f5db Replace a seq invocation with a shell loop
seq is not portable.  Use a while loop instead to make the "dnssec"
system test script POSIX-compatible.

(cherry picked from commit c0c4c024c6)
2020-10-27 12:26:03 +01:00
Michal Nowak
3e937a8c7c Get rid of bashisms in string comparisons
The double equal sign ('==') is a Bash-specific string comparison
operator.  Ensure the single equal sign ('=') is used in all POSIX shell
scripts in the system test suite in order to retain their portability.

(cherry picked from commit 481dfb9671)
2020-10-27 12:26:03 +01:00
Michal Nowak
fee71478c5 Merge branch 'mnowak/add-stress-test-to-CI-v9_16' into 'v9_16'
[v9_16] Add "stress" tests to GitLab CI

See merge request isc-projects/bind9!4307
2020-10-26 17:11:56 +00:00
Michal Nowak
06f721fdc5 Add "stress" tests to GitLab CI
Run "stress" tests for scheduled pipelines and pipelines created for
tags.  These tests were previously only performed manually (as part of
pre-release testing of each new BIND version).  Their purpose is to
detect memory leaks and potential performance issues.

As the run time of each "stress" test itself is set to 1 hour, set the
GitLab CI job timeout to 2 hours in order to account for the extra time
needed to set the test up and gather its results.

(cherry picked from commit 39305411e8)
2020-10-26 18:04:53 +01:00
Michal Nowak
8643bc7a7a Merge branch 'mnowak/openbsd-fix-gdb-in-system-test-v9_16' into 'v9_16'
[v9_16] Fix system test backtrace generation on OpenBSD

See merge request isc-projects/bind9!4304
2020-10-26 15:58:13 +00:00
Michal Nowak
659feff963 Fix system test backtrace generation on OpenBSD
On Linux core dump contains absolute path to crashed binary

    Core was generated by `/home/newman/isc/ws/bind9/bin/named/.libs/lt-named -D glue-ns1 -X named.lock -m'.

However, on OpenBSD there's only a basename

    Core was generated by `named'.

This commit adds support for the latter, retains the former.

(cherry picked from commit f0b13873a3)
2020-10-26 15:01:52 +01:00
Mark Andrews
e657199696 Merge branch '2226-tsan-error-in-dispatch-c-v9_16' into 'v9_16'
Hold qid->lock when calling deref_portentry() as

See merge request isc-projects/bind9!4302
2020-10-23 20:56:48 +00:00
Mark Andrews
2a5d2c55aa Hold qid->lock when calling deref_portentry() as
socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>

(cherry picked from commit 5c253c416d)
2020-10-24 07:14:47 +11:00
Mark Andrews
0a5ab32400 Merge branch '2215-dns_zoneflag_noixfr-is-misnamed-v9_16' into 'v9_16'
DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR

See merge request isc-projects/bind9!4300
2020-10-23 13:53:25 +00:00
Mark Andrews
2e264a4ae2 DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR
(cherry picked from commit 3a044444bd)
2020-10-24 00:26:25 +11:00
Evan Hunt
dd9e8a313b Merge branch '2221-netmgr-fixes-from-unit-testing-v9_16' into 'v9_16'
Fix the problems found when writing the unit test for netmgr

See merge request isc-projects/bind9!4294
2020-10-22 22:53:04 +00:00
Evan Hunt
b252fd5fd8 CHANGES
(cherry picked from commit 58a0e95976)
2020-10-22 15:01:12 -07:00
Ondřej Surý
bca8604bf3 Fix the data race when read-writing sock->active by using cmpxchg
(cherry picked from commit 8797e5efd5)
2020-10-22 15:00:07 -07:00
Ondřej Surý
74378ea4f4 Ignore and don't log ISC_R_NOTCONNECTED from uv_accept()
When client disconnects before the connection can be accepted, the named
would log a spurious log message:

    error: Accepting TCP connection failed: socket is not connected

We now ignore the ISC_R_NOTCONNECTED result code and log only other
errors

(cherry picked from commit 5ef71c420f)
2020-10-22 15:00:07 -07:00
Ondřej Surý
301e4145de Fix the isc_nm_closedown() to actually close the pending connections
1. The isc__nm_tcp_send() and isc__nm_tcp_read() was not checking
   whether the socket was still alive and scheduling reads/sends on
   closed socket.

2. The isc_nm_read(), isc_nm_send() and isc_nm_resumeread() have been
   changed to always return the error conditions via the callbacks, so
   they always succeed.  This applies to all protocols (UDP, TCP and
   TCPDNS).

(cherry picked from commit f7c82e406e)
2020-10-22 15:00:00 -07:00
Ondřej Surý
5547657bce Fix the way tcp_send_direct() is used
There were two problems how tcp_send_direct() was used:

1. The tcp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_tcp_send()), but the isc__nm_async_tcpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_tcp_send(), when the TCP send is already in the right
   netthread, it uses tcp_send_direct() to send the TCP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit 6af08d1ca6)
2020-10-22 14:59:01 -07:00
Ondřej Surý
e0ebd02b9c Detach the sock->server in uv_close() callback, not before
(cherry picked from commit d72bc3eb52)
2020-10-22 14:59:01 -07:00
Ondřej Surý
e18f3fd003 Explicitly stop reading before closing the nmtcpsocket
When closing the socket that is actively reading from the stream, the
read_cb() could be called between uv_close() and close callback when the
server socket has been already detached hence using sock->statichandle
after it has been already freed.

(cherry picked from commit 97b33e5bde)
2020-10-22 14:59:01 -07:00
Witold Kręcicki
63e923364f Proper handling of socket references in case of TCP conn failure.
(cherry picked from commit ff0a336d52)
2020-10-22 14:59:00 -07:00
Witold Kręcicki
b4e27a075a Don't crash if isc_uv_export returns an error in accept_connection.
isc_uv_export can return an error - e.g. EMFILE (from dup), handle this
nicely.

(cherry picked from commit ae9a6befa8)
2020-10-22 14:59:00 -07:00
Ondřej Surý
81085bbeca Fix the way udp_send_direct() is used
There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit afca2e3b21)
2020-10-22 14:59:00 -07:00
Michal Nowak
970e1821cc Merge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests-v9_16' into 'v9_16'
[v9_16] Ensure use of "echo_i" where possible

See merge request isc-projects/bind9!4290
2020-10-22 10:50:27 +00:00
Michal Nowak
47862fc559 Ensure use of "echo_i" where possible
In many instances 'echo "I:' construct was used where echo_i function
should have been.
2020-10-22 12:15:15 +02:00
Michał Kępień
216273c73b Merge branch 'v9_16_8-release' into 'v9_16'
Merge 9.16.8 release branch

See merge request isc-projects/bind9!4288
2020-10-22 07:16:08 +00:00
Michał Kępień
09b9dffd46 Set up release notes for BIND 9.16.9 2020-10-22 09:14:31 +02:00
Michał Kępień
f8c9f78684 Bump BIND_BASELINE_VERSION for ABI checks 2020-10-22 09:14:31 +02:00
Michał Kępień
3f28a134cf Bump BIND_BASELINE_VERSION for respdiff tests 2020-10-22 09:14:31 +02:00
Tinderbox User
48760b31f5 Merge branch 'prep-release' into v9_16_8-release 2020-10-22 09:09:07 +02:00
Michał Kępień
b8b7b55f3f Merge branch 'michal/prepare-release-notes-for-bind-9.16.8' into 'v9_16_8-release'
Prepare release notes for BIND 9.16.8

See merge request isc-private/bind9!217
2020-10-22 09:09:07 +02:00
Tinderbox User
44e91206a4 prep 9.16.8 2020-10-22 09:09:07 +02:00
Michał Kępień
a38a76d455 Prepare release notes for BIND 9.16.8 2020-10-22 09:09:07 +02:00
Michał Kępień
7adc616d7e Reorder release notes 2020-10-22 09:09:07 +02:00
Michał Kępień
92d513c235 Tweak and reword release notes 2020-10-22 09:09:07 +02:00
Michał Kępień
df8fd53b0f Tweak and reword recent CHANGES entries 2020-10-22 09:09:07 +02:00
Michał Kępień
6cf77e7c26 Minor ARM formatting tweak 2020-10-22 09:09:07 +02:00
Diego dos Santos Fronza
7280362005 Merge branch '1736-stub-zone-foiled-by-minimal-responses-v9_16' into 'v9_16'
Resolve "stub zone foiled by minimal-responses"

See merge request isc-projects/bind9!4282
2020-10-21 17:41:57 +00:00
Diego Fronza
34f1196f36 Add CHANGES entry 2020-10-21 14:04:43 -03:00
Diego Fronza
be98c78802 Adjusted additional system test (NS, non-root zone)
After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.
2020-10-21 12:12:57 -03:00
Diego Fronza
69e6bea835 Added test for the proposed fix
This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.
2020-10-21 12:12:36 -03:00
Diego Fronza
d5355b8105 Always return address records in additional section for NS queries 2020-10-21 12:12:22 -03:00
Diego Fronza
7a3dbbc395 Fix transfer of glue records in stub zones if master has minimal-responses set
Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.
2020-10-21 12:11:31 -03:00
Matthijs Mekking
aff8cb334d Merge branch '2208-tcp4recverr-stat-miscount-v9_16' into 'v9_16'
Don't increment network error stats on UV_EOF

See merge request isc-projects/bind9!4277
2020-10-21 06:34:19 +00:00
Matthijs Mekking
5c0b5b64e5 Don't increment network error stats on UV_EOF
When networking statistics was added to the netmgr (in commit
5234a8e00a), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.

(cherry picked from commit 6c5ff94218)
2020-10-20 14:05:09 +00:00
Diego dos Santos Fronza
b4ad8cb93d Merge branch '2195-freebsd-dnstap-system-test-failure-v9_16' into 'v9_16'
Fix dnstap system test on FreeBSD

See merge request isc-projects/bind9!4275
2020-10-20 13:57:41 +00:00
Diego Fronza
64ae91c62a Fix dnstap system test on FreeBSD
This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.
2020-10-20 10:22:50 -03:00
Mark Andrews
35df5e7a31 Merge branch 'marka-fix-not-enough-categories-v9_16' into 'v9_16'
Drop the expected minimum number of buckets to 4.

See merge request isc-projects/bind9!4265
2020-10-15 02:14:15 +00:00
Mark Andrews
7147e4f93a Drop the expected minimum number of buckets to 4.
The previous value of 5 produced too many false errors.

(cherry picked from commit 0abb49034e)
2020-10-15 12:32:11 +11:00
Mark Andrews
a5965e80ed Merge branch 'marka-rrl-mdig-burst-v9_16' into 'v9_16'
Try to improve rrl timing

See merge request isc-projects/bind9!4263
2020-10-15 01:11:06 +00:00
Mark Andrews
07017d0a8e Try to improve rrl timing
Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

(cherry picked from commit 92cdc7b6c7)
2020-10-15 11:41:20 +11:00
Mark Andrews
55eacc6945 Merge branch '2209-tsan-error-bin-named-controlconf-c-related-v9_16' into 'v9_16'
Complete the isc_nmhandle_detach() in the worker thread.

See merge request isc-projects/bind9!4262
2020-10-15 00:39:43 +00:00
Mark Andrews
da0a7a34ec Complete the isc_nmhandle_detach() in the worker thread.
isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

(cherry picked from commit f95ba8aa20)
2020-10-15 11:03:47 +11:00
Ondřej Surý
51a1303646 Merge branch 'ondrej/little-socket-fixes-v9_16' into 'v9_16'
Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

See merge request isc-projects/bind9!4254
2020-10-08 07:05:58 +00:00
Ondřej Surý
dbf2d0b15f Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro
In set_sndbuf() we were using ISC_PLATFORM_HAVEIPV6 macro that doesn't
exist anymore, because we assume that IPv6 support is always available.

(cherry picked from commit 96ac91a18a)
2020-10-08 09:03:08 +02:00
Ondřej Surý
cb49657a10 Merge branch 'ondrej/clean-netmgr-callback-locks-v9_16' into 'v9_16'
Clean netmgr callback locks (v9.16)

See merge request isc-projects/bind9!4252
2020-10-08 06:50:23 +00:00
Ondřej Surý
53d6a11a0e Clone the csock in accept_connection(), not in callback
If we clone the csock (children socket) in TCP accept_connection()
instead of passing the ssock (server socket) to the call back and
cloning it there we unbreak the assumption that every socket is handled
inside it's own worker thread and therefore we can get rid of (at least)
callback locking.

(cherry picked from commit e8b56acb49)
2020-10-08 08:16:54 +02:00
Ondřej Surý
69e6c8467c Change the isc__nm_tcpdns_stoplistening() to be asynchronous event
The isc__nm_tcpdns_stoplistening() would call isc__nmsocket_clearcb()
that would clear the .accept_cb from non-netmgr thread.  Change the
tcpdns_stoplistening to enqueue ievent that would get processed in the
right netmgr thread to avoid locking.

(cherry picked from commit d86a74d8a4)
2020-10-08 08:16:53 +02:00
Mark Andrews
9708b644ae Merge branch '2204-investigate-pipeline-system-test-failure-v9_16' into 'v9_16'
Restore the dns_message_reset() call before the dns_dispatch_getnext()

See merge request isc-projects/bind9!4249
2020-10-08 05:43:19 +00:00
Mark Andrews
84922b2dc7 Restore the dns_message_reset() call before the dns_dispatch_getnext()
This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.

(cherry picked from commit 1f63bb15b3)
2020-10-08 16:27:10 +11:00
Michał Kępień
35c3f4b7f3 Merge branch 'matthijs-kasp-test-requires-python-v9_16' into 'v9_16'
The kasp system test requires Python

See merge request isc-projects/bind9!4244
2020-10-07 20:20:47 +00:00
Matthijs Mekking
1b99fa8683 Merge branch 'he32-test-fix-v9_16' into 'v9_16'
Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4236
2020-10-07 13:30:41 +00:00
Havard Eidnes
cf19c9d3ba Avoid a non-standard bashism: use of "==" in "test".
(cherry picked from commit 7c3f62082bb0c6776ff560f0aef09ad2dfdf77ea)
2020-10-07 13:29:55 +00:00
Matthijs Mekking
5d3c4baad0 The kasp system test requires Python
Only run the "kasp" system test if the path to the Python interpreter is
set.
2020-10-07 14:14:14 +02:00
Mark Andrews
c913ac48d0 Merge branch 'marka-create_query-fix-REVERSE_INULL-v9_16' into 'v9_16'
Silence Coverity REVERSE_INULL report

See merge request isc-projects/bind9!4238
2020-10-06 12:56:03 +00:00
Mark Andrews
33d7b5b56f Silence Coverity REVERSE_INULL report
message does not need to be tested to NULL

(cherry picked from commit f0a66cb5aa)
2020-10-06 23:37:13 +11:00
Ondřej Surý
b618d41fae Merge branch '2183-dns-flag-day-2020-v9_16' into 'v9_16'
Resolve "DNS Flag Day 2020"

See merge request isc-projects/bind9!4229
2020-10-06 12:22:05 +00:00
Ondřej Surý
45b081f406 Add text describing the changes done in the MR in more detail
(cherry picked from commit 096d41b4e2)
2020-10-06 09:35:21 +02:00
Ondřej Surý
4d2390c0b9 Adjust legacy tests for default 1232 EDNS Buffer Size
* legacy test was just expecting default server EDNS buffer size to be 4096,
  the test needed the adjustment to reset the buffer sizes back to 4096.

(cherry picked from commit 354a2e102d5b8b0a73c9bcea14a4af7091ed6e31)
2020-10-06 09:35:21 +02:00
Ondřej Surý
b2ebbaf4a0 Adjust digdelv tests for default 1232 EDNS Buffer Size
* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

(cherry picked from commit f1556f8c41)
2020-10-06 09:35:20 +02:00
Ondřej Surý
58a518adca Change the default ENDS buffer size to 1232 for DNS Flag Day 2020
The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the minimal
required changes by changing the defaults for `edns-udp-size`,
`max-udp-size` and `nocookie-udp-size` to `1232` (the value picked by
DNS Flag Day 2020).

(cherry picked from commit bb990030d3)
2020-10-06 09:35:20 +02:00
Mark Andrews
4a707c4f87 Merge branch 'marka-run-sh-fixups-v9_16' into 'v9_16'
run.sh fixups for v9 16

See merge request isc-projects/bind9!4233
2020-10-06 06:22:00 +00:00
Mark Andrews
2614cc7610 run.sh failed to exit with a error code when it should
* if a core was detected 'status' was not updated.
* if a tsan or asan error was detected 'status' was not updated.
2020-10-06 06:03:59 +00:00
Mark Andrews
387e2e0c06 run.sh failed to report when system test failed. 2020-10-06 06:03:59 +00:00
Mark Andrews
0ded546c6e Merge branch 'marka-rndc-rst-fix-dnssec' into 'v9_16'
rndc.rst fix dnssec markup

See merge request isc-projects/bind9!4232
2020-10-06 06:01:05 +00:00
Mark Andrews
a1714cf4da incorrect markup in rndc.rst lead to bad layout 2020-10-06 11:09:05 +11:00
Ondřej Surý
ccb04c6f72 Merge branch 'ondrej/refactor-setsockopt-v9_16' into 'v9_16'
Refactor the setsockopt() code in network manager into helper functions (v9.16)

See merge request isc-projects/bind9!4228
2020-10-05 14:37:48 +00:00
Ondřej Surý
ccd2902a02 Split reusing the addr/port and load-balancing socket options
The SO_REUSEADDR, SO_REUSEPORT and SO_REUSEPORT_LB has different meaning
on different platform. In this commit, we split the function to set the
reuse of address/port and setting the load-balancing into separate
functions.

The libuv library already have multiplatform support for setting
SO_REUSEADDR and SO_REUSEPORT that allows binding to the same address
and port, but unfortunately, when used after the load-balancing socket
options have been already set, it overrides the previous setting, so we
need our own helper function to enable the SO_REUSEADDR/SO_REUSEPORT
first and then enable the load-balancing socket option.

(cherry picked from commit fd975a551d)
2020-10-05 16:19:23 +02:00
Ondřej Surý
5cff119533 Use uv_os_sock_t instead of uv_os_fd_t for sockets
On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef
to int.  That's not true on Windows, where uv_os_sock_t is SOCKET and
uv_os_fd_t is HANDLE and they differ in level of indirection.

(cherry picked from commit acb6ad9e3c)
2020-10-05 16:19:23 +02:00
Ondřej Surý
601fc37efe Refactor isc__nm_socket_freebind() to take fd and sa_family as args
The isc__nm_socket_freebind() has been refactored to match other
isc__nm_socket_...() helper functions and take uv_os_fd_t and
sa_family_t as function arguments.

(cherry picked from commit 9dc01a636b)
2020-10-05 16:19:23 +02:00
Ondřej Surý
c3d721b13b Add helper function to enable DF (don't fragment) flag on UDP sockets
This commits add isc__nm_socket_dontfrag() helper functions.

(cherry picked from commit d685bbc822)
2020-10-05 16:19:23 +02:00
Ondřej Surý
72b85a4100 Add SO_REUSEPORT and SO_INCOMING_CPU helper functions
The setting of SO_REUSE**** and SO_INCOMING_CPU have been moved into a
separate helper functions.

(cherry picked from commit 5daaca7146)
2020-10-05 16:19:23 +02:00
Matthijs Mekking
525750de71 Merge branch '1749-rndc-dnssec-rollover-v9_16' into 'v9_16'
Resolve "rndc trigger rollover"

See merge request isc-projects/bind9!4226
2020-10-05 09:49:00 +00:00
Matthijs Mekking
a87fb09eb4 Use default algorithm in kasp test if possible
These tests don't require a specific algorithm so they should use
the DEFAULT_ALGORITHM from 'conf.sh.common'.

(cherry picked from commit 78c09f5622)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
63652ca58f Use explicit result codes for 'rndc dnssec' cmd
It is better to add new result codes than to overload existing codes.

(cherry picked from commit 70d1ec432f)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
6bbb2a8581 Various rndc dnssec -checkds fixes
While working on 'rndc dnssec -rollover' I noticed the following
(small) issues:

- The key files where updated with hints set to "-when" and that
  should always be "now.
- The kasp system test did not properly update the test number when
  calling 'rndc dnssec -checkds' (and ensuring that works).
- There was a missing ']' in the rndc.c help output.

(cherry picked from commit edc53fc416)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
5bbecc5116 Test rndc rollover inactive key
When users (accidentally) try to roll an inactive key, throw an error.

(cherry picked from commit fcd34abb9e)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
4d0dc466b5 Add rndc dnssec -rollover command
This command is similar in arguments as -checkds so refactor the
'named_server_dnssec' function accordingly.  The only difference
are that:

- It does not take a "publish" or "withdrawn" argument.
- It requires the key id to be set (add a check to make sure).

Add tests that will trigger rollover immediately and one that
schedules a test in the future.

(cherry picked from commit e826facadb)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
ad48f07c9a Add manual key rollover logic
Add to the keymgr a function that will schedule a rollover. This
basically means setting the time when the key needs to retire,
and updating the key lifetime, then update the state file. The next
time that named runs the keymgr the new lifetime will be taken into
account.

(cherry picked from commit df8276aef0)
2020-10-05 11:20:35 +02:00
Matthijs Mekking
9ea2a33f7e Merge branch '1870-fix-after-backport-to-9_11_s-v9_16' into 'v9_16'
Change condition for rndc dumpdb -expired

See merge request isc-projects/bind9!4225
2020-10-05 09:19:24 +00:00
Matthijs Mekking
79f9a5ddd5 Change condition for rndc dumpdb -expired
After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.

(cherry picked from commit 5614454c3b)
2020-10-05 10:46:14 +02:00
Matthijs Mekking
fb68194882 Merge branch '2171-dnssec-policy-weird-algo-15-bug-v9_16' into 'v9_16'
Resolve "dnssec-policy behaviour for algorithm 15 keys different to algorithm 8 keys"

See merge request isc-projects/bind9!4222
2020-10-02 09:19:39 +00:00
Matthijs Mekking
1b69a49c6e Fix a timing issue in kasp system test
Sometimes, not all keys have been created in time before 'check_keys'
is called. Run a 'retry_quiet' on checking the number of keys before
continuing checking the key data.

(cherry picked from commit af3b014976)
2020-10-02 10:19:07 +02:00
Matthijs Mekking
456925d6ec Fix kasp min key size bug
The minimal size for RSASHA1, RSASHA256 is 512, but due to bad
assignment it was set to 1024.

(cherry picked from commit 7c555254fe)
2020-10-02 10:18:59 +02:00
Matthijs Mekking
0e07dbe263 Test migration to dnssec-policy with views
This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.

(cherry picked from commit 621093fe69)
2020-10-02 10:18:52 +02:00
Matthijs Mekking
d31297c9f8 Minor fix in kasp system test
The 'wait_for_nsec' does not need to add TSIG because it calls
'dig_with_opts' and that already checks for TSIG.

(cherry picked from commit 43c6806779)
2020-10-02 10:18:44 +02:00
Matthijs Mekking
795139a60c Add change and note for #2171
This is a bug that needs to be noted.

(cherry picked from commit d6d41e96a3)
2020-10-02 10:18:35 +02:00
Matthijs Mekking
a63dad13da Fix Ed25519 and Ed448 in dnssec-policy keymgr
The kasp code had bad implicit size values for the cryptographic
algorithms Ed25519 and Ed448. When creating keys they would never
match the dnssec-policy, leading to new attempts to create keys.

These algorithms were previously not yet added to the system tests,
due to lack of availability on some systems.

(cherry picked from commit 0e207392ec)
2020-10-02 10:18:25 +02:00
Matthijs Mekking
91a686c031 Add kasp tests for Ed25519 and Ed448
Use the testcrypto script to see if these algorithms are supported by
openssl. If so, add the specific configuration to the named.conf file
and touch a file to indicate support. If the file exists, the
corresponding setup and tests are performed.

(cherry picked from commit 7be1835795)
2020-10-02 10:18:17 +02:00
Michał Kępień
d93a6c2007 Merge branch '2139-rrset-order-fixes-and-cleanups-v9_16' into 'v9_16'
[v9_16] "rrset-order" fixes and cleanups

See merge request isc-projects/bind9!4218
2020-10-02 07:19:19 +00:00
Michał Kępień
4cd7008635 Add CHANGES entries
(cherry picked from commit 27c815a220)
2020-10-02 08:52:42 +02:00
Michał Kępień
9fe54084aa Rework "rrset-order" documentation
Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.

(cherry picked from commit 2ac04dc930)
2020-10-02 08:52:42 +02:00
Michał Kępień
502d79ae4f Add tests for "order none" RRset ordering rules
Make sure "order none" RRset ordering rules are tested in the
"rrsetorder" system test just like all other rule types are.  As the
check for the case of no "rrset-order" rule matching a given RRset also
tests "order none" (rather than "order random", as the test code may
suggest at first glance), replace the test code for that case so that it
matches other "order none" tests.

(cherry picked from commit abdd4c89fc)
2020-10-02 08:51:29 +02:00
Michał Kępień
9e62c206c6 Allow "order none" in "rrset-order" rules
named-checkconf treats the following configuration as valid:

    options {
        rrset-order {
            order none;
        };
    };

Yet, the above configuration causes named to crash on startup with:

    order.c:74: REQUIRE(mode == 0x00000800 || mode == 0x00000400 || mode == 0x00800000) failed, back trace

Add DNS_RDATASETATTR_NONE to the list of RRset ordering modes accepted
by dns_order_add() to allow "order none" to be used in "rrset-order"
rules.  This both prevents the aforementioned crashes and addresses the
discrepancy between named-checkconf and named.

(cherry picked from commit dbcf683c1a)
2020-10-02 08:50:51 +02:00
Ondřej Surý
0bdfa2aa9f Merge branch 'ondrej/fix-split-string-warnings-clang-12-v9_16' into 'v9_16'
Fix the clang 12 warnings with multi-line strings in string arrays

See merge request isc-projects/bind9!4212
2020-10-01 16:47:21 +00:00
Ondřej Surý
50db10b7ca Fix the clang 12 warnings with multi-line strings in string arrays
The clang 12 has a new warning that warns when using multi-line strings
in the string arrays, f.e.:

    { "aa",
      "b"
      "b",
      "cc" }

would generate warning like this:

    private_test.c:162:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "33333/RSASHA1" };
                                      ^
    private_test.c:161:7: note: place parentheses around the string literal to silence warning
                                      "Done removing signatures for key "
                                      ^
    private_test.c:197:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "NSEC chain",
                                      ^
    private_test.c:196:7: note: place parentheses around the string literal to silence warning
                                      "Removing NSEC3 chain 1 0 30 DEAF / creating "
                                      ^
    2 errors generated.

(cherry picked from commit 7b07f22969)
2020-10-01 18:42:11 +02:00
Ondřej Surý
23ad0bcfa1 Merge branch 'ondrej/cherry-picked-netmgr-v9_16' into 'v9_16'
Synchronize the netmgr changes with main branch

See merge request isc-projects/bind9!4211
2020-10-01 16:30:38 +00:00
Ondřej Surý
7a90ad1fe2 Add separate prefetch nmhandle to ns_client_t
As the query_prefetch() or query_rpzfetch() could be called during
"regular" fetch, we need to introduce separate storage for attaching
the nmhandle during prefetching the records.  The query_prefetch()
and query_rpzfetch() are guarded for re-entrance by .query.prefetch
member of ns_client_t, so we can reuse the same .prefetchhandle for
both.

(cherry picked from commit d4976e0ebe)
2020-10-01 18:09:35 +02:00
Evan Hunt
4b6b3e4158 CHANGES
(cherry picked from commit e460e321bd)
2020-10-01 18:09:35 +02:00
Evan Hunt
b8db702a0c fix LD_WRAP test in configure
The LD_WRAP test in configure was broken, and failed to
indicate LD_WRAP support correctly, resulting in some unit
tests failing to run.

(cherry picked from commit cfa4ea64bc)
2020-10-01 18:09:35 +02:00
Ondřej Surý
1126fe3b5b Refactor the pausing/unpausing and finishing the nm_thread
The isc_nm_pause(), isc_nm_resume() and finishing the nm_thread() from
nm_destroy() has been refactored, so all use the netievents instead of
directly touching the worker structure members.  This allows us to
remove most of the locking as the .paused and .finished members are
always accessed from the matching nm_thread.

When shutting down the nm_thread(), instead of issuing uv_stop(), we
just shutdown the .async handler, so all uv_loop_t events are properly
finished first and uv_run() ends gracefully with no outstanding active
handles in the loop.

(cherry picked from commit e5ab137ba3)
2020-10-01 18:09:35 +02:00
Witold Kręcicki
4a7dfd69ac tracing of active sockets and handles
If NETMGR_TRACE is defined, we now maintain a list of active sockets
in the netmgr object and a list of active handles in each socket
object; by walking the list and printing `backtrace` in a debugger
we can see where they were created, to assist in in debugging of
reference counting errors.

On shutdown, if netmgr finds there are still active sockets after
waiting, isc__nm_dump_active() will be called to log the list of
active sockets and their underlying handles, along with some details
about them.

(cherry picked from commit 00e04a86c8)
2020-10-01 18:09:35 +02:00
Evan Hunt
686b73ae25 limit the time we wait for netmgr to be destroyed
if more than 10 seconds pass while we wait for netmgr events to
finish running on shutdown, something is almost certainly wrong
and we should assert and crash.

(cherry picked from commit 2f2d60a989)
2020-10-01 18:09:35 +02:00
Evan Hunt
a73e807a46 add more logging to the shutdown system test
the test server running in shutdown/resolver was not logging
any debug info, which made it difficult to diagnose test failures.

(cherry picked from commit cc7ceace7d)
2020-10-01 18:09:35 +02:00
Ondřej Surý
5a92958fba properly lock the setting/unsetting of callbacks in isc_nmsocket_t
changes to socket callback functions were not thread safe.

(cherry picked from commit 89c534d3b9)
2020-10-01 18:09:35 +02:00
Evan Hunt
ba2e9dfb99 change from isc_nmhandle_ref/unref to isc_nmhandle attach/detach
Attaching and detaching handle pointers will make it easier to
determine where and why reference counting errors have occurred.

A handle needs to be referenced more than once when multiple
asynchronous operations are in flight, so callers must now maintain
multiple handle pointers for each pending operation. For example,
ns_client objects now contain:

        - reqhandle:    held while waiting for a request callback (query,
                        notify, update)
        - sendhandle:   held while waiting for a send callback
        - fetchhandle:  held while waiting for a recursive fetch to
                        complete
        - updatehandle: held while waiting for an update-forwarding
                        task to complete

(cherry picked from commit 57b4dde974)
2020-10-01 18:09:35 +02:00
Witold Kręcicki
0202b289c2 assorted small netmgr-related changes
- rename isc_nmsocket_t->tcphandle to statichandle
- cancelread functions now take handles instead of sockets
- add a 'client' flag in socket objects, currently unused, to
  indicate whether it is to be used as a client or server socket

(cherry picked from commit 7eb4564895)
2020-10-01 16:44:43 +02:00
Evan Hunt
7a4e97ef50 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.

(cherry picked from commit 38264b6a4d)
2020-10-01 16:44:43 +02:00
Witold Kręcicki
f0b089d922 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-10-01 16:44:43 +02:00
Evan Hunt
bc5ea9d65e use handles for isc_nm_pauseread() and isc_nm_resumeread()
by having these functions act on netmgr handles instead of socket
objects, they can be used in callback functions outside the netgmr.

(cherry picked from commit 55896df79d)
2020-10-01 16:44:43 +02:00
Evan Hunt
1263201732 don't use exclusive mode for rndc commands that don't need it
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.

(cherry picked from commit 002c328437)
2020-10-01 16:44:43 +02:00
Evan Hunt
6b77bd309a Don't destroy a non-closed socket, wait for all the callbacks.
We erroneously tried to destroy a socket after issuing
isc__nm_tcp{,dns}_close. Under some (race) circumstances we could get
nm_socket_cleanup to be called twice for the same socket, causing an
access to a dead memory.

(cherry picked from commit 233f134a4f)
2020-10-01 16:44:43 +02:00
Witold Kręcicki
5a0fbc41ec Fix possible race in isc__nm_tcpconnect.
There's a possibility of race in isc__nm_tcpconnect if the asynchronous
connect operation finishes with all the callbacks before we exit the
isc__nm_tcpconnect itself we might access an already freed memory.
Fix it by creating an additional reference to the socket freed at the
end of isc__nm_tcpconnect.

(cherry picked from commit 896db0f419)
2020-10-01 16:44:43 +02:00
Witold Kręcicki
ebb4d506d6 Add missing libisc.def definitions, netmgr version of isc_sockettype_t.
(cherry picked from commit 25f84ffc68)
2020-10-01 16:44:43 +02:00
Evan Hunt
b14cb9e2f1 restore "blackhole" functionality
the blackhole ACL was accidentally disabled with respect to client
queries during the netmgr conversion.

in order to make this work for TCP, it was necessary to add a return
code to the accept callback functions passed to isc_nm_listentcp() and
isc_nm_listentcpdns().

(cherry picked from commit 23c7373d68)
2020-10-01 16:44:43 +02:00
Evan Hunt
0a58a8e049 update the acl system test to include a blackhole test case
this ACL was previously untested, which allowed a regression to
go undetected.

(cherry picked from commit e3ee138098)
2020-10-01 16:44:43 +02:00
Evan Hunt
80569bf977 Make netmgr tcpdns send calls asynchronous
isc__nm_tcpdns_send() was not asynchronous and accessed socket
internal fields in an unsafe manner, which could lead to a race
condition and subsequent crash. Fix it by moving tcpdns processing
to a proper netmgr thread.

(cherry picked from commit 591b79b597)
2020-10-01 16:44:43 +02:00
Witold Kręcicki
3942b226b8 Fix a shutdown race in netmgr udp
We need to mark the socket as inactive early (and synchronously)
in the stoplistening process; otherwise we might destroy the
callback argument before we actually stop listening, and call
the callback on bad memory.

(cherry picked from commit 1cf65cd882)
2020-10-01 16:44:43 +02:00
Evan Hunt
ca39572e5d clean up outerhandle when a tcpdns socket is disconnected
this prevents a crash when some non-netmgr thread, such as a
recursive lookup, times out after the TCP socket is already
disconnected.

(cherry picked from commit 3704c4fff2)
2020-10-01 16:44:43 +02:00
Evan Hunt
f64a881a30 change the signature of recv callbacks to include a result code
this will allow recv event handlers to distinguish between cases
in which the region is NULL because of error, shutdown, or cancelation.

(cherry picked from commit 75c985c07f)
2020-10-01 16:44:43 +02:00
Evan Hunt
d9d482e9e2 implement isc_nm_cancelread()
The isc_nm_cancelread() function cancels reading on a connected
socket and calls its read callback function with a 'result'
parameter of ISC_R_CANCELED.

(cherry picked from commit 5191ec8f86)
2020-10-01 16:44:43 +02:00
Evan Hunt
e1ebbaacea shorten the sleep in isc_nm_destroy()
when isc_nm_destroy() is called, there's a loop that waits for
other references to be detached, pausing and unpausing the netmgr
to ensure that all the workers' events are run, followed by a
1-second sleep. this caused a delay on shutdown which will be
noticeable when netmgr is used in tools other than named itself,
so the delay has now been reduced to a hundredth of a second.

(cherry picked from commit 870204fe47)
2020-10-01 16:44:43 +02:00
Evan Hunt
a9061ea123 implement isc_nm_tcpconnect()
the isc_nm_tcpconnect() function establishes a client connection via
TCP.  once the connection is esablished, a callback function will be
called with a newly created network manager handle.

(cherry picked from commit abbb79f9d1)
2020-10-01 16:44:43 +02:00
Witold Kręcicki
8db2ef9f8e allow tcpdns sockets to self-reference while connected
A TCPDNS socket creates a handle for each complete DNS message.

Previously, when all the handles were disconnected, the socket
would be closed, but the wrapped TCP socket might still have
more to read.

Now, when a connection is established, the TCPDNS socket creates
a reference to itself by attaching itself to sock->self. This
reference isn't cleared until the connection is closed via
EOF, timeout, or server shutdown. This allows the socket to remain
open even when there are no active handles for it.

(cherry picked from commit cd79b49538)
2020-10-01 16:44:43 +02:00
Evan Hunt
4209f051e9 modify reference counting within netmgr
- isc__nmhandle_get() now attaches to the sock in the nmhandle object.
  the caller is responsible for dereferencing the original socket
  pointer when necessary.
- tcpdns listener sockets attach sock->outer to the outer tcp listener
  socket. tcpdns connected sockets attach sock->outerhandle to the handle
  for the tcp connected socket.
- only listener sockets need to be attached/detached directly. connected
  sockets should only be accessed and reference-counted via their
  associated handles.

(cherry picked from commit 5ea26ee1f1)
2020-10-01 16:44:43 +02:00
Evan Hunt
573bcdf932 make isc_nmsocket_{attach,detach}{} functions private
there is no need for a caller to reference-count socket objects.
they need tto be able tto close listener sockets (i.e., those
returned by isc_nm_listen{udp,tcp,tcpdns}), and an isc_nmsocket_close()
function has been added for that. other sockets are only accessed via
handles.

(cherry picked from commit 9e740cad21)
2020-10-01 16:44:43 +02:00
Ondřej Surý
826ddb246e Revert the tree to allow cherry-picking netmgr changes from main
The following reverted changes will be picked again as part of the
netmgr sync with main branch.

Revert "Merge branch '1996-confidential-issue-v9_16' into 'security-v9_16'"

This reverts commit e160b1509f, reversing
changes made to c01e643715.

Revert "Merge branch '2038-use-freebind-when-bind-fails-v9_16' into 'v9_16'"

This reverts commit 5f8ecfb918, reversing
changes made to 23021385d5.

Revert "Merge branch '1936-blackhole-fix-v9_16' into 'v9_16'"

This reverts commit f20bc90a72, reversing
changes made to 490016ebf1.

Revert "Merge branch '1938-fix-udp-race' into 'v9_16'"

This reverts commit 0a6c7ab2a9, reversing
changes made to 4ea84740e6.

Revert "Merge branch '1947-fix-tcpdns-race' into 'v9_16'"

This reverts commit 4ea84740e6, reversing
changes made to d761cd576b.
2020-10-01 16:44:43 +02:00
Mark Andrews
354fc9da47 Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime-v9_16' into 'v9_16'
Resolve "Allow task_test subtests to be selected at runtime."

See merge request isc-projects/bind9!4209
2020-10-01 13:15:11 +00:00
Mark Andrews
2b4f4cbbd0 Add the ability select individual tests to rdata_test
(cherry picked from commit 6293682020)
2020-10-01 22:57:47 +10:00
Mark Andrews
119630ec4b Add the ability to print out the list of test names (-l)
(cherry picked from commit a9c3374717)
2020-10-01 22:57:46 +10:00
Mark Andrews
6583a9437f Add the ability to select tests to run
task_test [-t <test_name>]

(cherry picked from commit 76837484e7)
2020-10-01 22:57:43 +10:00
Mark Andrews
8746e496c7 Alphabetise tests
(cherry picked from commit 96febe6b38)
2020-10-01 22:56:16 +10:00
Mark Andrews
5aeab366af Merge branch '2191-missing-locks-when-accessing-keynode-initial-and-keynode-managed-triggering-tsan-v9_16' into 'v9_16'
Add missing rwlock calls when access keynode.initial and keynode.managed

See merge request isc-projects/bind9!4207
2020-10-01 08:34:49 +00:00
Mark Andrews
fc3cab22a4 Add missing rwlock calls when access keynode.initial and keynode.managed
WARNING: ThreadSanitizer: data race
    Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_keynode_trust lib/dns/keytable.c:836
    #1 keyfetch_done lib/dns/zone.c:10187
    #2 dispatch lib/isc/task.c:1152
    #3 run lib/isc/task.c:1344
    #4 <null> <null>

    Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: read M2):
    #0 keynode_dslist_totext lib/dns/keytable.c:682
    #1 dns_keytable_totext lib/dns/keytable.c:732
    #2 named_server_dumpsecroots bin/named/server.c:11357
    #3 named_control_docommand bin/named/control.c:264
    #4 control_command bin/named/controlconf.c:390
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Location is heap block of size 241 at 0x000000000010 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 new_keynode lib/dns/keytable.c:346
    #9 insert lib/dns/keytable.c:393
    #10 dns_keytable_add lib/dns/keytable.c:421
    #11 process_key bin/named/server.c:955
    #12 load_view_keys bin/named/server.c:983
    #13 configure_view_dnsseckeys bin/named/server.c:1140
    #14 configure_view bin/named/server.c:5371
    #15 load_configuration bin/named/server.c:9110
    #16 loadconfig bin/named/server.c:10310
    #17 named_server_reconfigcommand bin/named/server.c:10693
    #18 named_control_docommand bin/named/control.c:250
    #19 control_command bin/named/controlconf.c:390
    #20 dispatch lib/isc/task.c:1152
    #21 run lib/isc/task.c:1344
    #22 <null> <null>

    Mutex M1 is already destroyed.

    Mutex M2 is already destroyed.

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/keytable.c:836 in dns_keynode_trust

(cherry picked from commit 840cf7adb3)
2020-10-01 18:14:37 +10:00
Ondřej Surý
4d28d725ab Merge branch 'ondrej/remove-dot-at-start-of-the-line-rst-v9_16' into 'v9_16'
Remove the .key from the beginning of the line in rst file

See merge request isc-projects/bind9!4204
2020-09-30 20:56:36 +00:00
Ondřej Surý
920018c496 Regenerate couple of generated files 2020-09-30 22:14:39 +02:00
Ondřej Surý
35a06c476d Remove the .key from the beginning of the line in rst file
The handling of . (dot) characted at the beginning of the line has
changed between the sphinx-doc versions, and it was constantly giving us
trouble when generating man pages when using different sphinx-doc.  This
commit just changes the source rst file, so there's no more . (dot) the
beginning of the line.

(cherry picked from commit a00ca65ae6)
2020-09-30 21:43:04 +02:00
Mark Andrews
7d443004d4 Merge branch '2180-threadsanitizer-data-race-bin-named-server-c-9678-25-in-view_loaded-v9_16' into 'v9_16'
make (named_server_t).reload_status atomic

See merge request isc-projects/bind9!4202
2020-09-30 15:03:25 +00:00
Mark Andrews
c99cf25ac9 make (named_server_t).reload_status atomic
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1:
    #0 view_loaded bin/named/server.c:9678:25
    #1 call_loaddone lib/dns/zt.c:308:3
    #2 doneloading lib/dns/zt.c:582:3
    #3 zone_asyncload lib/dns/zone.c:2322:3
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Previous read of size 4 at 0x000000000001 by thread T2:
    #0 named_server_status bin/named/server.c:11903:14
    #1 named_control_docommand bin/named/control.c:272:12
    #2 control_command bin/named/controlconf.c:390:17
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Location is heap block of size 409 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713:8
    #2 mem_get lib/isc/mem.c:622:8
    #3 mem_allocateunlocked lib/isc/mem.c:1268:8
    #4 isc___mem_allocate lib/isc/mem.c:1288:7
    #5 isc__mem_allocate lib/isc/mem.c:2453:10
    #6 isc___mem_get lib/isc/mem.c:1037:11
    #7 isc__mem_get lib/isc/mem.c:2432:10
    #8 named_server_create bin/named/server.c:9978:27
    #9 setup bin/named/main.c:1256:2
    #10 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race bin/named/server.c:9678:25 in view_loaded

(cherry picked from commit b00ba7ac94)
2020-10-01 00:47:53 +10:00
Mark Andrews
439714c0ea Merge branch '2190-in-new-yaml-output-when-truncation-is-query-time-usec-v9_16' into 'v9_16'
Resolve "dig: "-u" (microsecond timestamp precision) does not work in YAML output mode"

See merge request isc-projects/bind9!4201
2020-09-30 14:30:24 +00:00
Mark Andrews
a57735719d add CHANGES
(cherry picked from commit b7512e87b1)
2020-10-01 00:14:45 +10:00
Mark Andrews
a750617445 Output timestamps in yaml to the microsecond if -u is specified.
(cherry picked from commit 3fe7fa3db2)
2020-10-01 00:14:45 +10:00
Mark Andrews
ebf16118df Add ISO time stamps to the microsecond
(cherry picked from commit 519b070618)
2020-10-01 00:14:45 +10:00
Ondřej Surý
f692a94c20 Merge branch '2124-fix-assertion-failure-in-dns-message-v9_16' into 'v9_16'
Resolve "Bind 9.16.6 Assertion failure message.c:4733: REQUIRE(msg->state == (-1)) failed"

See merge request isc-projects/bind9!4196
2020-09-30 12:53:35 +00:00
Ondřej Surý
f779b8d1b4 Add CHANGES and release note for GL #2124
(cherry picked from commit 6179a38810)
2020-09-30 14:26:44 +02:00
Ondřej Surý
f0989bdf03 The dns_message_create() cannot fail, change the return to void
The dns_message_create() function cannot soft fail (as all memory
allocations either succeed or cause abort), so we change the function to
return void and cleanup the calls.

(cherry picked from commit 33eefe9f85)
2020-09-30 14:26:26 +02:00
Diego Fronza
46f22df54c cocci: Add semantic patch to refactor dns_message_destroy()
dns_message_t objects are now being handled using reference counting
semantics, so now dns_message_destroy() is not called directly anymore,
dns_message_detach must be called instead.

(cherry picked from commit 7deaf9a93c)
2020-09-30 11:35:23 +10:00
Diego Fronza
f557681472 Properly handling dns_message_t shared references
This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a
fetchctx and the dns_message_t object held by the query may be being
used by some external module, e.g. validator, even after the query
may have been destroyed, propery handling of the references to the
message were added in this commit to avoid accessing an already
destroyed object.

Specifically, in rctx_done(), a reference to the message is attached
at the beginning of the function and detached at the end, since a
possible call to fctx_cancelquery() would release the dns_message_t
object, and in the next lines of code a call to rctx_nextserver()
or rctx_chaseds() would require a valid pointer to the same object.

In valcreate() a new reference is attached to the message object,
this ensures that if the corresponding query object is destroyed
before the validator attempts to access it, no invalid pointer
access occurs.

In validated() we have to attach a new reference to the message,
since we destroy the validator object at the beginning of the
function, and we need access to the message in the next lines of
the same function.

rctx_nextserver() and rctx_chaseds() functions were adapted to
receive a new parameter of dns_message_t* type, this was so they
could receive a valid reference to a dns_message_t since using the
response context respctx_t to access the message through
rctx->query->rmessage could lead to an already released reference
due to the query being canceled.

(cherry picked from commit cde6227a68)
2020-09-30 11:35:11 +10:00
Diego Fronza
dfa2b7a247 Fix invalid dns message state in resolver's logic
The assertion failure REQUIRE(msg->state == DNS_SECTION_ANY), caused
by calling dns_message_setclass within function resquery_response()
in resolver.c, was happening due to wrong management of dns message_t
objects used to process responses to the queries issued by the
resolver.

Before the fix, a resolver's fetch context (fetchctx_t) would hold
a pointer to the message, this same reference would then be used
over all the attempts to resolve the query, trying next server,
etc... for this to work the message object would have it's state
reset between each iteration, marking it as ready for a new processing.

The problem arose in a scenario with many different forwarders
configured, managing the state of the dns_message_t object was
lacking better synchronization, which have led it to a invalid
dns_message_t state in resquery_response().

Instead of adding unnecessarily complex code to synchronize the
object, the dns_message_t object was moved from fetchctx_t structure
to the query structure, where it better belongs to, since each query
will produce a response, this way whenever a new query is created
an associated dns_messate_t is also created.

This commit deals mainly with moving the dns_message_t object from
fetchctx_t to the query structure.

(cherry picked from commit 02f9e125c1)
2020-09-30 11:34:57 +10:00
Diego Fronza
da84f8d1fd Refactored dns_message_t for using attach/detach semantics
This commit will be used as a base for the next code updates in
order to have a better control of dns_message_t objects' lifetime.

(cherry picked from commit 12d6d13100)
2020-09-30 11:34:42 +10:00
Mark Andrews
d1bcb2fdbe Merge branch '2189-some-comments-in-lib-dns-stats-c-use-incorrect-notation-for-bit-values-v9_16' into 'v9_16'
Update comments to have binary notation

See merge request isc-projects/bind9!4192
2020-09-29 00:41:59 +00:00
Mark Andrews
0c5191f27a Update comments to have binary notation
(cherry picked from commit 6727e23a47)
2020-09-29 10:40:56 +10:00
Michał Kępień
e59400e0ea Merge branch '2177-make-native-pkcs11-require-dlopen-support' into 'v9_16'
Make native PKCS#11 require dlopen() support

See merge request isc-projects/bind9!4177
2020-09-28 07:23:12 +00:00
Michał Kępień
187dca9cf7 Make native PKCS#11 require dlopen() support
PKCS#11 support in BIND requires dlopen() support from the operating
system and thus building with "--enable-native-pkcs11 --without-dlopen"
should not be possible.  Add an Autoconf check which enforces that
constraint.  Adjust the pairwise testing model accordingly.
2020-09-28 09:21:59 +02:00
Michał Kępień
8280d1fbed Merge branch '1725-clean-up-use-of-function-wrapping' into 'v9_16'
Clean up use of function wrapping

See merge request isc-projects/bind9!4175
2020-09-28 07:20:05 +00:00
Michał Kępień
87d9d10460 Fix function overrides in unit tests on macOS
Since Mac OS X 10.1, Mach-O object files are by default built with a
so-called two-level namespace which prevents symbol lookups in BIND unit
tests that attempt to override the implementations of certain library
functions from working as intended.  This feature can be disabled by
passing the "-flat_namespace" flag to the linker.  Fix unit tests
affected by this issue on macOS by adding "-flat_namespace" to LDFLAGS
used for building all object files on that operating system (it is not
enough to only set that flag for the unit test executables).
2020-09-28 09:16:48 +02:00
Michał Kępień
e05e5d7c12 Clean up use of function wrapping
Currently, building BIND using "--without-dlopen" universally breaks
building unit tests which employ the --wrap linker option (because the
replacement functions are put in a shared library and building shared
objects requires "--with-dlopen").  Fix by moving the overridden symbol,
isc_nmhandle_unref(), to lib/ns/tests/nstest.c and dropping
lib/ns/tests/wrap.c altogether.  This makes lib/ns/tests/Makefile.in
simpler and prevents --without-dlopen from messing with the process of
building unit tests.

Remove parts of configure.ac which are made redundant by the above
changes.

Put the replacement definition of isc_nmhandle_unref() inside an #ifdef
block, so that the build does not break for non-libtool builds (see
below).

These changes allow the broadest possible set of build variants to work
while also simplifying the build process:

  - for libtool builds, overriding isc_nmhandle_unref() is done by
    placing that symbol directly in lib/ns/tests/nstest.c and relying on
    the dynamic linker to perform symbol resolution in the expected way
    when the test binary is run,

  - for non-libtool builds, overriding isc_nmhandle_unref() is done
    using the --wrap linker option (the libtool approach cannot be used
    in this case as multiple strong symbols with the same name cannot
    coexist in the same binary),

  - the "--without-dlopen" option no longer affects building unit tests.
2020-09-28 09:16:48 +02:00
Mark Andrews
6b9421cbe5 Merge branch '2185-nsdname-wait-recurse-speed-test-fails-under-tsan-v9_16' into 'v9_16'
Resolve "nsdname-wait-recurse speed test fails under tsan"

See merge request isc-projects/bind9!4188
2020-09-28 04:14:38 +00:00
Mark Andrews
e77c8b57e2 Wait for 'rpz: policy: reload done' to signalled before proceeding.
RPZ rules cannot be fully relied upon until the summary RPZ database is
updated after an "rndc reload".  Wait until the relevant message is
logged after an "rndc reload" to prevent false positives in the
"rpzrecurse" system test caused by the RPZ rules not yet being in effect
by the time ns3 is queried.

(cherry picked from commit bdf8194af8)
2020-09-28 10:15:49 +10:00
Mark Andrews
9d2628532d add test markers to ns3 named.log
(cherry picked from commit 22d10df0f0)
2020-09-28 10:12:45 +10:00
Evan Hunt
a8dbe58e69 Merge branch '1041-filter-aaaa-purge-memory-pool-upon-plugin-destruction-v9_16' into 'v9_16'
Resolve "crash in 9.14.2, possibly on shutdown, cannot reproduce"

See merge request isc-projects/bind9!4187
2020-09-25 22:42:10 +00:00
Michał Kępień
f02593acda Add CHANGES entry
5238.	[bug]		filter-aaaa: named crashed upon shutdown if it was in
			the process of recursing for A RRsets. [GL #1040]

(cherry picked from commit 555e1f446c)
2020-09-25 14:04:54 -07:00
Evan Hunt
50cc4d6a3e Purge memory pool upon plugin destruction
The typical sequence of events for AAAA queries which trigger recursion
for an A RRset at the same name is as follows:

 1. Original query context is created.
 2. An AAAA RRset is found in cache.
 3. Client-specific data is allocated from the filter-aaaa memory pool.
 4. Recursion is triggered for an A RRset.
 5. Original query context is torn down.

 6. Recursion for an A RRset completes.
 7. A second query context is created.
 8. Client-specific data is retrieved from the filter-aaaa memory pool.
 9. The response to be sent is processed according to configuration.
10. The response is sent.
11. Client-specific data is returned to the filter-aaaa memory pool.
12. The second query context is torn down.

However, steps 6-12 are not executed if recursion for an A RRset is
canceled.  Thus, if named is in the process of recursing for A RRsets
when a shutdown is requested, the filter-aaaa memory pool will have
outstanding allocations which will never get released.  This in turn
leads to a crash since every memory pool must not have any outstanding
allocations by the time isc_mempool_destroy() is called.

Fix by creating a stub query context whenever fetch_callback() is called,
including cancellation events. When the qctx is destroyed, it will ensure
the client is detached and the plugin memory is freed.

(cherry picked from commit 86eddebc83)
2020-09-25 14:04:54 -07:00
Matthijs Mekking
7212ef519b Merge branch '1870-rndc-dumpdb-expired-v9_16' into 'v9_16'
Resolve "[Support#12071] [RT#46548] Output stale/expired data with 'rndc dumpdb'"

See merge request isc-projects/bind9!4186
2020-09-25 06:46:15 +00:00
Matthijs Mekking
f521948b2b rndc dumpdb -expired: print when RRsets expired
When calling 'rndc dumpdb -expired', also print when the RRset expired.

(cherry picked from commit d14c2d0d73)
2020-09-25 08:21:24 +02:00
Matthijs Mekking
48c7c7f2a6 Add notes and CHANGES for #1870
This is a new features so it requires a CHANGE and release notes entry.

(cherry picked from commit 1728599684)
2020-09-25 08:21:14 +02:00
Matthijs Mekking
02b53d38af Handle ancient rrsets in bind_rdataset
An ancient RRset is one still in the cache but expired, and awaiting
cleanup.

(cherry picked from commit 388cc666e5)
2020-09-25 08:21:02 +02:00
Matthijs Mekking
c139f1c23b Include expired rdatasets in iteration functions
By changing the check in 'rdatasetiter_first' and 'rdatasetiter_next'
from "now > header->rdh_ttl" to "now - RBDTB_VIRTUAL > header->rdh_ttl"
we include expired rdataset entries so that they can be used for
"rndc dumpdb -expired".

(cherry picked from commit 17d5bd4493)
2020-09-25 08:20:46 +02:00
Matthijs Mekking
6214a9db9d Add test for 'rdnc dumpdb -expired'
This test makes sure that expired records are dumped with rndc's
'dumpdb' command if the '-expired' flag is used.

(cherry picked from commit 1c3e6f4045)
2020-09-25 08:20:28 +02:00
Matthijs Mekking
d784ab872c Minor changes to serve-stale tests
Minor changes are:
- Replace the "$RNDCCMD dumpdb" logic with "rndc_dumpdb" from
  conf.sh.common (it does the same thing).
- Update a comment to match the grep calls below it (comment said the
  rest should be expired, while the grep calls indicate that they
  are still in the cache, the comment now explains why).

(cherry picked from commit 86a1bbfe28)
2020-09-25 08:20:17 +02:00
Matthijs Mekking
d77283ff63 Add -expired flag to rndc dumpdb command
This flag is the same as -cache, but will use a different style format
that will also print expired entries (awaiting cleanup) from the cache.

(cherry picked from commit 8beda7d2ea)
2020-09-25 08:20:02 +02:00
Mark Andrews
faa6510fee Merge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst-v9_16' into 'v9_16'
Resolve "Add RFC8906 to list of RFCs in doc/arm/general.rst"

See merge request isc-projects/bind9!4182
2020-09-24 01:02:31 +00:00
Suzanne Goldlust
b931ee60a5 Accidentally wrote RFC8096 instead of 8906
(cherry picked from commit bc604793d3)
2020-09-24 10:33:41 +10:00
Suzanne Goldlust
fd1957c7cf Add RFC8096 to list in doc/arm/general.rst
(cherry picked from commit 4c36b6bdf0)
2020-09-24 10:33:41 +10:00
Mark Andrews
e0de2f367a Merge branch 'marka-filter-aaaa-prereq-tsan-v9_16' into 'v9_16'
filter-aaaa add prereq test for tsan [v9_16]

See merge request isc-projects/bind9!4173
2020-09-23 05:51:12 +00:00
Mark Andrews
4f6ad6987b test whether we are running under tsan 2020-09-23 05:22:09 +00:00
Mark Andrews
672b0d9c26 Merge branch '2162-threadsanitizer-data-race-in-epoll_ctl-v9_16' into 'v9_16'
It appears that you can't change what you are polling for while connecting.

See merge request isc-projects/bind9!4172
2020-09-23 05:16:12 +00:00
Mark Andrews
c4edcaf140 It appears that you can't change what you are polling for while connecting.
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 epoll_ctl <null>
    #1 watch_fd lib/isc/unix/socket.c:704:8
    #2 wakeup_socket lib/isc/unix/socket.c:897:11
    #3 process_ctlfd lib/isc/unix/socket.c:3362:3
    #4 process_fds lib/isc/unix/socket.c:3275:10
    #5 netthread lib/isc/unix/socket.c:3516:10

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 connect <null>
    #1 isc_socket_connect lib/isc/unix/socket.c:4737:7
    #2 resquery_send lib/dns/resolver.c:2892:13
    #3 fctx_query lib/dns/resolver.c:2202:12
    #4 fctx_try lib/dns/resolver.c:4300:11
    #5 resquery_connected lib/dns/resolver.c:3130:4
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Location is file descriptor 513 created by thread T2 at:
    #0 connect <null>
    #1 isc_socket_connect lib/isc/unix/socket.c:4737:7
    #2 resquery_send lib/dns/resolver.c:2892:13
    #3 fctx_query lib/dns/resolver.c:2202:12
    #4 fctx_try lib/dns/resolver.c:4300:11
    #5 resquery_connected lib/dns/resolver.c:3130:4
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M1 (0x000000000016) created at:
    #0 pthread_mutex_init <null>
    #1 isc__mutex_init lib/isc/pthreads/mutex.c:288:8
    #2 setup_thread lib/isc/unix/socket.c:3584:3
    #3 isc_socketmgr_create2 lib/isc/unix/socket.c:3825:3
    #4 create_managers bin/named/main.c:932:11
    #5 setup bin/named/main.c:1223:11
    #6 main bin/named/main.c:1523:2

    Mutex M2 is already destroyed.

    Thread T1 'isc-socket-1' (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_socketmgr_create2 lib/isc/unix/socket.c:3826:3
    #3 create_managers bin/named/main.c:932:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race in epoll_ctl

(cherry picked from commit c37b251eb9)
2020-09-23 14:22:15 +10:00
Mark Andrews
4184c42a7c Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-v9_16' into 'v9_16'
Address lock order inversions.

See merge request isc-projects/bind9!4170
2020-09-23 02:09:01 +00:00
Mark Andrews
9bd58a1c7a Address lock order inversions.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 dns_view_findzonecut lib/dns/view.c:1310:2
    #2 fctx_create lib/dns/resolver.c:5070:13
    #3 dns_resolver_createfetch lib/dns/resolver.c:10813:12
    #4 dns_resolver_prime lib/dns/resolver.c:10442:12
    #5 dns_view_find lib/dns/view.c:1176:4
    #6 dbfind_name lib/dns/adb.c:3833:11
    #7 dns_adb_createfind lib/dns/adb.c:3155:12
    #8 findname lib/dns/resolver.c:3497:11
    #9 fctx_getaddresses lib/dns/resolver.c:3808:3
    #10 fctx_try lib/dns/resolver.c:4197:12
    #11 fctx_start lib/dns/resolver.c:4824:4
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_resolver_createfetch lib/dns/resolver.c:10767:2
    #2 dns_resolver_prime lib/dns/resolver.c:10442:12
    #3 dns_view_find lib/dns/view.c:1176:4
    #4 dbfind_name lib/dns/adb.c:3833:11
    #5 dns_adb_createfind lib/dns/adb.c:3155:12
    #6 findname lib/dns/resolver.c:3497:11
    #7 fctx_getaddresses lib/dns/resolver.c:3808:3
    #8 fctx_try lib/dns/resolver.c:4197:12
    #9 fctx_start lib/dns/resolver.c:4824:4
    #10 dispatch lib/isc/task.c:1152:7
    #11 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 dns_resolver_shutdown lib/dns/resolver.c:10530:4
    #2 view_flushanddetach lib/dns/view.c:632:4
    #3 dns_view_detach lib/dns/view.c:689:2
    #4 qctx_destroy lib/ns/query.c:5152:2
    #5 fetch_callback lib/ns/query.c:5749:3
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 view_flushanddetach lib/dns/view.c:630:3
    #2 dns_view_detach lib/dns/view.c:689:2
    #3 qctx_destroy lib/ns/query.c:5152:2
    #4 fetch_callback lib/ns/query.c:5749:3
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock

(cherry picked from commit a669c919c8)
2020-09-23 01:49:56 +00:00
Mark Andrews
5651f2876e Merge branch '2109-sig0-computation-could-be-wrong-v9_16' into 'v9_16'
Resolve "kind of use-after-free condition in SIG(0) signing"

See merge request isc-projects/bind9!4169
2020-09-23 01:46:15 +00:00
Mark Andrews
028a19059e add CHANGES note
(cherry picked from commit c7406db46f)
2020-09-23 11:17:23 +10:00
Mark Andrews
9e79a7d7ce Clone the saved / query message buffers
The message buffer passed to ns__client_request is only valid for
the life of the the ns__client_request call.  Save a copy of it
when we recurse or process a update as ns__client_request will
return before those operations complete.

(cherry picked from commit f0d9bf7c30)
2020-09-23 11:17:23 +10:00
Mark Andrews
e2e7194b7c Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2-v9_16' into 'v9_16'
Break lock order loop by sending TAT in an event

See merge request isc-projects/bind9!4165
2020-09-22 13:39:39 +00:00
Mark Andrews
f2c0aa1dfe Break lock order loop by sending TAT in an event
The dotat() function has been changed to send the TAT
query asynchronously, so there's no lock order loop
because we initialize the data first and then we schedule
the TAT send to happen asynchronously.

This breaks following lock-order loops:

zone->lock (dns_zone_setviewcommit) while holding view->lock
(dns_view_setviewcommit)

keytable->lock (dns_keytable_find) while holding zone->lock
(zone_asyncload)

view->lock (dns_view_findzonecut) while holding keytable->lock
(dns_keytable_forall)

(cherry picked from commit 3c4b68af7c)
2020-09-22 23:04:44 +10:00
Mark Andrews
2d351436e5 Merge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock-v9_16' into 'v9_16'
Address lock-order-inversion

See merge request isc-projects/bind9!4163
2020-09-22 12:45:54 +00:00
Mark Andrews
0b861934b4 Address lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_wrlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:52:4
    #2 zone_postload lib/dns/zone.c:5101:2
    #3 receive_secure_db lib/dns/zone.c:16206:11
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 receive_secure_db lib/dns/zone.c:16204:2
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 get_raw_serial lib/dns/zone.c:2518:2
    #2 zone_gotwritehandle lib/dns/zone.c:2559:4
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock

(cherry picked from commit 1090876693)
2020-09-22 22:26:53 +10:00
Michał Kępień
e72d5c7e73 Merge branch 'mnowak/pairwise-configure-testing-v9_16' into 'v9_16'
[v9_16] Add pairwise testing

See merge request isc-projects/bind9!4161
2020-09-22 09:43:42 +00:00
Michal Nowak
2ee405d753 Add pairwise testing
Pairwise testing is a test case generation technique based on the
observation that most faults are caused by interactions of at most two
factors.  For BIND, its configure options can be thought of as such
factors.

Process BIND configure options into a model that is subsequently
processed by the PICT tool in order to find an effective test vector.
That test vector is then used for configuring and building BIND using
various combinations of configure options.

(cherry picked from commit 420986bf18)
2020-09-22 11:39:08 +02:00
Matthijs Mekking
70a8076951 Merge branch '2127-xml2rst-add-missing-updates-v9_16' into 'v9_16'
Resolve "Update ARM with lost changes since the conversion to RST files"

See merge request isc-projects/bind9!4160
2020-09-22 08:08:32 +00:00
Matthijs Mekking
ab9b6abe51 Improve language in documentation
Various language specific improvements, from Suzanne Goldlust's
review.

(cherry picked from commit 49e76c15dd)
2020-09-22 09:35:00 +02:00
Matthijs Mekking
b4d8db40d4 Update DNSSEC documentation
This was originally done in commit
da0ae5299f but was lost when the
documentation was converted to RST files.

(cherry picked from commit 0b0320360f)
2020-09-22 09:34:14 +02:00
Matthijs Mekking
a93a6844a9 Add a note on DNSSEC sign metrics in the ARM
This was added previously in commit
3a3f40e372 but was lost when the
documentation was converted to RST files.

(cherry picked from commit 3a3ace0f41)
2020-09-22 09:32:18 +02:00
Matthijs Mekking
1e4a405e54 Remove leftover 'dnssec-keys' references
The option 'dnssec-keys' was introduced in 9.15 and also renamed to
'trust-anchors'. Rename the leftover references to 'trust-anchors'.

(cherry picked from commit e6b335c2ab)
2020-09-22 09:32:05 +02:00
Mark Andrews
c653ea6b06 Merge branch '2158-threadsanitizer-data-race-in-memmove-v9_16' into 'v9_16'
Remove the memmove call on dns_rbtnode_t structure that contains atomics

See merge request isc-projects/bind9!4154
2020-09-21 09:54:36 +00:00
Mark Andrews
d04d43c777 Remove the memmove call on dns_rbtnode_t structure that contains atomics
Calling the plain memmove on the structure that contains atomic members
triggers following TSAN warning (even when we don't really use the
atomic members in the code):

    WARNING: ThreadSanitizer: data race
      Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
	#0 memmove <null>
	#1 memmove /usr/include/x86_64-linux-gnu/bits/string_fortified.h:40:10
	#2 deletefromlevel lib/dns/rbt.c:2675:3
	#3 dns_rbt_deletenode lib/dns/rbt.c:2143:2
	#4 delete_node lib/dns/rbtdb.c
	#5 decrement_reference lib/dns/rbtdb.c:2202:4
	#6 prune_tree lib/dns/rbtdb.c:2259:3
	#7 dispatch lib/isc/task.c:1152:7
	#8 run lib/isc/task.c:1344:2

      Previous atomic write of size 8 at 0x000000000001 by thread T2 (mutexes: read M3):
	#0 __tsan_atomic64_fetch_sub <null>
	#1 decrement_reference lib/dns/rbtdb.c:2103:7
	#2 detachnode lib/dns/rbtdb.c:5440:6
	#3 dns_db_detachnode lib/dns/db.c:588:2
	#4 qctx_clean lib/ns/query.c:5104:3
	#5 ns_query_done lib/ns/query.c:10868:2
	#6 query_sign_nodata lib/ns/query.c
	#7 query_nodata lib/ns/query.c:8438:11
	#8 query_gotanswer lib/ns/query.c
	#9 query_lookup lib/ns/query.c:5624:10
	#10 ns__query_start lib/ns/query.c:5500:10
	#11 query_setup lib/ns/query.c:5224:11
	#12 ns_query_start lib/ns/query.c:11357:8
	#13 ns__client_request lib/ns/client.c:2166:3
	#14 udp_recv_cb lib/isc/netmgr/udp.c:414:2
	#15 uv__udp_recvmsg /home/ondrej/Projects/tsan/libuv/src/unix/udp.c
	#16 uv__udp_io /home/ondrej/Projects/tsan/libuv/src/unix/udp.c:180:5
	#17 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:461:11
	#18 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5
	#19 nm_thread lib/isc/netmgr/netmgr.c:500:11

      Location is heap block of size 132 at 0x000000000030 allocated by thread T3:
	#0 malloc <null>
	#1 default_memalloc lib/isc/mem.c:713:8
	#2 mem_get lib/isc/mem.c:622:8
	#3 mem_allocateunlocked lib/isc/mem.c:1268:8
	#4 isc___mem_allocate lib/isc/mem.c:1288:7
	#5 isc__mem_allocate lib/isc/mem.c:2453:10
	#6 isc___mem_get lib/isc/mem.c:1037:11
	#7 isc__mem_get lib/isc/mem.c:2432:10
	#8 create_node lib/dns/rbt.c:2239:9
	#9 dns_rbt_addnode lib/dns/rbt.c:1435:12
	#10 findnodeintree lib/dns/rbtdb.c:2895:12
	#11 findnode lib/dns/rbtdb.c:2941:10
	#12 dns_db_findnode lib/dns/db.c:439:11
	#13 diff_apply lib/dns/diff.c:306:5
	#14 dns_diff_apply lib/dns/diff.c:459:10
	#15 do_one_tuple lib/ns/update.c:444:11
	#16 update_one_rr lib/ns/update.c:495:10
	#17 update_action lib/ns/update.c:3123:6
	#18 dispatch lib/isc/task.c:1152:7
	#19 run lib/isc/task.c:1344:2

      Mutex M1 is already destroyed.

      Mutex M2 is already destroyed.

      Mutex M3 is already destroyed.

      Thread T1 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_taskmgr_create lib/isc/task.c:1434:3
	#3 create_managers bin/named/main.c:915:11
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:223:3
	#3 create_managers bin/named/main.c:909:15
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T3 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_taskmgr_create lib/isc/task.c:1434:3
	#3 create_managers bin/named/main.c:915:11
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race in memmove

(cherry picked from commit 48d54368d5)
2020-09-21 19:21:28 +10:00
Ondřej Surý
d4e0e9eb7b Merge branch '2166-bind-9-16-7-trap-divide-error-v9_16' into 'v9_16'
Resolve "bind 9.16.7 trap divide error"

See merge request isc-projects/bind9!4152
2020-09-21 09:11:10 +00:00
Ondřej Surý
dfb2b6b833 Add CHANGES and release note for GL #2166
(cherry picked from commit 2869ca1401)
2020-09-21 10:58:37 +02:00
Ondřej Surý
0ad77036d9 Handle the errors from sysconf() call in isc_meminfo_totalphys()
isc_meminfo_totalphys() would return invalid memory size when sysconf()
call would fail, because ((size_t)-1 * -1) is very large number.

(cherry picked from commit 79ca724d46)
2020-09-21 10:58:37 +02:00
Michał Kępień
b88f1f5e06 Merge branch 'mnowak/fix-make-doc' into 'v9_16'
Enforce synchronized documentation

See merge request isc-projects/bind9!4104
2020-09-21 08:15:32 +00:00
Michal Nowak
6802be3f50 Remove documentation building toolchain
Documentation building toolchain was moved to the base Docker image some
time ago.
2020-09-21 10:11:24 +02:00
Michal Nowak
ec7f2d35a4 Enforce synchronized documentation
Add a "make maintainer-clean" step to the "docs" GitLab CI job to ensure
generated documentation does not get out of sync with its sources.
2020-09-21 10:11:24 +02:00
Michal Nowak
fdf55e3582 Build '$(MANPAGES_IN)' before 'ootsetup'
'ootsetup' target requires '$(MANPAGES_IN)', otherwise it fails after
'maintainer-clean' target.
2020-09-21 10:11:24 +02:00
Michal Nowak
8088ba4274 Rebuild documentation 2020-09-21 10:11:24 +02:00
Michał Kępień
c597044d7f Merge branch '2169-fix-updating-summary-rpz-db-for-mixed-case-rpzs-v9_16' into 'v9_16'
[v9_16] Fix updating summary RPZ DB for mixed-case RPZs

See merge request isc-projects/bind9!4151
2020-09-21 07:53:57 +00:00
Michał Kępień
742904e236 Add CHANGES entry
(cherry picked from commit e6e4922fe8)
2020-09-21 09:32:46 +02:00
Michał Kępień
62f6653a12 Add release note
(cherry picked from commit 853a51d4a9)
2020-09-21 09:32:22 +02:00
Michał Kępień
170b869294 Fix updating summary RPZ DB for mixed-case RPZs
Each dns_rpz_zone_t structure keeps a hash table of the names this RPZ
database contains.  Here is what happens when an RPZ is updated:

  - a new hash table is prepared for the new version of the RPZ by
    iterating over it; each name found is added to the summary RPZ
    database,

  - every name added to the new hash table is searched for in the old
    hash table; if found, it is removed from the old hash table,

  - the old hash table is iterated over; all names found in it are
    removed from the summary RPZ database (because at that point the old
    hash table should only contain names which are not present in the
    new version of the RPZ),

  - the new hash table replaces the old hash table.

When the new version of the RPZ is iterated over, if a given name is
spelled using a different letter case than in the old version of the
RPZ, the new variant will hash to a different value than the old
variant, which means it will not be removed from the old hash table.
When the old hash table is subsequently iterated over to remove
seemingly deleted names, the old variant of the name will still be
there, causing the name to be deleted from the summary RPZ database
(which effectively causes a given rule to be ignored).

The issue can be triggered not just by altering the case of existing
names in an RPZ, but also by adding sibling names spelled with a
different letter case.  This is because RBT code preserves case when
node splitting occurs.  The end result is that when the RPZ is iterated
over, a given name may be using a different case than in the zone file
(or XFR contents).

Fix by downcasing all names found in the RPZ database before adding them
to the summary RPZ database.

(cherry picked from commit dc8a7791bd)
2020-09-21 09:32:21 +02:00
Ondřej Surý
86f9da7964 Merge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put-v9_16' into 'v9_16'
Exclude isc_mem_isovermem from ThreadSanitizer

See merge request isc-projects/bind9!4143
2020-09-17 16:46:04 +00:00
Ondřej Surý
8b1e4a5373 Exclude isc_mem_isovermem from ThreadSanitizer
The .is_overmem member of isc_mem_t structure is intentionally accessed
unlocked as 100% accuracy isn't necessary here.

Without the attribute, following TSAN warning would show up:

    WARNING: ThreadSanitizer: data race
      Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
	#0 isc___mem_put lib/isc/mem.c:1119:19
	#1 isc__mem_put lib/isc/mem.c:2439:2
	#2 dns_rdataslab_fromrdataset lib/dns/rdataslab.c:327:2
	#3 addrdataset lib/dns/rbtdb.c:6761:11
	#4 dns_db_addrdataset lib/dns/db.c:719:10
	#5 cache_name lib/dns/resolver.c:6538:13
	#6 cache_message lib/dns/resolver.c:6628:14
	#7 resquery_response lib/dns/resolver.c:7883:13
	#8 dispatch lib/isc/task.c:1152:7
	#9 run lib/isc/task.c:1344:2

      Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: write M3):
	#0 isc_mem_isovermem lib/isc/mem.c:1553:15
	#1 addrdataset lib/dns/rbtdb.c:6866:25
	#2 dns_db_addrdataset lib/dns/db.c:719:10
	#3 addoptout lib/dns/ncache.c:281:10
	#4 dns_ncache_add lib/dns/ncache.c:101:10
	#5 ncache_adderesult lib/dns/resolver.c:6668:12
	#6 ncache_message lib/dns/resolver.c:6845:11
	#7 rctx_ncache lib/dns/resolver.c:9174:11
	#8 resquery_response lib/dns/resolver.c:7894:2
	#9 dispatch lib/isc/task.c:1152:7
	#10 run lib/isc/task.c:1344:2

      Location is heap block of size 328 at 0x000000000020 allocated by thread T3:
	#0 malloc <null>
	#1 default_memalloc lib/isc/mem.c:713:8
	#2 mem_create lib/isc/mem.c:763:8
	#3 isc_mem_create lib/isc/mem.c:2425:2
	#4 configure_view bin/named/server.c:4494:4
	#5 load_configuration bin/named/server.c:9062:3
	#6 run_server bin/named/server.c:9771:2
	#7 dispatch lib/isc/task.c:1152:7
	#8 run lib/isc/task.c:1344:2

    [...]

    SUMMARY: ThreadSanitizer: data race lib/isc/mem.c:1119:19 in isc___mem_put

(cherry picked from commit 0110d1ab17)
2020-09-17 17:35:58 +02:00
Mark Andrews
8fd71091bf Merge branch '2131-tsan-data-race-in-accessing-controls-symtab-v9_16' into 'v9_16'
Lock access to control->symtab to prevent data race

See merge request isc-projects/bind9!4138
2020-09-17 09:59:48 +00:00
Mark Andrews
76682f7882 Lock access to control->symtab to prevent data race
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 isccc_symtab_foreach lib/isccc/symtab.c:277:14
    #1 isccc_cc_cleansymtab lib/isccc/cc.c:954:2
    #2 control_recvmessage bin/named/controlconf.c:477:2
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 isccc_symtab_define lib/isccc/symtab.c:242:2
    #1 isccc_cc_checkdup lib/isccc/cc.c:1026:11
    #2 control_recvmessage bin/named/controlconf.c:478:11
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Location is heap block of size 190352 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 isccc_symtab_create lib/isccc/symtab.c:76:18
    #2 isccc_cc_createsymtab lib/isccc/cc.c:948:10
    #3 named_controls_create bin/named/controlconf.c:1483:11
    #4 named_server_create bin/named/server.c:10057:2
    #5 setup bin/named/main.c:1256:2
    #6 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race lib/isccc/symtab.c:277:14 in isccc_symtab_foreach

(cherry picked from commit 0450acc1b6)
2020-09-17 19:31:41 +10:00
Mark Andrews
c8a675bae0 Merge branch '2123-lock-order-inversions-in-main-v9_16' into 'v9_16'
Resolve "Lock order inversions in main"

See merge request isc-projects/bind9!4136
2020-09-17 08:42:44 +00:00
Mark Andrews
b7b0a4d71f Pause dbiterator ealier to prevent lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 resume_addnsec3chain lib/dns/zone.c:3776:11
    #6 rss_post lib/dns/zone.c:20659:3
    #7 setnsec3param lib/dns/zone.c:20471:3
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 rss_post lib/dns/zone.c:20658:3
    #2 setnsec3param lib/dns/zone.c:20471:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8666:5
    #2 zone_maintenance lib/dns/zone.c:11063:4
    #3 zone_timer lib/dns/zone.c:14098:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8656:13
    #6 zone_maintenance lib/dns/zone.c:11063:4
    #7 zone_timer lib/dns/zone.c:14098:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

(cherry picked from commit 9e584a4511)
2020-09-17 18:24:07 +10:00
Mark Andrews
6edd349af5 Pause the database iterator to release rwlock
(cherry picked from commit 2e63de94aa)
2020-09-17 18:24:07 +10:00
Mark Andrews
5cdc4671ec Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000001) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11119:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11089:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8502:3
    #2 zone_maintenance lib/dns/zone.c:11056:4
    #3 zone_timer lib/dns/zone.c:14091:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_current lib/dns/rbtdb.c:9695:3
    #4 dns_dbiterator_current lib/dns/dbiterator.c:101:10
    #5 zone_nsec3chain lib/dns/zone.c:8539:3
    #6 zone_maintenance lib/dns/zone.c:11056:4
    #7 zone_timer lib/dns/zone.c:14091:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit fbed962204)
2020-09-17 18:24:07 +10:00
Mark Andrews
02f09ac566 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9247:3
    #3 zone_maintenance lib/dns/zone.c:11047:4
    #4 zone_timer lib/dns/zone.c:14090:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9488:13
    #6 zone_maintenance lib/dns/zone.c:11047:4
    #7 zone_timer lib/dns/zone.c:14090:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 dns_db_getsoaserial lib/dns/db.c:780:11
    #6 dump_done lib/dns/zone.c:11428:15
    #7 dump_quantum lib/dns/masterdump.c:1487:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dump_done lib/dns/zone.c:11426:4
    #3 dump_quantum lib/dns/masterdump.c:1487:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit c9dbad97b2)
2020-09-17 18:24:07 +10:00
Mark Andrews
d36b4ed8ed Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11115:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11085:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8274:3
    #2 zone_maintenance lib/dns/zone.c:11052:4
    #3 zone_timer lib/dns/zone.c:14087:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8412:13
    #6 zone_maintenance lib/dns/zone.c:11052:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit 98025e15d0)
2020-09-17 18:24:07 +10:00
Mark Andrews
6a1cd20473 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M3 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 copy_non_dnssec_records lib/dns/zone.c:16031:11
    #6 receive_secure_db lib/dns/zone.c:16163:12
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 receive_secure_db lib/dns/zone.c:16160:16
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M3 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9244:3
    #3 zone_maintenance lib/dns/zone.c:11044:4
    #4 zone_timer lib/dns/zone.c:14087:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9485:13
    #6 zone_maintenance lib/dns/zone.c:11044:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M3 in thread T3:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 zone_get_from_db lib/dns/zone.c:5602:11
    #6 get_raw_serial lib/dns/zone.c:2520:12
    #7 zone_gotwritehandle lib/dns/zone.c:2559:4
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M3 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit e185e37137)
2020-09-17 18:24:06 +10:00
Mark Andrews
f5a8d9055f Address lock-order-inversion between the keytable and the db locks.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_find lib/dns/keytable.c:522:2
    #3 sync_keyzone lib/dns/zone.c:4560:12
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 dns_rriterator_first lib/dns/rriterator.c:71:15
    #6 sync_keyzone lib/dns/zone.c:4543:16
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_find lib/dns/rbtdb.c:4029:2
    #3 dns_db_find lib/dns/db.c:500:11
    #4 addifmissing lib/dns/zone.c:4481:11
    #5 dns_keytable_forall lib/dns/keytable.c:786:4
    #6 sync_keyzone lib/dns/zone.c:4586:2
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_forall lib/dns/keytable.c:770:2
    #3 sync_keyzone lib/dns/zone.c:4586:2
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit 9e5f83c499)
2020-09-17 18:24:06 +10:00
Michał Kępień
a3368090d7 Merge branch 'v9_16_7-release' into 'v9_16'
Merge 9.16.7 release branch

See merge request isc-projects/bind9!4132
2020-09-16 20:56:50 +00:00
Michał Kępień
b027f992a0 Set up release notes for BIND 9.16.8 2020-09-16 22:55:35 +02:00
Michał Kępień
38cf12ac7d Bump BIND_BASELINE_VERSION for ABI checks 2020-09-16 22:55:35 +02:00
Tinderbox User
4c7341f651 Merge branch 'prep-release' into v9_16_7-release 2020-09-16 22:50:39 +02:00
Michał Kępień
a58c8ba0d2 Merge branch 'michal/prepare-release-notes-for-bind-9.16.7' into 'v9_16_7-release'
Prepare release notes for BIND 9.16.7

See merge request isc-private/bind9!209
2020-09-16 22:50:38 +02:00
Tinderbox User
a4f73cfe8a prep 9.16.7 2020-09-16 22:50:38 +02:00
Michał Kępień
4cebadfc3f Prepare release notes for BIND 9.16.7 2020-09-16 22:50:38 +02:00
Michał Kępień
a7f94c9502 Add release note for OSS-Fuzz fixes 2020-09-16 22:50:38 +02:00
Michał Kępień
b3aa411651 Add release note for GL #2074 2020-09-16 22:50:38 +02:00
Michał Kępień
fafc412ec6 Tweak and reword release notes 2020-09-16 22:50:38 +02:00
Michał Kępień
8fc6a644ce Tweak and reword recent CHANGES entries 2020-09-16 22:50:38 +02:00
Michal Nowak
c1c29ab908 Miscellaneous formatting and wording tweaks 2020-09-16 22:50:38 +02:00
Mark Andrews
4a5ed9c396 Merge branch 'marka-tsan-unit-no-ignore-error-v9_16' into 'v9_16'
tsan unit no ignore error v9_16

See merge request isc-projects/bind9!4127
2020-09-16 03:50:13 +00:00
Mark Andrews
56a3b0b1b5 remove 'allow_failure: true' from unit tsan tests 2020-09-16 13:28:15 +10:00
Evan Hunt
b04ae18772 Merge branch 'each-copyright-header-v9_16' into 'v9_16'
copyright header typos

See merge request isc-projects/bind9!4120
2020-09-15 00:03:13 +00:00
Evan Hunt
df698d73f4 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Evan Hunt
5627f0c512 fix a typo in copyright headers, and change "http" to "https"
(cherry picked from commit 481a7aae44)
2020-09-14 16:47:50 -07:00
Mark Andrews
73091f4746 Merge branch '2119-the-runtime-system-tests-interfered-with-each-other-v9_16' into 'v9_16'
Resolve "The runtime system tests interfered with each other"

See merge request isc-projects/bind9!4110
2020-09-10 10:42:12 +00:00
Mark Andrews
a7be4e219e Wait for test instance of named to exit before completing subtest.
(cherry picked from commit dda5b7b0b8)
2020-09-10 20:13:03 +10:00
Mark Andrews
9d1c7316a0 Don't use production address (127.0.0.1) in runtime system test.
(cherry picked from commit 1f14705938)
2020-09-10 20:00:53 +10:00
Mark Andrews
228c28301a Merge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading-v9_16' into 'v9_16'
Also wait for 'zone_dump: zone example/IN: enter'

See merge request isc-projects/bind9!4108
2020-09-10 09:55:01 +00:00
Mark Andrews
88de1ea75a Also wait for 'zone_dump: zone example/IN: enter'
use nextpartpeek as we don't want to reset the starting point

(cherry picked from commit 7b65bea6d2)
2020-09-10 18:48:33 +10:00
Mark Andrews
0741c440f0 Merge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull-v9_16' into 'v9_16'
Silence REVERSE_INULL warning (CID 306652)

See merge request isc-projects/bind9!4106
2020-09-09 22:12:16 +00:00
Mark Andrews
2c1b6b2168 Silence REVERSE_INULL warning (CID 306652)
(cherry picked from commit 584dbffab1)
2020-09-10 07:54:19 +10:00
Evan Hunt
66b067ef71 Merge branch 'each-fix-packet-v9_16' into 'v9_16'
work around perl error

See merge request isc-projects/bind9!4105
2020-09-09 19:30:25 +00:00
Evan Hunt
22f03344f7 work around perl error
some versions of perl failed to run packet.pl because the 'last'
keyword can't be used outside of a loop block. this commit changes
the packet dumping code to a function so we can use 'return' instead.

(cherry picked from commit bf9aee1b88)
2020-09-09 12:28:59 -07:00
Mark Andrews
2118f49ca1 Merge branch '2090-main-dig-tsan-error-v9_16' into 'v9_16'
Resolve "v9_11 dig tsan error"

See merge request isc-projects/bind9!4103
2020-09-09 06:45:37 +00:00
Mark Andrews
c359fa0933 Turn off TSAN for isc_log_wouldlog
(cherry picked from commit 7b3c7f52c2)
2020-09-09 16:22:39 +10:00
Mark Andrews
6bbe46a502 make all artifacts visible
(cherry picked from commit 93dd7b1b93)
2020-09-09 16:22:39 +10:00
Mark Andrews
947bc2594b Only test node->data if we care about whether data is present or not.
WARNING: ThreadSanitizer: data race (pid=28788)
  Write of size 8 at 0x7b200002e060 by thread T1 (mutexes: write M2947):
    #0 add32 /builds/isc-projects/bind9/lib/dns/rbtdb.c:6638:18 (libdns.so.1110+0xe7843)
    #1 addrdataset /builds/isc-projects/bind9/lib/dns/rbtdb.c:6975:12 (libdns.so.1110+0xe4185)
    #2 dns_db_addrdataset /builds/isc-projects/bind9/lib/dns/db.c:783:10 (libdns.so.1110+0x650ee)
    #3 validated /builds/isc-projects/bind9/lib/dns/resolver.c:5140:11 (libdns.so.1110+0x1909f7)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)

  Previous read of size 8 at 0x7b200002e060 by thread T5 (mutexes: write M521146194917735760):
    #0 dns_rbt_findnode /builds/isc-projects/bind9/lib/dns/rbt.c:1708:9 (libdns.so.1110+0xd910d)
    #1 cache_find /builds/isc-projects/bind9/lib/dns/rbtdb.c:5098:11 (libdns.so.1110+0xe188e)
    #2 dns_db_find /builds/isc-projects/bind9/lib/dns/db.c:554:11 (libdns.so.1110+0x642bb)
    #3 dns_view_find2 /builds/isc-projects/bind9/lib/dns/view.c:1068:11 (libdns.so.1110+0x1cc2c4)
    #4 dbfind_name /builds/isc-projects/bind9/lib/dns/adb.c:3714:11 (libdns.so.1110+0x46a4b)
    #5 dns_adb_createfind2 /builds/isc-projects/bind9/lib/dns/adb.c:3133:12 (libdns.so.1110+0x45278)
    #6 findname /builds/isc-projects/bind9/lib/dns/resolver.c:3166:11 (libdns.so.1110+0x1827f0)
    #7 fctx_getaddresses /builds/isc-projects/bind9/lib/dns/resolver.c:3462:3 (libdns.so.1110+0x18032d)
    #8 fctx_try /builds/isc-projects/bind9/lib/dns/resolver.c:3819:12 (libdns.so.1110+0x17e174)
    #9 fctx_start /builds/isc-projects/bind9/lib/dns/resolver.c:4219:4 (libdns.so.1110+0x1787a3)
    #10 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #11 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)

(cherry picked from commit 71ef3a8038)
2020-09-09 16:22:39 +10:00
Mark Andrews
f6ba3ec731 Address lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=12714)
  Cycle in lock order graph: M100252 (0x7b7c00010a08) => M1171 (0x7b7400000dc8) => M100252

  Mutex M1171 acquired here while holding mutex M100252 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9585:2 (libdns.so.1110+0x1769fd)
    #2 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #3 create_fetch /builds/isc-projects/bind9/lib/dns/validator.c:1156:10 (libdns.so.1110+0x1c1e5f)
    #4 validatezonekey /builds/isc-projects/bind9/lib/dns/validator.c:2124:13 (libdns.so.1110+0x1c3b6d)
    #5 start_positive_validation /builds/isc-projects/bind9/lib/dns/validator.c:2301:10 (libdns.so.1110+0x1bfde9)
    #6 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3647:12 (libdns.so.1110+0x1bef62)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3628:2 (libdns.so.1110+0x1bee31)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 acquired here while holding mutex M1171 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_validator_destroy /builds/isc-projects/bind9/lib/dns/validator.c:3912:2 (libdns.so.1110+0x1bf788)
    #2 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4916:2 (libdns.so.1110+0x18fdfd)
    #3 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #4 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1171 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4907:2 (libdns.so.1110+0x18fc3d)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T1 'isc-worker0000' (tid=12729, running) created by main thread at:
    #0 pthread_create <null> (delv+0x42afdb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_createinctx /builds/isc-projects/bind9/lib/isc/task.c:2091:11 (libisc.so.1107+0x4f4ac)
    #4 main /builds/isc-projects/bind9/bin/delv/delv.c:1639:2 (delv+0x4b7f96)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/delv/.libs/delv+0x4483a6) in pthread_mutex_lock
(cherry picked from commit 992a79a14b)
2020-09-09 16:22:39 +10:00
Mark Andrews
5d469f2498 Address lock-order-inversion
Obtain references to view->redirect and view->managed_keys then
release view->lock so dns_zone_setviewcommit and dns_zone_setviewrevert
can obtain the view->lock while holding zone->lock.

WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=9132)
  Cycle in lock order graph: M987831431424375936 (0x000000000000) => M1012319771577875480 (0x000000000000) => M987831431424375936

  Mutex M1012319771577875480 acquired here while holding mutex M987831431424375936 in thread T2:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_zone_setviewcommit /builds/isc-projects/bind9/lib/dns/zone.c:1571:2 (libdns.so.1110+0x1d74eb)
    #2 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2388:3 (libdns.so.1110+0x1cfe29)
    #3 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #4 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #5 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #6 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #7 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #8 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #9 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2382:2 (libdns.so.1110+0x1cfde7)
    #2 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #3 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #4 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #5 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #6 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 acquired here while holding mutex M1012319771577875480 in thread T7:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_findzonecut2 /builds/isc-projects/bind9/lib/dns/view.c:1300:2 (libdns.so.1110+0x1cc93a)
    #2 dns_view_findzonecut /builds/isc-projects/bind9/lib/dns/view.c:1261:9 (libdns.so.1110+0x1cc864)
    #3 fctx_create /builds/isc-projects/bind9/lib/dns/resolver.c:4459:13 (libdns.so.1110+0x1779d3)
    #4 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9628:12 (libdns.so.1110+0x176cb6)
    #5 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #6 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:10061:12 (libdns.so.1110+0x2055a5)
    #7 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #8 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #9 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #10 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1012319771577875480 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:9951:2 (libdns.so.1110+0x204dc3)
    #2 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #3 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T2 'isc-worker0001' (tid=9163, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

  Thread T7 'isc-worker0006' (tid=9168, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/named/.libs/named+0x4642a6) in pthread_mutex_lock
(cherry picked from commit cdcfde9e65)
2020-09-09 16:22:39 +10:00
Mark Andrews
5b425046dd isc_mutex_init_errcheck prototype should not be under ISC_MUTEX_PROFILE
(cherry picked from commit 552e0b852e)
2020-09-09 16:22:38 +10:00
Mark Andrews
4881207780 Defer read of zl->server and zl->reconfig until
the reference counter has gone to zero and there is
no longer a possibility of changes in other threads.

(cherry picked from commit 9b445f33e2)
2020-09-09 16:22:38 +10:00
Mark Andrews
255f7b0b12 Merge branch '2120-the-dynamic-load-flags-are-inconsistent-with-thread-analysis-v9_16' into 'v9_16'
Resolve "The dynamic load flags are inconsistent with thread analysis"

See merge request isc-projects/bind9!4096
2020-09-07 22:58:10 +00:00
Mark Andrews
5bc67c0ac9 Don't run dyndb and dlzexternal if running TSAN as
the dlopen flags being used are incompatible with TSAN.

(cherry picked from commit 86316ed29d)
2020-09-08 08:34:34 +10:00
Mark Andrews
248d002816 alphabetize tests/usage
(cherry picked from commit bbece7389e)
2020-09-08 08:26:13 +10:00
Evan Hunt
17f0cab259 Merge branch 'each-faster-tcp-test-v9_16' into 'v9_16'
shorten the tcp system test

See merge request isc-projects/bind9!4092
2020-09-04 21:36:01 +00:00
Evan Hunt
267c154a63 shorten the tcp system test
the tcp system test uses the 'packet.pl' test tool to send a packet
thousands of times. this took a long time because the tool was waiting
for replies and parsing them; however, for that particular test the
replies aren't relevant.

this commit uses non-blocking sockets and moves the reply parsing
outside the send loop, which speeds the system test up substantially.

(cherry picked from commit 1ceea908b6)
2020-09-04 14:22:53 -07:00
Michał Kępień
b0e1d19599 Merge branch '1919-include-bind-documentation-in-windows-zips-v9_16' into 'v9_16'
[v9_16] Include BIND documentation in Windows zips

See merge request isc-projects/bind9!4087
2020-09-03 10:11:07 +00:00
Michał Kępień
6e2a35df2d Include BIND documentation in Windows zips
As generated documentation files are no longer stored in the BIND Git
repository, put a copy of the PDF version of the BIND ARM generated by
the "docs" GitLab CI job into the Windows zips to make it easily
available to the end users on that platform.

Make sure Windows zips also contain certain documentation files included
in source tarballs to make the contents of each release more consistent
across different platforms.

(cherry picked from commit 549ddca256)
2020-09-03 12:02:19 +02:00
Mark Andrews
a86dd63dc0 Merge branch 'marka-check-deny-name-with-grant-subdomain-v9_16' into 'v9_16'
Check 'deny name' + 'grant subdomain' for the same name

See merge request isc-projects/bind9!4082
2020-09-03 06:41:46 +00:00
Mark Andrews
1ef4fa9a0b Check 'deny name' + 'grant subdomain' for the same name
(cherry picked from commit a402ffbced)
2020-09-03 16:22:01 +10:00
Mark Andrews
4e6635f13f Merge branch '2115-the-load-of-huge-zone-can-take-over-100-secs-when-running-under-a-sanitiser-v9_16' into 'v9_16'
Increase zone load timeout in the "rndc" test

See merge request isc-projects/bind9!4076
2020-09-02 22:00:12 +00:00
Mark Andrews
91daae5c62 Increase zone load timeout in the "rndc" test
The "huge.zone" zone can take longer than 100 seconds to load when
running under a sanitizer.  Increase the relevant zone load timeout to
prevent intermittent failures of the "rndc" system test.

(cherry picked from commit fd08918df5)
2020-09-02 21:41:30 +00:00
Mark Andrews
0b4b2e990b Merge branch '2084-9-11-data-race-in-dispatch_test-2-v9_16' into 'v9_16'
Resolve "9.11 data race in dispatch_test"

See merge request isc-projects/bind9!4075
2020-09-02 21:33:58 +00:00
Mark Andrews
e6332e4a67 watch_fd also requires thread->fdlock[lockid] to be held
(cherry picked from commit 22f499cdc4)
2020-09-03 07:14:45 +10:00
Mark Andrews
eadfe4b673 remove dead code
(cherry picked from commit e923e62f6c)
2020-09-03 07:14:45 +10:00
Ondřej Surý
cfeb3bf803 Merge branch '2091-print-out-more-diagnostics-on-dns_name_issubdomain-v9_16' into 'v9_16'
Print diagnostics on dns_name_issubdomain() failure in fctx_create()

See merge request isc-projects/bind9!4073
2020-09-02 20:21:19 +00:00
Ondřej Surý
56d2cf6f1e Print diagnostics on dns_name_issubdomain() failure in fctx_create()
Log diagnostic message when dns_name_issubdomain() in the fctx_create()
when the resolver is qname minimizing and forwarding at the same time.

(cherry picked from commit 0a22024c27)
2020-09-02 18:29:01 +02:00
Ondřej Surý
184b608745 Merge branch '1847-recursor-has-issues-recursing-ip6-arpa-v9_16' into 'v9_16'
Resolve "9.16.* recursor has issues recursing" [v9.16]

See merge request isc-projects/bind9!4070
2020-09-02 14:54:00 +00:00
Diego Fronza
d791f04960 Add CHANGES and release note for GL #1847
(cherry picked from commit 044a72cca9)
2020-09-02 16:52:39 +02:00
Diego Fronza
55c0fa2bf6 Added test for the proposed fix
The test works as follows:

1. Client wants to resolve unusual ip6.arpa. name:

   test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

2. Query is sent to ns7, a qmin enabled resolver.

3. ns7 do the first stage in query minimization for the name and send a new
   query to root (ns1):

  _.1.0.0.2.ip6.arpa.        IN  A

4. ns1 delegates ip6.arpa. to ns2.good.:

    ;; AUTHORITY SECTION:
    ;ip6.arpa.      20  IN  NS  ns2.good.

    ;; ADDITIONAL SECTION:
    ;ns2.good.      20  IN  A   10.53.0.2

5. ns7 do a second round in minimizing the name and send a new query
   to ns2.good. (10.53.0.2):

   _.8.2.6.0.1.0.0.2.ip6.arpa.    IN  A

6. ans2 delegates 8.2.6.0.1.0.0.2.ip6.arpa. to ns3.good.:

    ;; AUTHORITY SECTION:
    ;8.2.6.0.1.0.0.2.ip6.arpa. 60   IN  NS  ns3.good.

    ;; ADDITIONAL SECTION:
    ;ns3.good.      60  IN  A   10.53.0.3

7. ns7 do a third round in minimizing the name and send a new query to
   ns3.good.:

    _.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN A

8. ans3 delegates 1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. to ns4.good.:

    ;; AUTHORITY SECTION:
    ;1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    NS  ns4.good.

    ;; ADDITIONAL SECTION:
    ;ns4.good.      60  IN  A   10.53.0.4

9. ns7 do fourth round in minimizing the name and send a new query to
   ns4.good.:

	_.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa.    IN A

10. ns4.good. doesn't know such name, but answers stating it is authoritative for
    the domai:

	;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  53815
	...
	;; AUTHORITY SECTION:
	1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    SOA ns4.good.  ...

11. ns7 do another minimization on name:
   _.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
   sends to ns4.good. and gets the same SOA response stated in item #10

12. ns7 do another minimization on name:
	_.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
	sends to ns4.good. and gets the same SOA response stated in item #10.

13. ns7 do the last query minimization name for the ip6.arpa. QNAME.
	After all IPv6 labels are exausted the algorithm falls back to the
	original QNAME:
	test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa

    ns7 sends a new query with the original QNAME to ans4.

14. Finally ans4 answers with the expected response:
	;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  40969
	;; flags: qr aa; QUESTION: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
	;; OPT PSEUDOSECTION:
	; EDNS: version: 0, flags:; udp: 8192
	;; QUESTION SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

	;; ANSWER SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 1    IN TXT "long_ip6_name"

(cherry picked from commit 11add69198)
2020-09-02 16:52:39 +02:00
Diego Fronza
eb9d8e9e10 Fix resolution of unusual ip6.arpa names
Before this commit, BIND was unable to resolve ip6.arpa names like
the one reported in issue #1847 when using query minimization.

As reported in the issue, an attempt to resolve a name like
'rec-test-dom-158937817846788.test123.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.3.4.3.5.4.0.8.2.6.0.1.0.0.2.ip6.arpa'
using default settings would fail.

The reason was that query minimization algorithm in 'fctx_minimize_qname'
would divide any ip6.arpa names in increasing number of labels,
7,11, ... up to 35, thus limiting the destination name (minimized) to a number
of 35 labels.

In case the last query minimization attempt (with 35 labels) would fail with
NXDOMAIN, BIND would attempt the query mininimization again with the exact
same QNAME, limited on the 35 labels, and that in turn would fail again.

This fix avoids this fail loop by considering the extra labels that may appear
in the leftmost part of an ip6.arpa name, those after the IPv6 part.

(cherry picked from commit 230d79c191)
2020-09-02 16:52:39 +02:00
Matthijs Mekking
bd2932e110 Merge branch '1748-log-cds-cdnskey-publication-v9_16' into 'v9_16'
Resolve "Logging of CDS/CDNSKEY generation for workflow"

See merge request isc-projects/bind9!4067
2020-09-02 13:01:03 +00:00
Matthijs Mekking
729668841e Add change entry and release note for #1748
(cherry picked from commit ff006a1730)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
4a7f87aa89 Log when CDS/CDNSKEY is published in zone.
Log when named decides to add a CDS/CDNSKEY record to the zone. Now
you understand how the bug was found that was fixed in the previous
commits.

(cherry picked from commit f9ef5120c1)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
6405b04477 Fix CDS (non-)publication
The CDS/CDNSKEY record will be published when the DS is in the
rumoured state. However, with the introduction of the rndc '-checkds'
command, the logic in the keymgr was changed to prevent the DS
state to go in RUMOURED unless the specific command was given. Hence,
the CDS was never published before it was seen in the parent.

Initially I thought this was a policy approval rule, however it is
actually a DNSSEC timing rule. Remove the restriction from
'keymgr_policy_approval' and update the 'keymgr_transition_time'
function. When looking to move the DS state to OMNIPRESENT it will
no longer calculate the state from its last change, but from when
the DS was seen in the parent, "DS Publish". If the time was not set,
default to next key event of an hour.

Similarly for moving the DS state to HIDDEN, the time to wait will
be derived from the "DS Delete" time, not from when the DS state
last changed.

(cherry picked from commit c8205bfa0e)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
7065299a9d Silence two grep calls
(cherry picked from commit 2d2b8e7c02)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
94fe9f1fdf Update rndc_checkds test util
The 'rndc_checkds' utility now allows "now" as the time when the DS
has been seen in/seen removed from the parent.

Also it uses "KEYX" as the key argument, rather than key id.
The 'rndc_checkds' will retrieve the key from the "KEYX" string. This
makes the call a bit more readable.

(cherry picked from commit dd754a974c)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
2a9e4fea5a Improve kasp test readability
This commit has a lot of updates on comments, mainly to make the
system test more readable.

Also remove some redundant signing policy checks (check_keys,
check_dnssecstatus, check_keytimes).

Finally, move key time checks and expected key time settings above
'rndc_checkds' calls (with the new way of testing next key event
times there is no need to do them after 'rndc_checkds', and moving
them above 'rndc_checkds' makes the flow of testing easier to follow.

(cherry picked from commit 8cb394e047)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
a33c49a838 Add dnssec-settime [-P ds|-D ds] to kasp test
Add the new '-P ds' and '-D ds' calls to the kasp test setup so that
next key event times can reliably be tested.

(cherry picked from commit 4a67cdabfe)
2020-09-02 14:59:20 +02:00
Matthijs Mekking
75adf06f19 Add '-P ds' and '-D ds' to dnssec-settime
Add two more arguments to the dnssec-settime tool. '-P ds' sets the
time that the DS was published in the parent, '-D ds' sets the time
that the DS was removed from the parent (these times are not accurate,
but rely on the user to use them appropriately, and as long as the
time is not before actual publication/withdrawal, it is fine).

These new arguments are needed for the kasp system test. We want to
test when the next key event is once a DS is published, and now
that 'parent-registration-delay' is obsoleted, we need a different
approach to reliable test the timings.

(cherry picked from commit d4c4f6a669)
2020-09-02 14:59:20 +02:00
Ondřej Surý
3b5eb62009 Merge branch '2037-deferred-system-test-fix-v9_16' into 'v9_16'
Fix the new pkcs11 and tcp test [v9.16]

See merge request isc-projects/bind9!4050
2020-09-02 12:16:10 +00:00
Ondřej Surý
c978d3efdf Skip the large TCP assertion failure test in the CI environment 2020-09-02 13:11:10 +02:00
Ondřej Surý
d1643772eb Reorder the response reading in packet.pl to not fill TCP buffers 2020-09-02 12:46:43 +02:00
Mark Andrews
02be5fc953 Dump the returned packet 2020-09-02 12:46:43 +02:00
Ondřej Surý
92df4ba652 Multiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP
The test for assertion failure via large TCP packet needs to be repeated
multiple times (we use 300000).  This commit fixes the input file to be
properly hexlified and uses the new packet.pl -r feature to send it
300000 times via TCP.

(cherry picked from commit 5f6eb014aa)
2020-09-02 12:46:43 +02:00
Ondřej Surý
4dc666d474 Add -r <repeats> option to packet.pl
For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.

(cherry picked from commit dd46559a19)
2020-09-02 12:46:43 +02:00
Ondřej Surý
677e569dda Properly format 2037-pk11_numbits-crash-test.pkt file
(cherry picked from commit 22e0272063)
2020-09-02 12:46:43 +02:00
Mark Andrews
9b735298c2 Merge branch '2054-dig-bufsize-0-sets-bufsize-to-4096' into 'v9_16'
Resolve "dig +bufsize=0 sets bufsize to 4096" (9.11/9.16)

See merge request isc-projects/bind9!3891
2020-09-02 09:37:38 +00:00
Mark Andrews
0dc04cb901 dig +bufsize=0 failed to disable EDNS as a side effect. 2020-09-02 09:07:55 +00:00
Michał Kępień
e991f6ca9e Merge branch 'michal/fix-the-forward-system-test-on-windows' into 'v9_16'
Fix the "forward" system test on Windows

See merge request isc-projects/bind9!4060
2020-09-02 08:44:48 +00:00
Michał Kępień
665dcfae5f Fix the "forward" system test on Windows
Make the "forward" system test work on Windows again by fixing a
backporting glitch in commit 544ea41224.
2020-09-02 10:01:29 +02:00
Mark Andrews
bcfa5f1593 Merge branch '2081-data-race-in-zonemgr_test-v9_16' into 'v9_16'
Resolve "data race in zonemgr_test"

See merge request isc-projects/bind9!4056
2020-09-02 02:02:29 +00:00
Mark Andrews
debb5f3994 Add CHANGES note
(cherry picked from commit ca1b0f1539)
2020-09-02 11:40:09 +10:00
Mark Andrews
e460d83dbb isc_ratelimiter needs to hold a reference to its task
to prevent the task subsystem shutting down before the
ratelimiter is freed.

(cherry picked from commit b8e4b6d303)
2020-09-02 11:39:36 +10:00
Mark Andrews
e7e5a2fa6b Merge branch '2049-cleanup-sock-v9_16' into 'v9_16'
remove unused variable sock

See merge request isc-projects/bind9!4052
2020-09-01 22:59:32 +00:00
Mark Andrews
489b99b65c remove unused variable sock
(cherry picked from commit b1c424ddf3)
2020-09-02 08:41:11 +10:00
Mark Andrews
8df297f34a Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering-v9_16' into 'v9_16'
Use memory_order_acq_rel in isc_refcount_decrement.

See merge request isc-projects/bind9!4048
2020-09-01 13:09:35 +00:00
Mark Andrews
1af9cf78bd Use memory_order_acq_rel in isc_refcount_decrement.
While

if (isc_refcount_decrement() == 1) {	// memory_order_release
	isc_refcount_destroy();		// memory_order_acquire
	...
}

is theoretically the most efficent in practice, using
memory_order_acq_rel produces the same code on x86_64 and doesn't
trigger tsan data races (which use a idealistic model) if
isc_refcount_destroy() is not called immediately.  In fact
isc_refcount_destroy() could be removed if we didn't want
to check for the count being 0 when isc_refcount_destroy() is
called.

https://stackoverflow.com/questions/49112732/memory-order-in-shared-pointer-destructor
(cherry picked from commit 6278899a38)
2020-09-01 22:24:52 +10:00
Michał Kępień
4f949e5c5b Merge branch '2075-add-T-maxcachesize-command-line-option-v9_16' into 'v9_16'
[v9_16] Add "-T maxcachesize=..." command line option

See merge request isc-projects/bind9!4046
2020-08-31 22:10:26 +00:00
Michał Kępień
894b7a8345 Use "-T maxcachesize=2097152" in all system tests
In order to lower the amount of memory allocated at startup by named
instances used in the BIND system test suite, set the default value of
"max-cache-size" for these to 2 megabytes.  The purpose of this change
is to prevent named instances (or even entire virtual machines) from
getting killed by the operating system on the test host due to excessive
memory use.

Remove all "max-cache-size" statements from named configuration files
used in system tests ("checkconf" notwithstanding) to prevent confusion
as the "-T maxcachesize=..." command line option takes precedence over
configuration files.

(cherry picked from commit dad6572093)
2020-08-31 23:42:38 +02:00
Michał Kępień
3f25b8e608 Add "-T maxcachesize=..." command line option
An implicit default of "max-cache-size 90%;" may cause memory use issues
on hosts which run numerous named instances in parallel (e.g. GitLab CI
runners) due to the cache RBT hash table now being pre-allocated [1] at
startup.  Add a new command line option, "-T maxcachesize=...", to allow
the default value of "max-cache-size" to be overridden at runtime.  When
this new option is in effect, it overrides any other "max-cache-size"
setting in the configuration, either implicit or explicit.  This
approach was chosen because it is arguably the simplest one to
implement.

The following alternative approaches to solving this problem were
considered and ultimately rejected (after it was decided they were not
worth the extra code complexity):

  - adding the same command line option, but making explicit
    configuration statements have priority over it,

  - adding a build-time option that allows the implicit default of
    "max-cache-size 90%;" to be overridden.

[1] see commit aa72c31422

(cherry picked from commit 9ac1f6a9bc)
2020-08-31 23:41:24 +02:00
Ondřej Surý
3abbbead55 Merge branch '1996-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8620] Fix TCP DNS buffer sizes [TEST] [v9.16]

See merge request isc-projects/bind9!4044
2020-08-31 12:03:28 +00:00
Ondřej Surý
9d3c6785b5 Add PoC for assertion failure on large TCP DNS messages
(cherry picked from commit 2c796bb9c8)
2020-08-31 13:38:17 +02:00
Ondřej Surý
651a9fe4db Merge branch '1997-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding [TEST] [v9.16]

See merge request isc-projects/bind9!4042
2020-08-31 10:33:26 +00:00
Evan Hunt
544ea41224 test whether DS chasing works correctly when forwarding
(cherry picked from commit dd8db89525)
2020-08-31 12:00:13 +02:00
Ondřej Surý
22b0af0cf2 Merge branch '2037-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used [TEST] [v9.16]

See merge request isc-projects/bind9!4040
2020-08-31 09:50:37 +00:00
Ondřej Surý
f195c192a6 Add PoC system test for pk11_numbits() assertion
(cherry picked from commit a69433ba40)
2020-08-31 10:58:56 +02:00
Ondřej Surý
e7dca64cf7 Merge branch '2028-deferred-system-test-v9_16' into 'v9_16'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries [TEST] [v9.16]

See merge request isc-projects/bind9!4035
2020-08-31 07:24:41 +00:00
Mark Andrews
6acd6ae943 check that a malformed truncated response to a TSIG query is handled
(cherry picked from commit 8bbf3eb5f3)
2020-08-31 08:35:30 +02:00
Ondřej Surý
d723209185 Merge branch '1928-handle-EPROTO-v9_16' into 'v9_16'
Resolve "error: socket.c:1540: unexpected error:"

See merge request isc-projects/bind9!4032
2020-08-28 18:50:38 +00:00
Ondřej Surý
cc07b3f78a Add CHANGES and release note for GL #1928
(cherry picked from commit 4722196b13)
2020-08-28 20:49:02 +02:00
Ondřej Surý
9b9fee13fa Handle EPROTO errno from recvmsg
It was discovered, that some systems might set EPROTO instead of EACCESS
on recvmsg() call causing spurious syslog messages from the socket
code.  This commit returns soft handling of EPROTO errno code to the
socket code. [GL #1928]

(cherry picked from commit e0380d437d)
2020-08-28 20:49:01 +02:00
Ondřej Surý
3751e24e9e Merge branch '2104-fix-off-by-one-error-in-rehash_bits-v9_16' into 'v9_16'
Resolve "Bind 9.16.6 due to assertion failure"

See merge request isc-projects/bind9!4031
2020-08-28 18:48:41 +00:00
Ondřej Surý
be46c49300 Add CHANGES and release notes for GL #2104
(cherry picked from commit d47d2b3fe0)
2020-08-28 20:43:39 +02:00
Ondřej Surý
2b08ff879a Fix off-by-one error when calculating new hashtable size
When calculating the new hashtable bitsize, there was an off-by-one
error that would allow the new bitsize to be larger than maximum allowed
causing assertion failure in the rehash() function.

(cherry picked from commit 78543ad5a7)
2020-08-28 20:43:38 +02:00
Michal Nowak
0d964dfc4b Merge branch '2097-manual-page-tools-need-updating-v9_16' into 'v9_16'
[v9_16] Resolve "manual page tools need updating."

See merge request isc-projects/bind9!4022
2020-08-26 16:31:25 +00:00
Michal Nowak
5082d60105 Fix generated documentation 2020-08-26 16:30:04 +00:00
Michal Nowak
934c470b54 Add pandoc and w3m
pandoc and w3m are needed to generate some files.
2020-08-26 16:30:04 +00:00
Ondřej Surý
cd38e92c48 Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields-v9_16' into 'v9_16'
Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

See merge request isc-projects/bind9!4024
2020-08-26 15:31:38 +00:00
Mark Andrews
d8cb5ac0db Add CHANGES note
(cherry picked from commit d9594cffab)
2020-08-26 16:44:01 +02:00
Mark Andrews
c2ee9eea3a Refactor totext_loc
(cherry picked from commit 2ca4d35037)
2020-08-26 16:44:01 +02:00
Mark Andrews
baf93342d0 Correctly encode LOC records with non integer negative altitudes.
(cherry picked from commit 337cc878fa)
2020-08-26 16:44:01 +02:00
Mark Andrews
06b76b2b16 Check LOC's altitude field is properly parsed and encoded.
(cherry picked from commit 888dfd78c7)
2020-08-26 16:44:00 +02:00
Mark Andrews
7eb5d61703 Tighten LOC parsing to reject period and/or m as a value.
(cherry picked from commit 9225c67835)
2020-08-26 16:44:00 +02:00
Mark Andrews
92a13be6a0 Merge branch '2080-data-race-in-rdataset_addglue-v9_16' into 'v9_16'
Resolve "data race in rdataset_addglue"

See merge request isc-projects/bind9!4020
2020-08-26 12:18:35 +00:00
Mark Andrews
c37fd4ac56 Add CHANGES note
(cherry picked from commit 48973c3ec6)
2020-08-26 21:51:33 +10:00
Ondřej Surý
5674f76590 Use the Fibonacci Hashing for the RBTDB glue table
The rbtdb version glue_table has been refactored similarly to rbt.c hash
table, so it does use 32-bit hash function return values and apply
Fibonacci Hashing to lookup the index to the hash table instead of
modulo.  For more details, see the lib/dns/rbt.c commit log.

(cherry picked from commit 01684cc219)
2020-08-26 21:49:59 +10:00
Mark Andrews
511747307f rbtversion->glue_table_size must be read when holding a lock
(cherry picked from commit 33d0e8d168)
2020-08-26 21:49:59 +10:00
Michal Nowak
b1526940f4 Merge branch 'mnowak/tumbleweed-fix-krb5-config-location-v9_16' into 'v9_16'
[v9_16] Tumbleweed changed location of krb5-config

See merge request isc-projects/bind9!4018
2020-08-26 09:04:45 +00:00
Michal Nowak
9a305e0d47 Tumbleweed changed location of krb5-config
krb5-config is now in /usr/bin/ and we should detect it automatically.

(cherry picked from commit 6095811461)
2020-08-26 10:59:29 +02:00
Ondřej Surý
48c757eb79 Merge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour-v9_16' into 'v9_16'
Cast the original rcode to (dns_ttl_t) when setting extended rcode

See merge request isc-projects/bind9!4014
2020-08-25 19:00:50 +00:00
Mark Andrews
3fce53b0e3 Cast the original rcode to (dns_ttl_t) when setting extended rcode
Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in

(cherry picked from commit a347641782)
2020-08-25 16:40:42 +02:00
Michal Nowak
fbcff0ab14 Merge branch '2053-test-disable-buffer-useinline-in-gitlab-ci-v9_16' into 'v9_16'
[v9_16] Resolve "Test --disable-buffer-useinline in GitLab CI"

See merge request isc-projects/bind9!4012
2020-08-25 14:28:35 +00:00
Michal Nowak
a0e55857c7 Build CentOS 8 with --enable-buffer-useinline
(cherry picked from commit f34df4ef90)
2020-08-25 16:08:47 +02:00
Michal Nowak
79e8f1076a Fix warnings in when build with --enable-buffer-useinline
sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness

(cherry picked from commit dd425254a7)
2020-08-25 16:08:44 +02:00
Mark Andrews
92d4a23f28 Merge branch 'marka-add-missing-isc_mutex_init-v9_16' into 'v9_16'
Add missing isc_mutex_init to manytasks subtest.

See merge request isc-projects/bind9!4007
2020-08-25 00:21:27 +00:00
Mark Andrews
dd5be2940c add missing copyright entry 2020-08-25 10:01:28 +10:00
Mark Andrews
da4f189ea8 Add missing isc_mutex_init to manytasks subtest.
(cherry picked from commit 2eb5c29c83)
2020-08-25 09:58:30 +10:00
Michal Nowak
38fc4b11e2 Merge branch 'mnowak/update_BIND_BASELINE_VERSION_to_v9_16_6' into 'v9_16'
Update BIND_BASELINE_VERSION to v9_16_6

See merge request isc-projects/bind9!4000
2020-08-21 09:30:06 +00:00
Michal Nowak
e9d9c88747 Update BIND_BASELINE_VERSION to v9_16_6 2020-08-21 11:23:59 +02:00
Evan Hunt
1c7e3c8515 Merge tag 'v9_16_6' into v9_16
BIND 9.16.6
2020-08-20 12:08:57 -07:00
Mark Andrews
845bd649ed Merge branch '2077-negative-hook-point-value-in-filter-aaaa-c-v9_16' into 'v9_16'
Remove stray '-' from filter-aaaa initialisation

See merge request isc-projects/bind9!3986
2020-08-19 00:40:53 +00:00
Mark Andrews
590328178c Remove stray '-' from filter-aaaa initialisation
(cherry picked from commit 2fd5ba6507)
2020-08-19 10:18:47 +10:00
Michal Nowak
56e24987ee Merge branch 'mnowak/add-missing-only-schedules-v9_16' into 'v9_16'
[v9_16] Add missing 'only:schedules' to tarball-create job

See merge request isc-projects/bind9!3978
2020-08-18 09:36:16 +00:00
Michal Nowak
816a72889a Add missing 'only:schedules' to tarball-create job
Missing 'only:schedules' prevents schedule jobs to run.
Regressed in 2b5007ef1a.

(cherry picked from commit b3c80fafe0)
2020-08-18 11:35:05 +02:00
Ondřej Surý
6f9487c51b Merge branch 'marka-fuzz-consolidated-v9_16' into 'v9_16'
Consolidated fuzz fixes (v9.16)

See merge request isc-projects/bind9!3976
2020-08-18 09:32:01 +00:00
Mark Andrews
d8a57d32b1 A6: return FORMERR in fromwire if bits are non zero.
oss_fuzz: Issue 24864: bind9:dns_rdata_fromwire_text_fuzzer: Overwrites-const-input in dns_rdata_fromwire_text_fuzzer

(cherry picked from commit 8452404bd7)
2020-08-18 11:11:40 +02:00
Mark Andrews
6b1675a62c RRSIG: reject records with empty SIG section
(cherry picked from commit f6d7b8c20d)
2020-08-18 11:11:40 +02:00
Mark Andrews
f6d64fb2c8 Disable compression in dns_rdata_fromwire_text()
(cherry picked from commit 3e743da1bd)
2020-08-18 11:11:39 +02:00
Mark Andrews
8ed9da7324 dns_rdata_fromwire() only accepts input up to 2^16-1 octets.
(cherry picked from commit aa811801cb)
2020-08-18 11:11:36 +02:00
Mark Andrews
6aa46945ff Print out input if dns_rdata_fromtext() fails in debug mode.
(cherry picked from commit e4d30cb007)
2020-08-18 11:11:10 +02:00
Michal Nowak
0421ea1259 Merge branch 'mnowak/gcovr-v9_16' into 'v9_16'
[v9_16] Report coverage with gcovr

See merge request isc-projects/bind9!3973
2020-08-17 15:27:29 +00:00
Michal Nowak
764087eb19 Report coverage with gcovr 2020-08-17 16:55:26 +02:00
Michal Nowak
c5dc650b63 Merge branch 'mnowak/broaden-abi-check-scope-v9_16' into 'v9_16'
[v9_16] Broaden scope of abi-check

See merge request isc-projects/bind9!3971
2020-08-17 13:14:08 +00:00
Michal Nowak
a1227c3376 Broaden scope of abi-check
For abi-check we should use as broad 'configure' options as possible.

(cherry picked from commit 8e43f5e860)
2020-08-17 15:10:48 +02:00
Mark Andrews
156df0f808 Merge branch 'patch-3-v9_16' into 'v9_16'
Option -s is not supported in tsig-keygen

See merge request isc-projects/bind9!3968
2020-08-17 04:02:06 +00:00
JP Mens
d2e1c8c75e Option -s is not supported in tsig-keygen
(cherry picked from commit b01d26c608)
2020-08-17 12:39:50 +10:00
Mark Andrews
5a4c7a8015 Merge branch 'marka-fuzz-fixes-v9_16' into 'v9_16'
Marka fuzz fixes v9 16

See merge request isc-projects/bind9!3957
2020-08-13 15:51:43 +00:00
Mark Andrews
9af25fbc26 Add CHANGES note
(cherry picked from commit 80d69ba04c)
2020-08-14 00:38:45 +10:00
Mark Andrews
96096adc46 Add previously detected dns_rdata_fromwire_text failures
(cherry picked from commit 7ae055cef1)
2020-08-14 00:38:45 +10:00
Mark Andrews
9675d83b96 X25: Check that record is all ASCII digits
(cherry picked from commit 7e49689746)
2020-08-14 00:38:45 +10:00
Mark Andrews
ee10a93cbc WKS: reject records with zero octets at the end of the bitmap
(cherry picked from commit 9d446142d8)
2020-08-14 00:38:45 +10:00
Mark Andrews
e44da35092 TLSA: fix fromwire length checks
(cherry picked from commit 3429c35f52)
2020-08-14 00:38:45 +10:00
Mark Andrews
b4a66cffa8 SIG: reject records with a zero length signature
(cherry picked from commit 9b93e5d684)
2020-08-14 00:38:45 +10:00
Mark Andrews
10e8ad22c5 NXT: fix fromwire bitmap checks
(cherry picked from commit 73dd849655)
2020-08-14 00:38:45 +10:00
Mark Andrews
c712394b34 NSEC3PARAM: check that saltlen is consistent with the rdata length
(cherry picked from commit 7dc8e720ff)
2020-08-14 00:38:45 +10:00
Mark Andrews
26be6c817b NSEC3: reject records with a zero length hash field
(cherry picked from commit 031ee9e279)
2020-08-14 00:38:45 +10:00
Mark Andrews
ebd8033a96 IPSECKEY: require non-zero length public keys
(cherry picked from commit d7f7014803)
2020-08-14 00:38:45 +10:00
Mark Andrews
baf7d114af CERT: reject records with a empty certificate field
(cherry picked from commit a238f37239)
2020-08-14 00:38:45 +10:00
Mark Andrews
f09691feff Get rid of type 'RESERVED0'.
(cherry picked from commit 3c492b3ef1)
2020-08-14 00:38:45 +10:00
Mark Andrews
0c95100f98 dns_rdata_fromwire_text fixes:
* Disallow compression pointers in names as we are not
  reading from a packet and as a result length checks fail.
* Increase totext buffer size as fuzzer ran out of space on
  big bitmaps.
* NUL terminate totext to make fault diagnosis easier.
* Add debugging messages to make fault diagnosie easier.

(cherry picked from commit a92d973430)
2020-08-14 00:38:45 +10:00
Mark Andrews
5806d856cf base32_decode*() could incorrectly decode a input.
base32_decode_char() added a extra zero octet to the output
if the fifth character was a pad character.  The length
of octets to copy to the output was set to 3 instead of 2.

(cherry picked from commit 6c7e50c267)
2020-08-14 00:11:06 +10:00
Matthijs Mekking
5d6d138b9e Merge branch 'matthijs-fix-kasp-test-next-key-event-v9_16' into 'v9_16'
Fix check next key event check in kasp test

See merge request isc-projects/bind9!3956
2020-08-13 10:33:28 +00:00
Matthijs Mekking
9b69ab4c38 Fix check next key event check in kasp test
Prevent intermittent false positives on slow platforms by subtracting
the number of seconds which passed between key creation and invoking
'rndc dnssec -checkds'.

This particularly fails for the step3.csk-roll2.autosign zone because
the closest next key event is when the zone signatures become
omnipresent. Running 'rndc dnssec -checkds' some time later means
that the next key event is in fact closer than the calculated time
and thus we need to adjust the expected time by the time already
passed.

(cherry picked from commit 262b52a154)
2020-08-13 12:07:08 +02:00
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
Ondřej Surý
25846cfec4 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)
(cherry picked from commit f0ccc17f30)
2020-08-10 11:31:13 +02: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
Tinderbox User
05f41f1606 Merge branch 'prep-release' into v9_16_6-release 2020-08-06 08:17:06 +00:00
Tinderbox User
a195123ad0 prep 9.16.6 2020-08-06 08:14:40 +00:00
Michał Kępień
5a153fc13c Merge branch 'michal/prepare-release-notes-for-bind-9.16.6' into 'security-v9_16'
Prepare release notes for BIND 9.16.6

See merge request isc-private/bind9!202
2020-08-06 07:33:07 +00:00
Michał Kępień
1824496092 Reorder release notes 2020-08-06 09:19:25 +02:00
Michał Kępień
dc8ecaad5d Prepare release notes for BIND 9.16.6 2020-08-06 09:19:25 +02:00
Michał Kępień
4b309940ba Add release note for #1976 2020-08-06 09:19:25 +02:00
Michał Kępień
123ce55a4a Add release note for #1619 2020-08-06 09:19:25 +02:00
Michał Kępień
fdc6cf6369 Tweak and reword release notes 2020-08-06 09:19:25 +02:00
Michał Kępień
5259308441 Tweak and reword recent CHANGES entries 2020-08-06 09:19:25 +02:00
Michał Kępień
b9638e51e2 Merge branch '2055-grant-subdomain-fix-v9_16' into 'security-v9_16'
[CVE-2020-8624] Fix processing of "update-policy" rules of type "subdomain" (v9.16)

See merge request isc-private/bind9!197
2020-08-05 13:58:00 +00:00
Mark Andrews
b3b46c5842 Add CHANGES and release note for GL #2055 2020-08-05 15:55:06 +02:00
Mark Andrews
14aa0c5df6 Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
2020-08-05 15:55:06 +02:00
Mark Andrews
5bf457e89a Add a test for update-policy 'subdomain'
The new test checks that 'update-policy subdomain' is properly enforced.
2020-08-05 15:55:06 +02:00
Mark Andrews
7630a64141 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:55:06 +02:00
Michał Kępień
77196beff8 Merge branch '2037-confidential-issue-v9_16' into 'security-v9_16'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used (v9.16)

See merge request isc-private/bind9!199
2020-08-05 13:54:16 +00:00
Ondřej Surý
e3bd627e84 Add CHANGES and release note for GL #2037 2020-08-05 15:51:40 +02:00
Ondřej Surý
ac3862a5da 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:40 +02:00
Michał Kępień
d5b42ddd38 Merge branch '2028-unexpectedend-and-tsig-v9_16' into 'security-v9_16'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries (v9.16)

See merge request isc-private/bind9!195
2020-08-05 13:50:30 +00:00
Mark Andrews
be43228b61 Add CHANGES and release notes for GL #2028 2020-08-05 15:47:25 +02:00
Mark Andrews
0eec632d6a 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:25 +02:00
Michał Kępień
3b942affc0 Merge branch '1997-confidential-issue-v9_16' into 'security-v9_16'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding (v9.16)

See merge request isc-private/bind9!194
2020-08-05 13:46:23 +00:00
Evan Hunt
3a69802086 Add CHANGES and release note for GL #1997 2020-08-05 15:44:18 +02:00
Evan Hunt
81514ff925 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:44:18 +02:00
Michał Kępień
e160b1509f Merge branch '1996-confidential-issue-v9_16' into 'security-v9_16'
[CVE-2020-8620]: TCP Receive Buffer Length Assertion Check Denial of Service Vulnerability (v9.16)

See merge request isc-private/bind9!193
2020-08-05 13:32:03 +00:00
Ondřej Surý
9d69ee740f Add CHANGES and release note for GL #1996 2020-08-05 12:57:58 +02:00
Evan Hunt
9a372f2bce 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:58 +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
Mark Andrews
14fe6e77a7 Always check the return from isc_refcount_decrement.
Created isc_refcount_decrement_expect macro to test conditionally
the return value to ensure it is in expected range.  Converted
unchecked isc_refcount_decrement to use isc_refcount_decrement_expect.
Converted INSIST(isc_refcount_decrement()...) to isc_refcount_decrement_expect.

(cherry picked from commit bde5c7632a)
2020-07-31 12:54:47 +10:00
Mark Andrews
8454b9dbb8 Merge branch '2033-rndc-dnstap-roll-fix-was-incomplete-v9_16' into 'v9_16'
Refactor the code that counts the last log version to keep

See merge request isc-projects/bind9!3900
2020-07-31 00:25:59 +00:00
Mark Andrews
1981fb1327 Refactor the code that counts the last log version to keep
When silencing the Coverity warning in remove_old_tsversions(), the code
was refactored to reduce the indentation levels and break down the long
code into individual functions.  This improve fix for [GL #1989].

(cherry picked from commit aca18b8b5b)
2020-07-31 10:01:36 +10:00
Michal Nowak
2fa1c95357 Merge branch 'mnowak/various-system-test-fixes-v9_16' into 'v9_16'
[v9_16] Various system test fixes

See merge request isc-projects/bind9!3898
2020-07-30 14:57:48 +00:00
Michal Nowak
0f319908f0 Remove cross-test dependency on ckdnsrps.sh 2020-07-30 16:25:23 +02:00
Michal Nowak
72a6b0dc6f Fix name of the test directory of stop.pl in masterformat test 2020-07-30 16:24:18 +02:00
Michal Nowak
24f5f68d7a Ensure test fails if packet.pl does not work as expected 2020-07-30 16:20:46 +02:00
Ondřej Surý
d8f7f0e747 Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries-v9_16' into 'v9_16'
Resolve "Resizing (growing) of cache hash tables causes delays in processing of client queries"

See merge request isc-projects/bind9!3871
2020-07-30 11:47:32 +00:00
Ondřej Surý
343330413a Add CHANGES and release note for #1775
(cherry picked from commit 2b4f0f03f5)
2020-07-30 11:57:41 +02:00
Ondřej Surý
0fff3008ac 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.

(cherry picked from commit a9182c89a6)
2020-07-30 11:57:24 +02:00
Ondřej Surý
ebb2b055cc 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.

(cherry picked from commit f59fd49fd8)
2020-07-30 11:57:24 +02:00
Ondřej Surý
1e5df7f3bf Add HalfSipHash 2-4 reference implementation
The HalfSipHash implementation has 32-bit keys and returns 32-bit
value.

(cherry picked from commit 344d66aaff)
2020-07-30 11:57:24 +02:00
Ondřej Surý
d89eb403f3 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.

(cherry picked from commit 21d751dfc7)
2020-07-30 11:57:24 +02:00
Ondřej Surý
aa72c31422 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/

(cherry picked from commit e24bc324b4)
2020-07-30 11:57:24 +02:00
Michał Kępień
57b29d8967 Merge branch '2024-fix-idle-timeout-for-connected-tcp-sockets-v9_16' into 'v9_16'
[v9_16] Fix idle timeout for connected TCP sockets

See merge request isc-projects/bind9!3896
2020-07-30 09:49:50 +00:00
Michał Kępień
8b3014507a Add CHANGES for GL #2024
(cherry picked from commit 18efb2456f)
2020-07-30 11:16:18 +02:00
Michał Kępień
b6c33087b0 Fix idle timeout for connected TCP sockets
When named acting as a resolver connects to an authoritative server over
TCP, it sets the idle timeout for that connection to 20 seconds.  This
fixed timeout was picked back when the default processing timeout for
each client query was hardcoded to 30 seconds.  Commit
000a8970f8 made this processing timeout
configurable through "resolver-query-timeout" and decreased its default
value to 10 seconds, but the idle TCP timeout was not adjusted to
reflect that change.  As a result, with the current defaults in effect,
a single hung TCP connection will consistently cause the resolution
process for a given query to time out.

Set the idle timeout for connected TCP sockets to half of the client
query processing timeout configured for a resolver.  This allows named
to handle hung TCP connections more robustly and prevents the timeout
mismatch issue from resurfacing in the future if the default is ever
changed again.

(cherry picked from commit 953d704bd2)
2020-07-30 11:16:09 +02:00
Evan Hunt
65e0da3ad8 Merge branch '2050-libuv-version-v9_16' into 'v9_16'
report libuv version string in `named -V`

See merge request isc-projects/bind9!3890
2020-07-28 03:01:58 +00:00
Evan Hunt
bbc739b09b report libuv version string in named -V
(cherry picked from commit 1036338a10)
2020-07-27 19:55:22 -07:00
Evan Hunt
8247aeb8e9 Merge branch '1619-rpz-wildcard-passthru-ignored-v9_16' into 'v9_16'
Resolve "RPZ wildcard passthru ignored"

See merge request isc-projects/bind9!3889
2020-07-28 02:50:38 +00:00
Diego Fronza
31af3af57c Add CHANGES entry 2020-07-27 17:18:11 -03:00
Diego Fronza
1a101f223c Add test for RPZ wildcard passthru ignored fix 2020-07-27 17:17:02 -03:00
Diego Fronza
a8ce7b461c Fix rpz wildcard name matching
Whenever an exact match is found by dns_rbt_findnode(),
the highest level node in the chain will not be put into
chain->levels[] array, but instead the chain->end
pointer will be adjusted to point to that node.

Suppose we have the following entries in a rpz zone:
example.com     CNAME rpz-passthru.
*.example.com   CNAME rpz-passthru.

A query for www.example.com would result in the
following chain object returned by dns_rbt_findnode():

chain->level_count = 2
chain->level_matches = 2
chain->levels[0] = .
chain->levels[1] = example.com
chain->levels[2] = NULL
chain->end = www

Since exact matches only care for testing rpz set bits,
we need to test for rpz wild bits through iterating the nodechain, and
that includes testing the rpz wild bits in the highest level node found.

In the case of an exact match, chain->levels[chain->level_matches]
will be NULL, to address that we must use chain->end as the start point,
then iterate over the remaining levels in the chain.
2020-07-27 17:02:16 -03:00
Mark Andrews
6720ba8335 Merge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time-v9_16' into 'v9_16'
Resolve "dns_rdata_hip_next() fails to return ISC_R_NOMORE at the right time."

See merge request isc-projects/bind9!3885
2020-07-24 05:47:50 +00:00
Mark Andrews
af03936409 Add CHANGES note
(cherry picked from commit bcd049f116)
2020-07-24 15:25:17 +10:00
Mark Andrews
b0942c2442 Check walking the hip rendezvous servers.
Also fixes extraneous white space at end of record when
there are no rendezvous servers.

(cherry picked from commit 78db46d746)
2020-07-24 15:24:49 +10:00
Mark Andrews
397f51a807 Merge branch 'feature/master/unix-cleanup-v9_16' into 'v9_16'
Remove few lines in unix socket handling

See merge request isc-projects/bind9!3882
2020-07-24 04:05:53 +00:00
Petr Menšík
ac79d68765 Remove few lines in unix socket handling
Reuse the same checks two times, make difference minimal.

(cherry picked from commit 72d81c4768)
2020-07-24 13:47:26 +10:00
Mark Andrews
2950e1bb5d Merge branch 'dstlib-failure-abort-v9_16' into 'v9_16'
Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3878
2020-07-23 03:01:09 +00:00
Petr Menšík
fade143531 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.

(cherry picked from commit c5e7152cf0)
2020-07-23 11:28:11 +10:00
Michal Nowak
cdb346e51f Merge branch 'mnowak/try-harder-to-analyze-cores-v9_16' into 'v9_16'
[v9_16] Rationalize backtrace logging

See merge request isc-projects/bind9!3869
2020-07-20 14:48:32 +00:00
Michal Nowak
9509af7008 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-20 13:09:06 +02:00
Michal Nowak
ace988990a 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-20 12:48:29 +02:00
Michal Nowak
c2bbe11349 Fold stop_servers_failed() to stop_servers() 2020-07-20 12:48:11 +02:00
Michał Kępień
5a0849d7d0 Merge branch 'v9_16_5-release' into 'v9_16'
Merge 9.16.5 release branch

See merge request isc-projects/bind9!3861
2020-07-15 21:23:33 +00:00
Michał Kępień
0fbe13bc65 Set up release notes for BIND 9.16.6 2020-07-15 23:19:58 +02:00
Michał Kępień
84f16aaca9 Bump BIND_BASELINE_VERSION for ABI checks 2020-07-15 23:19:58 +02:00
Tinderbox User
284436ddfa Merge branch 'prep-release' into v9_16_5-release 2020-07-15 23:10:56 +02:00
Tinderbox User
b03a635f68 prep 9.16.5 2020-07-15 23:10:55 +02:00
Michał Kępień
1ab9297bef Merge branch 'michal/prepare-release-notes-for-bind-9.16.5' into v9_16_5-release 2020-07-15 23:10:41 +02:00
Michał Kępień
03995ef2d0 Reorder release notes 2020-07-15 23:10:41 +02:00
Michał Kępień
560c7c2452 Add release note for #1938 2020-07-15 23:10:41 +02:00
Michał Kępień
f97cf92fda Add release note for #1937 2020-07-15 23:10:41 +02:00
Michał Kępień
ea6e64f7d0 Tweak and reword release notes 2020-07-15 23:10:40 +02:00
Michał Kępień
a67bdd4d1d Prepare release notes for BIND 9.16.5 2020-07-15 23:10:17 +02:00
Michał Kępień
035cf4eddd Tweak and reword recent CHANGES entries 2020-07-15 23:10:17 +02:00
Matthijs Mekking
25d452a9d6 Merge branch '2006-coverity-checked-return-keymgr-v9_16' into 'v9_16'
Check return value of dst_key_getbool()

See merge request isc-projects/bind9!3859
2020-07-15 09:04:13 +00:00
Matthijs Mekking
4dabb688db 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.

(cherry picked from commit e645d2ef1e)
2020-07-14 17:48:21 +02:00
Michał Kępień
d7ad26b472 Merge branch 'michal/use-image-key-in-qemu-based-ci-job-templates-v9_16' into 'v9_16'
[v9_16] Use "image" key in QEMU-based CI job templates

See merge request isc-projects/bind9!3856
2020-07-14 08:32:44 +00:00
Michał Kępień
3b91ec5d1d 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.

(cherry picked from commit 72201badf0)
2020-07-14 10:04:10 +02:00
Mark Andrews
24f5187bd7 Merge branch 'u/fanf2/fix-signing-v9_16' into 'v9_16'
U/fanf2/fix signing v9 16

See merge request isc-projects/bind9!3852
2020-07-14 03:09:57 +00:00
Mark Andrews
a0ad1d19cb Add release note for [GL !3735]
(cherry picked from commit 3ff60b881f)
2020-07-14 12:12:13 +10:00
Mark Andrews
132ed083fb Add CHANGES note for [GL !3735]
(cherry picked from commit f4fbca6e16)
2020-07-14 12:12:11 +10:00
Mark Andrews
90154d203b 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.

(cherry picked from commit 11ecf7901b)
2020-07-14 12:11:42 +10:00
Tony Finch
31005d61ae 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`.

(cherry picked from commit 030674b2a3)
2020-07-14 12:11:42 +10:00
Mark Andrews
38fe63402b Merge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoindex-undefined-on-illumos-v9_16' into 'v9_16'
Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined

See merge request isc-projects/bind9!3850
2020-07-14 01:25:55 +00:00
Mark Andrews
d47c42a0ab Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined
Also 'zone' should be initialised to zero.

(cherry picked from commit e7662c4c63)
2020-07-14 10:53:06 +10:00
Evan Hunt
8012cef139 Merge branch 'each-lmdb-lock-fix-v9_16' into 'v9_16'
ensure new_zone_lock is released after count_newzones()

See merge request isc-projects/bind9!3845
2020-07-14 00:17:16 +00:00
Evan Hunt
fc73dbdc7d make sure new_zone_lock is locked before unlocking it
it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.

(cherry picked from commit ed37c63e2b)
2020-07-13 23:53:14 +00:00
Mark Andrews
3140598d95 Merge branch '1993-check-c-1576-37-error-expected-identifier-before-numeric-constant-on-illumos-v9_16' into 'v9_16'
Handle namespace clash over 'SEC' on illumos.

See merge request isc-projects/bind9!3849
2020-07-13 23:37:19 +00:00
Mark Andrews
b955da48aa Handle namespace clash over 'SEC' on illumos.
(cherry picked from commit 18eef20241)
2020-07-14 09:06:46 +10:00
Mark Andrews
4636de422f Merge branch '2005-coverity-is-reporting-double-unlock-v9_16' into 'v9_16'
Resolve "Coverity is reporting double unlock."

See merge request isc-projects/bind9!3848
2020-07-13 23:04:06 +00:00
Mark Andrews
37b732f8fd Add CHANGES for [GL #2005]
(cherry picked from commit 4e03bfac86)
2020-07-14 07:36:00 +10:00
Mark Andrews
f771d75c9b Address potential double unlock in process_fd
(cherry picked from commit cc0089c66b)
2020-07-14 07:35:17 +10:00
Mark Andrews
7b32e7fec8 Merge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed-v9_16' into 'v9_16'
Fallback to built in trust-anchors, managed-keys, or trusted-keys

See merge request isc-projects/bind9!3843
2020-07-13 06:49:03 +00:00
Mark Andrews
0265bd17d5 Fallback to built in trust-anchors, managed-keys, or trusted-keys
if the bind.keys file cannot be parsed.

(cherry picked from commit d02a14c795)
2020-07-13 15:13:50 +10:00
Mark Andrews
70f639c17c Merge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer-overflow-v9_16' into 'v9_16'
Resolve "'rndc dnstap --roll' with too big a argument (>128) can cause a buffer overflow."

See merge request isc-projects/bind9!3842
2020-07-13 05:00:19 +00:00
Mark Andrews
94288631a9 Add changes for [GL #1989]
(cherry picked from commit 42b2290c3a)
2020-07-13 14:04:53 +10:00
Mark Andrews
67f85d648f Address overrun in remove_old_tsversions
If too many versions of log / dnstap files to be saved where requests
the memory after to_keep could be overwritten.  Force the number of
versions to be saved to a save level.  Additionally the memmove length
was incorrect.

(cherry picked from commit 6ca78bc57d)
2020-07-13 14:04:04 +10:00
Mark Andrews
79179c6382 Merge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in-tsig_test-c-v9_11-v9_16' into 'v9_16'
Assert tsigout is non-NULL

See merge request isc-projects/bind9!3841
2020-07-13 04:00:27 +00:00
Mark Andrews
e67b7a62d0 Assert tsigout is non-NULL
(cherry picked from commit 827746e89b)
2020-07-13 13:21:12 +10:00
Mark Andrews
f2c2251af3 Merge branch '2014-statschannel-system-test-failed-at-setup-stage-v9_16' into 'v9_16'
Don't verify the zone when setting expire to "now+1s" as it can fail

See merge request isc-projects/bind9!3839
2020-07-13 03:18:07 +00:00
Mark Andrews
7e62d76b6b Don't verify the zone when setting expire to "now+1s" as it can fail
as too much wall clock time may have elapsed.

Also capture signzone output for forensic analysis

(cherry picked from commit a0e8a11cc6)
2020-07-13 12:42:46 +10:00
Mark Andrews
f80cfadaba Merge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c-v9_16' into 'v9_16'
check returns from inet_pton()

See merge request isc-projects/bind9!3837
2020-07-13 02:37:06 +00:00
Mark Andrews
12fac1ce70 check returns from inet_pton()
(cherry picked from commit 9499adeb5e)
2020-07-13 11:44:58 +10:00
Mark Andrews
fe9dc60ba4 Merge branch '2003-remove-redundant-listener-null-check-v9_16' into 'v9_16'
Remove redundant check for listener being non-NULL

See merge request isc-projects/bind9!3835
2020-07-13 01:11:26 +00:00
Mark Andrews
86464e6e4b Remove redundant check for listener being non-NULL
(cherry picked from commit c91dc92410)
2020-07-13 10:28:34 +10:00
Michał Kępień
4d38e0d448 Merge branch '1976-fix-locking-for-lmdb-0.9.26-v9_16' into 'v9_16'
[v9_16] Fix locking for LMDB 0.9.26

See merge request isc-projects/bind9!3831
2020-07-10 10:11:14 +00:00
Michał Kępień
a496b01487 Add CHANGES for GL #1976
(cherry picked from commit 7fffa5abba)
2020-07-10 11:30:46 +02:00
Michał Kępień
0bc4d6cc7a Fix locking for LMDB 0.9.26
When "rndc reconfig" is run, named first configures a fresh set of views
and then tears down the old views.  Consider what happens for a single
view with LMDB enabled; "envA" is the pointer to the LMDB environment
used by the original/old version of the view, "envB" is the pointer to
the same LMDB environment used by the new version of that view:

 1. mdb_env_open(envA) is called when the view is first created.
 2. "rndc reconfig" is called.
 3. mdb_env_open(envB) is called for the new instance of the view.
 4. mdb_env_close(envA) is called for the old instance of the view.

This seems to have worked so far.  However, an upstream change [1] in
LMDB which will be part of its 0.9.26 release prevents the above
sequence of calls from working as intended because the locktable mutexes
will now get destroyed by the mdb_env_close() call in step 4 above,
causing any subsequent mdb_txn_begin() calls to fail (because all of the
above steps are happening within a single named process).

Preventing the above scenario from happening would require either
redesigning the way we use LMDB in BIND, which is not something we can
easily backport, or redesigning the way BIND carries out its
reconfiguration process, which would be an even more severe change.

To work around the problem, set MDB_NOLOCK when calling mdb_env_open()
to stop LMDB from controlling concurrent access to the database and do
the necessary locking in named instead.  Reuse the view->new_zone_lock
mutex for this purpose to prevent the need for modifying struct dns_view
(which would necessitate library API version bumps).  Drop use of
MDB_NOTLS as it is made redundant by MDB_NOLOCK: MDB_NOTLS only affects
where LMDB reader locktable slots are stored while MDB_NOLOCK prevents
the reader locktable from being used altogether.

[1] 2fd44e3251

(cherry picked from commit 53120279b5)
2020-07-10 11:30:31 +02:00
Mark Andrews
6ddf0667aa Merge branch '2011-off-by-one-error-in-dns_rdatatype_attributes-v9_16' into 'v9_16'
Adjust range limit of unknown meta types

See merge request isc-projects/bind9!3825
2020-07-08 04:42:06 +00:00
Mark Andrews
86681ca6f1 Adjust range limit of unknown meta types
(cherry picked from commit 092a159dcd)
2020-07-08 13:44:47 +10:00
Mark Andrews
8a36946413 Merge branch '2009-update-isc-logo-in-documentation-v9_16' into 'v9_16'
Update ISC logo

See merge request isc-projects/bind9!3822
2020-07-08 03:40:09 +00:00
Mark Andrews
714424e0eb Update ISC logo
(cherry picked from commit 875a637eeb)
2020-07-08 03:25:57 +00:00
Mark Andrews
acb018599e Merge branch '1475-convert-header-attributes-to-atomic-v9_16' into 'v9_16'
Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1545 in mark_header_stale and check_stale_header"

See merge request isc-projects/bind9!3821
2020-07-08 02:56:29 +00:00
Mark Andrews
032133d8ce Add CHANGES note for [GL #1475]
(cherry picked from commit adf7cb4ba7)
2020-07-08 12:02:25 +10:00
Ondřej Surý
0279cc76a7 Update STALE and ANCIENT header attributes atomically
The ThreadSanitizer found a data race when updating the stale header.
Instead of trying to acquire the write lock and failing occasionally
which would skew the statistics, the dns_rdatasetheader_t.attributes
field has been promoted to use stdatomics.  Updating the attributes in
the mark_header_ancient() and mark_header_stale() now uses the cmpxchg
to update the attributes forfeiting the need to hold the write lock on
the tree.  Please note that mark_header_ancient() still needs to hold
the lock because .dirty is being updated in the same go.

(cherry picked from commit 81d4230e60)
2020-07-08 12:01:46 +10:00
Mark Andrews
48939d5c59 Merge branch 'ondrej/add-16-bit-stdatomic-shims-v9_16' into 'v9_16'
Make the stdatomic shim and mutexatomic type complete

See merge request isc-projects/bind9!3819
2020-07-08 01:19:16 +00:00
Mark Andrews
dd32fb9284 Make the stdatomic shim and mutexatomic type complete
The stdatomic shims for non-C11 compilers (Windows, old gcc, ...) and
mutexatomic implemented only and minimal subset of the atomic types.
This commit adds 16-bit operations for Windows and all atomic types as
defined in standard.

(cherry picked from commit bccea5862d)
2020-07-08 10:29:59 +10:00
Mark Andrews
b10416d87e Merge branch '1991-cleanup-redundant-non-null-check-v9_16' into 'v9_16'
remove redundant rctx != NULL check

See merge request isc-projects/bind9!3805
2020-07-06 01:22:01 +00:00
Mark Andrews
244ebdfb8c remove redundant rctx != NULL check
(cherry picked from commit 2fa2dbd5fb)
2020-07-06 10:30:25 +10:00
Matthijs Mekking
4c5ce87043 Merge branch '1988-windows-rndc-dnssec-status-bad-output-v9_16' into 'v9_16'
Increase "rndc dnssec -status" output size

See merge request isc-projects/bind9!3804
2020-07-04 16:31:11 +00:00
Matthijs Mekking
293d52341d Increase "rndc dnssec -status" output size
BUFSIZ (512 bytes on Windows) may not be enough to fit the status of a
DNSSEC policy and three DNSSEC keys.

Set the size of the relevant buffer to a hardcoded value of 4096 bytes,
which should be enough for most scenarios.

(cherry picked from commit 9347e7db7e)
2020-07-03 15:13:50 +02:00
Ondřej Surý
448a2e7314 Merge branch 'ondrej/dont-fail-system-test-on-missing-pytest-v9_16' into 'v9_16'
Add prereq.sh script to the shutdown system test

See merge request isc-projects/bind9!3796
2020-07-03 07:22:00 +00:00
Ondřej Surý
b9b1366bf0 Add prereq.sh script to the shutdown system test
The shutdown test requires python, pytest and dnspython.
2020-07-03 08:54:01 +02:00
Michał Kępień
38ca3fbcdc Merge branch '1627-add-changes-entry-v9_16' into 'v9_16'
[v9_16] Add CHANGES entry for #1627

See merge request isc-projects/bind9!3797
2020-07-02 09:23:05 +00:00
Michał Kępień
c84cea3f9b Add CHANGES entry for #1627
(cherry picked from commit dee2b3c7c8)
2020-07-02 11:21:20 +02:00
Ondřej Surý
fb713451ab Merge branch '1951-add-bind-version-number-to-introduction-rst-file-v9_16' into 'v9_16'
Add release statement to introduction.rst

See merge request isc-projects/bind9!3792
2020-07-02 08:06:25 +00:00
Suzanne Goldlust
c25c0a1ef3 Add release statement to introduction.rst
(and remove duplicate copyright statement)

(cherry picked from commit a4549f89bf)
2020-07-02 10:05:45 +02:00
Mark Andrews
006b1f0378 Merge branch '1939-rumoured-kasp-intermittent-failures-v9_16' into 'v9_16'
Resolve "kasp system test intermittent test failures for "rumoured.kasp" zone"

See merge request isc-projects/bind9!3786
2020-07-02 05:30:34 +00:00
Matthijs Mekking
de02eb55b5 Fix kasp test set_keytime
While the creation and publication times of the various keys
in this policy are nearly at the same time there is a chance that
one key is created a second later than the other.

The `set_keytimes_algorithm_policy` mistakenly set the keytimes
for KEY3 based of the "published" time from KEY2.

(cherry picked from commit 24e07ae98e)
2020-07-02 04:56:20 +00:00
Ondřej Surý
a10f754c60 Merge branch '1987-fix-formatting-error-in-man-pages-section-of-bind-arm-v9_16' into 'v9_16'
Fix formatting of See Also section header

See merge request isc-projects/bind9!3787
2020-07-01 21:47:15 +00:00
Suzanne Goldlust
4112b96d52 Fix formatting of See Also section header
(cherry picked from commit e3e787bc14)
2020-07-01 23:46:39 +02:00
Michał Kępień
63548a4f2c Merge branch '1946-man-page-installation-fixes' into 'v9_16'
Man page installation fixes

See merge request isc-projects/bind9!3772
2020-07-01 20:08:39 +00:00
Michał Kępień
8c9cacb7e8 Restore man pages for symlinked BIND tools
Commit b580eb2fb3 inadvertently caused the
man pages for symlinked BIND tools (named-compilezone, tsig-keygen) to
no longer be installed by "make install".  Fix by restoring the commands
which ensure that.
2020-07-01 22:06:25 +02:00
Michał Kępień
58c07cc153 Install NZD-related man pages conditionally
Commit b580eb2fb3 inadvertently caused
NZD-related man pages to be installed unconditionally.  Ensure they are
only installed for LMDB-enabled builds.
2020-07-01 22:06:25 +02:00
Michał Kępień
75e322ec08 Install dnstap-related man pages conditionally
Commit b580eb2fb3 inadvertently caused
dnstap-related man pages to be installed unconditionally.  Ensure they
are only installed for dnstap-enabled builds.
2020-07-01 22:06:25 +02:00
Ondřej Surý
be5aa87d58 Merge branch '1968-cleanup-dead-nodes-fix-v9_16' into 'v9_16'
Resolve "Again: BIND | rbtdb.c:2162: INSIST with bind with 9.11.20  (see #1718)"

See merge request isc-projects/bind9!3782
2020-07-01 14:07:36 +00:00
Ondřej Surý
3733bd33e9 Add CHANGES and release note for #1968
(cherry picked from commit 4c12709da4)
2020-07-01 15:35:21 +02:00
Witold Kręcicki
000c7d1340 rbtdb: cleanup_dead_nodes should ignore alive nodes on the deadlist
(cherry picked from commit c8f2d55acf)
2020-07-01 15:35:21 +02:00
Ondřej Surý
d5a0bd2cf2 Merge branch '1862-insist-in-query-c-v9_16' into 'v9_16'
Fix assertion failure when server is under load and root zone is not yet loaded. (v9.16)

See merge request isc-projects/bind9!3774
2020-07-01 13:04:08 +00:00
Ondřej Surý
935123ff99 Add release notes for #1862 2020-07-01 12:55:49 +02:00
Witold Kręcicki
85a786abd2 Add CHANGES note for #1862 2020-07-01 12:55:29 +02:00
Witold Kręcicki
03e583ffa8 Fix assertion failure during startup when the server is under load.
When we're coming back from recursion fetch_callback does not accept
DNS_R_NXDOMAIN as an rcode - query_gotanswer calls query_nxdomain in
which an assertion fails on qctx->is_zone. Yet, under some
circumstances, qname minimization will return an DNS_R_NXDOMAIN - when
root zone mirror is not yet loaded. The fix changes the DNS_R_NXDOMAIN
answer to DNS_R_SERVFAIL.
2020-07-01 12:55:12 +02:00
Ondřej Surý
0bffc160ec Merge branch '1747-fix-race-in-rndc-when-shutting-down-v9_16' into 'v9_16'
Resolve "BIND 9.16.1 does core dump when stopped"

See merge request isc-projects/bind9!3778
2020-07-01 10:53:42 +00:00
Ondřej Surý
401fd09e4d Add CHANGES and release not for #1747
(cherry picked from commit 605209402f)
2020-07-01 12:52:51 +02:00
Diego Fronza
004849fd36 Added test for the fix
This test ensures that named will correctly shutdown
when receiving multiple control connections after processing
of either "rncd stop" or "kill -SIGTERM" commands.

Before the fix, named was crashing due to a race condition happening
between two threads, one running shutdown logic in named/server.c
and other handling control logic in controlconf.c.

This test tries to reproduce the above scenario by issuing multiple
queries to a target named instance, issuing either rndc stop or kill
-SIGTERM command to the same named instance, then starting multiple rndc
status connections to ensure it is not crashing anymore.

(cherry picked from commit 042e509753)
2020-07-01 12:52:51 +02:00
Ondřej Surý
7c0fb5e492 Don't continue opening a new rndc connection if we are shutting down
Due to lack of synchronization, whenever named was being requested to
stop using rndc, controlconf.c module could be trying to access an already
released pointer through named_g_server->interfacemgr in a separate
thread.

The race could only be triggered if named was being shutdown and more
rndc connections were ocurring at the same time.

This fix correctly checks if the server is shutting down before opening
a new rndc connection.

(cherry picked from commit be6cc53ec2)
2020-07-01 12:52:51 +02:00
Ondřej Surý
1e4ac3a94c Merge branch 'ondrej/update-rndc.conf-manpage-v9_16' into 'v9_16'
Commit the regenerated rndc.conf.5in manual page

See merge request isc-projects/bind9!3779
2020-07-01 10:21:34 +00:00
Ondřej Surý
4d65685cc3 Commit the regenerated rndc.conf.5in manual page
(cherry picked from commit c5b63e14bc)
2020-07-01 12:21:16 +02:00
Matthijs Mekking
99b9c82cec Merge branch '1612-rndc-dnssec-status-v9_16' into 'v9_16'
Resolve "Get current state of DNSSEC keys (kasp) via rndc"

See merge request isc-projects/bind9!3771
2020-07-01 10:14:53 +00:00
Matthijs Mekking
9f5a43808f Fix linking problem for #1612
When a library is examined, an object file within it can be left out
of the link if it does not provide symbols that the symbol table
needs.  Introducing `isc_stdtime_tostring` caused a build failure for
`update_test` because it now requires `libisc.a(stdtime.o)` and that
also exports the `isc_stdtime_get` symbol, meaning we have a
multiple definition error.

Add a local version of `isc_stdtime_tostring`, so that the linker
will not search for it in available object files.
2020-07-01 10:55:30 +02:00
Matthijs Mekking
2d9b282d77 Update notes, changes for #1612
(cherry picked from commit e273b95a8b)
2020-07-01 09:58:25 +02:00
Matthijs Mekking
f1b3686cd2 Output rndc dnssec -status
Implement the 'rndc dnssec -status' command that will output
some information about the key states, such as which policy is
used for the zone, what keys are in use, and when rollover is
scheduled.

Add loose testing in the kasp system test, the actual times are
already tested via key file inspection.

(cherry picked from commit 19ce9ec1d4)
2020-07-01 09:57:44 +02:00
Matthijs Mekking
34a9c3f6c9 Implement dummy 'rndc dnssec -status' command
Add the code and documentation required to provide DNSSEC signing
status through rndc.  This does not yet show any useful information,
just provide the command that will output some dummy string.

(cherry picked from commit e1ba1bea7c)
2020-07-01 09:57:44 +02:00
Matthijs Mekking
7915327aac Move dst key printtime in separate function
I'd like to use the same functionality (pretty print the datetime
of keytime metadata) in the 'rndc dnssec -status' command.  So it is
better that this logic is done in a separate function.

Since the stdtime.c code have differernt files for unix and win32,
I think the "#ifdef WIN32" define can be dropped.

(cherry picked from commit 9e03f8e8fe)
2020-07-01 09:57:44 +02:00
Evan Hunt
f20bc90a72 Merge branch '1936-blackhole-fix-v9_16' into 'v9_16'
Resolve "blackhole ACL broken"

See merge request isc-projects/bind9!3776
2020-07-01 06:53:39 +00:00
Evan Hunt
7a8e132c74 CHANGES, release note
(cherry picked from commit 08401e38c1)
2020-06-30 21:10:31 -07:00
Evan Hunt
952461b6af restore "blackhole" functionality
the blackhole ACL was accidentally disabled with respect to client
queries during the netmgr conversion.

in order to make this work for TCP, it was necessary to add a return
code to the accept callback functions passed to isc_nm_listentcp() and
isc_nm_listentcpdns().

(cherry picked from commit 23c7373d68)
2020-06-30 21:10:31 -07:00
Evan Hunt
6b00e5f5a0 update the acl system test to include a blackhole test case
this ACL was previously untested, which allowed a regression to
go undetected.

(cherry picked from commit e3ee138098)
2020-06-30 19:41:42 -07:00
Mark Andrews
490016ebf1 Merge branch 'marka-silence-pyyaml-warning' into 'v9_16'
Silence PyYAML warning

See merge request isc-projects/bind9!3769
2020-06-30 01:39:16 +00:00
Michał Kępień
62f631f798 Silence PyYAML warning
Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):
2020-06-30 11:19:47 +10:00
Mark Andrews
02643b5ab1 Merge branch 'marka-define-top-srcdir' into 'v9_16'
define TOP_SRCDIR

See merge request isc-projects/bind9!3768
2020-06-30 00:12:15 +00:00
Mark Andrews
089df5f8ef Add TOP_SRCDIR to conf.sh.in and conf.sh.win32 2020-06-29 23:50:45 +00:00
Mark Andrews
79d99b6022 Merge branch 'u/fanf2/dnstap-roll-v9_16' into 'v9_16'
U/fanf2/dnstap roll v9 16

See merge request isc-projects/bind9!3754
2020-06-29 23:21:29 +00:00
Mark Andrews
3a12c2de74 Add Release Note for [GL !3728]
(cherry picked from commit 81d15bc967)
2020-06-29 22:30:02 +00:00
Mark Andrews
6822909470 Add CHANGES for [GL !3728]
(cherry picked from commit ce776e79ed)
2020-06-29 22:30:01 +00:00
Mark Andrews
bf205b00c3 Check that 'rndc dnstap -roll <value>' works
(cherry picked from commit a289a57c7f)
2020-06-29 22:30:01 +00:00
Tony Finch
b7f7b8128e Fix rndc dnstap -roll N
The `rndc` argument was always overridden by the static configuration,
because the logic for handling the number of dnstap files to retain
was both backwards and a bit redundant.

(cherry picked from commit 7c07129a51)
2020-06-29 22:30:01 +00:00
Ondřej Surý
7579386567 Merge branch 'ondrej/fix-manpages-in-rtd-v9_16' into 'v9_16'
Fix the manpages TOC in the BIND 9 ARM (v9.16)

See merge request isc-projects/bind9!3766
2020-06-29 17:43:55 +00:00
Ondřej Surý
9d876eccd3 Fix miscellaneous little bugs in RST formatting
(cherry picked from commit b51d10608e)
2020-06-29 19:41:52 +02:00
Ondřej Surý
7196a64fdf Add missing rndc.conf header that was breaking manpages section
The rndc.conf main header was missing the header markup and that was
breaking the TOC for all manpages in the ARM because sphinx-build
incorrectly remembered the markup for subheader to be ~~~~ instead of
----.

(cherry picked from commit 5c56a0ddbc)
2020-06-29 19:41:15 +02:00
Michał Kępień
41ca96103c Merge branch 'mnowak/add-new-releases-v9_16' into 'v9_16'
[v9_16] Add Ubuntu 20.04, Fedora 32, Alpine 3.12, OpenBSD 6.7, and FreeBSD 11.4

See merge request isc-projects/bind9!3762
2020-06-29 11:06:15 +00:00
Michał Kępień
0af1ca9659 Fix build-time GSSAPI detection on Tumbleweed
The "krb5-devel" package on openSUSE Tumbleweed installs the
"krb5-config" binary into a custom prefix, which prevents BIND's
"configure" script from autodetecting it.  Fix by specifying the path to
the "krb5-config" binary using --with-gssapi.

(cherry picked from commit 1be15f5900)
2020-06-29 12:44:56 +02:00
Michal Nowak
9703b967d1 Update FreeBSD 11 to 11.4
(cherry picked from commit 18f97b9af2)
2020-06-29 12:44:17 +02:00
Michal Nowak
988057c22d Update to Alpine Linux 3.12
(cherry picked from commit eff79ab20c)
2020-06-29 12:44:17 +02:00
Michal Nowak
6c1ff7c5e5 Update to OpenBSD 6.7
(cherry picked from commit 374660fd37)
2020-06-29 12:44:17 +02:00
Michal Nowak
d5e6d5c28e Drop Bionic
(cherry picked from commit 27c8bc1750)
2020-06-29 12:44:17 +02:00
Michal Nowak
e0751c74d5 Add Ubuntu 20.04 Focal Fossa, update Fedora to 32
(cherry picked from commit c3e259a8c9)
2020-06-29 12:44:16 +02:00
Michał Kępień
83df6d1334 Merge branch '1977-address-compilation-warnings-on-freebsd-11.4' into 'v9_16'
Address compilation warnings on FreeBSD 11.4

See merge request isc-projects/bind9!3760
2020-06-29 10:05:56 +00:00
Michał Kępień
be35b872fd Address compilation warnings on FreeBSD 11.4
With Clang 10.0.0 on FreeBSD 11.4, compiling lib/dns/spnego.c triggers
the following warnings:

    spnego.c:361:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:366:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:371:12: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                            return (GSS_S_DEFECTIVE_TOKEN);
                                    ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:376:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    spnego.c:380:11: error: converting the result of '<<' to a boolean always evaluates to true [-Werror,-Wtautological-constant-compare]
                    return (GSS_S_DEFECTIVE_TOKEN);
                            ^
    /usr/include/gssapi/gssapi.h:423:41: note: expanded from macro 'GSS_S_DEFECTIVE_TOKEN'
    #define GSS_S_DEFECTIVE_TOKEN      (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
                                            ^
    5 errors generated.

Address by replacing all instances of the GSS_S_DEFECTIVE_TOKEN constant
with a boolean value.  Invert the values returned by cmp_gss_type() so
that its only call site reads more naturally in the context of the
comment preceding it.
2020-06-29 12:03:01 +02:00
Matthijs Mekking
55e2b57a14 Merge branch '1876-kasp-test-wait-for-reconfig-v9_16' into 'v9_16'
Resolve "kasp: algnum migration test does not wait long enough."

See merge request isc-projects/bind9!3761
2020-06-29 07:43:42 +00:00
Matthijs Mekking
7eed00502f kasp tests: fix wait for reconfig done
The wait until zones are signed after rndc reconfig is broken
because the zones are already signed before the reconfig.  Fix
by having a different way to ensure the signing of the zone is
complete.  This does require a call to the "wait_for_done_signing"
function after each "check_keys" call after the ns6 reconfig.

The "wait_for_done_signing" looks for a (newly added) debug log
message that named will output if it is done signing with a certain
key.

(cherry picked from commit a47192ed5b)
2020-06-29 08:09:40 +02:00
Matthijs Mekking
60752f8092 kasp tests: Replace while loops with retry_quiet
(cherry picked from commit cf76d839ae)
2020-06-29 08:09:32 +02:00
Evan Hunt
0a6c7ab2a9 Merge branch '1938-fix-udp-race' into 'v9_16'
Resolve "Repeated bind 9.16.3 assert error in libuv (attempting restart after an earlier/different crash)"

See merge request isc-projects/bind9!3722
2020-06-26 09:05:37 +00:00
Witold Kręcicki
2be35bd2bc CHANGES 2020-06-26 01:44:10 -07:00
Witold Kręcicki
4582ef3bb2 Fix a shutdown race in netmgr udp.
We need to mark the socket as inactive early (and synchronously)
in the stoplistening process - otherwise we might destroy the
callback argument before actually stopping listening, and call
the callback on a bad memory.
2020-06-26 01:44:03 -07:00
Evan Hunt
4ea84740e6 Merge branch '1947-fix-tcpdns-race' into 'v9_16'
Resolve "Segmentation fault in recursive stress test"

See merge request isc-projects/bind9!3721
2020-06-26 08:40:27 +00:00
Witold Kręcicki
bb629b9b16 CHANGES 2020-06-26 01:18:31 -07:00
Witold Kręcicki
97e44fa3df Make netmgr tcpdns send calls asynchronous.
isc__nm_tcpdns_send() was not asynchronous and accessed socket
internal fields in an unsafe manner, which could lead to a race
condition and subsequent crash. Fix it by moving the whole tcpdns
processing to a proper netmgr thread.
2020-06-26 01:18:27 -07:00
Evan Hunt
d761cd576b Merge branch '1952-yaml-ipv6-v9_16' into 'v9_16'
append "0" to IPv6 addresses ending in "::" when printing YAML

See merge request isc-projects/bind9!3752
2020-06-26 02:31:09 +00:00
Evan Hunt
f171017570 append "0" to IPv6 addresses ending in "::" when printing YAML
such addresses broke some YAML parsers.

(cherry picked from commit a8baf79e33)
2020-06-25 18:57:06 -07:00
Mark Andrews
4e33f6b338 Merge branch '1689-bind-stops-dnskey-lookup-in-get_dst_key-when-a-key-with-unsupported-algorithm-is-found-first-v9_16' into 'v9_16'
Resolve "BIND stops DNSKEY lookup in get_dst_key() when a key with unsupported algorithm is found first"

See merge request isc-projects/bind9!3748
2020-06-25 14:11:08 +00:00
Matthijs Mekking
6d91799388 Add todo in dnssec system test for [GL #1689]
Add a note why we don't have a test case for the issue.

It is tricky to write a good test case for this if our tools are
not allowed to create signatures for unsupported algorithms.

(cherry picked from commit c6345fffe9)
2020-06-25 22:44:19 +10:00
Mark Andrews
3e3afeb31e Add Release Note for [GL #1689]
(cherry picked from commit e195d4608a)
2020-06-25 22:44:17 +10:00
Mark Andrews
fd05589e66 Add CHANGES for [GL #1689]
(cherry picked from commit b733bd6555)
2020-06-25 22:43:25 +10:00
Mark Andrews
3612f662da The validator could fail when select_signing_key/get_dst_key failed
to select the signing key because the algorithm was not supported
and the loop was prematurely aborted.

(cherry picked from commit d475f3aeed)
2020-06-25 22:42:43 +10:00
Mark Andrews
022d923161 Merge branch '1969-silence-cppcheck-warnings' into 'v9_16'
Resolve "Silence CPPCHECK warnings"

See merge request isc-projects/bind9!3746
2020-06-25 12:38:54 +00:00
Mark Andrews
3f48a1e06e Add INSIST's to silence cppcheck warnings
(cherry picked from commit 0cf25d7f38)
2020-06-25 21:13:17 +10:00
Mark Andrews
b43641a55d Address potential thread issues:
Assign and then check node for NULL to address another thread
changing radix->head in the meantime.

Move 'node != NULL' check into while loop test to silence cppcheck
false positive.

Fix pointer != NULL style.

(cherry picked from commit 51f08d2095)
2020-06-25 21:11:27 +10:00
Mark Andrews
085afcaba8 Merge branch '1965-bin-named-unix-os-c-warning-s-directive-output-may-be-truncated-on-openindiana-v9_16' into 'v9_16'
Resize unamebuf[] to avoid warnings about snprintf() not having

See merge request isc-projects/bind9!3744
2020-06-24 23:37:15 +00:00
Mark Andrews
4885f0813e Resize unamebuf[] to avoid warnings about snprintf() not having
enough buffer space.  Also change named_os_uname() prototype so
that it is now returning (const char *) rather than (char *).  If
uname() is not supported on a UNIX build prepopulate unamebuf[]
with "unknown architecture".

(cherry picked from commit 4bc3de070f)
2020-06-25 09:26:22 +10:00
Ondřej Surý
646f73797b Merge branch '1949-checknames-v9_16' into 'v9_16'
Resolve "check-names doesn't use 'primary' and 'secondary'"

See merge request isc-projects/bind9!3732
2020-06-22 12:42:35 +00:00
Ondřej Surý
bf208a3894 Add CHANGES and release note for #1949
(cherry picked from commit eaafae2766)
2020-06-22 14:30:14 +02:00
Evan Hunt
dca3658720 "check-names primary" and "check-names secondary" were ignored
these keywords were added to the parser as synonyms for "master"
and "slave" but were never hooked in to the configuration of named,
so they were ignored. this has been fixed and the option is now
checked for correctness.

(cherry picked from commit ba31b189b4)
2020-06-22 14:30:14 +02:00
Ondřej Surý
98f5a27f6d Merge branch '1627-address-race-in-zone-maintenance-v9_16' into 'v9_16'
Address race between zone_maintenance and dns_zone_setview_helper

See merge request isc-projects/bind9!3729
2020-06-22 12:00:20 +00:00
Mark Andrews
34a5ad82d6 Address race between zone_maintenance and dns_zone_setview_helper
There was a possible NULL dereference due to data race between accessing
zone->view and zone->view->adb.

(cherry picked from commit 67c8f7329d)
2020-06-22 12:27:11 +02:00
Mark Andrews
b6e308b9ee Merge branch '1955-lmdb_cflags-missing-from-dns_includes-in-make-includes-in' into 'v9_16'
Resolve "${LMDB_CFLAGS} missing from DNS_INCLUDES in make/includes.in"

See merge request isc-projects/bind9!3719
2020-06-19 08:07:46 +00:00
Mark Andrews
036cd40b8c Add CHANGES note for [GL #1955] 2020-06-19 12:23:00 +10:00
Mark Andrews
39c3565408 Add ${LMDB_CFLAGS} to DNS_INCLUDES in make/includes.in
so that <lmdb.h> will be found when <dns/lmdb.h> is included.
2020-06-19 12:13:27 +10:00
Mark Andrews
41e38c216d Add missing #pragma once to <dns/lmdb.h> 2020-06-19 12:12:45 +10:00
Michał Kępień
8aed0ff51a Merge branch 'v9_16_4-release' into 'v9_16'
[CVE-2020-8618] [CVE-2020-8619] Merge 9.16.4 release branch

See merge request isc-projects/bind9!3712
2020-06-18 08:47:51 +00:00
Michał Kępień
4712aa7330 Set up release notes for BIND 9.16.5 2020-06-18 10:33:50 +02:00
Michał Kępień
43b610a79d Bump BIND_BASELINE_VERSION for ABI checks 2020-06-18 10:33:50 +02:00
Tinderbox User
9eb5040216 Merge branch 'prep-release' into security-v9_16 2020-06-18 10:25:51 +02:00
Tinderbox User
adab85b815 prep 9.16.4 2020-06-18 10:25:50 +02:00
Michał Kępień
64ee041fa7 Merge branch 'security-v9_16-docs' into 'security-v9_16'
Prepare documentation for BIND 9.16.4

See merge request isc-private/bind9!173
2020-06-18 10:25:37 +02:00
Michał Kępień
3859bbe57a Tweak and reword release notes 2020-06-18 10:25:37 +02:00
Michał Kępień
338ba6e1a1 Add release note for #1859 2020-06-18 10:25:37 +02:00
Michał Kępień
0f28a6f0c4 Add release note for #1842 2020-06-18 10:25:37 +02:00
Michał Kępień
6e28c57d5c Add release note for #1834 2020-06-18 10:25:37 +02:00
Michał Kępień
0d2315a5f2 Add release note for #1812 2020-06-18 10:25:37 +02:00
Michał Kępień
ca941a6542 Add release note for #1714 2020-06-18 10:25:37 +02:00
Michał Kępień
63a4cbfddf Add release note for #83 2020-06-18 10:25:37 +02:00
Michał Kępień
2e3a70fe8d Reorder release notes 2020-06-18 10:25:36 +02:00
Michał Kępień
40b3591eea Prepare release notes for BIND 9.16.4 2020-06-18 10:25:05 +02:00
Michał Kępień
e4c2281e11 Merge branch 'security-wildcard-test-marka-v9_16' into security-v9_16 2020-06-18 10:18:42 +02:00
Michał Kępień
ef42ca2864 Tweak and reword recent CHANGES entries 2020-06-18 10:18:42 +02:00
Michał Kępień
0454d26078 Merge branch 'security-new_reference-insist-v9_16' into security-v9_16 2020-06-18 10:18:42 +02:00
Mark Andrews
f8d7bd22f7 Add CHANGES note
(cherry picked from commit 5acccc6e8dbcfd7efa31686946d677d7895a7fff)
2020-06-18 10:18:42 +02:00
Michał Kępień
c9e2a23d9e Merge branch '1850-cleanup-client_allocsendbuf-v9_16' into security-v9_16 2020-06-18 10:18:42 +02:00
Mark Andrews
b40b453c93 Add CHANGES entry for #1718
(cherry picked from commit d7c26a97c82c256e00b167c65a70fb304a7320d4)
2020-06-18 10:18:42 +02:00
Mark Andrews
e522e80dc4 Add checking RFC 4592 responses examples to wildcard system test
(cherry picked from commit 30586aa054c9cd8a4e64c91ed78683a4b54c79bc)
2020-06-18 10:18:42 +02:00
Mark Andrews
e742313374 Add release notes for #1850
(cherry picked from commit 8d2dffa53a987c31af053824bc210a7fe3d66849)
2020-06-18 10:18:42 +02:00
Mark Andrews
54e5fb53e3 Add release note for #1718
(cherry picked from commit 2f9d6d4f7eb624986db914a2825bbcc4e6d378b1)
2020-06-18 10:18:42 +02:00
Mark Andrews
88cd1e264c Add CHANGES entry for #1850
(cherry picked from commit 9b56a3c85578e56e10b174391e579d8e32ff6e34)
2020-06-18 10:18:42 +02:00
Mark Andrews
6964a21fa6 Remove INSIST from from new_reference
RBTDB node can now appear on the deadnodes lists following the changes
to decrement_reference in 176b23b6cd to
defer checking of node->down when the tree write lock is not held.  The
node should be unlinked instead.

(cherry picked from commit 569cc155b8680d8ed12db1fabbe20947db24a0f9)
2020-06-18 10:18:42 +02:00
Mark Andrews
ee6f60349b Adjust NS_CLIENT_TCP_BUFFER_SIZE and cleanup client_allocsendbuf
NS_CLIENT_TCP_BUFFER_SIZE was 2 byte too large following the
move to netmgr add associated changes to lib/ns/client.c and
as a result an INSIST could be trigger if the DNS message being
constructed had a checkpoint stage that fell in those two extra
bytes.  Adjusted NS_CLIENT_TCP_BUFFER_SIZE and cleaned up
client_allocsendbuf now that the previously reserved 2 bytes
are no longer used.

(cherry picked from commit 5a92af19b7dce684b0e6670ae6ec1c4c58613263)
2020-06-18 10:18:41 +02:00
Ondřej Surý
8b61b30a57 Merge branch '1950-properly-handle-missing-kyua' into 'v9_16'
Skip the unit tests when kyua is not available

See merge request isc-projects/bind9!3704
2020-06-17 13:28:14 +00:00
Ondřej Surý
4ab9e79e6f Add CHANGES and release note for #1950 2020-06-17 15:04:43 +02:00
Ondřej Surý
762a3c866e Skip the unit tests when kyua is not available
The unittest.sh script tried to execute the unit tests when cmocka
development libraries was available, but kyua, the execution engine,
was not.  Now, both need to be installed in the system.
2020-06-17 15:04:43 +02:00
Ondřej Surý
eca3c5f615 Merge branch 'ondrej/switch-the-default-branch-name-to-main-v9_16' into 'v9_16'
Adjust the GitLab CI scripts for new default branch name

See merge request isc-projects/bind9!3707
2020-06-17 12:19:22 +00:00
Ondřej Surý
e12ab8c48b Adjust the GitLab CI scripts for new default branch name
(cherry picked from commit b36cd06a0b)
2020-06-17 14:17:21 +02:00
Ondřej Surý
f0a3d4d688 Merge branch '1943-remove-references-to-blacklist-and-whitelist-in-bind-arm-v9_16' into 'v9_16'
Remove references to "blacklist" and "whitelist"

See merge request isc-projects/bind9!3701
2020-06-16 20:00:32 +00:00
Suzanne Goldlust
4cc90976f6 Update logging-categories.rst and reference.rst
Remove references to "blacklist" and "whitelist"

(cherry picked from commit 4a04fb68cd)
2020-06-16 21:58:49 +02:00
Ondřej Surý
06f125c9d4 Merge branch '1931-fix-out-of-order-rfcs-in-general-rst-file-of-bind-arm-v9_16' into 'v9_16'
Fix two RFCs that were out of numerical order

See merge request isc-projects/bind9!3700
2020-06-16 19:34:17 +00:00
Suzanne Goldlust
194ea4b256 Fix two RFCs that were out of numerical order
(cherry picked from commit acb4742182)
2020-06-16 21:33:11 +02:00
Ondřej Surý
8b7c9df2b0 Merge branch '1945-system-clang-tsan-has-bad-symbolizer-v9_16' into 'v9_16'
Set the TSAN symbolizer path directly, the indirection via env doesn't work

See merge request isc-projects/bind9!3698
2020-06-16 08:54:45 +00:00
Ondřej Surý
362007bf1f Set the TSAN symbolizer path directly, the indirection via env doesn't work
(cherry picked from commit 39107365a7)
2020-06-16 10:51:58 +02:00
Ondřej Surý
cebc77a560 Merge branch '1474-threadsanitizer-data-race-lib-dns-message-c-v9_16' into 'v9_16'
Add missing acquire memory barrier in isc_nmhandle_unref

See merge request isc-projects/bind9!3695
2020-06-16 08:51:17 +00:00
Ondřej Surý
8b4fe6c6c5 Add missing acquire memory barrier in isc_nmhandle_unref
The ThreadSanitizer uses system synchronization primitives to check for
data race.  The netmgr handle->references was missing acquire memory
barrier before resetting and reusing the memory occupied by isc_nmhandle_t.

(cherry picked from commit 1013c0930e)
2020-06-16 08:58:33 +02:00
Mark Andrews
b6e4432081 Merge branch 'marka-dsset-refs-v9_16' into 'v9_16'
Marka dsset refs v9 16

See merge request isc-projects/bind9!3688
2020-06-11 07:52:21 +00:00
Mark Andrews
02541e95e3 Add release note for [GL #1926]
(cherry picked from commit f97889a51a)
2020-06-11 16:09:44 +10:00
Mark Andrews
e7969ca571 Add CHANGES note [GL #1926]
(cherry picked from commit 9d89244ba2)
2020-06-11 16:09:44 +10:00
Mark Andrews
06cebcb6b7 val->keynode is no longer needed
(cherry picked from commit ff4fc3f8dc)
2020-06-11 16:09:43 +10:00
Mark Andrews
70c27df941 The dsset returned by dns_keynode_dsset needs to be thread safe.
- clone keynode->dsset rather than return a pointer so that thread
  use is independent of each other.
- hold a reference to the dsset (keynode) so it can't be deleted
  while in use.
- create a new keynode when removing DS records so that dangling
  pointers to the deleted records will not occur.
- use a rwlock when accessing the rdatalist to prevent instabilities
  when DS records are added.

(cherry picked from commit e5b2eca1d3)
2020-06-11 16:09:43 +10:00
Evan Hunt
5b4d4cb3f3 Merge branch '1930-tcp-race-quota-v9_16' into 'v9_16'
Fix a race in TCP accepting.

See merge request isc-projects/bind9!3684
2020-06-10 18:49:55 +00:00
Witold Kręcicki
aa2282853a Fix a race in TCP accepting.
There's a possibility of a race in TCP accepting code:
T1 accepts a connection C1
T2 accepts a connection C2
T1 tries to accept a connection C3, but we hit a quota,
   isc_quota_cb_init() sets quota_accept_cb for the socket,
   we return from accept_connection
T2 drops C2, but we race in quota_release with accepting C3 so
   we don't see quota->waiting is > 0, we don't launch the callback
T1 accepts a connection C4, we are able to get the quota we clear
   the quota_accept_cb from sock->quotacb
T1 drops C1, tries to call the callback which is zeroed, sigsegv.
2020-06-10 11:39:43 -07:00
Witold Kręcicki
7ff1ff88f9 Don't clean quota cb cb_func/data, we don't own it 2020-06-10 17:52:53 +02:00
Michał Kępień
56005ed658 Merge branch '1921-gitlab-ci-release-process-fixes-v9_16' into 'v9_16'
[v9_16] GitLab CI release process fixes

See merge request isc-projects/bind9!3681
2020-06-09 13:02:15 +00:00
Michał Kępień
f1ddba0703 Fix GitLab CI job building release tarballs
Adjust the script for the GitLab CI job building release tarballs to
account for the changes in the documentation building process introduced
by the migration to Sphinx.
2020-06-09 14:57:00 +02:00
Witold Krecicki
1abfc5ad97 Merge branch 'wpk/fix-isc-assertions-c-error-v9_16' into 'v9_16'
Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

See merge request isc-projects/bind9!3677
2020-06-08 17:18:01 +00:00
Witold Kręcicki
31897276d9 Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c
(cherry picked from commit f4260dc0c5)
2020-06-08 15:57:31 +00:00
Witold Krecicki
5467970c9e Merge branch '1859-deadlock-in-socket-c-v9_16' into 'v9_16'
Resolve "Possible deadlock in unix/socket.c"

See merge request isc-projects/bind9!3678
2020-06-08 15:56:43 +00:00
Witold Kręcicki
bbf1422614 Fix possible deadlock in unix/socket.c
In process_fd we lock sock->lock and then internal_accept locks mgr->lock,
in isc_sockmgr_render* functions we lock mgr->lock and then lock sock->lock,
that can cause a deadlock when accessing stats. Unlock sock->lock early in
all the internal_{send,recv,connect,accept} functions instead of late
in process_fd.
2020-06-08 15:30:10 +02:00
Ondřej Surý
24573abeef Merge branch '1808-race-in-resolver-fetch-v9_16' into 'v9_16'
Resolve "assertion failure in bind 9.16.2"

See merge request isc-projects/bind9!3671
2020-06-06 07:30:07 +00:00
Ondřej Surý
710c2dc654 Add release note for #1808
(cherry picked from commit 5a9f594629)
2020-06-05 18:58:13 -07:00
Witold Kręcicki
3175009575 Add CHANGES entry for #1808
(cherry picked from commit f0f859411f)
2020-06-05 18:58:13 -07:00
Witold Kręcicki
c3dcab5f13 Fix a data access race in resolver
We were passing client address to dns_resolver_createfetch as a pointer
and it was saved as a pointer. The client (with its address) could be
gone before the fetch is finished, and in a very odd scenario
log_formerr would call isc_sockaddr_format() which first checks if the
address family is valid (and at this point it still is), then the
sockaddr is cleared, and then isc_netaddr_fromsockaddr is called which
fails an assertion as the address family is now invalid.

(cherry picked from commit 175c4d9055)
2020-06-05 18:58:13 -07:00
Ondřej Surý
30625774f7 Merge branch '1842-correct-the-bind-arm-to-say-that-the-default-session-key-for-use-with-update-policy-local-is-v9_16' into 'v9_16'
Edit reference.rst to indicate that the TSIG

See merge request isc-projects/bind9!3673
2020-06-05 14:38:50 +00:00
Suzanne Goldlust
365263f559 Edit reference.rst to indicate that the TSIG
session key is automatically created on startup

(cherry picked from commit 79920cea70)
2020-06-05 16:37:43 +02:00
Mark Andrews
7ef5145cc9 Merge branch '1835-add-yaml-for-ede-v9_16' into 'v9_16'
Resolve "Add the ability to parse and display Extended DNS Error code (EDE)."

See merge request isc-projects/bind9!3666
2020-06-05 03:18:36 +00:00
Mark Andrews
0c23582ffd Improve the behaviour of yamlget.py when run with python2
(cherry picked from commit 9e72266705)
2020-06-05 10:51:01 +10:00
Mark Andrews
28a940fe69 Add +yaml support for EDE
(cherry picked from commit 0ec77c2b92)
2020-06-05 10:50:58 +10:00
Michal Nowak
7c8cfe38be Merge branch '1902-bind-build-problems-on-netbsd-9-v9_16' into 'v9_16'
[v9_16] Fix "array subscript is of type 'char'"

See merge request isc-projects/bind9!3660
2020-06-04 14:28:11 +00:00
Michal Nowak
e39685b579 Fix "array subscript is of type 'char'" 2020-06-04 16:27:43 +02:00
Ondřej Surý
80882a8e14 Merge branch '1798-reject-master-zones-with-ds-records-at-the-apex-v9_16' into 'v9_16'
Resolve "Reject master zones with DS records at the apex."

See merge request isc-projects/bind9!3662
2020-06-04 14:25:39 +00:00
Mark Andrews
653a6543c0 Add release note for #1798
(cherry picked from commit 8b05e6f710)
2020-06-04 16:06:48 +02:00
Mark Andrews
2ef63ad627 Add CHANGES entry for #1798
(cherry picked from commit 06e714df0d)
2020-06-04 16:06:48 +02:00
Mark Andrews
6ac4e62fbc Ignore attempts to add DS records at zone apex
DS records belong in the parent zone at a zone cut and
are not retrievable with modern recursive servers.

(cherry picked from commit ae55fbbe9c)
2020-06-04 16:06:45 +02:00
Mark Andrews
b17f6eba6a Reject primary zones with an DS record at the zone apex.
DS records only belong at delegation points and if present
at the zone apex are invariably the result of administrative
errors.  Additionally they can't be queried for with modern
resolvers as the parent servers will be queried.

(cherry picked from commit 35a58d30c9)
2020-06-04 16:06:07 +02:00
Ondřej Surý
b2f7bd98b6 Merge branch '1782-ipv6-docs-v9_16' into 'v9_16'
Resolve "9.16.x: listen-on-v6 { any; }; no longer works as documented on FreeBSD"

See merge request isc-projects/bind9!3661
2020-06-04 14:04:59 +00:00
Witold Kręcicki
a0faf3dfc5 Add release notes for #1782
(cherry picked from commit d3ea1caf5a)
2020-06-04 16:02:59 +02:00
Witold Kręcicki
587556f0af Documentation update wrt IPv6 listening.
With netmgr we're creating separate socket for each IPv6 interface,
just as with IPv4 - update documentation accordingly.

(cherry picked from commit 6a2100034b)
2020-06-04 16:02:19 +02:00
Michał Kępień
ec9d1b6363 Merge branch '1841-test-multiple-softhsm-versions-in-gitlab-ci-v9_16' into 'v9_16'
[v9_16] Test multiple SoftHSM versions in GitLab CI

See merge request isc-projects/bind9!3657
2020-06-04 12:39:48 +00:00
Michał Kępień
b3899c29c4 Embed SoftHSM version in CI job names
To indicate the SoftHSM version used in each CI job while avoiding the
need to add another token to job names, replace "pkcs11" with
"softhsm2.4" and "fedora31:amd64" with "softhsm2.6".

(cherry picked from commit c7169c4ab0)
2020-06-04 12:38:54 +00:00
Michał Kępień
99c69ec144 Make Fedora CI jobs PKCS#11-enabled
Various SoftHSM versions differ in algorithm support.  Since Fedora
tends to have the latest SoftHSM version available in its stock package
repositories, enable PKCS#11 support in Fedora jobs to test multiple
SoftHSM versions in GitLab CI.

(cherry picked from commit 3ecb202ba3)
2020-06-04 12:38:54 +00:00
Michał Kępień
d089a0a0f7 Fix & unify Debian job comments in .gitlab-ci.yml
(cherry picked from commit 8aa864d042)
2020-06-04 12:38:54 +00:00
Ondřej Surý
449c8dd88b Merge branch '1877-reduce-default-for-max-stale-ttl-release-notes-update-v9_16' into 'v9_16'
Update release note for #1877

See merge request isc-projects/bind9!3659
2020-06-04 12:25:37 +00:00
Ondřej Surý
e66ddab0f9 Update release note for #1877
(cherry picked from commit bee9ed84f4)
2020-06-04 14:16:47 +02:00
Ondřej Surý
319aec7439 Merge branch 'nsupdate-late-responses-v9_16' into 'v9_16'
Delay kserver cleanup until all tasks finish (v9.16)

See merge request isc-projects/bind9!3651
2020-06-04 11:16:15 +00:00
Ondřej Surý
5c5c92e2fa Add CHANGES entry for !3316
(cherry picked from commit 72e78f0a4b)
2020-06-04 11:32:54 +02:00
Petr Mensik
596a0f27c4 Delay kserver cleanup until all tasks finishes
It might be possible some pending task would run when kserver is already
cleaned up. Postpone gsstsig structures cleanup after task and timer
managers are destroyed. No pending threads are possible after it.

Make action in maybeshutdown only if doshutdown was not already called.
Might be called from getinput event.

(cherry picked from commit 2685e69be8)
2020-06-04 11:32:33 +02:00
Ondřej Surý
7e4eb8ad36 Merge branch '83-cleanup-how-we-build-release-notes-v9_16' into 'v9_16'
Stop building release notes as a separate sphinx-doc document

See merge request isc-projects/bind9!3650
2020-06-04 09:26:10 +00:00
Ondřej Surý
ef50067fd2 Stop building release notes as a separate sphinx-doc document
The release notes were previously built as a separate document
(including the PDF version).  It was agreed that this doesn't make much
sense, so the release notes are now included only as an appendix to the
BIND 9 ARM.

(cherry picked from commit 8eb2323ec3)
2020-06-04 11:24:53 +02:00
Ondřej Surý
3149d687c3 Merge branch '1914-remove-libdns-documentation-v9_16' into 'v9_16'
Remove libdns section in ARM

See merge request isc-projects/bind9!3648
2020-06-04 09:00:58 +00:00
Ondřej Surý
ad0ab84835 Remove libdns section in ARM
When we made BIND 9 libraries private to BIND 9, we forgot to remove the
libdns section on "export" libraries from the ARM.

(cherry picked from commit 3637c466c9)
2020-06-04 11:00:16 +02:00
Ondřej Surý
137ffd8ec6 Merge branch '1910-text-edits-in-general-rst-v9_16' into 'v9_16'
Content, clarity, grammar updates to general.rst

See merge request isc-projects/bind9!3647
2020-06-04 08:57:33 +00:00
Suzanne Goldlust
e940446777 Content, clarity, grammar updates to general.rst
This includes reorganization of the lists of RFCs supported by BIND 9.

I included all the RFCs and notes from the list identified by Vicky in
any DNS-related RFCs written by current ISC engineers, on the assumption
that BIND would comply with them.

(cherry picked from commit 8ca7f22671)
2020-06-04 10:57:01 +02:00
Ondřej Surý
87ee1a225e Merge branch '1899-fix-tcp-accept-windows-v9_16' into 'v9_16'
isc_uv_import must pass UV__IPC_SOCKET_XFER_TCP_CONNECTION, not SERVER.

See merge request isc-projects/bind9!3645
2020-06-03 22:19:22 +00:00
Witold Kręcicki
091117b7ae isc_uv_import must pass UV__IPC_SOCKET_XFER_TCP_CONNECTION, not SERVER.
As a leftover from old TCP accept code isc_uv_import passed TCP_SERVER
flag when importing a socket on Windows.
Since now we're importing/exporting accepted connections it needs to
pass TCP_CONNECTION flag.

(cherry picked from commit 801f7af6e9)
2020-06-03 23:27:24 +02:00
Ondřej Surý
4b9e317561 Merge branch 'wpk/tcp-accept-refactoring-v9_16' into 'v9_16'
TCP accept refactoring (v9_16)

See merge request isc-projects/bind9!3602
2020-06-03 21:26:39 +00:00
Witold Kręcicki
279470e6cb CHANGES note
(cherry picked from commit 813ff015a4)
2020-06-03 23:00:53 +02:00
Witold Kręcicki
c4f91575ca Clean quota callback after calling it
(cherry picked from commit 2f252a1068)
2020-06-03 23:00:52 +02:00
Witold Kręcicki
818afe613f Redesigned TCP accepting: one listen/accept loop, passing the connected socket.
Instead of using bind() and passing the listening socket to the children
threads using uv_export/uv_import use one thread that does the accepting,
and then passes the connected socket using uv_export/uv_import to a random
worker. The previous solution had thundering herd problems (all workers
waking up on one connection and trying to accept()), this one avoids this
and is simpler.
The tcp clients quota is simplified with isc_quota_attach_cb - a callback
is issued when the quota is available.

(cherry picked from commit 60629e5b0b)
2020-06-03 23:00:52 +02:00
Michał Kępień
881c7c4921 Merge branch 'michal/misc-danger-tweaks-v9_16' into 'v9_16'
[v9_16] Miscellaneous Danger tweaks

See merge request isc-projects/bind9!3640
2020-06-03 14:01:02 +00:00
Michał Kępień
a63c88953a Only run Danger if DANGER_GITLAB_API_TOKEN is set
Prevent the Danger GitLab CI job from failing when the GitLab API key to
use is not set.

(cherry picked from commit 2c90438583)
2020-06-03 15:51:15 +02:00
Michał Kępień
09e8f41fd3 Prevent invalid warnings about missing identifiers
The Danger script inspects differences between the current version of a
given merge request's target branch and the merge request branch.  If
the latter falls behind the former, the Danger script will wrongly warn
about missing GitLab/RT identifiers because it incorrectly treats the
"+++" diff marker as an indication of the merge request adding new lines
to a file.  Tweak the relevant conditional expression to prevent such
invalid warnings from being raised.

(cherry picked from commit e062812c38)
2020-06-03 15:51:15 +02:00
Michał Kępień
102e9afc17 Make fetching target branch reliable
As GitLab Runner Docker executor caches Git repositories between jobs,
prevent the Danger script from attempting to update local refs to ensure
"git fetch" returns with an exit code of 0.  Use the FETCH_HEAD ref for
determining the differences between the merge request branch and its
target branch.

(cherry picked from commit d558c4cb78)
2020-06-03 15:51:13 +02:00
Michał Kępień
e4d99f2162 Tweak condition for missing log message warning
Commits adding CHANGES entries and/or release notes do not need a commit
log message.  Do not warn about a missing commit log message for such
commits to make the warning more meaningful.

(cherry picked from commit c13944ca46)
2020-06-03 15:51:13 +02:00
Ondřej Surý
0afd0858ae Merge branch 'wpk/fix-socket-test-teardown-v9_16' into 'v9_16'
tests: fix isc/socket_test.c teardown

See merge request isc-projects/bind9!3636
2020-06-03 13:36:15 +00:00
Witold Kręcicki
ca26bcca38 tests: fix isc/socket_test.c teardown
In case of a test failure we weren't tearing down sockets and tasks
properly, causing the test to hang instead of failing nicely.

(cherry picked from commit 4a8d9250cf)
2020-06-03 14:12:18 +02:00
Ondřej Surý
4a5f917392 Merge branch '1911-remove-runtime_check-res-0-for-so_incoming_cpu-v9_16' into 'v9_16'
Resolve "RUNTIME_CHECK(res == 0) in SO_REUSE and SO_INCOMING_CPU, commit 09ba47b0676"

See merge request isc-projects/bind9!3635
2020-06-03 10:48:22 +00:00
Ondřej Surý
8c207e34a7 Add CHANGES for #1911
(cherry picked from commit 80a2ef8987)
2020-06-03 12:47:21 +02:00
Ondřej Surý
1217916c1e Don't check the result of setting SO_INCOMING_CPU
The SO_INCOMING_CPU is available since Linux 3.19 for getting the value,
but only since Linux 4.4 for setting the value (see below for a full
description).  BIND 9 should not fail when setting the option on the
socket fails, as this is only an optimization and not hard requirement
to run BIND 9.

    SO_INCOMING_CPU (gettable since Linux 3.19, settable since Linux 4.4)
        Sets or gets the CPU affinity of a socket.  Expects an integer flag.

            int cpu = 1;
            setsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, sizeof(cpu));

        Because all of the packets for a single stream (i.e., all
	packets for the same 4-tuple) arrive on the single RX queue that
	is associated with a particular CPU, the typical use case is to
	employ one listening process per RX queue, with the incoming
	flow being handled by a listener on the same CPU that is
	handling the RX queue.  This provides optimal NUMA behavior and
	keeps CPU caches hot.

(cherry picked from commit 4ec357da0a)
2020-06-03 12:47:21 +02:00
Ondřej Surý
b79922151d Merge branch '1877-reduce-default-for-max-stale-ttl-to-something-more-reasonable-12-hours-or-similar-v9_16' into 'v9_16'
Resolve "Reduce default for max-stale-ttl to something more reasonable - 12 hours or similar" (v9.16)

See merge request isc-projects/bind9!3628
2020-06-03 10:45:43 +00:00
Ondřej Surý
ae8944a017 Add CHANGES for #1877
(cherry picked from commit e81728289c)
2020-06-03 10:45:09 +00:00
Ondřej Surý
5e0c510d79 Add release notes for #1877
(cherry picked from commit fc4f3b92ab)
2020-06-03 10:45:09 +00:00
Ondřej Surý
d85b936898 Reduce the default value for max-stale-ttl from 1 week to 12 hours
Originally, the default value for max-stale-ttl was 1 week, which could
and in some scenarios lead to cache exhaustion on a busy resolvers.
Picking the default value will always be juggling between value that's
useful (e.g. keeping the already cached records after they have already
expired and the upstream name servers are down) and not bloating the
cache too much (e.g. keeping everything for a very long time).  The new
default reflects what we think is a reasonable to time to react on both
sides (upstream authoritative and downstream recursive).

(cherry picked from commit 13fd3ecfab)
2020-06-03 10:45:09 +00:00
Ondřej Surý
0010728a77 Merge branch '1909-text-edits-in-history-rst-v9_16' into 'v9_16'
Content, clarity, and grammar edits to history.rst

See merge request isc-projects/bind9!3633
2020-06-03 10:29:33 +00:00
Suzanne Goldlust
e56f0e6d98 Content, clarity, and grammar edits to history.rst
(cherry picked from commit f6164e080f)
2020-06-03 12:28:35 +02:00
Ondřej Surý
8027549a4c Merge branch '1908-text-edits-in-troubleshooting-rst-v9_16' into 'v9_16'
Content, clarity, and grammar edits to troubleshooting.rst

See merge request isc-projects/bind9!3632
2020-06-03 10:27:42 +00:00
Suzanne Goldlust
ca5dae4d44 Content, clarity, and grammar edits to troubleshooting.rst
(cherry picked from commit c6a064a6e9)
2020-06-03 12:26:23 +02:00
Ondřej Surý
8872133cef Merge branch '1906-more-bind-arm-text-edits-v9_16' into 'v9_16'
Content, grammar, and clarity updates to security.rst

See merge request isc-projects/bind9!3631
2020-06-03 10:26:03 +00:00
Suzanne Goldlust
0b4e53bffc Content, grammar, and clarity updates to security.rst
(cherry picked from commit 7c2136766b)
2020-06-03 12:20:52 +02:00
Matthijs Mekking
9d25d0aad6 Merge branch '1845-1846-keyrollover-bugs-v9_16' into 'v9_16'
Resolve "kasp: bug in keymgr_key_has_successor()"

See merge request isc-projects/bind9!3622
2020-06-02 15:32:05 +00:00
Matthijs Mekking
a17dcccf7d Retire predecessor when creating successor
When creating the successor, the current active key (predecessor)
should change its goal state to HIDDEN.

Also add two useful debug logs in the keymgr_key_rollover function.

(cherry picked from commit e71d60299f)
2020-06-02 14:54:41 +02:00
Matthijs Mekking
ef1a4a416a If prepub > retire, prepub now
Catch a case where if the prepublication time of the successor key
is later than the retire time of the predecessor. If that is the
case we should prepublish as soon as possible, a.k.a. now.

(cherry picked from commit c08d0f7dd6)
2020-06-02 14:54:32 +02:00
Matthijs Mekking
b0737b8c61 Put new key rollover logic in separate function
The `dns_keymgr_run()` function became quite long, put the logic
that looks if a new key needs to be created (start a key rollover)
in a separate function.

(cherry picked from commit bcf8192438)
2020-06-02 14:54:20 +02:00
Matthijs Mekking
168d362b54 Fix bug in keymgr_key_has_successor
The logic in `keymgr_key_has_successor(key, keyring)` is flawed, it
returns true if there is any key in the keyring that has a successor,
while what we really want here is to make sure that the given key
has a successor in the given keyring.

Rather than relying on `keymgr_key_exists_with_state`, walk the
list of keys in the keyring and check if the key is a successor of
the given predecessor key.

(cherry picked from commit 0d578097ef)
2020-06-02 14:54:08 +02:00
Matthijs Mekking
f20420c3de Merge branch '1843-print-correct-keytiming-metadata-v9_16' into 'v9_16'
Resolve "kasp: Set correct keytimings"

See merge request isc-projects/bind9!3620
2020-06-02 11:46:03 +00:00
Matthijs Mekking
e85c1aa74e Replace date -d with python script
The usage of 'date -d' in the kasp system test is not portable,
replace with a python script.  Also remove some leftover
"set_keytime 'yes'" calls.

(cherry picked from commit 5b3decaf48)
2020-06-02 11:36:25 +02:00
Matthijs Mekking
ba5d122fd6 Add change entry
(cherry picked from commit bcf3c9fecf)
2020-06-02 11:36:17 +02:00
Matthijs Mekking
da2daea0e6 Test keytimes on algorithm rollover
This improves keytime testing on algorithm rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit 61c1040ae5)
2020-06-02 11:36:08 +02:00
Matthijs Mekking
327d8bb273 Test keytimes on policy changes
This improves keytime testing on reconfiguration of the
dnssec-policy.

(cherry picked from commit da5e1e3a0f)
2020-06-02 11:36:01 +02:00
Matthijs Mekking
f026332f88 Test keytimes on CSK rollover
This improves keytime testing on CSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

Since an "active key" for ZSK and KSK means something
different, this makes it tricky to decide when a CSK is
active. An "active key" intuitively means the key is signing
so we say a CSK is active when it is creating zone signatures.

This change means a lot of timings for the CSK rollover tests
need to be adjusted.

The keymgr code needs a slight change on calculating the
prepublication time: For a KSK we need to include the parent
registration delay, but for CSK we look at the zone signing
property and stick with the ZSK prepublication calculation.

(cherry picked from commit e233433772)
2020-06-02 11:35:52 +02:00
Matthijs Mekking
8e0776d0d5 Test keytimes on KSK rollover
This improves keytime testing on KSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit 649d0833ce)
2020-06-02 11:35:43 +02:00
Matthijs Mekking
437ec25c0c kasp: registration delay adjustments
Registration delay is not part of the Iret retire interval, thus
removed from the calculation when setting the Delete time metadata.

Include the registration delay in prepublication time, because
we need to prepublish the key sooner than just the Ipub
publication interval.

(cherry picked from commit 50bbbb76a8)
2020-06-02 11:35:32 +02:00
Matthijs Mekking
48a265b2c7 Test keytimes on ZSK rollover
This improves keytime testing on ZSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit e01fcbbaf8)
2020-06-02 11:35:19 +02:00
Matthijs Mekking
0e1290c383 Test keytimes on enable-dnssec case
This improves keytime testing for enabling DNSSEC.  It now
tests for specific times, and also tests for SyncPublish.

(cherry picked from commit cf51c87fad)
2020-06-02 11:35:09 +02:00
Matthijs Mekking
cad5ae1682 Set SyncPublish on keys
Set the SyncPublish metadata on keys that don't have them yet.

(cherry picked from commit 30cb5c97c2)
2020-06-02 11:34:57 +02:00
Matthijs Mekking
e036a0a919 Start testing keytiming metadata
This commit adds testing keytiming metadata.  In order to facilitate
this, the kasp system test undergoes a few changes:

1. When finding a key file, rather than only saving the key ID,
   also save the base filename and creation date with `key_save`.
   These can be used later to set expected key times.
2. Add a test function `set_addkeytime` that takes a key, which
   keytiming to update, a datetime in keytiming format, and a number
   (seconds) to add, and sets the new time in the given keytime
   parameter of the given key.  This is used to set the expected key
   times.
3. Split `check_keys` in `check_keys` and `check_keytimes`.  First we
   need to find the keyfile before we can check the keytimes.
   We need to retrieve the creation date (and sometimes other
   keytimes) to determine the other expected key times.
4. Add helper functions to set the expected key times per policy.
   This avoids lots of duplication.

Check for keytimes for the first test cases (all that do not cover
rollovers).

(cherry picked from commit f8e34b57b4)
2020-06-02 11:34:49 +02:00
Matthijs Mekking
91d861b90d Stop keeping track of key parameter count
Stop tracking in the comments the number of key parameters in the
kasp system test, it adds nothing beneficial.

(cherry picked from commit 8483f71258)
2020-06-02 11:34:39 +02:00
Matthijs Mekking
cec9ddd18c Fix some more test output filenames
After removing dnssec-settime calls that set key rollover
relationship, we can adjust the counts in test output filenames.

Also fix a couple of more wrong counts in output filenames.

(cherry picked from commit 8204e31f0e)
2020-06-02 11:34:31 +02:00
Matthijs Mekking
f4d3a774f7 Set key rollover relationship without settime
Using dnssec-setttime after dnssec-keygen in the kasp system test
can lead to off by one second failures, so reduce the usage of
dnssec-settime in the setup scripts.  This commit deals with
setting the key rollover relationship (predecessor/successor).

(cherry picked from commit 5a590c47a5)
2020-06-02 11:34:22 +02:00
Matthijs Mekking
34fd8a0531 Move setting keytimes from settime to keygen
In the kasp system test, we are going to set the keytimes on
dnssec-keygen so we can test them against the key creation time.
This prevents off by one second in the test, something that can
happen if you set those times with dnssec-settime after
dnssec-keygen.

Also fix some test output filenames.

(cherry picked from commit 637d5f9a68)
2020-06-02 11:34:13 +02:00
Matthijs Mekking
6879cdca77 Set keytimes appropriately when using kasp
While kasp relies on key states to determine when a key needs to
be published or be used for signing, the keytimes are used by
operators to get some expectation of key publication and usage.

Update the code such that these keytimes are set appropriately.
That means:
- Print "PublishCDS" and "DeleteCDS" times in the state files.
- The keymgr sets the "Removed" and "PublishCDS" times and derives
  those from the dnssec-policy.
- Tweak setting of the "Retired" time, when retiring keys, only
  update the time to now when the retire time is not yet set, or is
  in the future.

This also fixes a bug in "keymgr_transition_time" where we may wait
too long before zone signatrues become omnipresent or hidden. Not
only can we skip waiting the sign delay Dsgn if there is no
predecessor, we can also skip it if there is no successor.

Finally, this commit moves setting the lifetime, reducing two calls
to one.

(cherry picked from commit 18dc27afd3)
2020-06-02 11:34:04 +02:00
Matthijs Mekking
ab8ee0d040 keygen -k: allow to set times, not genonly
For testing purposes mainly, we want to allow set keytimings on
generated keys, such that we don't have to "keygen/settime" which
can result in one second off times.

(cherry picked from commit 1c21631730)
2020-06-02 11:33:55 +02:00
Ondřej Surý
5585b1cf01 Merge branch '1164-add-danger-python-to-gitlab-ci-v9_16' into 'v9_16'
Add Danger Python to GitLab CI (v9_16)

See merge request isc-projects/bind9!3611
2020-06-01 11:55:40 +00:00
Michał Kępień
b594b1c95f Add Danger Python to GitLab CI
Certain rules of the BIND development process are not codified anywhere
and/or are used inconsistently.  In an attempt to improve this
situation, add a GitLab CI job which uses Danger Python to add comments
to merge requests when certain expectations are not met.  Two categories
of feedback are used, only one of which - fail() - causes the GitLab CI
job to fail.  Exclude dangerfile.py from Python QA checks as the way the
contents of that file are evaluated triggers a lot of Flake8 and PyLint
warnings.

(cherry picked from commit 36bb45a8b6)
2020-06-01 13:45:35 +02:00
Ondřej Surý
7648a4cfb8 Merge branch 'each-sphinx-doc-v9_16' into 'v9_16'
backport sphinx documentation to v9_16

See merge request isc-projects/bind9!3536
2020-06-01 08:18:12 +00:00
Suzanne Goldlust
d56c44579e Grammar, clarity, and content fixes in reference.rst
Also converted logging-categories.rst from a table to text and adjusted
the util/check-categories.sh script.

(cherry picked from commit 1e067c4d0b)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
1dd8581cd8 Text, grammar, typo, and clarity edits in multiple ARM chapters
Files requirements.rst, configuration.rs, plugins.rst, and partially
reference.rst has been edited.

(cherry picked from commit c7264db658)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
6b6bb534de Content and grammar edits to catz.rst
(cherry picked from commit 19ff2e2a79)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
cb855df86d Content updates to CONTRIBUTING.md
(cherry picked from commit 58c61b6e7b)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
6907ce0716 Various text edits to advanced.rst 2020-06-01 09:58:29 +02:00
Suzanne Goldlust
ac76a21566 Fix incorrect command formatting 2020-06-01 09:58:29 +02:00
Suzanne Goldlust
a2dde47f49 Content and grammar edits to dnssec.rst
(cherry picked from commit 5d3ef17ac8)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
20fdee450e Content and grammar changes to managed-keys.rst
(cherry picked from commit c269c061ee)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
cabaa9de9d Content and grammar updates to dlz.rst
(cherry picked from commit 5d6c93aed7)
2020-06-01 09:58:29 +02:00
Suzanne Goldlust
a1282ff3c1 Content and grammar updates to dyndb.rst
(cherry picked from commit 18129808f7)
2020-06-01 09:58:29 +02:00
Evan Hunt
a40d6ec091 generate grammar text correctly in RST format 2020-06-01 09:58:29 +02:00
Evan Hunt
714b559902 fix doxygen build 2020-06-01 09:58:29 +02:00
Evan Hunt
93bdf74804 clean up doc checks
- Update util/check-categories.sh for logging-categories.rst, call from CI
- remove xmllint of .html files
2020-06-01 09:58:29 +02:00
Evan Hunt
5a855f6754 convert release notes to RST 2020-06-01 09:58:25 +02:00
Evan Hunt
b580eb2fb3 add support for building sphinx documentation 2020-06-01 09:54:46 +02:00
Evan Hunt
330c9b32ba convert python tools' man pages to RST 2020-06-01 09:54:45 +02:00
Ondřej Surý
58e20fa746 Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.

(cherry picked from commit 9fb6d11abb)
2020-06-01 09:54:45 +02:00
Ondřej Surý
69706125c6 Merge branch 'wpk/fix-leaking-mutexes-and-conditionals-v9_16' into 'v9_16'
Fix leaking mutexes and conditionals (v9_16)

See merge request isc-projects/bind9!3607
2020-05-30 07:03:09 +00:00
Witold Kręcicki
2a01586068 CHANGES and release notes
(cherry picked from commit 4ae2a74873)
2020-05-30 07:53:33 +02:00
Witold Kręcicki
3461aab083 Clear sock->magic to 0 when destroying a netmgr socket
(cherry picked from commit 7ef756f639)
2020-05-30 07:50:30 +02:00
Witold Kręcicki
4ceddeee78 Add missing isc_mutex_destroy and isc_conditional_destroy calls.
While harmless on Linux, missing isc_{mutex,conditional}_destroy
causes a memory leak on *BSD. Missing calls were added.

(cherry picked from commit a8807d9a7b)
2020-05-30 07:50:30 +02:00
Evan Hunt
b46faa1b04 Merge branch '1857-assertion-failure-insist-nlabels-name-labels-v9_16' into 'v9_16'
Resolve "assertion failure in 9.16.2: name.c:1738: INSIST(nlabels == name->labels)"

See merge request isc-projects/bind9!3608
2020-05-29 23:28:39 +00:00
Evan Hunt
593b9ae80f CHANGES, release note
(cherry picked from commit 6ebab27567)
2020-05-29 15:04:26 -07:00
Mark Andrews
69c43a03d0 Ensure tree lock is always held when dns_rbt_fullnamefromnode is called
(cherry picked from commit eded3efb79)
2020-05-29 15:02:09 -07:00
Evan Hunt
8b154d0f9f pass the nodename to add32() instead of calling dns_rbt_fullnamefromnode()
in addition to being more efficient, this prevents a possible crash by
looking up the node name before the tree sructure can be changed when
cleaning up dead nodes in addrdataset().

(cherry picked from commit db9d10e3c1)
2020-05-29 15:02:09 -07:00
Mark Andrews
8cd193f18d Merge branch '1858-silence-tsan-in-bin-nsupdate-nsupdate-c-v9_16' into 'v9_16'
Lock access to 'answer' to silence TSAN

See merge request isc-projects/bind9!3597
2020-05-28 03:48:20 +00:00
Mark Andrews
f00cb2415a Lock access to 'answer' to silence TSAN
(cherry picked from commit b3bd8a270b)
2020-05-28 11:11:45 +10:00
Evan Hunt
4ffe9e2e0d Merge branch 'each-bool-conditionals-v9_16' into 'v9_16'
remove unnecessary 'true' and 'false' comparisons in boolean expressions

See merge request isc-projects/bind9!3585
2020-05-26 00:48:17 +00:00
Evan Hunt
c19a593d3e change "expr == false" to "!expr" in conditionals
(cherry picked from commit 57e54c46e4)
2020-05-25 17:04:04 -07:00
Evan Hunt
00c816778d change 'expr == true' to 'expr' in conditionals
(cherry picked from commit 68a1c9d679)
2020-05-25 17:03:59 -07:00
Mark Andrews
be88fb1aa7 Merge branch '1860-delv-crashes-processing-deprecated-trusted-keys-clause-in-anchor-file-v9_16' into 'v9_16'
Resolve "delv crashes processing deprecated "trusted-keys" clause in anchor file"

See merge request isc-projects/bind9!3584
2020-05-25 23:50:15 +00:00
Mark Andrews
79790edb84 Add CHANGES
(cherry picked from commit 7854b652c3)
2020-05-26 09:19:06 +10:00
Mark Andrews
d64c9b7eb4 Handle deprecated 'trusted-keys' style anchors
(cherry picked from commit d807febd25)
2020-05-26 09:18:34 +10:00
Mark Andrews
5c6919fdde Check that delv supports deprecated trusted-keys
(cherry picked from commit 26b3ca7acf)
2020-05-26 09:18:34 +10:00
Mark Andrews
d5829b44fa Merge branch '1861-named_checknames_get-missing-dbc-v9_16' into 'v9_16'
Resolve "named_checknames_get missing DBC"

See merge request isc-projects/bind9!3581
2020-05-25 04:37:38 +00:00
Mark Andrews
63238a6c7a Add DBC checks to named_checknames_get
(cherry picked from commit 20c07da49b)
2020-05-25 11:52:17 +10:00
Mark Andrews
d02f1ed5b8 Set obj to NULL so INSIST makes sense
(cherry picked from commit ac9e266749)
2020-05-25 11:52:17 +10:00
Michał Kępień
4762184c65 Merge branch 'michal/do-not-install-python-packages-in-gitlab-ci-jobs-v9_16' into 'v9_16'
[v9_16] Do not install Python packages in GitLab CI jobs

See merge request isc-projects/bind9!3573
2020-05-21 10:02:03 +00:00
Michał Kępień
88f6eb7648 Add py.test-3 to the list of tested pytest names
Some operating systems (e.g. CentOS, OpenBSD) install the main pytest
script as "py.test-3".  Add that name to the list of names passed to
AC_PATH_PROGS() in order for pytest to be properly detected on a broader
range of operating systems.

(cherry picked from commit d5562a3e7e)
2020-05-21 11:38:39 +02:00
Michał Kępień
8d33f372a0 Do not use f-strings in Python system tests
Use str.format() instead of f-strings in Python system tests to enable
them to work on Python 3 versions older than 3.6 as the latter is not
available on some operating systems used in GitLab CI that are still
actively supported (CentOS 6, Debian 9, Ubuntu 16.04).

(cherry picked from commit 5562c38ffb)
2020-05-21 11:38:26 +02:00
Michał Kępień
1dfa34da3f Do not install Python packages in GitLab CI jobs
As Python QA tools, BIND system test prerequisites, and documentation
building utilities are now all included in operating system images used
in GitLab CI, do not use pip for installing them in each CI job any
more.

(cherry picked from commit e3c217296d)
2020-05-21 11:37:48 +02:00
Mark Andrews
7d5cddf6bc Merge branch '1854-extend-loop-limit-by-1-v9_16' into 'v9_16'
Extend loop count by 1 to account for non-exact timing in usleep().

See merge request isc-projects/bind9!3570
2020-05-21 04:50:39 +00:00
Mark Andrews
4df013f0ea Extend loop count by 1 to account for non-exact timing in usleep().
(cherry picked from commit 3012e1ad9b)
2020-05-21 14:09:42 +10:00
Michał Kępień
51d0494a3c Merge branch 'v9_16_3-release' into 'v9_16'
[CVE-2020-8616] [CVE-2020-8617] Merge 9.16.3 release branch

See merge request isc-projects/bind9!3563
2020-05-19 13:08:51 +00:00
Michał Kępień
d8575efbdd Set up release notes for BIND 9.16.4 2020-05-19 14:11:08 +02:00
Michał Kępień
9dd4bff43a Bump BIND_BASELINE_VERSION for ABI checks 2020-05-19 14:11:08 +02:00
Michał Kępień
9a1c87ea6c Fix UTF-8 character in doc/arm/notes.txt 2020-05-19 13:57:37 +02:00
Michał Kępień
e4fc5335a3 Revert README updates 2020-05-19 13:57:37 +02:00
Michał Kępień
e67d247ee7 Adjust library API versions 2020-05-19 13:57:37 +02:00
Tinderbox User
e0b52d0153 Merge branch 'prep-release' into v9_16 2020-05-19 13:57:37 +02:00
Tinderbox User
046f56f5ab prep 9.16.3 2020-05-19 13:57:36 +02:00
Mark Andrews
66af483729 Merge branch '1388-confidential-issue-security-v9_16' into 'security-v9_16'
1388 confidential issue security v9 16

See merge request isc-private/bind9!151
2020-05-19 13:57:07 +02:00
Mark Andrews
0312831ace Merge branch '1703-tsig-verify-failure-security-v9_16' into 'security-v9_16'
1703 tsig verify failure security v9 16

See merge request isc-private/bind9!148
2020-05-19 13:57:07 +02:00
Mark Andrews
d042ef51a1 Add release notes entry 2020-05-19 13:57:07 +02:00
Mark Andrews
4ba2a6ca22 Add release note entry 2020-05-19 13:57:07 +02:00
Mark Andrews
6124c3404f Add CHANGES entry 2020-05-19 13:57:07 +02:00
Mark Andrews
dfaad75502 Add CHANGES entry 2020-05-19 13:57:07 +02:00
Mark Andrews
25f9aefff5 Update the ARM to reflect that TLD and root servers are no longer exempt
from max-recursion-queries limits.
2020-05-19 13:57:07 +02:00
Mark Andrews
baa7ec24e2 Only look at tsig.error in responses 2020-05-19 13:57:07 +02:00
Mark Andrews
39bb741927 Count queries to the root and TLD servers as well 2020-05-19 13:57:07 +02:00
Mark Andrews
9d787ab6f0 Check that a 'BADTIME' response with 'QR=0' is handled as a request 2020-05-19 13:57:07 +02:00
Stephen Morris
9648c335d5 Add test for reduction in number of fetches
Add a system test that counts how many address fetches are made
for different numbers of NS records and checks that the number
are successfully limited.
2020-05-19 13:57:07 +02:00
Mark Andrews
b9c4f1b648 Reduce the number of fetches we make when looking up addresses
If there are more that 5 NS record for a zone only perform a
maximum of 4 address lookups for all the name servers.  This
limits the amount of remote lookup performed for server
addresses at each level for a given query.
2020-05-19 13:57:07 +02:00
Mark Andrews
1b00c4ab65 Merge branch '1856-race-in-clear-signing-records-in-dnssec-system-test-v9_16' into 'v9_16'
Resolve "Race in 'clear signing records' in dnssec system test."

See merge request isc-projects/bind9!3559
2020-05-19 06:10:48 +00:00
Mark Andrews
6fd64c970b Add CHANGES
(cherry picked from commit 3405ee9eb2)
2020-05-19 13:46:07 +10:00
Mark Andrews
c813b5a737 Address race in dnssec system test. 'clear signing records' can fail
as the update triggers by the rndc command to clear the signing records
may not have completed by the time the subsequent rndc command to test
that the records have been removed is commenced.  Loop several times to
prevent false negative.

(cherry picked from commit 353018c0e5)
2020-05-19 13:46:07 +10:00
Mark Andrews
0172ecc1e1 Merge branch '1855-check-max-journal-size-limits-failed-as-not-enough-time-allowed-v9_16' into 'v9_16'
Resolve ""check max-journal-size limits" failed as not enough time allowed"

See merge request isc-projects/bind9!3556
2020-05-18 23:36:37 +00:00
Mark Andrews
3353bbbe4a Add CHANGES
(cherry picked from commit aaacf3ef45)
2020-05-19 08:15:11 +10:00
Mark Andrews
906211a02a Wait longer (up to 20 secs) for journal to be truncated
(cherry picked from commit 0c2f0e02f2)
2020-05-19 08:15:11 +10:00
Michał Kępień
961e7359f8 Merge branch 'michal/misc-cppcheck-tweaks-v9_16' into 'v9_16'
[v9_16] Miscellaneous cppcheck tweaks

See merge request isc-projects/bind9!3552
2020-05-18 08:35:34 +00:00
Michał Kępień
4c2c93c821 Work around cppcheck 2.0 uninitvar false positives
cppcheck 2.0 reports false positives about uninitialized variables in a
lot of places throughout BIND source code, e.g.:

    bin/dnssec/dnssec-cds.c:282:6: error: Uninitialized variable: length [uninitvar]
     if (isc_buffer_availablelength(&buf) <= len) {
         ^

Apparently cppcheck 2.0 has issues with processing (&var)->field syntax,
which is what the macros from lib/isc/include/isc/buffer.h are evaluated
to.  This issue was reported upstream [1] and will hopefully be
addressed in a future cppcheck release.

In the meantime, to avoid modifying BIND source code in multiple places
just because of a static checker false positive, work around the issue
by adding intermediate variables to buffer macro definitions using a sed
invocation in the cppcheck job script.

[1] https://sourceforge.net/p/cppcheck/discussion/general/thread/122153e3c1/

(cherry picked from commit 481fa34e50)
2020-05-18 10:33:20 +02:00
Michał Kępień
9a932a3038 Make GCC version extraction work with GCC 10
Add whitespace to the regular expression used for extracting the GCC
version from "gcc --version" output so that it works properly with
multi-digit major version numbers.

(cherry picked from commit 3b48eec79f)
2020-05-18 10:33:20 +02:00
Michał Kępień
87a1a7ea75 Ensure cppcheck creates a HTML report upon failure
Commit 691c8f6828 broke the cppcheck job
in GitLab CI: when cppcheck fails, the script is immediately
interrupted, preventing cppcheck-htmlreport from being run.  To ensure
the HTML report is generated when cppcheck fails, revert to invoking
cppcheck-htmlreport in the "after_script" part of the job.

(cherry picked from commit cb2037ee9d)
2020-05-18 10:33:14 +02:00
Mark Andrews
89ba820df8 Merge branch '1852-race-in-autosign-system-test-v9_16' into 'v9_16'
Resolve "race in autosign system test."

See merge request isc-projects/bind9!3549
2020-05-18 06:58:02 +00:00
Mark Andrews
d9f357d082 Add CHANGES
(cherry picked from commit 07e335138b)
2020-05-18 15:58:44 +10:00
Mark Andrews
74f79188db Retry checks that records are present and signed
There a race between when the delta is logged and when the
server returns signed record.  Retry the queries if the
lookups fail to meet expectations.

(cherry picked from commit 46c4e5d96f)
2020-05-18 15:58:43 +10:00
Michal Nowak
09489a6bac Merge branch 'mnowak/abi-check-artifacts-v9_16' into 'v9_16'
[v9_16] Collect TXT and HTML reports produced by ABI checker

See merge request isc-projects/bind9!3542
2020-05-15 09:37:02 +00:00
Michal Nowak
b5fdddd593 Collect TXT and HTML reports produced by ABI checker
Although in util/api-checker.sh we create textual reports, we don't
preserve them in job artifacts, but we should.

We don't want to keep all HTML pages present in the project root, but
just those produced by ABI checker.

(cherry picked from commit b5ccf95b0a)
2020-05-15 11:31:02 +02:00
Mark Andrews
14a8713ef4 Merge branch '1714-provide-ixfr-no-should-still-send-up-to-date-responses-v9_16' into 'v9_16'
Resolve "'provide-ixfr no;' should still send up-to-date responses."

See merge request isc-projects/bind9!3539
2020-05-15 05:37:38 +00:00
Mark Andrews
5b5bebee05 Add CHANGES entry
(cherry picked from commit 11b1cbecb0)
2020-05-15 14:30:04 +10:00
Mark Andrews
89c1bc58e4 move provide-ixfr testing after the serial has been checked
(cherry picked from commit c7cdc47cc5)
2020-05-15 14:29:12 +10:00
Mark Andrews
1f08f14903 Merge branch '1835-add-the-ability-to-parse-and-display-extended-dns-error-code-ede-v9_16' into 'v9_16'
Resolve "Add the ability to parse and display Extended DNS Error code (EDE)."

See merge request isc-projects/bind9!3526
2020-05-13 00:55:57 +00:00
Mark Andrews
2e02c6f9a7 Add release note entry
(cherry picked from commit 88615006c5)
2020-05-13 10:31:53 +10:00
Mark Andrews
e196c7f9fa Add CHANGES entry
(cherry picked from commit 79729c0e19)
2020-05-13 10:31:51 +10:00
Mark Andrews
88e11a9971 Check display of EDE option
(cherry picked from commit e6b0153f8a)
2020-05-13 10:26:39 +10:00
Mark Andrews
c13fb2c67f Also print out valid printable utf8
(cherry picked from commit 1c8f9d06e2)
2020-05-13 10:26:39 +10:00
Mark Andrews
eed4fab37b Report Extended DNS Error codes
(cherry picked from commit b144ae1bb0)
2020-05-13 10:26:39 +10:00
Evan Hunt
5c596c41d7 Merge branch 'each-nsec3-ixfr-v9_16' into 'v9_16'
don't bother checking for empty nodes when searching the NSEC3 tree

See merge request isc-projects/bind9!3528
2020-05-12 21:04:13 +00:00
Evan Hunt
78bc45573c CHANGES
(cherry picked from commit 0f901b5f2d)
2020-05-12 13:37:34 -07:00
Evan Hunt
1ccfadefe0 don't bother checking for empty nodes when searching the NSEC3 tree
this avoids a time-wasting search that could occur during an
IXFR that replaced an NSEC3 chain.

(cherry picked from commit 7192edf9c2)
2020-05-12 13:36:55 -07:00
Ondřej Surý
fe6d405a72 Merge branch '1232-stats-channel-zone-timers-v9_16' into 'v9_16'
Resolve "[ISC-support #15166] expose zone timers (reload, refresh, expire)  via stats channel"

See merge request isc-projects/bind9!3520
2020-05-12 12:39:37 +00:00
Ondřej Surý
0339e5cb06 Add CHANGES
(cherry picked from commit ce6cb62862)
2020-05-12 14:12:40 +02:00
Ondřej Surý
7f0f2d9fd4 Add release notes
(cherry picked from commit e0aa62bc4c)
2020-05-12 14:12:40 +02:00
Ondřej Surý
75e76b072a Rewrite the statschannel traffic tests to pytest
(cherry picked from commit 1202fd912a)
2020-05-12 14:12:03 +02:00
Ondřej Surý
09a1c051ec Add tests for zone timers using the pytest testing framework
(cherry picked from commit 6aa6d7be58)
2020-05-12 14:12:03 +02:00
Paul Frieden
838329bcb7 Add the zone timers to the XSL
(cherry picked from commit 72ffa194e2)
2020-05-12 14:12:03 +02:00
Paul Frieden
794c645987 Export zone timers via stats channels
(cherry picked from commit 543bab699d)
2020-05-12 14:12:03 +02:00
Ondřej Surý
d3c19d290b Merge branch 'marka-silence-flake8-warning-v9_16' into 'v9_16'
Silence: E741 ambiguous variable name 'l'

See merge request isc-projects/bind9!3524
2020-05-12 12:09:55 +00:00
Mark Andrews
2a45b67ee1 Silence: E741 ambiguous variable name 'l'
(cherry picked from commit 189d21fb96)
2020-05-12 14:06:52 +02:00
Ondřej Surý
2232e6379f Merge branch 'ondrej/fix-statschannel-setup.sh-failure-v9_16' into 'v9_16'
Fix statschannel setup.sh failure (v9_16)

See merge request isc-projects/bind9!3523
2020-05-12 12:02:33 +00:00
Ondřej Surý
a2e21137a6 Fix the rsabigexponent setup.sh script to not fail
(cherry picked from commit 2dbf68ab30)
2020-05-12 13:21:10 +02:00
Ondřej Surý
c7e2af1a45 Add missing manykeys.db.in file that was causing statschannel setup.sh to fail
(cherry picked from commit e43893fb0c)
2020-05-12 13:20:49 +02:00
Ondřej Surý
24085c6bbd Fail immediatelly when clean.sh or setup.sh fails
The `statschannel/ns2/` was missing `manykeys.db.in`, but the test
succeeded even when `setup.sh` (or `clean.sh`) failed to execute.  This
commit makes run.sh to run in stricter mode and fail the test
immediately when `clean.sh` or `setup.sh` fails.

(cherry picked from commit 8b357a35d2)
2020-05-12 13:20:45 +02:00
Ondřej Surý
9fec9c51fd Merge branch '25-fix-underlinking-and-overlinking-of-libraries' into 'v9_16'
Resolve "Revise what gets linked where and improve overlinking/underlinking"

See merge request isc-projects/bind9!3442
2020-05-11 09:39:24 +00:00
Ondřej Surý
af1b56240f Resolve the overlinking of the system libraries
Originally, every library and binaries got linked to everything, which
creates unnecessary overlinking.  This wasn't as straightforward as it
should be as we still support configuration without libtool for 9.16.

Couple of smaller issues related to include headers and an issue where
sanitizer overload dlopen and dlclose symbols, so we were getting false
negatives in the autoconf test.
2020-05-11 09:49:54 +02:00
Ondřej Surý
b75778042f libns and libirs were underlinked (missing libisc, libdns, libisccfg)
Underlinking states for the situation when a binary uses a symbol not provided
by libraries it is directly linked to.  The libns was not linked to libisc and
libdns, and libirs was not linked to libisc, libdns and libisccfg) while using
symbols from these libraries directly.
2020-05-11 09:49:53 +02:00
Mark Andrews
6f3edab604 Merge branch 'marka-call-check-categories' into 'v9_16'
have CI call util/check-categories.sh

See merge request isc-projects/bind9!3513
2020-05-11 01:00:01 +00:00
Mark Andrews
2270e28fde have CI call util/check-categories.sh 2020-05-11 10:57:44 +10:00
Mark Andrews
848fe7c4a5 Merge branch '1817-named-checkzone-s-full-relative-missing-from-usage-v9_16' into 'v9_16'
add [-s (full|relative)] to usage

See merge request isc-projects/bind9!3510
2020-05-08 07:22:33 +00:00
Mark Andrews
cb9699bb0c add [-s (full|relative)] to usage
(cherry picked from commit 3f93f3ee11)
2020-05-08 16:55:16 +10:00
Evan Hunt
05237ebdbc Merge branch '1812-uninitialized-dscp-v9_16' into 'v9_16'
Unexpected output from named-checkconf

See merge request isc-projects/bind9!3506
2020-05-06 22:38:55 +00:00
Evan Hunt
a654989716 initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p'
(cherry picked from commit f8d753d452)
2020-05-06 12:42:11 -07:00
Michał Kępień
ef4f2de63b Merge branch 'michal/prepare-release-notes-for-bind-9.16.3' into 'v9_16'
Prepare release notes for BIND 9.16.3

See merge request isc-projects/bind9!3495
2020-05-05 20:32:52 +00:00
Michał Kępień
3ba119e167 Add release note for GL #1807 2020-05-05 22:27:13 +02:00
Michał Kępień
666cdd8514 Add release note for GL #1695 2020-05-05 22:27:13 +02:00
Michał Kępień
d376746db7 Release notes: wording and formatting tweaks 2020-05-05 22:27:13 +02:00
Michał Kępień
f996fb97b5 Reorder release notes within each section 2020-05-05 22:27:13 +02:00
Michał Kępień
9be4198dee Move release notes to the sections they belong to 2020-05-05 22:27:13 +02:00
Michał Kępień
80b11a1e2a Move AXFR release note to the correct file 2020-05-05 22:27:13 +02:00
Michał Kępień
692e300b82 Tweak and reword recent CHANGES entries 2020-05-05 22:27:13 +02:00
Michał Kępień
6eccd41f7c Merge branch 'michal/fix-server-shutdown-in-run.sh' into 'v9_16'
Fix server shutdown in bin/tests/system/run.sh

See merge request isc-projects/bind9!3500
2020-05-05 12:18:43 +00:00
Michał Kępień
2b037713bd Fix server shutdown in bin/tests/system/run.sh
a4f0281962 is a flawed backport of
cf5105939c - it retained the original
invocation of bin/tests/system/stop.pl in bin/tests/system/run.sh.  This
results in the former script being called twice for each system test,
which does not cause problems on Unix systems, but triggers false
positives about named instances dying prematurely on Windows.  Fix by
removing the offending invocation of bin/tests/system/stop.pl from
bin/tests/system/run.sh.
2020-05-05 13:49:43 +02:00
Michał Kępień
aaf37b0a2e Merge branch 'wpk/changes-notes-3487' into 'v9_16'
CHANGES/relnotes for !3487

See merge request isc-projects/bind9!3494
2020-05-04 10:56:53 +00:00
Witold Kręcicki
984dfcf98b CHANGES/relnotes for \!3487 2020-05-04 12:50:50 +02:00
Michał Kępień
48231bb52e Merge branch '1797-add-release-note-discussing-recvmmsg-support-v9_16' into 'v9_16'
[v9_16] Add release note discussing recvmmsg() support

See merge request isc-projects/bind9!3493
2020-05-04 10:04:25 +00:00
Michał Kępień
ea7921967f Add release note discussing recvmmsg() support
(cherry picked from commit 84dc6d86cb)
2020-05-04 12:03:16 +02:00
Michał Kępień
f609bdbc0c Merge branch 'michal/1674-add-release-note' into 'v9_16'
Add release note for GL #1674

See merge request isc-projects/bind9!3490
2020-05-04 09:06:31 +00:00
Michał Kępień
4715a76345 Add release note for GL #1674 2020-05-04 11:00:23 +02:00
Evan Hunt
89a9a4eca5 Merge branch '1807-checkconf-error-v9_16' into 'v9_16'
named-checkconf -z could exit with an incorrect status

See merge request isc-projects/bind9!3488
2020-05-02 01:01:56 +00:00
Evan Hunt
0a0e02f31e named-checkconf -z could exit with an incorrect staatus
the CHECK() macro resets result, so an error code from an earlier
view could be erased if the last view loaded had no errors.

(cherry picked from commit 7e73660206)
2020-05-01 17:17:00 -07:00
Witold Krecicki
741a0b8387 Merge branch '1713-use-default-buffer-sizes-v9_16' into 'v9_16'
Don't set UDP recv/send buffer sizes - use system defaults (unless explicitly defined)

See merge request isc-projects/bind9!3487
2020-05-01 16:56:33 +00:00
Witold Kręcicki
444a16bff9 Don't set UDP recv/send buffer sizes - use system defaults (unless explicitly defined)
(cherry picked from commit fa02f6438b)
2020-05-01 17:47:19 +02:00
Ondřej Surý
97d650e6e2 Merge branch 'ondrej/fix-SO_REUSEPORT-usage-on-FreeBSD-v9_16' into 'v9_16'
Fix SO_REUSEPORT usage on FreeBSD (v9.16)

See merge request isc-projects/bind9!3486
2020-05-01 14:51:11 +00:00
Ondřej Surý
e23321eba9 Add CHANGES note for GL !3365
(cherry picked from commit 23a653dd92)
2020-05-01 16:50:06 +02:00
Ondřej Surý
c56cd29bbb Use SO_REUSEPORT only on Linux, use SO_REUSEPORT_LB on FreeBSD
The SO_REUSEPORT socket option on Linux means something else on BSD
based systems.  On FreeBSD there's 1:1 option SO_REUSEPORT_LB, so we can
use that.

(cherry picked from commit 09ba47b067)
2020-05-01 16:50:06 +02:00
Ondřej Surý
a0134ad57e Merge branch '1795-make-dnstap-work-reliably-with-netmgr-v9_16' into 'v9_16'
Resolve "Some dnstap data may not be logged in BIND 9.15.6+"

See merge request isc-projects/bind9!3485
2020-05-01 14:32:12 +00:00
Michał Kępień
ea5f122ffc Add CHANGES entry
(cherry picked from commit 47c769e475)
2020-05-01 16:29:36 +02:00
Michał Kępień
3a40a3f9a8 Add a release note
(cherry picked from commit 4a5c1c7bfe)
2020-05-01 16:29:18 +02:00
Michał Kępień
299954d006 Make dnstap work reliably with netmgr
The introduction of netmgr doubled the number of threads from which
dnstap data may be logged: previously, it could only happen from within
taskmgr worker threads; with netmgr, it can happen both from taskmgr
worker threads and from network threads.  Since the argument passed to
fstrm_iothr_options_set_num_input_queues() was not updated to reflect
this change, some calls to fstrm_iothr_get_input_queue() can now return
NULL, effectively preventing some dnstap data from being logged.
Whether this bug is triggered or not depends on thread scheduling order
and packet distribution between network threads, but will almost
certainly be triggered on any recursive resolver sooner or later.  Fix
by requesting the correct number of dnstap input queues to be allocated.

(cherry picked from commit 77dc091855)
2020-05-01 16:29:18 +02:00
Ondřej Surý
f6fcd0d208 Merge branch '1763-ossl-eddsa-engine-v9_16' into 'v9_16'
Add engine support to OpenSSL EdDSA implementation (v9.16)

See merge request isc-projects/bind9!3483
2020-05-01 14:27:12 +00:00
Ondřej Surý
a3ed49c515 Add release notes for #1763
(cherry picked from commit 3c5cdc3f24)
2020-05-01 16:25:56 +02:00
Ondřej Surý
928a4ff3f3 Add CHANGES note for #1763
(cherry picked from commit 3422c496ae)
2020-05-01 16:25:56 +02:00
Aaron Thompson
dddcc4a7eb Add engine support to OpenSSL EdDSA implementation.
(cherry picked from commit 6a9f20d031)
2020-05-01 16:25:56 +02:00
Aaron Thompson
112ffbaaa2 Use OpenSSL raw key functions for EdDSA keys.
(cherry picked from commit f9685b29f9)
2020-05-01 16:25:56 +02:00
Ondřej Surý
3112e08ba0 Merge branch '1534-add-ecdsa-openssl-pkcs11-engine-support-v9_16' into 'v9_16'
Add engine support to OpenSSL ECDSA implementation (v9.16)

See merge request isc-projects/bind9!3484
2020-05-01 14:25:17 +00:00
Ondřej Surý
b657411076 Add release note for GL #1534
(cherry picked from commit 80d51223c3)
2020-05-01 14:31:19 +02:00
Ondřej Surý
a600ff4917 Add CHANGES note for GL #1534
(cherry picked from commit dde438dac7)
2020-05-01 14:31:12 +02:00
Ondřej Surý
ce0f31a93b Simplify error handling
(cherry picked from commit 064d8b7a6d)
2020-05-01 14:30:04 +02:00
Ondřej Surý
0fa7c9099c Add initial support for ECDSA keys via OpenSSL PKCS#11 engine
(cherry picked from commit aff61535c2)
2020-05-01 14:30:04 +02:00
Ondřej Surý
46ddf100cc Merge branch 'ondrej/fix-system-tests-on-openbsd-v9.16' into 'v9_16'
Fix system tests on openbsd v9.16

See merge request isc-projects/bind9!3478
2020-05-01 11:40:21 +00:00
Ondřej Surý
3300e73570 Rename start() and stop() to start_server() and stop_server()
On OpenBSD, there's non-POSIX alias from stop to kill that breaks
the conf.sh.common script.
2020-05-01 13:37:44 +02:00
Ondřej Surý
7f37699725 Change the 'date -R' to sort-of iso-8601 emulated time 2020-05-01 13:37:44 +02:00
Ondřej Surý
da90f69a29 Merge branch '1797-libuv-1-37-requires-uv_init_ex-to-be-used-for-mmsg-v9_16' into 'v9_16'
Resolve "libuv >= 1.37 requires uv_udp_init_ex() to be used for mmsg"

See merge request isc-projects/bind9!3474
2020-05-01 10:45:46 +00:00
Witold Kręcicki
21d0bf6cd8 CHANGES note 2020-05-01 11:29:18 +02:00
Witold Kręcicki
786a289dfb Don't free udp recv buffer if UV_UDP_MMSG_CHUNK is set
(cherry picked from commit 83049ceabf)
2020-05-01 11:27:46 +02:00
Ondřej Surý
cf7975400e Use UV_UDP_RECVMMSG to enable mmsg support in libuv if available
(cherry picked from commit d5356a40ff)
2020-05-01 11:27:46 +02:00
Ondřej Surý
c015ae2341 Merge branch '1648-native-pkcs11-eddsa-v9_16' into 'v9_16'
Resolve "Fix PKCS#11-based EdDSA support"

See merge request isc-projects/bind9!3472
2020-05-01 08:32:45 +00:00
Ondřej Surý
e4a7cf0624 Make the cleanpkcs11.sh more universal across branches 2020-05-01 09:02:54 +02:00
Ondřej Surý
7b5cc16bad Fix another the start_fail -> start_servers_failed typo 2020-05-01 08:06:07 +02:00
Ondřej Surý
795cfad2d3 Fixup the start_fail -> start_servers_failed typo
(cherry picked from commit 0313d2950a)
2020-05-01 08:03:08 +02:00
Ondřej Surý
73868ba80b Add release notes
(cherry picked from commit e69d34a454)
2020-05-01 08:03:08 +02:00
Ondřej Surý
492703d1a8 Add CHANGES
(cherry picked from commit 84fffbdb4c)
2020-05-01 08:03:03 +02:00
Ondřej Surý
09535ac6d6 Fix the check for non-operational algs 15 and 16 in PKCS#11
(cherry picked from commit 57c39ddbe3)
2020-05-01 08:02:09 +02:00
Ondřej Surý
f35b8cee47 Fail running run.sh when clean.sh or setup.sh fails
(cherry picked from commit 101672f664)
2020-05-01 08:02:05 +02:00
Ondřej Surý
4cc5b572bd Refactor the pkcs11 to test for individual algorithms
(cherry picked from commit a6bdb9639a)
2020-05-01 08:00:52 +02:00
Aaron Thompson
c0e1dc33d5 Update EdDSA implementation to PKCS#11 v3.0.
Per Current Mechanisms 2.3.5, the curve name is DER-encoded in the
EC_PARAMS attribute, and the public key value is DER-encoded in the
EC_POINT attribute.

(cherry picked from commit 2e6b7a56cc)
2020-05-01 08:00:52 +02:00
Aaron Thompson
2401952bbb Fix EdDSA key sizes (key_size is in bits).
(cherry picked from commit 9b87fe1051)
2020-05-01 08:00:52 +02:00
Aaron Thompson
4ba7a0ec2d Add EdDSA algorithms back to dnssec-keyfromlabel help text.
Regressed in 45afdb2672.

(cherry picked from commit 4969577189)
2020-05-01 08:00:52 +02:00
Ondřej Surý
a39348336e Merge branch '1763-pkcs11-code-cleanups-v9_16' into 'v9_16'
Resolve "Implement and improve the PKCS#11 code"

See merge request isc-projects/bind9!3471
2020-05-01 05:57:17 +00:00
Ondřej Surý
fb8f428f07 Add CHANGES
(cherry picked from commit 48473d464f)
2020-05-01 06:54:27 +02:00
Ondřej Surý
358affe585 Use switch instead of if when evaluating curves
Previously, the code would do:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    if (alg == CURVE1) { /* code for CURVE1 */ }
    else { /* code for CURVE2 */ }

This approach is less extensible and also more prone to errors in case
the initial REQUIRE() is forgotten.  The code has been refactored to
use:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    switch (alg) {
    case CURVE1: /* code for CURVE1 */; break;
    case CURVE2: /* code for CURVE2 */; break;
    default: INSIST(0);
    }

(cherry picked from commit cf30e7d0d1)
2020-05-01 06:54:27 +02:00
Ondřej Surý
4e1c7e1c01 Refactor the code using the pk11 ECC constants.
The pk11/constants.h header contained static CK_BYTE arrays and
we had to use #defines to pull only those we need.  This commit
changes the constants to only define byte arrays with the content
and either use them directly or define the CK_BYTE arrays locally
where used.

(cherry picked from commit da38bd0e1d)
2020-05-01 06:54:27 +02:00
Ondřej Surý
dc51f720b9 Only print warning when PKCS#11 dnssec-keygen fails from Edwards curves
(cherry picked from commit 9d979d7cd6)
2020-05-01 06:54:26 +02:00
Aaron Thompson
fb21f7d0e6 Fix a segfault when a PKCS#11 token is not found.
(cherry picked from commit 541d7bafe6)
2020-05-01 06:54:26 +02:00
Aaron Thompson
0777eb04bf Fix bad syntax in pkcs11eddsa_link.c.
Introduced in 994e656977.

(cherry picked from commit 46cae09023)
2020-05-01 06:54:26 +02:00
Aaron Thompson
8607580599 Update to PKCS#11 v3.0 EdDSA macros.
(cherry picked from commit 3e685fe01a)
2020-05-01 06:54:26 +02:00
Aaron Thompson
b5f2e93339 Fix compiler warnings about unused pk11 constants.
(cherry picked from commit 2ef379d911)
2020-05-01 06:54:26 +02:00
Aaron Thompson
61853130c9 Remove remaining PKCS#11 DH references.
Missed in 0a73c9f137 and 8efd394c80.

(cherry picked from commit d28c7dadbb)
2020-05-01 06:54:26 +02:00
Aaron Thompson
f89a566b26 Remove unnecessary forward declarations.
(cherry picked from commit 6a6485a531)
2020-05-01 06:54:26 +02:00
Aaron Thompson
690eb14078 Finish refactoring pkcs11eddsa_link.c after isc_buffer_allocate change.
Left over after c73e5866c4.

(cherry picked from commit 7744aece03)
2020-05-01 06:54:26 +02:00
Aaron Thompson
c8b85a191e Remove unreachable label in pkcs11eddsa_link.c.
Missed in ae83801e2b.

(cherry picked from commit b4a7bfd55e)
2020-05-01 06:54:26 +02:00
Aaron Thompson
f534519af5 Finish refactoring after the removal of --with-ecdsa and --with-eddsa.
Missed in c3b8130fe8.

(cherry picked from commit 7fc4f926fb)
2020-05-01 06:54:26 +02:00
Aaron Thompson
78e4cc96d7 Remove old comment.
Missed in 6aae193ded.

(cherry picked from commit 48e0c0bc4a)
2020-05-01 06:54:26 +02:00
Aaron Thompson
e1d846124c Finish replacing OP_EC with OP_ECDSA/OP_EDDSA.
Missed in c3b8130fe8.

(cherry picked from commit bb158e8a4c)
2020-05-01 06:54:26 +02:00
Aaron Thompson
866e5d05f2 Fix incorrect PKCS11 macro in dnssec-revoke.
Missed in c3b8130fe8.

(cherry picked from commit b217052081)
2020-05-01 06:54:26 +02:00
Mark Andrews
fa56081e47 Merge branch '1695-addzone-system-tests-failing-in-mac-os-x-v9_16' into 'v9_16'
Resolve "addzone system tests failing in Mac OS X"

See merge request isc-projects/bind9!3469
2020-04-30 23:56:09 +00:00
Mark Andrews
5813998c69 Add CHANGES entry
(cherry picked from commit d63479a48d)
2020-05-01 09:14:36 +10:00
Mark Andrews
dafabb6d13 Mimic nzf_append from bin/named/server.c
nzf_append is conditionally compiled and this is intended to
catch error introduced by changes to the called functions on all
systems before the changes are run through the CI.

(cherry picked from commit a66c6fc883)
2020-05-01 09:14:02 +10:00
Mark Andrews
ce7e96f26f Add jobs for 'configure --with{out}-lmdb' to the GitLab CI
We missed a case where LMDB was not installed/used in the build
and that broke system tests on such systems.

(cherry picked from commit 060b56dc70)
2020-05-01 09:14:02 +10:00
Mark Andrews
f78f58312c Add more special zones to addzone restart test.
Test zones with various escape sequences and filesystem seperator
characters.
* escaped double quote (\")
* escaped escape (\\)
* escaped decimal byte value (\032)
* slash seperator (/)

(cherry picked from commit 5ab9b5b1e6)
2020-05-01 09:13:59 +10:00
Mark Andrews
59c135ca4d Escape double quote when printing quoted string.
When we were printing quoted string, the double quotes where unescaped
leading to prematurely ending the quoted string.

(cherry picked from commit b02081d423)
2020-05-01 09:12:05 +10:00
Mark Andrews
d8078d4e95 Merge branch '1806-system-and-unit-clang-asan-have-incorrect-needs-v9_16' into 'v9_16'
Incorrect job in needs, gcc:asan -> clang:asan

See merge request isc-projects/bind9!3462
2020-04-30 08:50:31 +00:00
Mark Andrews
a8d0f49420 Incorrect job in needs, gcc:asan -> clang:asan
(cherry picked from commit 0adf9562fb)
2020-04-30 18:48:46 +10:00
Mark Andrews
5d978fded4 Merge branch '1804-util-parse_tsan-py-is-not-pylint-clean-v9_16' into 'v9_16'
pylint cleanups

See merge request isc-projects/bind9!3459
2020-04-30 08:43:58 +00:00
Mark Andrews
8578ea9c8a pylint cleanups
(cherry picked from commit d7618f6954)
2020-04-30 17:33:38 +10:00
Ondřej Surý
042f0e0d9b Merge branch '1783-ax_check_compile_flag-fno-delete-null-pointer-checks-does-not-fail-for-clang-v9_16' into 'v9_16'
Force test for -fno-delete-null-pointer-checks to fail

See merge request isc-projects/bind9!3453
2020-04-29 16:33:31 +00:00
Mark Andrews
363ac686fd Force test for -fno-delete-null-pointer-checks to fail
(cherry picked from commit 82ab846f13)
2020-04-29 18:25:26 +02:00
Ondřej Surý
56997fe9da Merge branch 'ondrej/fix-asan-symbolizer-v9_16' into 'v9_16'
Fix the ASAN symbolizer

See merge request isc-projects/bind9!3451
2020-04-29 15:29:29 +00:00
Ondřej Surý
141598f3d3 Fix the ASAN symbolizer
(cherry picked from commit 96805e8c91)
2020-04-29 17:02:33 +02:00
Mark Andrews
d449ccc796 Merge branch '1764-build-9-16-2-release-make-depend-fatal-error-lib-dns-dnstap-pb-c-h-no-such-file-or-directory' into 'v9_16'
'make depend' failed

See merge request isc-projects/bind9!3398
2020-04-29 14:10:29 +00:00
Mark Andrews
72143febe7 check that 'make depend' does not fail 2020-04-30 00:09:48 +10:00
Mark Andrews
06fa0d7b4e address 'make depend' issues 2020-04-30 00:09:48 +10:00
Ondřej Surý
c0ae965c91 Merge branch '725-prepare-system-tests-for-pytest-v9_16' into 'v9_16'
Add a pytest runner to run.sh

See merge request isc-projects/bind9!3447
2020-04-29 12:40:40 +00:00
Ondřej Surý
f783e41af7 Silence the invalid-name errors from pylint 2020-04-29 12:19:40 +02:00
Ondřej Surý
a4f0281962 Add a pytest runner to run.sh
The system tests currently uses patchwork of shell scripts which doesn't
offer proper error handling.

This commit introduced option to write new tests in pytest framework
that also allows easier manipulation of DNS traffic (using dnspython),
native XML and JSON manipulation and proper error reporting.

(cherry picked from commit cf5105939c)
2020-04-29 12:00:15 +02:00
Ondřej Surý
56e1e6bc4c Merge branch '1090-fix-unable-to-set-effective-uid-to-0-v9_16' into 'v9_16'
Resolve "BIND 9.14: unable to set effective uid to 0"

See merge request isc-projects/bind9!3440
2020-04-28 16:40:13 +00:00
Ondřej Surý
d6275ff6ee Add release notes for GL #1042, #1090
(cherry picked from commit 60b608b65b)
2020-04-28 17:29:35 +02:00
Ondřej Surý
368a016ce0 Add CHANGES for #1042, #1090
(cherry picked from commit a0a5eab31c)
2020-04-28 17:29:35 +02:00
Mark Andrews
1254db80bb Propagate first_time to named_os_openfile in generate_session_key.
named_os_openfile was being called with switch_user set to true
unconditionally leading to log messages about being unable to
switch user identity from named when regenerating the key.

(cherry picked from commit 071bc29962)
2020-04-28 17:29:35 +02:00
Ondřej Surý
fe0eca7c20 Don't change effective uid when we already dropped privileges
When running on Linux and system capabilities are available, named will
drop the extra capabilities before loading the configuration.  This led
to spurious warnings from `seteuid()` because named already dropped
CAP_SETUID and CAP_GETUID capabilities.

The fix removes setting the effective uid/gid when capabilities are
available, and adds a check that we are running under the user we were
requested to run.

(cherry picked from commit 6c82e2af92)
2020-04-28 17:29:35 +02:00
Ondřej Surý
7e72b69661 Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/hmac.h-v9_16' into 'v9_16'
Stop leaking OpenSSL types and defines in the isc/hmac.h

See merge request isc-projects/bind9!3439
2020-04-28 14:29:55 +00:00
Ondřej Surý
8717ce376b Stop leaking OpenSSL types and defines in the isc/hmac.h
The <isc/md.h> header directly included <openssl/hmac.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.

(cherry picked from commit 70100c664a)
2020-04-28 16:28:54 +02:00
Ondřej Surý
1d3749819e Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/safe.h-v9_16' into 'v9_16'
Stop leaking OpenSSL types and defines in the isc/safe.h

See merge request isc-projects/bind9!3438
2020-04-28 14:28:24 +00:00
Ondřej Surý
5948a29463 Stop leaking OpenSSL types and defines in the isc/safe.h
The two "functions" that isc/safe.h declared before were actually simple
defines to matching OpenSSL functions.  The downside of the approach was
enforcing all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace changing the defines into
simple functions, we no longer enforce this.  In the long run, this
might also allow us to switch cryptographic library implementation
without affecting the downstream users.

(cherry picked from commit ab827ab5bf)
2020-04-28 16:27:39 +02:00
Ondřej Surý
80725efe18 Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/md.h-v9_16' into 'v9_16'
Stop leaking OpenSSL types and defines in the isc/md.h

See merge request isc-projects/bind9!3437
2020-04-28 14:08:29 +00:00
Ondřej Surý
c22c8cb0e1 Stop leaking OpenSSL types and defines in the isc/md.h
The <isc/md.h> header directly included <openssl/evp.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.

While making the isc_md_type_t type opaque, the API using the data type
was changed to use the pointer to isc_md_type_t instead of using the
type directly.

(cherry picked from commit 4e114f8ed6)
2020-04-28 15:24:07 +02:00
Michal Nowak
d4b002cac7 Merge branch 'mnowak/1751-abi-check-does-not-know-which-source-is-older-newer-v9_16' into 'v9_16'
[v9_16] Ensure proper comparison order in "abi-check" jobs

See merge request isc-projects/bind9!3420
2020-04-23 07:43:11 +00:00
Michal Nowak
313518dd3d Ensure proper comparison order in "abi-check" jobs
Right before the release API version (LIBINTERFACE, LIBREVISION, LIBAGE)
for older and newer libraries tends to be the same. Given that, commit
hash can't be the determining factor here, Unix time of the commit
should suit us better and is placed after the API version. The commit
hash is preserved as it's useful to see it in the actual report.

(cherry picked from commit 8e3e2836b0)
2020-04-23 09:38:25 +02:00
Ondřej Surý
c8ac079529 Merge branch 'ondrej/make-merge_copyrights-ignore-hidden-files-v9_16' into 'v9_16'
Make merge_copyrights ignore hidden files

See merge request isc-projects/bind9!3418
2020-04-23 06:03:48 +00:00
Ondřej Surý
250d16b9c2 Make merge_copyrights ignore hidden files
(cherry picked from commit 6d46082d82)
2020-04-23 08:00:40 +02:00
Evan Hunt
2fba60af58 Merge branch '1779-lock-rpzs-v9_16' into 'v9_16'
acquire maintenance lock when running incremental RPZ updates

See merge request isc-projects/bind9!3412
2020-04-22 00:45:07 +00:00
Evan Hunt
11bdacfcf9 CHANGES
(cherry picked from commit 2cf3d4c700)
2020-04-21 17:24:36 -07:00
Evan Hunt
7622f8ccfb acquire maintenance lock when running incremental RPZ updates
this addresses a race that could occur during shutdown or when
reconfiguring to remove RPZ zones.

this change should ensure that the rpzs structure and the incremental
updates don't interfere with each other: rpzs->zones entries cannot
be set to NULL while an update quantum is running, and the
task should be destroyed and its queue purged so that no subsequent
quanta will run.

(cherry picked from commit 286e8cd7ea)
2020-04-21 17:24:09 -07:00
Ondřej Surý
8a955ea403 Merge branch 'ondrej/enable-quota-test-in-Kyuatest-v9_16' into 'v9_16'
Fix and enable quota_test in Kyuafile

See merge request isc-projects/bind9!3409
2020-04-21 13:34:54 +00:00
Witold Kręcicki
90fc717ca3 Fix detaching the extra quotas in the quota_test
(cherry picked from commit 62f738ba48)
2020-04-21 14:18:54 +02:00
Ondřej Surý
c3e26ebd26 Enable quota_test in Kyuafile
(cherry picked from commit 54defc8b78)
2020-04-21 14:18:54 +02:00
Mark Andrews
351a488cf0 Merge branch '1674-warn-bad-id-in-axfr' into 'v9_16'
Warn about AXFR stream with inconsistent message id (9.16 and earlier)

See merge request isc-projects/bind9!3381
2020-04-20 09:53:57 +00:00
Mark Andrews
06e53c9e14 Check that bad message id's are caught by named 2020-04-20 19:13:48 +10:00
Mark Andrews
9937116f21 Convert to using retry_quiet and nextpart 2020-04-20 19:13:47 +10:00
Mark Andrews
998b2d5a57 Warn about AXFR streams that are incompatible with BIND 9.18 2020-04-20 19:13:47 +10:00
Matthijs Mekking
b0d5c23275 Merge branch '1737-coverity-dst_key_gettime-v9_16' into 'v9_16'
Address Coverity warnings in keymgr.c

See merge request isc-projects/bind9!3403
2020-04-20 08:10:34 +00:00
Matthijs Mekking
7ac4966a7a Address Coverity warnings in keymgr.c
Coverity showed that the return value of `dst_key_gettime` was
unchecked in INITIALIZE_STATE. If DST_TIME_CREATED was not set we
would set the state to be initialized to a weird last changed time.

This would normally not happen because DST_TIME_CREATED is always
set. However, we would rather set the time to now (as the comment
also indicates) not match the creation time.

The comment on INITIALIZE_STATE also needs updating as we no
longer always initialize to HIDDEN.

(cherry picked from commit 564f9dca35)
2020-04-20 09:43:23 +02:00
Michał Kępień
844cb55109 Merge branch '1753-make-isc-rwlock-implementation-the-default-again-v9_16' into 'v9_16'
[v9_16] Make ISC rwlock implementation the default again

See merge request isc-projects/bind9!3399
2020-04-17 06:41:37 +00:00
Michał Kępień
3763967607 Add CHANGES entry
5385.	[func]		Make ISC rwlock implementation the default again.
			[GL #1753]

(cherry picked from commit 58daa5af1e)
2020-04-17 08:40:24 +02:00
Michał Kępień
09720319a3 Add a release note
(cherry picked from commit 0cf1e2bf62)
2020-04-17 08:40:22 +02:00
Michał Kępień
76f0db42ec Make ISC rwlock implementation the default again
Revert the change from ad03c22e97 as
further testing has shown that with hyper-threading disabled, named with
ISC rwlocks outperforms named with pthread rwlocks in cold cache testing
scenarios.  Since building named with pthread rwlocks might still be a
better choice for some workloads, keep the compile-time option which
enables that.

(cherry picked from commit 17101fd093)
2020-04-17 08:39:34 +02:00
Michał Kępień
4bf68a6b21 Merge branch '1765-create-empty-release-notes-for-9-16-3' into 'v9_16'
create empty release notes for 9.16.3

See merge request isc-projects/bind9!3396
2020-04-17 06:31:10 +00:00
Mark Andrews
8d04b6b93a Add empty release notes for BIND 9.16.3 2020-04-17 10:23:50 +10:00
Michał Kępień
5f8fc7a934 Merge branch 'mnowak/abi-tracker-helper-v9_16_2' into 'v9_16'
abi-check: Update BIND_BASELINE_VERSION to v9_16_2

See merge request isc-projects/bind9!3385
2020-04-16 21:22:28 +00:00
Michal Nowak
035c632a7a abi-check: Update BIND_BASELINE_VERSION to v9_16_2 2020-04-16 21:22:06 +00:00
Michał Kępień
58175cdb4f Merge branch 'v9_16_2-release' into 'v9_16'
Merge 9.16.2 release branch

See merge request isc-projects/bind9!3393
2020-04-16 21:08:52 +00:00
Tinderbox User
f4e6b61b0f regen v9_16 2020-04-16 23:07:41 +02:00
Tinderbox User
152ff84f79 prep 9.16.2 2020-04-16 23:07:40 +02:00
Matthijs Mekking
fad5998fc9 Merge branch '1709-dnssec-policy-inlinesigning-v9_16' into 'v9_16'
Resolve "dnssec-policy implicitly enables inline-signing"

See merge request isc-projects/bind9!3389
2020-04-16 14:56:53 +00:00
Matthijs Mekking
a538ae2e1a Update changes
(cherry picked from commit acae6cf438)
2020-04-16 16:04:28 +02:00
Matthijs Mekking
75c330379c Add kasp tests dyn update zone
Add two tests that checks that dynamic zones
can be updated and will be signed appropriately.
One zone covers an update with freeze/thaw, the
other covers an update through nsupdate.

(cherry picked from commit e3aa12fc0a)
2020-04-16 16:04:28 +02:00
Matthijs Mekking
6e3654c434 dnssec-policy: to sign inline or not
When dnssec-policy was introduced, it implicitly set inline-signing.
But DNSSEC maintenance required either inline-signing to be enabled,
or a dynamic zone.  In other words, not in all cases you want to
DNSSEC maintain your zone with inline-signing.

Change the behavior and determine whether inline-signing is
required: if the zone is dynamic, don't use inline-signing,
otherwise implicitly set it.

You can also explicitly set inline-signing to yes with dnssec-policy,
the restriction that both inline-signing and dnssec-policy cannot
be set at the same time is now lifted.

However, 'inline-signing no;' on a non-dynamic zone with a
dnssec-policy is not possible.

(cherry picked from commit 644f0d958a)
2020-04-16 16:04:28 +02:00
Ondřej Surý
5d50f27bbe Merge branch '1763-improve-isc_buffer-API-documentation-v9_16' into 'v9_16'
Fix/improve some comments in buffer.h.

See merge request isc-projects/bind9!3390
2020-04-16 13:58:58 +00:00
Aaron Thompson
99f800df0d Fix/improve some comments in buffer.h.
isc_buffer_dup now cannot fail as a result of c73e5866c4.

(cherry picked from commit 850d8ae019)
2020-04-16 15:58:25 +02:00
Matthijs Mekking
ddbcf75c9c Merge branch 'matthijs-dnssec-keys-trust-anchors-leftovers-v9_16' into 'v9_16'
Replace leftover DNSSEC-KEYS with TRUST-ANCHORS - 9.16

See merge request isc-projects/bind9!3376
2020-04-16 13:08:40 +00:00
Matthijs Mekking
728112d70c Replace leftover DNSSEC-KEYS with TRUST-ANCHORS
Change 5332 renamed "dnssec-keys" configuration statement to the
more descriptive "trust-anchors".  Not all occurrences in the
documentation had been updated.

(cherry picked from commit 7c6dde024155585008e9bfd09c03722d69211d02)
2020-04-16 14:08:04 +02:00
Matthijs Mekking
4c87ea09c3 Merge branch 'matthijs-fix-digdelv-yamlget-v9_16' into 'v9_16'
Fix digdelv test - 9.16

See merge request isc-projects/bind9!3387
2020-04-16 12:06:14 +00:00
Matthijs Mekking
f980c888a5 Fix digdelv test
The yamlget.py file was changed in !3311 as part of making the
python code pylint and flake8 compliant.  This omitted setting
'item' to 'item[key]' which caused the digdelv yaml tests to fail.

Also, the pretty printing is not really necessary, so remove
the "if key not in item; print error" logic.

(cherry picked from commit 464d0417d1)
2020-04-16 13:28:54 +02:00
Ondřej Surý
e925880741 Merge branch '1755-tune-the-windows-build-so-we-can-use-wx-equivalent-of-werror-v9_16' into 'v9_16'
Resolve "Tune the Windows build, so we can use /WX (equivalent of -Werror)"

See merge request isc-projects/bind9!3378
2020-04-16 06:18:33 +00:00
Ondřej Surý
fd9237e18e Don't escape spaces in CONFIGARGS, use double backslash with all whitespace
(cherry picked from commit 9b0e85cbd5)
2020-04-16 07:56:38 +02:00
Ondřej Surý
7d87d88811 Align the irs_getnameinfo() declaration and definition on Windows
(cherry picked from commit e3076c4caa)
2020-04-16 07:56:38 +02:00
Ondřej Surý
8b84fb4f42 Disable MSB8028 warning
All our MSVS Project files share the same intermediate directory.  We
know that this doesn't cause any problems, so we can just disable the
detection in the project files.

Example of the warning:

  warning MSB8028: The intermediate directory (.\Release\) contains files shared from another project (dnssectool.vcxproj).  This can lead to incorrect clean and rebuild behavior.

(cherry picked from commit b6c2012d93)
2020-04-16 07:56:38 +02:00
Ondřej Surý
fd5167dd70 Fix the discrepancy between cfg_pluginlist_foreach declaration and definition
There was a missing indirection for the pluginlist_cb_t *callback in the
declaration of the cfg_pluginlist_foreach function.  Reported by MSVC as:

  lib\isccfg\parser.c(4057): warning C4028: formal parameter 4 different from declaration

(cherry picked from commit 4ffe725585)
2020-04-16 07:56:38 +02:00
Ondřej Surý
54f72ca7b6 Workaround MSVC warning C4477
Due to a way the stdatomic.h shim is implemented on Windows, the MSVC
always things that the outside type is the largest - atomic_(u)int_fast64_t.
This can lead to false positives as this one:

  lib\dns\adb.c(3678): warning C4477: 'fprintf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'

We workaround the issue by loading the value in a scoped local variable
with correct type first.

(cherry picked from commit 60c632ab91)
2020-04-16 07:56:37 +02:00
Ondřej Surý
d7948f9c8c Disable C4090 MSVC warning
MSVC documentation states: "This warning can be caused when a pointer to
a const or volatile item is assigned to a pointer not declared as
pointing to const or volatile."

Unfortunately, this happens when we dynamically allocate and deallocate
block of atomic variables using isc_mem_get and isc_mem_put.

Couple of examples:

  lib\isc\hp.c(134): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\hp.c(144): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\stats.c(55): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\stats.c(87): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]

(cherry picked from commit 063e05491b)
2020-04-16 07:56:37 +02:00
Ondřej Surý
c70159e792 Fix invalid cast in win32 stdatomic.h shim
The InterlockedOr8() and InterlockedAnd8() first argument was cast
to (atomic_int_fast8_t) instead of (atomic_int_fast8_t *), this was
reported by MSVC as:

  warning C4024: '_InterlockedOr8': different types for formal and actual parameter 1
  warning C4024: '_InterlockedAnd8': different types for formal and actual parameter 1

(cherry picked from commit 54168d55c0)
2020-04-16 07:56:37 +02:00
Ondřej Surý
9e6e1f587a Remove the Windows build job dependency on autoreconf job
(cherry picked from commit 70318943fe)
2020-04-16 07:56:37 +02:00
Ondřej Surý
8aef53cdb2 Disable MSVC C4133 when using stdatomic.h win32 shim
(cherry picked from commit b1f66d1e13)
2020-04-16 07:56:37 +02:00
Ondřej Surý
beee2a6598 Don't return from void function
(cherry picked from commit 948a23e6bb)
2020-04-16 07:55:40 +02:00
Ondřej Surý
820b9ba38a Set WarningLevel to Level1 for Release, treat warnings as errors
Our vcxproj files set the WarningLevel to Level3, which is too verbose
for a code that needs to be portable.  That basically leads to ignoring
all the errors that MSVC produces.  This commits downgrades the
WarningLevel to Level1 and enables treating warnings as errors for
Release builds.  For the Debug builds the WarningLevel got upgraded to
Level4, and treating warnings as errors is explicitly disabled.

We should eventually make the code clean of all MSVC warnings, but it's
a long way to go for Level4, so it's more reasonable to start at Level1.

For reference[1], these are the warning levels as described by MSVC
documentation:

  * /W0 suppresses all warnings. It's equivalent to /w.
  * /W1 displays level 1 (severe) warnings. /W1 is the default setting
    in the command-line compiler.
  * /W2 displays level 1 and level 2 (significant) warnings.
  * /W3 displays level 1, level 2, and level 3 (production quality)
    warnings. /W3 is the default setting in the IDE.
  * /W4 displays level 1, level 2, and level 3 warnings, and all level 4
    (informational) warnings that aren't off by default. We recommend
    that you use this option to provide lint-like warnings. For a new
    project, it may be best to use /W4 in all compilations. This option
    helps ensure the fewest possible hard-to-find code defects.
  * /Wall displays all warnings displayed by /W4 and all other warnings
    that /W4 doesn't include — for example, warnings that are off by
    default.
  * /WX treats all compiler warnings as errors. For a new project, it
    may be best to use /WX in all compilations; resolving all warnings
    ensures the fewest possible hard-to-find code defects.

1. https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=vs-2019

(cherry picked from commit 789d253e3d)
2020-04-16 07:55:40 +02:00
Michał Kępień
aab746701e Merge branch 'michal/fix-srcid-on-windows-v9_16' into 'v9_16'
[v9_16] Fix "srcid" on Windows

See merge request isc-projects/bind9!3371
2020-04-15 09:42:13 +00:00
Michał Kępień
021b83059e Fix "srcid" on Windows
Windows BIND releases produced by GitLab CI are built from Git
repositories, not from release tarballs, which means the "srcid" file is
not present in the top source directory when MSBuild is invoked.  This
causes the Git commit hash for such builds to be set to "unset_id".
Enable win32utils/Configure to try determining the commit hash for a
build by invoking Git on the build host if the "srcid" file is not
present (which is what its Unix counterpart does).

(cherry picked from commit 05e13e7caf)
2020-04-15 11:39:45 +02:00
Ondřej Surý
b0ca52f211 Merge branch 'ondrej/add-missing-time.h-on-win32-v9_16' into 'v9_16'
Add missing time.h header in windows isc/time.h for missing prototypes

See merge request isc-projects/bind9!3370
2020-04-15 08:43:45 +00:00
Ondřej Surý
ff967f9d65 Add missing time.h header in windows isc/time.h for missing prototypes
The win32 isc/time.h was missing <time.h> header leading to:

    lib\isc\win32\include\isc\time.h(29): warning C4013: 'gmtime_s'
    undefined; assuming extern returning int (compiling source file
    ..\app.c) [lib\isc\win32\libisc.vcxproj]

    lib\isc\win32\include\isc\time.h(39): warning C4013: 'localtime_s'
    undefined; assuming extern returning int (compiling source file
    ..\app.c) [lib\isc\win32\libisc.vcxproj]

(cherry picked from commit b9f68d098b)
2020-04-15 10:18:42 +02:00
Ondřej Surý
58201570c1 Merge branch 'ondrej/add-python-static-analysis-to-gitlab-ci-v9_16' into 'v9_16'
Add python static analysis to GitLab CI (v9.16)

See merge request isc-projects/bind9!3366
2020-04-15 07:48:01 +00:00
Ondřej Surý
4c4af11e5b Make the python code pylint and flake8 compliant
(cherry picked from commit 1e4ff9d485)
2020-04-15 07:43:35 +02:00
Ondřej Surý
4586a10327 Add pylint and flake8 tests to GitLab CI
Our python code didn't adhere to any coding standard.  In this commit, we add
flame8 (https://pypi.org/project/flake8/), and pylint (https://www.pylint.org/).

There's couple of exceptions:

- ans.py scripts are not checked, nor fixed as part of this MR
- pylint's missing-*-docstring and duplicate-code checks have
  been disabled via .pylintrc

Both exceptions should be removed in due time.

(cherry picked from commit ee534592e3)
2020-04-15 07:43:35 +02:00
Michał Kępień
e69c9b7fb9 Merge branch 'michal/misc-doc-fixes-v9_16' into 'v9_16'
[v9_16] Miscellaneous documentation fixes

See merge request isc-projects/bind9!3361
2020-04-09 05:50:04 +00:00
Stephen Morris
2b79ffb29c Tweak release notes for BIND 9.16.2 2020-04-08 22:49:00 +02:00
Michał Kępień
aeb1eb20e8 Tweak CHANGES for BIND 9.16.2 2020-04-08 22:49:00 +02:00
Ondřej Surý
2c0adf7e5a Merge branch 'bug/master/libisc-link-v9_16' into 'v9_16'
Link all required libraries to libisc

See merge request isc-projects/bind9!3360
2020-04-08 15:13:10 +00:00
Petr Menšík
ad79e7c080 Link all required libraries to libisc
It would fail to link -lisc without additional libraries, which should
not be required.

(cherry picked from commit 4cc7d2412f)
2020-04-08 17:03:27 +02:00
Ondřej Surý
e11d690ae7 Merge branch 'ondrej/changes-notes-v9_16-v9_16' into 'v9_16'
Add missing CHANGES notes from v9_16 branch

See merge request isc-projects/bind9!3358
2020-04-08 13:18:11 +00:00
Ondřej Surý
cb100ed530 Add missing CHANGES notes from v9_16 branch
(cherry picked from commit 2ef1149519)
2020-04-08 15:11:07 +02:00
Ondřej Surý
d42318d1ef Merge branch 'ondrej/missing-changes-v9_11-v9_16' into 'v9_16'
Add missing CHANGES notes from v9_11 branch

See merge request isc-projects/bind9!3353
2020-04-08 12:47:49 +00:00
Ondřej Surý
9777aab8ce Add missing CHANGES notes from v9_11 branch
(cherry picked from commit 434929b53d)
2020-04-08 14:46:07 +02:00
Michał Kępień
cc19294ac3 Merge branch '1742-work-around-an-msvc-bug-v9_16' into 'v9_16'
[v9_16] Work around an MSVC bug

See merge request isc-projects/bind9!3351
2020-04-08 12:30:18 +00:00
Michał Kępień
5b32f7362c Work around an MSVC bug
The assembly code generated by MSVC for at least some signed comparisons
involving atomic variables incorrectly uses unsigned conditional jumps
instead of signed ones.  In particular, the checks in isc_log_wouldlog()
are affected in a way which breaks logging on Windows and thus also all
system tests involving a named instance.  Work around the issue by
assigning the values returned by atomic_load_acquire() calls in
isc_log_wouldlog() to local variables before performing comparisons.

(cherry picked from commit 4c4f5cccaa)
2020-04-08 14:29:22 +02:00
Matthijs Mekking
83dcb7417b Merge branch '1669-kasp-test-fails-on-windows-v9_16' into 'v9_16'
Resolve ""kasp" system test is failing consistently on Windows"

See merge request isc-projects/bind9!3340
2020-04-08 08:44:56 +00:00
Matthijs Mekking
0d050323c0 Increase migrate.kasp DNSKEY TTL
Increate the DNSKEY TTL of the migrate.kasp zone for the following
reason:  The key states are initialized depending on the timing
metadata. If a key is present long enough in the zone it will be
initialized to OMNIPRESENT.  Long enough here is the time when it
was published (when the setup script was run) plus DNSKEY TTL.
Otherwise it is set to RUMOURED, or to HIDDEN if no timing metadata
is set or the time is still in the future.

Since the TTL is "only" 5 minutes, the DNSKEY state may be
initialized to OMNIPRESENT if the test is slow, but we expect it
to be in RUMOURED state.  If we increase the TTL to a couple of
hours it is very unlikely that it will be initialized to something
else than RUMOURED.

(cherry picked from commit 04e6711029)
2020-04-08 09:47:36 +02:00
Matthijs Mekking
02a2de8adb Fix ns6 template zonefile
The template zone file for server ns6 should have the ns6 domain
name, not ns3.

(cherry picked from commit 8d3c0156f4)
2020-04-08 09:47:36 +02:00
Matthijs Mekking
c923532b77 Remove kasp Windows prereq check
Now that the timing issue is fixed, we can enable the kasp test
again on Windows.

(cherry picked from commit 87c05fa62f)
2020-04-08 09:47:36 +02:00
Matthijs Mekking
9b57ad68d4 Fix kasp timing issue on Windows
This fixes another intermittent failure in the kasp system test.
It does not happen often, except for in the Windows platform tests
where it takes a long time to run the tests.

In the "kasp" system test, there is an "rndc reconfig" call which
triggers a new rekey event.  check_next_key_event() verifies the time
remaining from the moment "rndc reconfig" is called until the next key
event.  However, the next key event time is calculated from the key
times provided during key creation (i.e. during test setup).  Given
this, if "rndc reconfig" is called a significant amount of time after
the test is started, some check_next_key_event() checks will fail.

Fix by calculating the time passed since the start of the test and
when 'rndc reconfig' happens.  Substract this time from the
calculated next key event.

This only needs to be done after an "rndc reconfig" on zones where
the keymgr needs to wait for a period of time (for example for keys
to become OMNIPRESENT, or HIDDEN). This is on step 2 and step 5 of
the algorithm rollover.  In step 2 there is a waiting period before
the DNSKEY is OMNIPRESENT, in step 5 there is a waiting period
before the DNSKEY is HIDDEN.

In step 1 new keys are created, in step 3 and 4 key states just
entered OMNIPRESENT, and in step 6 we no longer care because the
key lifetime is unlimited and we default to checking once per hour.

Regardless of our indifference about the next key event after step 6,
change some of the key timings in the setup script to better
reflect reality: DNSKEY is in HIDDEN after step 5, DS times have
changed when the new DS became active.

(cherry picked from commit 62a97570b8)
2020-04-08 09:47:32 +02:00
Ondřej Surý
81259f8c18 Merge branch '1574-confidential-issue-rebinding-protection-fail-in-forwarding-mode-v9_16' into 'v9_16'
Resolve "DNS rebinding protection is ineffective when BIND is configured as a forwarding DNS server"

See merge request isc-projects/bind9!3343
2020-04-08 07:44:52 +00:00
Ondřej Surý
48110357ac Add release notes 2020-04-08 09:43:41 +02:00
Ondřej Surý
d092db3465 Add CHANGES 2020-04-08 09:43:41 +02:00
Diego Fronza
2cba24a6d5 Add test for the proposed fix
This test asserts that option "deny-answer-aliases" works correctly
when forwarding requests.

As a matter of example, the behavior expected for a forwarder BIND
instance, having an option such as deny-answer-aliases { "domain"; }
is that when forwarding a request for *.anything-but-domain, it is
expected that it will return SERVFAIL if any answer received has a CNAME
for "*.domain".

(cherry picked from commit 9bdb960a16a69997b08746e698b6b02c8dc6c795)
2020-04-08 08:52:58 +02:00
Diego Fronza
bba353d512 Fixed rebinding protection bug when using forwarder setups
BIND wasn't honoring option "deny-answer-aliases" when configured to
forward queries.

Before the fix it was possible for nameservers listed in "forwarders"
option to return CNAME answers pointing to unrelated domains of the
original query, which could be used as a vector for rebinding attacks.

The fix ensures that BIND apply filters even if configured as a forwarder
instance.

(cherry picked from commit af6a4de3d5ad6c1967173facf366e6c86b3ffc28)
2020-04-08 08:52:58 +02:00
Mark Andrews
e12ea4f4db Merge branch '1715-kasp-system-test-timing-issue-with-view-zones-2-v9_16' into 'v9_16'
Wait for zone to be signed

See merge request isc-projects/bind9!3338
2020-04-06 10:09:14 +00:00
Mark Andrews
f0d44c49c9 Wait for zone to be signed
(cherry picked from commit 78746cfabd)
2020-04-06 19:33:03 +10:00
Mark Andrews
8b2af5a1c9 Merge branch '1715-kasp-system-test-timing-issue-with-view-zones-v9_16' into 'v9_16'
Wait for DNSKEY records to be signed

See merge request isc-projects/bind9!3336
2020-04-06 09:31:11 +00:00
Mark Andrews
78b748b109 Wait for DNSKEY records to be signed
(cherry picked from commit 5a4ab3360d)
2020-04-06 19:01:25 +10:00
Ondřej Surý
5370e73340 Merge branch '1087-fix-the-nonmatching-statcounter-increments-decrements-v9_16' into 'v9_16'
Fix the some of the underflowing statistics (v9.16)

See merge request isc-projects/bind9!3332
2020-04-04 05:25:23 +00:00
Ondřej Surý
dfe202e29b Add CHANGES
(cherry picked from commit 22aaeb5150)
2020-04-03 20:22:56 +02:00
Ondřej Surý
cacaa94350 Fix the statistic counter underflow in ns_client_t
In case of normal fetch, the .recursionquota is attached and
ns_statscounter_recursclients is incremented when the fetch is created.  Then
the .recursionquota is detached and the counter decremented in the
fetch_callback().

In case of prefetch or rpzfetch, the quota is attached, but the counter is not
incremented.  When we reach the soft-quota, the function returns early but don't
detach from the quota, and it gets destroyed during the ns_client_endrequest(),
so no memory was leaked.

But because the ns_statscounter_recursclients is only incremented during the
normal fetch the counter would be incorrectly decremented on two occassions:

1) When we reached the softquota, because the quota was not properly detached
2) When the prefetch or rpzfetch was cancelled mid-flight and the callback
   function was never called.

(cherry picked from commit 78886d4bed)
2020-04-03 20:22:56 +02:00
Ondřej Surý
0e9b0d79fb Remove the extra decstats on STATID_ACTIVE for children sockets
(cherry picked from commit 26842ac25c)
2020-04-03 20:22:56 +02:00
Witold Kręcicki
3559b32dcc Fix the memory ordering for the isc stats to be acquire-release
(cherry picked from commit 4ffd4cd4f6)
2020-04-03 20:22:55 +02:00
Witold Krecicki
27be7a8bd1 Merge branch 'wpk/tcpdns-refactoring-v9_16' into 'v9_16'
netmgr refactoring: use generic functions when operating on sockets.

See merge request isc-projects/bind9!3331
2020-04-03 12:21:20 +00:00
Witold Kręcicki
365636dbc9 netmgr refactoring: use generic functions when operating on sockets.
tcpdns used transport-specific functions to operate on the outer socket.
Use generic ones instead, and select the proper call in netmgr.c.
Make the missing functions (e.g. isc_nm_read) generic and add type-specific
calls (isc__nm_tcp_read). This is the preparation for netmgr TLS layer.

(cherry picked from commit 5fedd21e16)
2020-04-03 13:44:28 +02:00
Matthijs Mekking
949846399d Merge branch '1179-dnssec-stats-oom-kill-v9_16' into 'v9_16'
Resolve "OOM issue after upgrade from 9.14.3 to 9.14.4"

See merge request isc-projects/bind9!3329
2020-04-03 08:33:28 +00:00
Matthijs Mekking
ed2d3c55c2 Update release notes
(cherry picked from commit 386890a161)
2020-04-03 10:04:32 +02:00
Matthijs Mekking
df16e24d66 Replace hard coded value with constant
(cherry picked from commit c1723b2535)
2020-04-03 10:04:24 +02:00
Matthijs Mekking
f46187bcaa Merge if blocks in statschannel.c
(cherry picked from commit 1596d3b498)
2020-04-03 10:04:16 +02:00
Matthijs Mekking
ae19d0f60a Replace sign operation bool with enum
(cherry picked from commit 44b49955e1)
2020-04-03 10:04:07 +02:00
Matthijs Mekking
c3d738c883 Embed algorithm in key tag counter
Key tags are not unique across algorithms.

(cherry picked from commit b2028e26da)
2020-04-03 10:03:58 +02:00
Matthijs Mekking
facd99fd9c Group the keyid with the counters
Rather than group key ids together, group key id with its
corresponding counters. This should make growing / shrinking easier
than having keyids then counters.

(cherry picked from commit eb6a8b47d7)
2020-04-03 10:03:49 +02:00
Matthijs Mekking
e67490cadb Add test for many keys
Add a statschannel test case for DNSSEC sign metrics that has more
keys than there are allocated stats counters for.  This will produce
gibberish, but at least it should not crash.

(cherry picked from commit 31e8b2b13c)
2020-04-03 10:03:39 +02:00
Matthijs Mekking
f59f446122 Redesign dnssec sign statistics
The first attempt to add DNSSEC sign statistics was naive: for each
zone we allocated 64K counters, twice.  In reality each zone has at
most four keys, so the new approach only has room for four keys per
zone. If after a rollover more keys have signed the zone, existing
keys are rotated out.

The DNSSEC sign statistics has three counters per key, so twelve
counters per zone. First counter is actually a key id, so it is
clear what key contributed to the metrics.  The second counter
tracks the number of generated signatures, and the third tracks
how many of those are refreshes.

This means that in the zone structure we no longer need two separate
references to DNSSEC sign metrics: both the resign and refresh stats
are kept in a single dns_stats structure.

Incrementing dnssecsignstats:

Whenever a dnssecsignstat is incremented, we look up the key id
to see if we already are counting metrics for this key.  If so,
we update the corresponding operation counter (resign or
refresh).

If the key is new, store the value in a new counter and increment
corresponding counter.

If all slots are full, we rotate the keys and overwrite the last
slot with the new key.

Dumping dnssecsignstats:

Dumping dnssecsignstats is no longer a simple wrapper around
isc_stats_dump, but uses the same principle.  The difference is that
rather than dumping the index (key tag) and counter, we have to look
up the corresponding counter.

(cherry picked from commit 705810d577)
2020-04-03 10:03:30 +02:00
Ondřej Surý
86933f4a27 Merge branch '1717-rwlock-contention-in-isc_log_wouldlog-api-performance-impact-v9_16' into 'v9_16'
Reduce rwlock contention in isc_log_wouldlog()

See merge request isc-projects/bind9!3327
2020-04-03 08:00:39 +00:00
Ondřej Surý
aec1578620 Reduce rwlock contention in isc_log_wouldlog()
The rwlock introduced to protect the .logconfig member of isc_log_t
structure caused a significant performance drop because of the rwlock
contention.  It was also found, that the debug_level member of said
structure was not protected from concurrent read/writes.

The .dynamic and .highest_level members of isc_logconfig_t structure
were actually just cached values pulled from the assigned channels.

We introduced an even higher cache level for .dynamic and .highest_level
members directly into the isc_log_t structure, so we don't have to
access the .logconfig member in the isc_log_wouldlog() function.

(cherry picked from commit 3a24eacbb6)
2020-04-03 07:59:34 +00:00
Matthijs Mekking
96660671e2 Merge branch '1706-dnssec-policy-migration-v9_16' into 'v9_16'
Resolve "Changing from auto-dnssec maintain to dnssec-policy x immediately deletes existing keys"

See merge request isc-projects/bind9!3328
2020-04-03 07:59:04 +00:00
Matthijs Mekking
3726d7f857 Test migration to dnssec-policy, change algorithm
Add a test to ensure migration from 'auto-dnssec maintain;' to
dnssec-policy works even if the algorithm is changed.  The existing
keys should not be removed immediately, but their goal should be
changed to become hidden, and the new keys with the different
algorithm should be introduced immediately.

(cherry picked from commit 551acb44f4)
2020-04-03 09:17:06 +02:00
Matthijs Mekking
9387729711 Only initialize goal on active keys
If we initialize goals on all keys, superfluous keys that match
the policy all desire to be active.  For example, there are six
keys available for a policy that needs just two, we only want to
set the goal state to OMNIPRESENT on two keys, not six.

(cherry picked from commit 2389fcb4dc)
2020-04-03 09:16:51 +02:00
Matthijs Mekking
1553411d43 Update documentation with !1706 fix
(cherry picked from commit f47e697da3)
2020-04-03 09:16:25 +02:00
Matthijs Mekking
4741f2d07e Test migration to dnssec-policy, retire old keys
Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly.  Earlier commit deals with migration where existing keys
match the policy.  This commit deals with migration where existing
keys do not match the policy.  In that case, named must not
immediately delete the existing keys, but gracefully roll to the
dnssec-policy.

However, named did remove the existing keys immediately.  This is
because the legacy key states were initialized badly.  Because
those keys had their states initialized to HIDDEN or RUMOURED, the
keymgr decides that they can be removed (because only when the key
has its states in OMNIPRESENT it can be used safely).

The original thought to initialize key states to HIDDEN (and
RUMOURED to deal with existing keys) was to ensure that those keys
will go through the required propagation time before the keymgr
decides they can be used safely.  However, those keys are already
in the zone for a long time and making the key states represent
otherwise is dangerous: keys may be pulled out of the zone while
in fact they are required to establish the chain of trust.

Fix initializing key states for existing keys by looking more closely
at the time metadata.  Add TTL and propagation delays to the time
metadata and see if the DNSSEC records have been propagated.
Initialize the state to OMNIPRESENT if so, otherwise initialize to
RUMOURED.  If the time metadata is in the future, or does not exist,
keep initializing the state to HIDDEN.

The added test makes sure that new keys matching the policy are
introduced, but existing keys are kept in the zone until the new
keys have been propagated.

(cherry picked from commit 7f43520893)
2020-04-03 09:16:11 +02:00
Matthijs Mekking
83a00866b0 Tweak kasp system test
A few kasp system test tweaks to improve test failure debugging and
deal with tests related to migration to dnssec-policy.

1. When clearing a key, set lifetime to "none".  If "none", skip
   expect no lifetime set in the state file.  Legacy keys that
   are migrated but don't match the dnssec-policy will not have a
   lifetime.

2. The kasp system test prints which key id and file it is checking.
   Log explicitly if we are checking the id or a file.

3. Add quotes around "ID" when setting the key id, for consistency.

4. Fix a typo (non -> none).

5. Print which key ids are found, this way it is easier to see what
   KEY[1-4] failed to match one of the key files.

(cherry picked from commit a224754d59)
2020-04-03 09:15:51 +02:00
Matthijs Mekking
7aa5a11bdd Fix and test migration to dnssec-policy
Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly. Several adjustments in the keymgr are required to get it right:

- Set published time on keys when we calculate prepublication time.
  This is not strictly necessary, but it is weird to have an active
  key without the published time set.

- Initalize key states also before matching keys. Determine the
  target state by looking at existing time metadata: If the time
  data is set and is in the past, it is a hint that the key and
  its corresponding records have been published in the zone already,
  and the state is initialized to RUMOURED. Otherwise, initialize it
  as HIDDEN. This fixes migration to dnssec-policy from existing
  keys.

- Initialize key goal on keys that match key policy to OMNIPRESENT.
  These may be existing legacy keys that are being migrated.

- A key that has its goal to OMNIPRESENT *or* an active key can
  match a kasp key.  The code was changed with CHANGE 5354 that
  was a bugfix to prevent creating new KSK keys for zones in the
  initial stage of signing.  However, this caused problems for
  restarts when rollovers are in progress, because an outroducing
  key can still be an active key.

The test for this introduces a new KEY property 'legacy'.  This is
used to skip tests related to .state files.

(cherry picked from commit 6801899134)
2020-04-03 09:15:39 +02:00
Evan Hunt
6c379655d9 Merge branch '1447-incremental-rpz-update-v9_16' into 'v9_16'
incrementally clean up old RPZ records during updates

See merge request isc-projects/bind9!3319
2020-04-01 09:55:26 +00:00
Evan Hunt
5700485c21 CHANGES and release note
(cherry picked from commit 899f9440c0)
2020-04-01 01:32:55 -07:00
Evan Hunt
a288dee81e incrementally clean up old RPZ records during updates
After an RPZ zone is updated via zone transfer, the RPZ summary
database is updated, inserting the newly added names in the policy
zone and deleting the newly removed ones. The first part of this
was quantized so it would not run too long and starve other tasks
during large updates, but the second part was not quantized, so
that an update in which a large number of records were deleted
could cause named to become briefly unresponsive.

(cherry picked from commit 32da119ed8)
2020-04-01 01:32:55 -07:00
Mark Andrews
4e32fd130f Merge branch 'marka-empty-release-notes-v9_16' into 'v9_16'
add empty release notes for 9.16.2

See merge request isc-projects/bind9!3314
2020-03-31 07:07:20 +00:00
Mark Andrews
657ad6de31 add empty release notes for 9.16.2
(cherry picked from commit 503e2dff64)
2020-03-31 17:12:03 +11:00
Witold Krecicki
df93653818 Merge branch '1700-proper-tcp-resuming-v9_16' into 'v9_16'
Deactivate the handle before sending the async close callback.

See merge request isc-projects/bind9!3310
2020-03-30 12:57:50 +00:00
Witold Kręcicki
3274650123 Deactivate the handle before sending the async close callback.
We could have a race between handle closing and processing async
callback. Deactivate the handle before issuing the callback - we
have the socket referenced anyway so it's not a problem.
2020-03-30 10:54:12 +00:00
Witold Krecicki
52ae7bf603 Merge branch 'wpk/quota-callback-v9_16' into 'v9_16'
Add a quota attach function with a callback, some code cleanups.

See merge request isc-projects/bind9!3309
2020-03-30 10:30:23 +00:00
Witold Kręcicki
7ab77d009d Add a quota attach function with a callback, some code cleanups.
We introduce a isc_quota_attach_cb function - if ISC_R_QUOTA is returned
at the time the function is called, then a callback will be called when
there's quota available (with quota already attached). The callbacks are
organized as a LIFO queue in the quota structure.
It's needed for TCP client quota -  with old networking code we had one
single place where tcp clients quota was processed so we could resume
accepting when the we had spare slots, but it's gone with netmgr - now
we need to notify the listener/accepter that there's quota available so
that it can resume accepting.

Remove unused isc_quota_force() function.

The isc_quote_reserve and isc_quota_release were used only internally
from the quota.c and the tests.  We should not expose API we are not
using.

(cherry picked from commit d151a10f30)
2020-03-30 10:29:33 +02:00
Mark Andrews
a5ec7f9c83 Merge branch '1678-bind-fails-to-build-with-mysql-support-against-mysql8-mysql-connector-8-v9_16' into 'v9_16'
Resolve "BIND fails to build with MYSQL support against mysql8/mysql-connector-8"

See merge request isc-projects/bind9!3305
2020-03-26 23:21:58 +00:00
Ondřej Surý
2f3272ef86 Use compound literals in mysql_options() call
Makes use of compound literals instead of using extra my_bool
variable just to hold "true/1" value.

(cherry picked from commit 715b7a7cec)
2020-03-27 09:05:46 +11:00
Mark Andrews
3387fa03e4 Typedef my_bool if missing.
ORACLE MySQL 8.0 has dropped the my_bool type, so we need to reinstate
it back when compiling with that version or higher.  MariaDB is still
keeping the my_bool type.  The numbering between the two (MariaDB 5.x
jumped to MariaDB 10.x) doesn't make the life of the developer easy.

(cherry picked from commit c6d5d5c88f)
2020-03-27 09:05:46 +11:00
Mark Andrews
5f6b54927e remove unused variable
(cherry picked from commit 7af9883b48)
2020-03-27 09:05:46 +11:00
Michał Kępień
4bade7774a Merge branch 'michal/misc-gitlab-ci-yml-cleanups-v9_16' into 'v9_16'
[v9_16] Miscellaneous .gitlab-ci.yml cleanups

See merge request isc-projects/bind9!3300
2020-03-26 10:43:11 +00:00
Michał Kępień
7910702fec Remove unused YAML anchors
Some YAML anchors defined in .gitlab-ci.yml are not subsequently used.
Remove them to prevent confusion.

(cherry picked from commit 3d121ede6c)
2020-03-26 11:41:55 +01:00
Michał Kępień
688b759ed0 Do not install compiledb in cppcheck job
compiledb is already included in the Docker image used by the cppcheck
job.  Do not attempt installing it again.

(cherry picked from commit 3d264dbe81)
2020-03-26 11:41:55 +01:00
Michał Kępień
89ef138ba6 Include compiler name in all build/test job names
Most build/test job names already contain a "clang", "gcc", or "msvc"
prefix which indicates the compiler used for a given job.  Apply that
naming convention to all build/test job names.

(cherry picked from commit 0c898084cd)
2020-03-26 11:41:55 +01:00
Michał Kępień
6044f6d73d Refactor TSAN unit test job definitions
Multiple YAML keys have identical values for both TSAN unit test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN unit test job definitions to reduce code duplication.

(cherry picked from commit 84463f33bf)
2020-03-26 11:41:55 +01:00
Michał Kępień
536704c749 Run "kyua report-html" for TSAN unit test jobs
Definitions of jobs running unit tests under TSAN contain an
"after_script" YAML key.  Since the "unit_test_job" anchor is included
in those job definitions before "after_script" is defined, the
job-specific value of that key overrides the one defined in the included
anchor.  This prevents "kyua report-html" from being run for TSAN unit
test jobs.  Moving the invocation of "kyua report-html" to the "script"
key in the "unit_test_job" anchor is not acceptable as it would cause
the exit code of that command to determine the result of all unit test
jobs and we need that to be the exit code of "make unit".  Instead, add
"kyua report-html" invocations to the "after_script" key of TSAN unit
test job definitions to address the problem without affecting other job
definitions.

(cherry picked from commit 6ebce9425e)
2020-03-26 11:41:55 +01:00
Michał Kępień
873cefc8c9 Refactor TSAN system test job definitions
Multiple YAML keys have identical values for both TSAN system test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN system test job definitions to reduce code duplication.

(cherry picked from commit a9aa295f1f)
2020-03-26 11:41:54 +01:00
Michał Kępień
0c726127f7 Drop "before_script" key from TSAN job definitions
Both "system_test_job" and "unit_test_job" YAML anchors contain a
"before_script" key.  TSAN job definitions first specify their own value
of the "before_script" key and then include the aforementioned YAML
anchors, which results in the value of the "before_script" key being
overridden with the value specified by the included anchor.  Given this,
remove "before_script" definitions specific to TSAN jobs as they serve
no practical purpose.

(cherry picked from commit 8ef01c7b50)
2020-03-26 11:41:54 +01:00
Michał Kępień
b358cf30b2 Define TSAN options in a global variable
All assignments for the TSAN_OPTIONS variable are identical across the
entire .gitlab-ci.yml file.  Define a global TSAN_OPTIONS_COMMON
variable and use it in job definitions to reduce code duplication.

(cherry picked from commit 6325c0993a)
2020-03-26 11:41:54 +01:00
Ondřej Surý
f24de93e80 Merge branch '1679-fix-the-tv_nsec_check-v9_16' into 'v9_16'
Fix the tv_nsec check in isc_stdtime_get() (v9.16)

See merge request isc-projects/bind9!3293
2020-03-25 22:00:24 +00:00
Ondřej Surý
e017574b74 Correct the typecast of .tv_sec in isc_stdtime_get() 2020-03-25 22:10:10 +01:00
Ondřej Surý
2bb2a10ba4 Fix the tv_nsec check in isc_stdtime_get()
(cherry picked from commit 0d06a62dd1)
2020-03-25 21:19:55 +01:00
Ondřej Surý
7e79134ec0 Merge branch 'ondrej/no-clang-on-debian-sid-v9_16' into 'v9_16'
Rewrite .gitlab-ci.yml to have 'base_image' and other GitLab CI improvements (v9.16)

See merge request isc-projects/bind9!3288
2020-03-25 17:29:25 +00:00
Ondřej Surý
71c5f29573 Replace clang:stretch:amd64 build with clang:buster:amd64 build (+ add missing system test)
(cherry picked from commit 281531d82b)
2020-03-25 18:12:39 +01:00
Ondřej Surý
691c8f6828 Replace bear with compiledb and drop MAKE_COMMAND because we don't need it
(cherry picked from commit ec72d1100d)
2020-03-25 18:12:38 +01:00
Ondřej Surý
591732e64c Adjust the GitLab CI jobs to match the new images
The custom builds (oot, asan, tsan) were mostly built using Debian sid
amd64 image.  The problem was that this image broke too easily, because
it's Debian "unstable" after all.

This commit introduces "base_image" that should be most stable with
extra bits on top (clang, coccinelle, cppcheck, ...).  Currently, that
would be Debian buster amd64.

Other changes introduced by this commit:

* Change the default clang version to 10
* Run both ASAN and TSAN with both gcc and clang compilers
* Remove Clang Debian stretch i386 job

(cherry picked from commit 5f5721aa11)
2020-03-25 18:12:38 +01:00
Ondřej Surý
206d3841df Merge branch 'ondrej/scan-build-10-fixes-v9_16' into 'v9_16'
Ondrej/scan build 10 fixes v9 16

See merge request isc-projects/bind9!3286
2020-03-25 17:10:21 +00:00
Ondřej Surý
0fdc09efb6 Fix 'Dereference of null pointer' from scan-build-10
These are mostly false positives, the clang-analyzer FAQ[1] specifies
why and how to fix it:

> The reason the analyzer often thinks that a pointer can be null is
> because the preceding code checked compared it against null. So if you
> are absolutely sure that it cannot be null, remove the preceding check
> and, preferably, add an assertion as well.

The 4 warnings reported are:

dnssec-cds.c:781:4: warning: Access to field 'base' results in a dereference of a null pointer (loaded from variable 'buf')
                        isc_buffer_availableregion(buf, &r);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:996:36: note: expanded from macro 'isc_buffer_availableregion'
                                   ^
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:821:16: note: expanded from macro 'ISC__BUFFER_AVAILABLEREGION'
                (_r)->base = isc_buffer_used(_b);              \
                             ^~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:152:29: note: expanded from macro 'isc_buffer_used'
        ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
                                   ^~~~~~~~~
1 warning generated.

--

byname_test.c:308:34: warning: Access to field 'fwdtable' results in a dereference of a null pointer (loaded from variable 'view')
                RUNTIME_CHECK(dns_fwdtable_add(view->fwdtable, dns_rootname,
                                               ^~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/util.h:318:52: note: expanded from macro 'RUNTIME_CHECK'
                                                   ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/error.h:50:21: note: expanded from macro 'ISC_ERROR_RUNTIMECHECK'
        ((void)(ISC_LIKELY(cond) ||  \
                           ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/likely.h:23:43: note: expanded from macro 'ISC_LIKELY'
                                            ^
1 warning generated.

--

./rndc.c:255:6: warning: Dereference of null pointer (loaded from variable 'host')
        if (*host == '/') {
            ^~~~~
1 warning generated.

--

./main.c:1254:9: warning: Access to field 'sctx' results in a dereference of a null pointer (loaded from variable 'named_g_server')
        sctx = named_g_server->sctx;
               ^~~~~~~~~~~~~~~~~~~~
1 warning generated.

References:
1. https://clang-analyzer.llvm.org/faq.html#null_pointer

(cherry picked from commit ddd0d356e5)
2020-03-25 18:06:29 +01:00
Ondřej Surý
230d250b3d Fix 'Dead nested assignment's from scan-build-10
The 3 warnings reported are:

os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
        if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

--

rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
        return (zbits &= x);
                ^        ~
1 warning generated.

--

openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
        while ((err = ERR_get_error()) != 0) {
                ^     ~~~~~~~~~~~~~~~
1 warning generated.

(cherry picked from commit 262f087bcf)
2020-03-25 18:06:29 +01:00
Ondřej Surý
0db685ed43 Merge branch 'ondrej/remove-debian-jessie-from-gitlab-ci-v9_16' into 'v9_16'
Remove Debian 8 ("Jessie") from the GitLab CI

See merge request isc-projects/bind9!3282
2020-03-25 06:03:45 +00:00
Ondřej Surý
ed3dd7d67e Remove Debian 8 ("Jessie") from the GitLab CI
There are several reason why remove Debian 8 from the CI:

* Debian 8 ("jessie") has been superseded by Debian 9 ("stretch").
* Regular security support updates have been discontinued as of
  June 17th, 2018.
* Jessie LTS is supported from 17th June 2018 to June 30, 2020.

In other words, it's no longer officially supported by Debian security
team, but by the volunteer/paid contributor composed LTS team.  And the
release will be discontinued in three months from now.  We can use the
freed CI resources to bring new platforms or just to make the jobs run a
bit faster.

(cherry picked from commit 75f46cc3d1)
2020-03-24 14:51:33 +01:00
Mark Andrews
c04d7c28bb Merge branch '1698-converting-isc_log-to-rwlock-broke-windows-v9_16' into 'v9_16'
Used to the correct unlock type (read)

See merge request isc-projects/bind9!3277
2020-03-24 05:04:28 +00:00
Mark Andrews
0b13677f7f Used to the correct unlock type (read)
(cherry picked from commit b7dbfd14d8)
2020-03-24 15:44:06 +11:00
Ondřej Surý
6aebc6c207 Merge branch '4-gitlab-ci.yml-improvement-v9_16' into 'v9_16'
Improve GitLab CI configuration [v9.16]

See merge request isc-projects/bind9!3259
2020-03-20 15:13:43 +00:00
Ondřej Surý
b1475b1ffd Rename MAKE environment variable to MAKE_COMMAND
The environment variable MAKE has been replaced with MAKE_COMMAND,
because overriding MAKE variable also changed the definition of the MAKE
inside the Makefiles, and we want only a single wrapper around the whole
build process.

Previously, setting `MAKE` to `bear make` meant that `bear make` would
be run at every nested make invocation, which messed up the upcoming
automake transition as compile_commands.json would be generated in every
subdirectory instead of just having one central file at the top of the
build tree.

(cherry picked from commit de1a637a69)
2020-03-20 16:07:11 +01:00
Ondřej Surý
a872f0270a Remove cppcheck arm64 job
All *:sid:amd64 jobs were errorneously copied to *:sid:arm64 including
the extra cppcheck run.  Remove the extra definitions from arm64 jobs.

(cherry picked from commit 99f9e2c53e)
2020-03-20 16:07:11 +01:00
Ondřej Surý
7a296c60e1 Replace dependencies+needs with needs+artifacts in GitLabCI config
All jobs now use solely the newer needs configuration to declare
dependencies between jobs:

    needs:
      - job: <foo>
        artifacts: true

instead of combination of dependencies and needs which is deprecated.
This change completely unbundles the stages (alas the stages still needs
to stay because the job graph has to stay acyclic between the stages).

(cherry picked from commit 66ba808c1b)
2020-03-20 16:07:11 +01:00
Michal Nowak
8d46aba685 Merge branch 'mnowak/abi-tracker-helper-v9.17.0-v9_16' into 'v9_16'
[v9_16] Bump BIND baseline version for abi-check

See merge request isc-projects/bind9!3270
2020-03-20 12:12:26 +00:00
Michal Nowak
5fae0df7ee Bump BIND baseline version for abi-check
(cherry picked from commit 3730d59bf9)
2020-03-20 13:10:41 +01:00
Matthijs Mekking
3a13a96169 Merge branch 'v9_16_1-release' into 'v9_16'
Apply 9.16.1 release branch

See merge request isc-projects/bind9!3263
2020-03-20 11:29:29 +00:00
Tinderbox User
ecfea36b72 Update changes after QA review 2020-03-20 11:47:02 +01:00
Tinderbox User
d2c4cfcf1f regen v9_16 2020-03-20 11:47:02 +01:00
Tinderbox User
aed7d77c97 prep 9.16.1
Updated version and CHANGES files with new release number.

Check the API files:
- lib/bind9/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/dns/api:
  Function dns_acl_match changed, struct dns_badcache changed,
  function dns_badcache_add changed, function dns_clent_startupdate
  changed, struct dns_compress changed, struct dns_resolver changed,
  rwlock size changed. This means a LIBINTERFACE increment.
- lib/irs/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/isc/api:
  The structs isc__networker and isc_nmsocket changed. This means
  increment LIBINTERFACE.  The functions isc_uv_export and
  isc_uv_import are removed, so LIBAGE must beq zero.
- lib/isccc/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/isccfg/api:
  Source code changes, but no interface changes: increment
  LIBREVISION.
- lib/ns/api:
  Function ns_clientmgr_create, ns_interfacemgr_create, and
  structs ns_clientmgr, ns_interface, ns_interfacemgr changed:
  increment LIBINTERFACE.

No need to update README or release notes.

Updated CHANGES: Add GitLab MR reference to entry 5357. Remove
merge conflict gone wrong ("max-ixfr-ratio" is not in 9.16).

Add /util/check-make-install.in to .gitattributes.
2020-03-20 11:47:01 +01:00
Michal Nowak
2bddcc9e2b Merge branch 'mnowak/unit-test-debugging-enhancements-v9_16' into 'v9_16'
[v9_16] Enhance unit test debugging

See merge request isc-projects/bind9!3267
2020-03-20 10:37:43 +00:00
Michal Nowak
94fa27e43f Enhance unit test debugging
When unit test fails, core file is created. Kyua's 'debug' command can
run GDB on it and provide backtrace. Unfortunately Kyua is picky about
location of these core files we opt to use custom Kyua fork and copy
core files from Kyua working directory to source tree and make it
available in GitLab.

(cherry picked from commit 8fad74e0e5)
2020-03-20 10:55:09 +01:00
Ondřej Surý
509a06f7b0 Merge branch '1679-remove-workaround-for-systems-with-broken-gettimeofday-system-calls-v9_16' into 'v9_16'
Use clock_gettime() instead of gettimeofday() for isc_stdtime function

See merge request isc-projects/bind9!3258
2020-03-20 09:46:54 +00:00
Ondřej Surý
0345dac44c Use clock_gettime() instead of gettimeofday() for isc_stdtime function
This also removes Solaris 2.8 broken gettimeofday() workaround

(cherry picked from commit e691b89a9a)
2020-03-19 10:17:26 +01:00
Ondřej Surý
2de447b088 Merge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock-v9_16' into 'v9_16'
Use isc_rwlock to lock .logconfig member of isc_log_t

See merge request isc-projects/bind9!3256
2020-03-18 12:48:13 +00:00
Ondřej Surý
11a6ac594a Use isc_rwlock to lock .logconfig member of isc_log_t
In isc_log_woudlog() the .logconfig member of isc_log_t structure was
accessed unlocked on the merit that there could be just a race when
.logconfig would be NULL, so the message would not be logged.  This
turned not to be true, as there's also data race deeper.  The accessed
isc_logconfig_t object could be in the middle of destruction, so the
pointer would be still non-NULL, but the structure members could point
to a chunk of memory no longer belonging to the object.  Since we are
only accessing integer types (the log level), this would never lead to
a crash, it leads to memory access to memory area no longer belonging to
the object and this a) wrong, b) raises a red flag in thread-safety tools.

(cherry picked from commit 4d58856ff7)
2020-03-18 13:25:28 +01:00
Ondřej Surý
072dacfc30 Merge branch 'marka-memget-cannot-fail-logging-v9_16' into 'v9_16'
Refactor the isc_log API so it cannot fail on memory failures

See merge request isc-projects/bind9!3255
2020-03-18 11:45:13 +00:00
Mark Andrews
af14091f65 Refactor the isc_log API so it cannot fail on memory failures
The isc_mem API now crashes on memory allocation failure, and this is
the next commit in series to cleanup the code that could fail before,
but cannot fail now, e.g. isc_result_t return type has been changed to
void for the isc_log API functions that could only return ISC_R_SUCCESS.

(cherry picked from commit 0b793166d0)
2020-03-18 11:44:18 +01:00
Evan Hunt
8899b0c1e6 Merge branch 'each-lgtm-fixes-v9_16' into 'v9_16'
fix LGTM warnings

See merge request isc-projects/bind9!3249
2020-03-17 22:56:26 +00:00
Ondřej Surý
bfe832aea7 Add C11 localtime_r and gmtime_r shims for Windows
On Windows, C11 localtime_r() and gmtime_r() functions are not
available.  While localtime() and gmtime() functions are already thread
safe because they use Thread Local Storage, it's quite ugly to #ifdef
around every localtime_r() and gmtime_r() usage to make the usage also
thread-safe on POSIX platforms.

The commit adds wrappers around Windows localtime_s() and gmtime_s()
functions.

NOTE: The implementation of localtime_s and gmtime_s in Microsoft CRT
are incompatible with the C standard since it has reversed parameter
order and errno_t return type.

(cherry picked from commit 08f4c7d6c0)
2020-03-17 15:33:24 -07:00
Evan Hunt
82edb5a54a silence a warning about unsafe snprintf() call
(cherry picked from commit ec95b84e8d)
2020-03-17 15:33:24 -07:00
Evan Hunt
1ac200626b clean up dead code
removed an if statement that always evaluated to false

(cherry picked from commit fc5ae3192b)
2020-03-17 15:33:24 -07:00
Evan Hunt
3d9a46bcb8 replace unsafe ctime() and gmtime() function calls
This silences LGTM warnings that these functions are not thread-safe.

(cherry picked from commit 5703f70427)
2020-03-17 15:33:24 -07:00
Evan Hunt
a8184b35cd remove or comment empty conditional branches
some empty conditional branches which contained a semicolon were
"fixed" by clang-format to contain nothing. add comments to prevent this.

(cherry picked from commit 735be3b816)
2020-03-17 15:33:23 -07:00
Evan Hunt
10b3f7da89 Merge branch '1684-timer-test-build-v9_16' into 'v9_16'
fix a pointer-to-int cast error

See merge request isc-projects/bind9!3247
2020-03-17 20:27:31 +00:00
Evan Hunt
64ce02b5f8 fix a pointer-to-int cast error
(cherry picked from commit 6b76646037)
2020-03-17 13:10:42 -07:00
Mark Andrews
d2bb41c9b6 Merge branch '1682-dighost-c-idn_output_filter-has-off-by-one-error-v9_16' into 'v9_16'
address off by one error in idn_output_filter

See merge request isc-projects/bind9!3245
2020-03-17 05:48:24 +00:00
Mark Andrews
5dde15b0f2 address off by one error in idn_output_filter
(cherry picked from commit af67acc0d0)
2020-03-17 15:51:29 +11:00
Michał Kępień
056c3d752b Merge branch 'michal/update-gitlab-ci-to-freebsd-12.1-v9_16' into 'v9_16'
[v9_16] Update GitLab CI to FreeBSD 12.1

See merge request isc-projects/bind9!3239
2020-03-16 19:05:21 +00:00
Michał Kępień
e88a9a1be9 Move FreeBSD CI jobs to libvirt-based executors
To get rid of the currently used FreeBSD-specific executor, move FreeBSD
CI jobs to libvirt-based executors.  Make the necessary tag and variable
adjustments.

(cherry picked from commit 80618b5378)
2020-03-16 19:04:48 +00:00
Michał Kępień
c5cbb73f1b Update GitLab CI to FreeBSD 12.1
Since FreeBSD 12.1 is the current FreeBSD 12.x release, replace FreeBSD
12.0 GitLab CI jobs with their up-to-date counterparts.

(cherry picked from commit 4c68b56246)
2020-03-16 19:04:48 +00:00
Mark Andrews
2d05668744 Merge branch '1681-compile-error-geoip_test-c-maxminddb-h-file-not-found-v9_16' into 'v9_16'
Add MAXMINDDB_CFLAGS to CINCLUDES

See merge request isc-projects/bind9!3236
2020-03-16 13:14:23 +00:00
Mark Andrews
86a30a691b Add MAXMINDDB_CFLAGS to CINCLUDES
(cherry picked from commit 81a80274bd)
2020-03-16 18:51:52 +11:00
Mark Andrews
a7c32f4fe0 Merge branch '1676-address-timing-issue-in-forward-system-test-v9_16' into 'v9_16'
wait for the reply message before checking to avoid false negative.

See merge request isc-projects/bind9!3230
2020-03-16 00:18:07 +00:00
Mark Andrews
c3cd3ae488 wait for the reply message before checking to avoid false negative.
Waiting for the reply message will ensure that all messages being
looked for exist in the logs at the time of checking.  When the
test was only waiting for the send message there was a race between
grep and the ns1 instance of named logging that it had seen the
request.

(cherry picked from commit a38a324442)
2020-03-16 10:52:10 +11:00
Mark Andrews
a3c2e9ada6 Merge branch '1655-bind-9-11-5-writes-syntax-errors-to-its-zone-cache-v9_16' into 'v9_16'
Resolve "BIND 9.11.5 writes syntax errors to its zone cache"

See merge request isc-projects/bind9!3226
2020-03-13 04:25:01 +00:00
Mark Andrews
846d0c45bd Add CHANGES note
(cherry picked from commit c9c59db5b3)
2020-03-13 15:03:15 +11:00
Mark Andrews
743c509842 Quote zone name so that specials are handled
(cherry picked from commit 59498ce17f)
2020-03-13 15:02:27 +11:00
Mark Andrews
41060e3d45 Pass NUL terminated buffer name to cfg_parse_buffer
(cherry picked from commit 91efc587b2)
2020-03-13 15:02:26 +11:00
Mark Andrews
9f466b5b17 Test reloading of zones with special
(cherry picked from commit ad030332bd)
2020-03-13 15:02:26 +11:00
Mark Andrews
98d4b93c59 Merge branch 'marka-maybe-silence-missing-unlock-v9_16' into 'v9_16'
Silence missing unlock from Coverity.

See merge request isc-projects/bind9!3224
2020-03-13 02:36:35 +00:00
Mark Andrews
cf6b2a6c18 Silence missing unlock from Coverity.
Save 'i' to 'locknum' and use that rather than using
'header->node->locknum' when performing the deferred
unlock as 'header->node->locknum' can theoretically be
different to 'i'.

(cherry picked from commit 8dd8d48c9f)
2020-03-13 13:17:46 +11:00
Mark Andrews
075f74af95 Merge branch '1652-nslookup-assertion-at-soa_6-c-302-require-rdata-length-0-failed-back-trace-v9_16' into 'v9_16'
Resolve "nslookup: assertion at soa_6.c:302: REQUIRE(rdata->length != 0) failed, back trace"

See merge request isc-projects/bind9!3222
2020-03-13 01:30:14 +00:00
Mark Andrews
0cf72a9414 Check that dig/host/nslookup handle a UPDATE response.
Additionally check that "delete $qname SOA" in the update
reponse doesn't trigger a insertion in nslookup.

(cherry picked from commit 6593cf0b5a)
2020-03-13 11:47:10 +11:00
Mark Andrews
087cd378c4 Report opcode mismatch
(cherry picked from commit bb7576cc9b)
2020-03-13 11:47:10 +11:00
Mark Andrews
e57ff07a7d turn off best effort processing in host and add the ability to specify the port
(cherry picked from commit 4a7b9dba61)
2020-03-13 11:47:10 +11:00
Mark Andrews
7136044885 turn off best effort processing in nslookup
(cherry picked from commit d1cb30e747)
2020-03-13 11:47:10 +11:00
Evan Hunt
43d96d80c4 Merge branch '864-zone-type-table-in-arm-needs-improvement-v9_16' into 'v9_16'
Resolve "zone type table in ARM needs improvement"

See merge request isc-projects/bind9!3217
2020-03-12 09:52:09 +00:00
Evan Hunt
a4f3ec5d97 build doc 2020-03-12 02:25:42 -07:00
Evan Hunt
1a8b6481bf improve readability of bibliogrpahy
Change <biblioentry> and <citetitle> sections to improve the readability
of the bibliography sections. Thanks to Sun Guonian.
2020-03-12 02:22:55 -07:00
Evan Hunt
e1b6438fdd shorten text for mirror zones to prevent overspill 2020-03-12 02:22:50 -07:00
Mark Andrews
7acdb181c5 use relative widths for zone table 2020-03-12 02:22:33 -07:00
Evan Hunt
0cdca3a5fc Merge branch '1661-fix-dbsize-v9_16' into 'v9_16'
improve calculation of database size

See merge request isc-projects/bind9!3196
2020-03-12 08:11:38 +00:00
Evan Hunt
c5405c2700 improve calculation of database size
"max-journal-size" is set by default to twice the size of the zone
database. however, the calculation of zone database size was flawed.

- change the size calculations in dns_db_getsize() to more accurately
  represent the space needed for a journal file or *XFR message to
  contain the data in the database. previously we returned the sizes
  of all rdataslabs, including header overhead and offset tables,
  which resulted in the database size being reported as much larger
  than the equivalent journal transactions would have been.
- map files caused a particular problem here: the full name can't be
  determined from the node while a file is being deserialized, because
  the uppernode pointers aren't set yet. so we store "full name length"
  in the dns_rbtnode structure while serializing, and clear it after
  deserialization is complete.
2020-03-12 00:38:37 -07:00
Ondřej Surý
c99f7cf9bd Merge branch 'ondrej/fix-clang-format-headers-symlinks-v9_16' into 'v9_16'
Fix .clang-format.headers symlinks (v9.16)

See merge request isc-projects/bind9!3213
2020-03-11 09:24:21 +00:00
Ondřej Surý
67464af0bb Fixup the headers formatting 2020-03-11 10:23:35 +01:00
Ondřej Surý
60c6ff4ece Fix the deeper symlinks to .clang-format.headers 2020-03-11 10:21:54 +01:00
Ondřej Surý
ff60a59b7f Merge branch 'ondrej/clang-format-improve-includes-v9_16' into 'v9_16'
Improve #include block sorting and grouping in clang-format (v9_16)

See merge request isc-projects/bind9!3194
2020-03-11 08:55:38 +00:00
Ondřej Surý
f3c2274479 Use the new sorting rules to regroup #include headers 2020-03-11 08:55:12 +00:00
Ondřej Surý
ba0aff0d59 Improve the #include block sorting
The IncludeCategories was incomplete, it missed pk11/ and dst/ headers
and the rule that put "" header after all <> headers was broken.
2020-03-11 08:55:12 +00:00
Michał Kępień
164109087e Merge branch 'michal/minor-release-note-tweaks-v9_16' into 'v9_16'
[v9_16] Minor release note tweaks

See merge request isc-projects/bind9!3211
2020-03-11 08:54:48 +00:00
Michał Kępień
f483c4a6bb Add GitLab identifier to rwlock release note
(cherry picked from commit 3e6ef80706)
2020-03-11 09:52:51 +01:00
Michał Kępień
45170c828e Merge branch '1636-add-release-note-about-controlling-source-ports-v9_16' into 'v9_16'
[v9_16] Add release note about controlling source ports

See merge request isc-projects/bind9!3209
2020-03-11 08:32:58 +00:00
Michał Kępień
e6d4da4080 Add release note about controlling source ports
(cherry picked from commit 384b413dc5)
2020-03-11 09:30:42 +01:00
Michał Kępień
43bea15a7a Release note wording tweaks
(cherry picked from commit 2283d38ac2)
2020-03-11 09:29:44 +01:00
Michał Kępień
c7dee5dd84 Move pthread rwlocks release note to a section
(cherry picked from commit f8a8eaba8b)
2020-03-11 09:28:01 +01:00
Michał Kępień
1d1605fb57 Merge branch 'matthijs-disable-mscv-kasp-system-test-v9_16' into 'v9_16'
[v9_16] Disable kasp test on Windows

See merge request isc-projects/bind9!3208
2020-03-11 07:20:54 +00:00
Matthijs Mekking
e58c1cfe1a Remove leftover set_keydir
(cherry picked from commit 2094e5ed4d)
2020-03-10 16:04:13 +01:00
Matthijs Mekking
a22e881a97 Disable kasp test on Windows
The kasp system test is timing critical.  The test passes on all
Linux based machines, but fails frequently on Windows.  The test
takes a lot more time on Windows and at the final checks fail
because the expected next key event is too far off.  For example:

I:kasp:check next key event for zone step2.algorithm-roll.kasp (570)
I:kasp:error: bad next key event time 20909 for zone \
  step2.algorithm-roll.kasp (expect 21600)
I:kasp:failed

This is because the kasp system test calculates the time when the
next key event should occur based on the policy.  This assumes that
named is able to do key management within a minute.  But starting,
named, doing key management for other zones, and reconfiguring takes
much more time on Windows and thus the next key event on Windows is
much shorter than anticipated.

That this happens is a good thing because this means that the
correct next key event is used, but is not so nice for testing, as
it is hard to determine how much time named needed before finishing
the current key event.

Disable the kasp test on Windows now because it is blocking the
release.  We know the cause of these test failures, and it is clear
that this is a fault in the test, not the code.  Therefore we feel
comfortable disabling the test right now and work on a fix while
unblocking the release.

(cherry picked from commit 4e610b7f6b)
2020-03-10 16:04:13 +01:00
Michal Nowak
6d8f8abe49 Merge branch 'mnowak/abi-tracker-helper-v9_16' into 'v9_16'
[v9_16] Add API Checker

See merge request isc-projects/bind9!3203
2020-03-10 08:56:20 +00:00
Michal Nowak
0cff4c4e4f Add API Checker
ABI checker tools generate HTML and TXT API compatibility reports of
BIND libraries. Comparison is being done between two bind source trees
which hold built BIND.

In the CI one version is the reference version defined by
BIND_BASELINE_VERSION variable, the latter one is the HEAD of branch
under test.

(cherry picked from commit 49bc08e612)
2020-03-10 09:53:44 +01:00
Evan Hunt
15090b4dea Merge branch '1664-double-unlock-v9_16' into 'v9_16'
remove redundant ZONEDB_UNLOCK

See merge request isc-projects/bind9!3198
2020-03-10 00:08:51 +00:00
Evan Hunt
2db2a22f28 remove redundant ZONEDB_UNLOCK
(cherry picked from commit b54454b7c6)
2020-03-09 16:47:44 -07:00
Matthijs Mekking
44680ad1cf Merge branch '1653-dnssec-policy-view-race-v9_16' into 'v9_16'
Resolve "Race condition with dnssec-policy, same zone in different views"

See merge request isc-projects/bind9!3195
2020-03-09 15:59:51 +00:00
Matthijs Mekking
33ceecdde7 Update changes, documentation
(cherry picked from commit 47e42d5750)
2020-03-09 16:25:46 +01:00
Matthijs Mekking
29cde9e990 Fix race condition dnssec-policy with views
When configuring the same dnssec-policy for two zones with the same
name but in different views, there is a race condition for who will
run the keymgr first. If running sequential only one set of keys will
be created, if running parallel two set of keys will be created.

Lock the kasp when running looking for keys and running the key
manager. This way, for the same zone in different views only one
keyset will be created.

The dnssec-policy does not implement sharing keys between different
zones.

(cherry picked from commit e0bdff7ecd)
2020-03-09 16:25:35 +01:00
Matthijs Mekking
7508598b8d Merge branch 'matthijs-refactor-kasp-test-v9_16' into 'v9_16'
Refactor kasp test (backport v9_16)

See merge request isc-projects/bind9!3191
2020-03-09 15:21:57 +00:00
Matthijs Mekking
da9a1bc5f3 Add check calls to kasp zsk-retired test
The test case for zsk-retired was missing the actual checks.  Add
them and fix the set_policy call to expect three keys.

(cherry picked from commit 2e4b55de85)
2020-03-09 15:43:38 +01:00
Matthijs Mekking
44bacf33fc More consistent spacing and comments
Some comments started with a lowercased letter. Capitalized them to
be more consistent with the rest of the comments.

Add some newlines between `set_*` calls and check calls, also to be
more consistent with the other test cases.

(cherry picked from commit 7e54dd74f9)
2020-03-09 15:43:29 +01:00
Matthijs Mekking
c73cca2622 Replace key_states
(cherry picked from commit f500b16f83)
2020-03-09 15:43:17 +01:00
Matthijs Mekking
406f27ebae Replace key_timings
(cherry picked from commit 32e4916c59)
2020-03-09 15:43:10 +01:00
Matthijs Mekking
581e184a21 Replace key_properties
(cherry picked from commit 628e09a423)
2020-03-09 15:43:02 +01:00
Matthijs Mekking
0d9fef7768 Replace zone_properties
(cherry picked from commit 8a4787d585)
2020-03-09 15:42:54 +01:00
Matthijs Mekking
be84cc82af Merge branch 'matthijs-kasp-test-algoroll-v9_16' into 'v9_16'
Backport kasp algorithm rollover test plus bugfixes to v9_16

See merge request isc-projects/bind9!3187
2020-03-09 14:24:57 +00:00
Matthijs Mekking
bc02baa045 Add additional wait period for algorithm rollover
We may be checking the algorithm steps too fast: the reconfig
command may still be in progress. Make sure the zones are signed
and loaded by digging the NSEC records for these zones.

(cherry picked from commit d16520532f)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
01098fb81e Make clang-format happy
(cherry picked from commit 53bd81ad19)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
4e8ffc4ed8 update CHANGES
(cherry picked from commit 6ddfed3de0)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
b59dc6f89e Add CSK algorithm rollover test
(cherry picked from commit 917cf5f86f)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
c20ac664dd [#1624] dnssec-policy change retire unwanted keys
When changing a dnssec-policy, existing keys with properties that no
longer match were not being retired.

(cherry picked from commit 3905a03205)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
4bbefa8514 [#1625] Algorithm rollover waited too long
Algorithm rollover waited too long before introducing zone
signatures.  It waited to make sure all signatures were resigned,
but when introducing a new algorithm, all signatures are resigned
immediately.  Only add the sign delay if there is a predecessor key.

(cherry picked from commit 28506159f0)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
150464e719 [#1626] Fix stuck algorithm rollover
Algorithm rollover was stuck on submitting DS because keymgr thought
it would move to an invalid state.  It did not match the current
key because it checked it against the current key in the next state.
Fixed by when checking the current key, check it against the desired
state, not the existing state.

(cherry picked from commit a8542b8cab)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
f8b555a3a2 Add algorithm rollover test case
Add a test case for algorithm rollover.  This is triggered by
changing the dnssec-policy.  A new nameserver ns6 is introduced
for tests related to dnssec-policy changes.

This requires a slight change in check_next_key_event to only
check the last occurrence.  Also, change the debug log message in
lib/dns/zone.c to deal with checks when no next scheduled key event
exists (and default to loadkeys interval 3600).

(cherry picked from commit 88ebe9581b)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
08ed7461af Remove unneeded step6 zone
The zone 'step6.ksk-doubleksk.autosign' is configured but is not
set up nor tested.  Remove the unneeded configured zone.

(cherry picked from commit cc2afe853b)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
9dc207a363 Introduce enable dnssec test case
(cherry picked from commit fdb3f6f400)
2020-03-09 14:42:53 +01:00
Matthijs Mekking
5e3bad7c95 Prepare kasp for algorithm rollover test
Algorithm rollover will require four keys so introduce KEY4.
Also it requires to look at key files for multiple algorithms so
change getting key ids to be algorithm rollover agnostic (adjusting
count checks).  The algorithm will be verified in check_key so
relaxing 'get_keyids' is fine.

Replace '${_alg_num}' with '$(key_get KEY[1-4] ALG_NUM)' in checks
to deal with multiple algorithms.

(cherry picked from commit 00ced2d2e7)
2020-03-09 14:42:53 +01:00
Michał Kępień
a8563d7fdd Merge branch 'michal/do-not-run-openbsd-system-test-jobs-for-tags-v9_16' into 'v9_16'
[v9_16] Do not run OpenBSD system test jobs for tags

See merge request isc-projects/bind9!3188
2020-03-09 13:35:33 +00:00
Michał Kępień
2c645e10f0 Do not run OpenBSD system test jobs for tags
OpenBSD virtual machines seem to affected particularly badly by other
activity happening on the host.  This causes trouble around release
time: when multiple tags are pushed to the repository, a large number of
jobs is started concurrently on all CI runners.  In extreme cases, this
causes the system test suite to run for about an hour (!) on OpenBSD
VMs, with multiple tests failing.  We investigated the test artifacts
for all such cases in the past and the outcome was always the same: test
failures were caused by extremely slow I/O on the guest.  We tried
various tricks to work around this problem, but nothing helped.

Given the above, stop running OpenBSD system test jobs for pending BIND
releases to prevent the results of these jobs from affecting the
assessment of a given release's readiness for publication.  This change
does not affect OpenBSD build jobs.  OpenBSD system test jobs will still
be run for scheduled and web-requested pipelines, to make sure we catch
any severe issues with test code on that platform sooner or later.

(cherry picked from commit 7b002cea83)
2020-03-09 14:34:18 +01:00
Matthijs Mekking
c33930f99a Merge branch '1413-fix-dnssec-test-v9_16' into 'v9_16'
Fix dnssec test

See merge request isc-projects/bind9!3186
2020-03-09 12:09:47 +00:00
Matthijs Mekking
3b7bfa807f Fix dnssec test
There is a failure mode which gets triggered on heavily loaded
systems. A key change is scheduled in 5 seconds to make ZSK2 inactive
and ZSK3 active, but `named` takes more than 5 seconds to progress
from `rndc loadkeys` to the query check. At this time the SOA RRset
is already signed by the new ZSK which is not expected to be active
at that point yet.

Split up the checks to test the case where RRsets are signed
correctly with the offline KSK (maintained the signature) and
the active ZSK.  First run, RRsets should be signed with the still
active ZSK2, second run RRsets should be signed with the new active
ZSK3.

(cherry picked from commit aebb2aaa0f)
2020-03-09 12:04:12 +01:00
Diego dos Santos Fronza
213defd9e8 Merge branch '1472-threadsanitizer-lock-order-inversion-potential-deadlock-dns_resolver_createfetch-vs_v9_16' into 'v9_16'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) - dns_resolver_createfetch vs. dns_resolver_prime"

See merge request isc-projects/bind9!3157
2020-03-06 17:31:47 +00:00
Diego Fronza
277581c5a1 Fixed disposing of resolver->references in destroy() function 2020-03-06 13:37:07 -03:00
Diego Fronza
341b69aa7e Fixed potential-lock-inversion
This commit simplifies a bit the lock management within dns_resolver_prime()
and prime_done() functions by means of turning resolver's attribute
"priming" into an atomic_bool and by creating only one dependent object on the
lock "primelock", namely the "primefetch" attribute.

By having the attribute "priming" as an atomic type, it save us from having to
use a lock just to test if priming is on or off for the given resolver context
object, within "dns_resolver_prime" function.

The "primelock" lock is still necessary, since dns_resolver_prime() function
internally calls dns_resolver_createfetch(), and whenever this function
succeeds it registers an event in the task manager which could be called by
another thread, namely the "prime_done" function, and this function is
responsible for disposing the "primefetch" attribute in the resolver object,
also for resetting "priming" attribute to false.

It is important that the invariant "priming == false AND primefetch == NULL"
remains constant, so that any thread calling "dns_resolver_prime" knows for sure
that if the "priming" attribute is false, "primefetch" attribute should also be
NULL, so a new fetch context could be created to fulfill this purpose, and
assigned to "primefetch" attribute under the lock protection.

To honor the explanation above, dns_resolver_prime is implemented as follow:
	1. Atomically checks the attribute "priming" for the given resolver context.
	2. If "priming" is false, assumes that "primefetch" is NULL (this is
           ensured by the "prime_done" implementation), acquire "primelock"
	   lock and create a new fetch context, update "primefetch" pointer to
	   point to the newly allocated fetch context.
	3. If "priming" is true, assumes that the job is already in progress,
	   no locks are acquired, nothing else to do.

To keep the previous invariant consistent, "prime_done" is implemented as follow:
	1. Acquire "primefetch" lock.
	2. Keep a reference to the current "primefetch" object;
	3. Reset "primefetch" attribute to NULL.
	4. Release "primefetch" lock.
	5. Atomically update "priming" attribute to false.
	6. Destroy the "primefetch" object by using the temporary reference.

This ensures that if "priming" is false, "primefetch" was already reset to NULL.

It doesn't make any difference in having the "priming" attribute not protected
by a lock, since the visible state of this variable would depend on the calling
order of the functions "dns_resolver_prime" and "prime_done".

As an example, suppose that instead of using an atomic for the "priming" attribute
we employed a lock to protect it.
Now suppose that "prime_done" function is called by Thread A, it is then preempted
before acquiring the lock, thus not reseting "priming" to false.
In parallel to that suppose that a Thread B is scheduled and that it calls
"dns_resolver_prime()", it then acquires the lock and check that "priming" is true,
thus it will consider that this resolver object is already priming and it won't do
any more job.
Conversely if the lock order was acquired in the other direction, Thread B would check
that "priming" is false (since prime_done acquired the lock first and set "priming" to false)
and it would initiate a priming fetch for this resolver.

An atomic variable wouldn't change this behavior, since it would behave exactly the
same, depending on the function call order, with the exception that it would avoid
having to use a lock.

There should be no side effects resulting from this change, since the previous
implementation employed use of the more general resolver's "lock" mutex, which
is used in far more contexts, but in the specifics of the "dns_resolver_prime"
and "prime_done" it was only used to protect "primefetch" and "priming" attributes,
which are not used in any of the other critical sections protected by the same lock,
thus having zero dependency on those variables.
2020-03-06 13:37:07 -03:00
Diego Fronza
84d6896661 Added atomic_compare_exchange_strong_acq_rel macro
It is much better to read than:
atomic_compare_exchange_strong_explicit() with 5 arguments.
2020-03-06 13:37:07 -03:00
Michał Kępień
eb80b0c1d5 Merge branch 'michal/fix-using-sibling-root-libuv-for-windows-builds-v9_16' into 'v9_16'
[v9_16] Fix using sibling-root libuv for Windows builds

See merge request isc-projects/bind9!3182
2020-03-06 12:38:25 +00:00
Michał Kępień
11f2f7bfbf Fix using sibling-root libuv for Windows builds
HAVE_UV_IMPORT and other config.h macros must not be set unconditionally
because no existing libuv release exposes uv_import() and/or uv_export()
yet.  Windows builds not passing an explicit path to libuv to
win32utils/Configure are currently broken because of this, so comment
out the offending lines and describe when the aforementioned config.h
macros should be set.

(cherry picked from commit 57b430b8ca)
2020-03-06 13:37:25 +01:00
Mark Andrews
40fd6b8616 Merge branch '1628-release-process-failed-to-detect-that-header-file-was-not-installed-v9_16' into 'v9_16'
test installed header files

See merge request isc-projects/bind9!3175
2020-03-06 03:06:18 +00:00
Mark Andrews
fc199384c5 test installed header files
(cherry picked from commit a278b6bd84)
2020-03-06 02:20:03 +00:00
Mark Andrews
aa995a2f1d Merge branch 'marka-install-missing-header-files' into 'v9_16'
Fix lists of installed header files

See merge request isc-projects/bind9!3178
2020-03-06 02:17:35 +00:00
Mark Andrews
5d64049301 Fix lists of installed header files 2020-03-06 13:00:04 +11:00
Witold Krecicki
a5c21d5862 Merge branch '1650-fix-race-in-killoldestclient-v9_16' into 'v9_16'
Destroy query in killoldestquery under a lock.

See merge request isc-projects/bind9!3162
2020-03-06 00:58:40 +00:00
Witold Kręcicki
aec3dd28d6 Destroy query in killoldestquery under a lock.
Fixes a race between ns_client_killoldestquery and ns_client_endrequest -
killoldestquery takes a client from `recursing` list while endrequest
destroys client object, then killoldestquery works on a destroyed client
object. Prevent it by holding reclist lock while cancelling query.

(cherry picked from commit df3dbdff81)
2020-03-05 23:55:42 +00:00
Witold Krecicki
ce4866f456 Merge branch '1643-tcp-connections-accounting-v9_16' into 'v9_16'
Resolve "Problems reported in BIND 9.16.0 after hitting tcp-clients limit"

See merge request isc-projects/bind9!3172
2020-03-05 23:55:11 +00:00
Witold Kręcicki
5b22e3689d Only use tcpdns timer if it's initialized.
(cherry picked from commit 4b9962d4a3)
2020-03-05 23:27:56 +00:00
Witold Kręcicki
196d937007 CHANGES note
(cherry picked from commit d2445310e2)
2020-03-05 23:27:56 +00:00
Witold Kręcicki
b32b01d403 Fix TCPDNS socket closing issues
(cherry picked from commit ae1499ca19)
2020-03-05 23:27:56 +00:00
Evan Hunt
a8e9ef194c add a test of normal TCP query behavior before and after high-water test
(cherry picked from commit 1383804597)
2020-03-05 23:27:56 +00:00
Witold Kręcicki
11b80da9ff Limit TCP connection quota logging to 1/s
(cherry picked from commit fc9792eae8)
2020-03-05 23:27:56 +00:00
Witold Kręcicki
b85de76816 Proper accounting of active TCP connections
(cherry picked from commit fc9e2276ca)
2020-03-05 23:27:56 +00:00
Mark Andrews
ccc75390bb Merge branch 'marka-sort-AC_CONFIG_FILES-v9_16' into 'v9_16'
sort AC_CONFIG_FILES

See merge request isc-projects/bind9!3168
2020-03-05 22:30:29 +00:00
Mark Andrews
5390eee7cf sort AC_CONFIG_FILES
(cherry picked from commit fd0d4ba948)
2020-03-06 08:48:44 +11:00
Michal Nowak
0665c7f550 Merge branch 'mnowak/respdiff-v9_16' into 'v9_16'
[v9_16] Add respdiff job

See merge request isc-projects/bind9!3164
2020-03-05 14:47:10 +00:00
Michal Nowak
704eeb3288 Add respdiff job
This job leverages respdiff test from the private bind-qa repo.

(cherry picked from commit 04f8b65a8f)
2020-03-05 12:15:04 +01:00
Michal Nowak
fca6950ff5 Merge branch 'mnowak/pkcs11-test-fix-v9_16' into 'v9_16'
[v9_16] Fix pkcs11 test

See merge request isc-projects/bind9!3160
2020-03-05 07:00:51 +00:00
Michal Nowak
53ca8cac14 Fix "pkcs11" system test
- Define the SLOT environment variable before starting the test.  This
    variable defaults to 0 and that does not work with SoftHSM 2.

  - The system test expects the PIN environment variable to be set to
    "1234" while bin/tests/prepare-softhsm2.sh sets it to "0000".
    Update bin/tests/prepare-softhsm2.sh so that it sets the PIN to
    "1234".

  - Move contents of bin/tests/system/pkcs11/prereq.sh to
    bin/tests/system/pkcs11/setup.sh as the former was creating a file
    called "supported" that was getting removed by the latter before
    bin/tests/system/pkcs11/tests.sh could access it.

  - Fix typo in "have_ecx".

(cherry picked from commit 100a230e80f01a777b917b135b4bae9a4ac0e8ae)
2020-03-05 07:00:50 +00:00
Evan Hunt
15afc90941 Merge branch '1647-addtrustedkey-dnskey-v9_16' into 'v9_16'
Resolve "delv 9.16.0, failed to add trusted key '.': ran out of space"

See merge request isc-projects/bind9!3159
2020-03-05 00:44:08 +00:00
Evan Hunt
f827513c53 CHANGES
(cherry picked from commit d805fe821e)
2020-03-04 16:25:32 -08:00
Evan Hunt
d5107fb63a add a system test to check that delv loads trust anchors correctly
(cherry picked from commit a81ae32d8a)
2020-03-04 15:42:12 -08:00
Tony Finch
48860528d0 Fix dns_client_addtrustedkey(dns_rdatatype_dnskey)
Use a buffer that is big enough for DNSKEY records as well as DS
records.

(cherry picked from commit 689ef89b67)
2020-03-04 15:42:12 -08:00
Witold Krecicki
3d1a5e3ebb Merge branch 'wpk-use-pthread-rwlock-by-default-v9_16' into 'v9_16'
Use pthread rwlocks by default

See merge request isc-projects/bind9!3156
2020-03-04 11:36:06 +00:00
Witold Kręcicki
d6b4493aa9 Add release notes for pthread rwlocks change
(cherry picked from commit 4ca5c02d0e)
2020-03-04 10:11:17 +00:00
Witold Kręcicki
16cedf6e45 Use pthread rwlocks by default
(cherry picked from commit ad03c22e97)
2020-03-04 10:11:17 +00:00
Witold Krecicki
805a44eaff Merge branch 'wpk/perfwork-7-multilocked-badcache-v9_16' into 'v9_16'
Wpk/perfwork 7 multilocked badcache v9 16

See merge request isc-projects/bind9!3155
2020-03-04 10:07:55 +00:00
Witold Kręcicki
3212ab0052 Workaround for clang static analyzer bug.
(cherry picked from commit 6c8f309745)
2020-03-04 10:48:59 +01:00
Witold Kręcicki
1296e48e11 Badcache with multiple locks.
Previously badcache used one single mutex for everything, which
was causing performance issues. Use one global rwlock for the whole
hashtable and per-bucket mutexes.

(cherry picked from commit 47e5f5564c)
2020-03-04 10:48:59 +01:00
Mark Andrews
6bfe3fb988 Merge branch '1656-masterformat-system-test-failed-missing-sleep-1-v9_16' into 'v9_16'
properly wait for zone to be loaded

See merge request isc-projects/bind9!3153
2020-03-04 07:45:38 +00:00
Mark Andrews
50a03f82b2 properly wait for zone to be loaded
(cherry picked from commit 0abcface49)
2020-03-04 18:16:42 +11:00
Mark Andrews
c90d788d5b Merge branch 'marka-check-touched-v9_16' into 'v9_16'
Marka check touched v9 16

See merge request isc-projects/bind9!3147
2020-03-03 22:34:38 +00:00
Mark Andrews
e01e4d6921 Add CHANGES entry
(cherry picked from commit 64474db14e)
2020-03-04 09:11:47 +11:00
Mark Andrews
3e08796e85 Restart zone maintenance if it had been stalled.
(cherry picked from commit f171347b5f)
2020-03-04 09:11:46 +11:00
Mark Andrews
3cdfa9758b Check inline master zones that are touched reload correctly.
(cherry picked from commit 50e079d6c3)
2020-03-04 09:11:46 +11:00
Witold Krecicki
aa365bc905 Merge branch 'wpk/socket-destroy-race-v9_16' into 'v9_16'
Fix a race in isc_socket destruction.

See merge request isc-projects/bind9!3144
2020-03-03 09:02:14 +00:00
Witold Kręcicki
e4d39f57ff Fix a race in isc_socket destruction.
There was a very slim chance of a race between isc_socket_detach and
process_fd: isc_socket_detach decrements references to 0, and before it
calls destroy gets preempted. Second thread calls process_fd, increments
socket references temporarily to 1, and then gets preempted, first thread
then hits assertion in destroy() as the reference counter is now 1 and
not 0.

(cherry picked from commit 81ba0fe0e6)
2020-03-03 09:26:54 +01:00
Mark Andrews
b9a9407514 Merge branch '1627-call-set_resigntime-and-zone_settimer-v9_16' into 'v9_16'
Resolve "inline re-signing stops"

See merge request isc-projects/bind9!3138
2020-03-03 06:13:02 +00:00
Mark Andrews
d768a69377 add release note entry
(cherry picked from commit 23ce0f32e5)
2020-03-03 16:50:56 +11:00
Mark Andrews
14cf433d77 Add CHANGES note
(cherry picked from commit 905549f061)
2020-03-03 16:11:24 +11:00
Ondřej Surý
633f07e298 Adjust lock/unlock in zone_rekey()
(cherry picked from commit aaaa7e67fa)
2020-03-03 16:10:45 +11:00
Mark Andrews
b301dfcfe8 Ensure that resigintime and the zone timer are set
(cherry picked from commit a6626594aa)
2020-03-03 16:10:45 +11:00
Matthijs Mekking
8b34aeb874 Add more zone locks
Add more zone locks around code that touches zone timer setting
in failure modes.

(cherry picked from commit 143d1c9767)
2020-03-03 16:10:45 +11:00
Mark Andrews
f67202587f Always call set_resigntime with the zone lock held
(cherry picked from commit 7212961849)
2020-03-03 16:10:45 +11:00
Mark Andrews
7f86372e5a Always call zone_settimer()
zone_needdump() could potentially not call zone_settimer() so
explitly call zone_settimer() as zone->resigntime could have
gone backward.

(cherry picked from commit 5ec57f31b0)
2020-03-03 16:10:45 +11:00
Mark Andrews
91f75acb27 Call set_resigntime() in receive_secure_serial()
With RRSIG records no longer being signed with the full
sig-validity-interval we need to ensure the zone->resigntime
as it may need to be set to a earlier time.

(cherry picked from commit 5d1611afdc)
2020-03-03 16:10:45 +11:00
Michał Kępień
690591c3c9 Merge branch '1640-add-ZLIB_LIBS-to-ISCLIBS-v9_16' into 'v9_16'
[v9_16] Add ZLIB_LIBS to ISCLIBS

See merge request isc-projects/bind9!3131
2020-02-28 14:39:02 +00:00
Michał Kępień
69974ea278 Add ZLIB_LIBS to ISCLIBS
When --with-zlib is passed to ./configure (or when the latter
autodetects zlib's presence), libisc uses certain zlib functions and
thus libisc's users should be linked against zlib in that case.  Adjust
Makefile variables appropriately to prevent shared build failures caused
by underlinking.

(cherry picked from commit fc967ba092)
2020-02-28 15:22:59 +01:00
Witold Krecicki
0e6a8e8dc8 Merge branch 'wpk/perfwork-3-small-nits-v9_16' into 'v9_16'
Wpk/perfwork 3 small nits v9 16

See merge request isc-projects/bind9!3130
2020-02-28 09:36:49 +00:00
Evan Hunt
d794d85ce1 comments
(cherry picked from commit 0b76d8a490)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
e11a8e832e Don't define NS_CLIENT_TRACE by default
(cherry picked from commit 4b6a064972)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
fbc81f4ed7 Increase inactivehandles and inactivereqs size for better reuse.
(cherry picked from commit 4791263def)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
1e1c3f2e7f Increase nodelock count for both cache and regular db.
(cherry picked from commit 0344684385)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
3e3350809e Use RESOLVER_NTASKS_PERCPU - 32 for regular tuning, 8 for small
(cherry picked from commit 0d80266f7e)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
bd33adfb67 use SO_INCOMING_CPU for UDP sockets
(cherry picked from commit 517e6eccdf)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
0edf2e290b Remove some stale fields from ns_client_t; make sendbuf allocated on heap
(cherry picked from commit 8c6c07286f)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
1af2ca358e Don't update LRU if the node was recently used.
Updating LRU requires write-locking the node, which causes contention.
Update LRU only if time difference is large enough.

(cherry picked from commit fe584c01cc)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
4e422b3f10 We don't need to fill udp local address every time since we are bound to it.
(cherry picked from commit a658f7976c)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
d0b8c6a378 Don't check if the client is on recursing list (requires locking) if it's not RECURSING
(cherry picked from commit 938b61405b)
2020-02-28 10:05:25 +01:00
Witold Kręcicki
f7039eb27e Use the original threadid when sending a UDP packet to decrease probability of context switching
(cherry picked from commit eb874608c1)
2020-02-28 10:05:25 +01:00
Mark Andrews
68748443db Merge branch '1638-rrsig-soa-and-re-signing-v9_16' into 'v9_16'
Resolve "RRSIG(SOA) and re-signing."

See merge request isc-projects/bind9!3128
2020-02-28 00:27:20 +00:00
Mark Andrews
e2551b794f capture named-journalprint output
(cherry picked from commit 88c828cb9f)
2020-02-28 10:05:45 +11:00
Mark Andrews
761f66e2e3 sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time
(cherry picked from commit a24fd55836)
2020-02-28 10:05:44 +11:00
Mark Andrews
9a16804eee use the full sig-validity-interval for RRSIG(SOA)
(cherry picked from commit 660dc3eba7)
2020-02-28 10:05:44 +11:00
Mark Andrews
994aa0a28e Merge branch 'marka-coverity-stop-taint-v9_16' into 'v9_16'
Simplify hash computation to prevent pointer being classed as tainted.

See merge request isc-projects/bind9!3127
2020-02-27 22:27:23 +00:00
Mark Andrews
aace42d663 Simplify hash computation to prevent pointer being classed as tainted.
mem.c:add_trace_entry() -> isc_hash_function() -> isc_siphash24()

129        for (; in != end; in += 8) {

	6. byte_swapping: Performing a byte swapping operation on
	in implies that it came from an external source, and is
	therefore tainted.

130                uint64_t m = U8TO64_LE(in);

(cherry picked from commit 8c983a7ebd)
2020-02-28 09:06:09 +11:00
Witold Krecicki
099540b8f5 Merge branch '1623-assertion-failure-ns-client-endrequest-v9_16' into 'v9_16'
Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.

See merge request isc-projects/bind9!3123
2020-02-27 12:41:48 +00:00
Witold Kręcicki
c8dd7e07cd Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.
Fix a potential assertion failure on shutdown in ns__client_endrequest.
Scenario:
1. We are shutting down, interface->clientmgr is gone.
2. We receive a packet, it gets through ns__client_request
3. mgr == NULL, return
4. isc_nmhandle_detach calls ns_client_reset_cb
5. ns_client_reset_cb calls ns_client_endrequest
6. INSIST(client->state == NS_CLIENTSTATE_WORKING ||
          client->state == NS_CLIENTSTATE_RECURSING) is not met
   - we haven't started processing this packet so
   client->state == NS_CLIENTSTATE_READY.
As a solution - don't do anything in ns_client_reset_cb if the client
is still in READY state.

(cherry picked from commit b0888ff039)
2020-02-27 12:08:02 +00:00
Witold Krecicki
9f7acb1dd0 Merge branch 'wpk/perfwork-5-isc-result-rwlock-v9_16' into 'v9_16'
Use isc_rwlock for isc_result tables

See merge request isc-projects/bind9!3124
2020-02-27 11:39:43 +00:00
Witold Kręcicki
a308064f9f Use isc_rwlock for isc_result tables
(cherry picked from commit 00f2146265)
2020-02-27 12:07:16 +01:00
Witold Krecicki
af500373e9 Merge branch 'wpk/perfwork-4-compressctx-arena-v9_16' into 'v9_16'
Add an arena to compressctx

See merge request isc-projects/bind9!3122
2020-02-27 09:12:39 +00:00
Witold Kręcicki
3dfa493f16 Add an arena to compressctx
(cherry picked from commit 3a3b5f557a)
2020-02-27 08:54:02 +01:00
Evan Hunt
c9996ae871 Merge branch 'each-speedup-serve-stale-test-v9_16' into 'v9_16'
Speed up serve-stale test

See merge request isc-projects/bind9!3121
2020-02-27 07:28:55 +00:00
Evan Hunt
8d3efd031b send bursts of queries in parallel to reduce test runtime
sending each group of queries simultaneously, and then checking the
output after the last one finishes, reduces the runtime of the
serve-stale test by about six minutes.

(cherry picked from commit 195d25b222)
2020-02-26 23:02:07 -08:00
Evan Hunt
817e2aaf14 stop testing 'serve-stale yes' and 'serve-fail no' alternate syntax
"yes" and "no" are permissible synonyms for "on" and "off", which
use exactly the same code paths. making sure they work isn't a good
use of 80 seconds of test time.

(cherry picked from commit 027601cd3e)
2020-02-26 23:02:07 -08:00
Evan Hunt
5691da9e9e use "on|off" in rndc -h output to match the man page
(cherry picked from commit 770bf4980f)
2020-02-26 23:02:07 -08:00
Evan Hunt
7bd96b9c24 Merge branch 'each-cosmetic-fixes-v9_16' into 'v9_16'
minor cosmetic fixes

See merge request isc-projects/bind9!3119
2020-02-25 19:55:11 +00:00
Evan Hunt
4926c232cd minor cosmetic fixes
- the configuration summary reported zlib compression was not
  supported even when it was.
- when bind.keys.h was regenerated it violated clang-format style.

(cherry picked from commit beda680f90)
2020-02-25 11:20:58 -08:00
Evan Hunt
7624ae6af8 Merge branch '1632-spelling-take2-v9_16' into 'v9_16'
some Fossies-reported spelling errors were accidentally left unfixed

See merge request isc-projects/bind9!3111
2020-02-21 22:17:54 +00:00
Evan Hunt
f0972d5bbd some Fossies-reported spelling errors were accidentally left unfixed
(cherry picked from commit a2aa29ed4f)
2020-02-21 14:15:18 -08:00
Evan Hunt
863f33f3eb Merge branch 'each-dlz-build-v9_16' into 'v9_16'
fix build errors in DLZ modules

See merge request isc-projects/bind9!3109
2020-02-21 17:22:24 +00:00
Evan Hunt
bb2dec1697 fix build errors in DLZ modules
(cherry picked from commit a06620fe59)
2020-02-21 09:21:07 -08:00
Michał Kępień
4f9e0936f0 Merge branch 'michal/clean-up-with-tuning-large-remnants-v9_16' into 'v9_16'
[v9_16] Clean up --with-tuning=large remnants

See merge request isc-projects/bind9!3107
2020-02-21 13:30:17 +00:00
Michał Kępień
01646805bb Clean up --with-tuning=large remnants
The change introduced by commit be159f5565
was not fully complete.  Adjust ./configure summary so that it reflects
the new way the --with-tuning switch works, fixing the Autoconf variable
used for determining the value of that switch.  Fix win32utils/Configure
so that it behaves the same way as its Unix counterpart.

(cherry picked from commit a5fc3a6364)
2020-02-21 13:43:16 +01:00
Evan Hunt
777ad343cc Merge branch '1632-spelling-v9_16' into 'v9_16'
fix spelling errors reported by Fossies.

See merge request isc-projects/bind9!3105
2020-02-21 07:49:44 +00:00
Mark Andrews
c6f73b5d0c update signatures
(cherry picked from commit 40fc5809cd)
2020-02-21 07:05:31 +00:00
Evan Hunt
11a0d771f9 fix spelling errors reported by Fossies.
(cherry picked from commit ba0313e649)
2020-02-21 07:05:31 +00:00
Mark Andrews
d133acc8bb Merge branch 'marka-fix-signature-test-v9_16' into 'v9_16'
Fix code to generate the test signatues.

See merge request isc-projects/bind9!3104
2020-02-21 06:51:32 +00:00
Mark Andrews
5aa1222cdf Fix code to generate the test signatues.
* ctx needs to be destroyed before it is regenerated.
* emit the name of the signature to be replaced.
* cleanup memory before asserting so post longjump doesn't detect a
  memory leak.
* comment code.

(cherry picked from commit 3a8c8a2a31)
2020-02-21 17:43:01 +11:00
Ondřej Surý
bfdd704889 Merge branch 'cherry-pick-e4671ef2' into 'v9_16'
Merge branch 'ondrej/fix-crash-on-arm64-from-weak-cmpxchg' into 'master'

See merge request isc-projects/bind9!3100
2020-02-20 19:57:09 +00:00
Ondřej Surý
36987a98d1 Merge branch 'ondrej/fix-crash-on-arm64-from-weak-cmpxchg' into 'master'
Fix crash on arm64 from using atomic_compare_exchange_weak outside of the loop

See merge request isc-projects/bind9!3042

(cherry picked from commit e4671ef2fa)

fa68a0d8 Added atomic_compare_exchange_strong_acq_rel macro
4cf275ba Replace non-loop usage of atomic_compare_exchange_weak with strong variant
4ff887db Add arm64 to GitLab CI
2020-02-20 19:21:01 +00:00
Michał Kępień
ab2676f74e Merge branch 'michal/make-a-sed-script-in-doc-arm-makefile.in-portable-v9_16' into 'v9_16'
[v9_16] Make a sed script in doc/arm/Makefile.in portable

See merge request isc-projects/bind9!3097
2020-02-20 11:27:44 +00:00
Michał Kępień
19be2e7efa Make a sed script in doc/arm/Makefile.in portable
BSD sed does not recognize \s as a whitespace matching token.  Make the
sed script in doc/arm/Makefile.in which ensures GitLab identifiers are
not split across lines portable by replacing \s with [[:space:]].

(cherry picked from commit b25e6b51f6)
2020-02-20 12:24:15 +01:00
Michał Kępień
0dfa6afa09 Merge branch 'michal/increase-lifetime-of-docs-sid-amd64-artifacts-v9_16' into 'v9_16'
[v9_16] Increase lifetime of docs:sid:amd64 artifacts

See merge request isc-projects/bind9!3096
2020-02-20 10:57:37 +00:00
Michał Kępień
e09e5cd7f5 Increase lifetime of docs:sid:amd64 artifacts
Artifacts generated by the docs:sid:amd64 job need to be retained longer
than for other jobs as they are used for building bind.isc.org contents.
If these artifacts are removed too quickly, pipelines in the pages/bind
GitLab project start failing, preventing content updates from being
published.  Increase lifetime of the relevant job artifacts to prevent
this from happening.

(cherry picked from commit 9751ba5a75)
2020-02-20 11:53:18 +01:00
Michał Kępień
d6777801a3 Merge branch 'michal/fix-lib-isc-tests-socket_test-hangs-v9_16' into 'v9_16'
[v9_16] Fix lib/isc/tests/socket_test hangs

See merge request isc-projects/bind9!3093
2020-02-20 10:49:48 +00:00
Witold Krecicki
e60ea71ec1 Fix lib/isc/tests/socket_test hangs
(cherry picked from commit 0fe149b2fa)
2020-02-20 11:40:51 +01:00
Witold Krecicki
eed269270e Merge branch 'wpk/perfork-2-libuv-tuning-v9_16' into 'v9_16'
Perfwork 2/6 - libuv tuning - support for uv_{recv/send}mmsg, use of libuv-provided uv_export/import

See merge request isc-projects/bind9!3084
2020-02-18 14:02:47 +00:00
Witold Kręcicki
32d00479e6 Use libuv-provided uv_{export,import} if available.
We were using our own versions of isc_uv_{export,import} functions
for multithreaded TCP listeners. Upcoming libuv version will
contain proper uv_{export,import} functions - use them if they're
available.
2020-02-18 14:21:16 +01:00
Witold Kręcicki
85c2f8dab5 Make nm->recvbuf larger and heap allocated, to allow uv_recvmmsg usage.
Upcoming version of libuv will suport uv_recvmmsg and uv_sendmmsg. To
use uv_recvmmsg we need to provide a larger buffer and be able to
properly free it.
2020-02-18 14:21:16 +01:00
Witold Krecicki
4880224a6a Merge branch 'wpk/perfwork-1-client-mctxpool-taskpool-v9_16' into 'v9_16'
Perfwork 1/6 - Use thread-sharded mctxpool and taskpool in ns_client

See merge request isc-projects/bind9!3083
2020-02-18 11:38:42 +00:00
Witold Kręcicki
1b9df6779d Use thread-friendly mctxpool and taskpool in ns_client.
Make ns_client mctxpool more thread-friendly by sharding it by
netmgr threadid, use task pool also sharded by thread id to avoid
lock contention.
2020-02-18 11:57:46 +01:00
Witold Kręcicki
777fb6a6f2 Make isc_task_pause/isc_task_unpause thread safe.
isc_task_pause/unpause were inherently thread-unsafe - a task
could be paused only once by one thread, if the task was running
while we paused it it led to races. Fix it by making sure that
the task will pause if requested to, and by using a 'pause reference
counter' to count task pause requests - a task will be unpaused
iff all threads unpause it.

Don't remove from queue when pausing task - we lock the queue lock
(expensive), while it's unlikely that the task will be running -
and we'll remove it anyway in dispatcher
2020-02-18 10:24:06 +01:00
Evan Hunt
8d0360474c Merge branch 'each-tweak-penalty-v9_16' into 'v9_16'
adjust the clang-format penalties to reduce string breaking

See merge request isc-projects/bind9!3080
2020-02-17 23:04:29 +00:00
Evan Hunt
25496b2299 adjust the clang-format penalties to reduce string breaking
this corrects some style glitches such as:
```
        long_function_call(arg, arg2, arg3, arg4, arg5, "str"
                                                        "ing");
```
...by adjusting the penalties for breaking strings and call
parameter lists.

(cherry picked from commit 0002377dca)
2020-02-17 14:43:46 -08:00
Ondřej Surý
887244ae86 Merge branch 'ondrej/clang-format-fixups-v9_16' into 'v9_16'
clang-format fixups v9_16

See merge request isc-projects/bind9!3074
2020-02-16 17:40:51 +00:00
Ondřej Surý
649fe9be35 Fixup the missing clang-format bits
(cherry picked from commit 3832e3ecc9)
2020-02-16 18:07:27 +01:00
Ondřej Surý
a16d99d3fe Switch to clang-format-10 that's more accessible on more platforms
(cherry picked from commit cbb127eb43)
2020-02-16 18:03:48 +01:00
Ondřej Surý
f6546a2466 Merge branch 'cherry-pick-a04cdde4' into 'v9_16'
Merge branch '46-enforce-clang-format-rules' into 'master'

See merge request isc-projects/bind9!3064
2020-02-14 08:46:35 +00:00
Ondřej Surý
829b461c54 Merge branch '46-enforce-clang-format-rules' into 'master'
Start enforcing the clang-format rules on changed files

Closes #46

See merge request isc-projects/bind9!3063

(cherry picked from commit a04cdde45d)

d2b5853b Start enforcing the clang-format rules on changed files
618947c6 Switch AlwaysBreakAfterReturnType from TopLevelDefinitions to All
654927c8 Add separate .clang-format files for headers
5777c44a Reformat using the new rules
60d29f69 Don't enforce copyrights on .clang-format
2020-02-14 08:45:59 +00:00
Ondřej Surý
99a019eb06 Merge branch 'cherry-pick-d3b49b66' into 'v9_16'
Merge branch 'each-style-tweak' into 'master'

See merge request isc-projects/bind9!3062
2020-02-14 05:57:37 +00:00
Ondřej Surý
cdef20bb66 Merge branch 'each-style-tweak' into 'master'
adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
2020-02-14 05:35:29 +00:00
Ondřej Surý
c646c20e79 Merge branch 'cherry-pick-67b68e06' into 'v9_16'
Merge branch '46-add-curly-braces' into 'master'

See merge request isc-projects/bind9!3060
2020-02-13 22:44:02 +00:00
Ondřej Surý
2e55baddd8 Merge branch '46-add-curly-braces' into 'master'
Add curly braces using uncrustify and then reformat with clang-format back

Closes #46

See merge request isc-projects/bind9!3057

(cherry picked from commit 67b68e06ad)

36c6105e Use coccinelle to add braces to nested single line statement
d14bb713 Add copy of run-clang-tidy that can fixup the filepaths
056e133c Use clang-tidy to add curly braces around one-line statements
2020-02-13 21:28:35 +00:00
Tinderbox User
6270e602ea Merge branch 'prep-release' into v9_16 2020-02-12 20:03:44 +00:00
Tinderbox User
29696e495f prep v9.16.0 2020-02-12 20:03:16 +00:00
Michał Kępień
932d618a13 Merge branch 'michal/prepare-release-notes-for-bind-9.16.0' into 'v9_16'
Prepare release notes for BIND 9.16.0

See merge request isc-projects/bind9!2881
2020-02-12 15:06:32 +00:00
Michał Kępień
d75b945a30 Add libuv information to win32utils/build.txt 2020-02-12 16:04:04 +01:00
Michał Kępień
241c7e91fe Fix broken link in configure.ac 2020-02-12 16:04:04 +01:00
Michał Kępień
e177963906 Update PLATFORMS for BIND 9.16 2020-02-12 16:04:04 +01:00
Michał Kępień
db3ce9c0a9 Update README for BIND 9.16 2020-02-12 16:04:04 +01:00
Michał Kępień
5eded8d66e Prepare release notes for BIND 9.16.0
- Merge release notes from all 9.15.x releases, leaving only those
    which do not apply to BIND 9.14.

  - Add missing GitLab/RT issue identifiers.

  - Update "Introduction", "Note on Version Numbering", and "End of
    Life" sections with BIND 9.16 information.
2020-02-12 16:04:04 +01:00
Ondřej Surý
cac3c8e6fb Merge branch 'cherry-pick-7099e79a' into 'v9_16'
Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'

See merge request isc-projects/bind9!3053
2020-02-12 14:53:37 +00:00
Ondřej Surý
c931d8e417 Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'
Reformat source code with clang-format

Closes #46

See merge request isc-projects/bind9!2156

(cherry picked from commit 7099e79a9b)

4c3b063e Import Linux kernel .clang-format with small modifications
f50b1e06 Use clang-format to reformat the source files
11341c76 Update the definition files for Windows
df6c1f76 Remove tkey_test (which is no-op anyway)
2020-02-12 14:51:18 +00:00
Michal Nowak
dbe15330fe Merge branch 'mnowak/coverity-disable-web-tag-v9_16' into 'v9_16'
[v9_16] Run Coverity Scan only when specific variables are present

See merge request isc-projects/bind9!3054
2020-02-12 14:47:52 +00:00
Michal Nowak
b833064648 Run Coverity Scan only when specific variables are present
Submissions to Coverity Scan should be limited to those originated from
release branches and only from a specific schedule which holds
COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN variables.

(cherry picked from commit 48530aa21395414b0f9788ea5ab158b2b09ab977)
2020-02-12 14:47:52 +00:00
5128 changed files with 408613 additions and 1376094 deletions

View File

@@ -34,10 +34,6 @@ PointerAlignment: Right
PointerBindsToType: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(urcu\.h|urcu/urcu-|urcu-)'
Priority: 2
- Regex: '^<urcu/'
Priority: 3
- Regex: '^<isc/'
Priority: 5
- Regex: '^<(pk11|pkcs11)/'
@@ -54,18 +50,18 @@ IncludeCategories:
Priority: 35
- Regex: '^<irs/'
Priority: 40
- Regex: '^<bind9/'
Priority: 45
- Regex: '^<(dig|named|rndc|confgen|dlz)/'
Priority: 50
- Regex: '^<dlz_'
Priority: 55
- Regex: '^".*"'
Priority: 99
- Regex: '^<tests/'
Priority: 100
- Regex: '<openssl/'
Priority: 4
Priority: 1
- Regex: '<(mysql|protobuf-c)/'
Priority: 4
Priority: 1
- Regex: '.*'
Priority: 0
IndentExternBlock: NoIndent
@@ -78,6 +74,3 @@ PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8
ForEachMacros: [ 'cds_lfs_for_each', 'cds_lfs_for_each_safe', 'cds_list_for_each_entry_safe', 'ISC_LIST_FOREACH', 'ISC_LIST_FOREACH_SAFE', 'ISC_LIST_FOREACH_REV', 'ISC_LIST_FOREACH_REV_SAFE' ]
RemoveParentheses: ReturnStatement
RemoveSemicolon: true

View File

@@ -34,40 +34,24 @@ PointerAlignment: Right
PointerBindsToType: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(urcu/urcu-|urcu-)'
Priority: 2
- Regex: '^<urcu/'
Priority: 3
- Regex: '^<isc/'
Priority: 5
- Regex: '^<(pk11|pkcs11)/'
Priority: 10
Priority: 2
- Regex: '^<dns/'
Priority: 15
- Regex: '^<dst/'
Priority: 20
- Regex: '^<isccc/'
Priority: 25
Priority: 3
- Regex: '^<iscccc/'
Priority: 4
- Regex: '^<isccfg/'
Priority: 30
Priority: 5
- Regex: '^<ns/'
Priority: 35
- Regex: '^<irs/'
Priority: 40
- Regex: '^<(dig|named|rndc|confgen|dlz)/'
Priority: 50
- Regex: '^<dlz_'
Priority: 55
- Regex: '^".*"'
Priority: 99
- Regex: '^<tests/'
Priority: 100
- Regex: '<openssl/'
Priority: 4
- Regex: '<(mysql|protobuf-c)/'
Priority: 4
- Regex: '.*'
Priority: 0
Priority: 6
- Regex: '^<bind9/)'
Priority: 7
- Regex: '^(<[^/]*)/)'
Priority: 8
- Regex: '<[[:alnum:].]+>'
Priority: 1
- Regex: '".*"'
Priority: 9
IndentExternBlock: NoIndent
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
@@ -78,5 +62,3 @@ PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8
RemoveParentheses: ReturnStatement
RemoveSemicolon: true

View File

@@ -16,6 +16,10 @@
(concat directory-of-current-dir-locals-file "./"))
;; libisc
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/unix/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/pthreads/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/include"))
(expand-file-name
@@ -49,10 +53,6 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/bind9/include"))
;; libtest
(expand-file-name
(concat directory-of-current-dir-locals-file "tests/include"))
;; bin
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/check"))
@@ -61,7 +61,7 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/confgen"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/confgen/include"))
(concat directory-of-current-dir-locals-file "bin/confgen/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/dig/include"))
(expand-file-name
@@ -79,7 +79,7 @@
(expand-file-name "/usr/include/libxml2")
(expand-file-name "/usr/include/json-c")
(expand-file-name "/usr/local/opt/openssl@1.1/include")
(expand-file-name "/usr/local/opt/libxml2/include/libxml2")
(expand-file-name "/usr/local/opt/json-c/include/json-c/")
@@ -110,9 +110,8 @@
"--enable=all"
"--suppress=missingIncludeSystem"
"--suppress=nullPointerRedundantCheck"
"--suppress=preprocessorErrorDirective"
"--suppress=unknownMacro"
"--suppress=unmatchedSuppression"
(concat "--suppressions-list=" (expand-file-name
(concat directory-of-current-dir-locals-file "util/suppressions.txt")))
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)

View File

@@ -1,5 +0,0 @@
[*.sh{,.in}]
indent_style = space
indent_size = 2
binary_next_line = true
switch_case_indent = true

File diff suppressed because it is too large Load Diff

2
.gitattributes vendored
View File

@@ -10,4 +10,4 @@
/util/** export-ignore
/util/bindkeys.pl -export-ignore
/util/check-make-install.in -export-ignore
/util/dtrace.sh -export-ignore
/util/mksymtbl.pl -export-ignore

View File

@@ -1 +0,0 @@
contrib/gitchangelog/changelog.rc.py

View File

@@ -1,55 +0,0 @@
name: "CodeQL"
on:
push:
branches: [ "bind-9.16", "bind-9.18", "main" ]
schedule:
- cron: '39 8 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: liburcu-dev libuv1-dev libssl-dev libnghttp2-dev libxml2-dev liblmdb-dev libjson-c-dev pkg-config autoconf automake autotools-dev libtool-bin libjemalloc-dev libedit-dev libcap-dev libidn2-dev libkrb5-dev libmaxminddb-dev zlib1g-dev python3-ply
version: 1.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

View File

@@ -1,15 +0,0 @@
name: 'Lock down mirror repository'
on:
issues:
types: opened
pull_request:
types: opened
jobs:
lockdown:
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v2
with:
github-token: ${{ github.token }}

View File

@@ -1,50 +0,0 @@
name: SonarCloud
on:
push:
branches: [ "bind-9.16", "bind-9.18", "main" ]
schedule:
- cron: '39 8 * * 3'
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: liburcu-dev libuv1-dev libssl-dev libnghttp2-dev libxml2-dev liblmdb-dev libjson-c-dev pkg-config autoconf automake autotools-dev libtool-bin libjemalloc-dev libedit-dev libcap-dev libidn2-dev libkrb5-dev libmaxminddb-dev zlib1g-dev python3-ply
version: 1.0
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
- name: Run build-wrapper
run: |
autoreconf -fi
./configure
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

40
.gitignore vendored
View File

@@ -4,14 +4,11 @@
*.gcno
*.la
*.lo
*.log
*.log.txt
*.o
*.orig
*.plist/ # ccc-analyzer store its results in .plist directories
*.rej
*.so
*.trs
*_test
*.ipch # vscode/intellisense precompiled header
*~
@@ -40,6 +37,7 @@ __pycache__/
/depcomp
/install-sh
/isc-config.sh
/libltdl/*
/libtool
/ltmain.sh
/m4/libtool.m4
@@ -54,50 +52,16 @@ __pycache__/
/stamp-h1
/test-driver
Makefile
Makefile.in
Makefile.user
ans.run
gen.dSYM/
kyua.log
named.memstats
named.run
timestamp
/compile_commands.json
# Gets generated by Build Ear (bear)
/compile_commands.commands.json
/tsan
/util/check-make-install
/INSTALL
doc/man/dnssec-cds.8in
doc/man/dnssec-checkds.8in
doc/man/dnssec-coverage.8in
doc/man/dnssec-dsfromkey.8in
doc/man/dnssec-importkey.8in
doc/man/dnssec-keyfromlabel.8in
doc/man/dnssec-keygen.8in
doc/man/dnssec-keymgr.8in
doc/man/dnssec-ksr.8in
doc/man/dnssec-revoke.8in
doc/man/dnssec-settime.8in
doc/man/dnssec-signzone.8in
doc/man/dnssec-verify.8in
doc/man/named-checkconf.8in
doc/man/named-checkzone.8in
doc/man/named-journalprint.8in
doc/man/named-nzd2nzf.8in
doc/man/nsec3hash.8in
doc/man/pkcs11-destroy.8in
doc/man/pkcs11-keygen.8in
doc/man/pkcs11-list.8in
doc/man/pkcs11-tokens.8in
# clangd index directory
/\.cache/
/\.*_clangd/
# GNU Global index files
/GPATH
/GRTAGS
/GTAGS
TAGS
# Emacs specific files
\.dir-locals-2.el
/emacs.desktop
/emacs.desktop-lock

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +1,46 @@
<!--
If the bug you are reporting is potentially security-related - for example,
if it involves an assertion failure or other crash in `named` that can be
triggered repeatedly - then please make sure that you make the new issue
confidential by clicking the checkbox at the bottom!
triggered repeatedly - then please do *NOT* report it here, but send an
email to [security-officer@isc.org](security-officer@isc.org).
-->
### Summary
<!-- Concisely summarize the bug encountered. -->
(Summarize the bug encountered concisely.)
### BIND version affected
<!--
Make sure you are testing with the **latest** supported version of BIND
for a given branch. Many bugs have been fixed over time!
### BIND version used
See https://kb.isc.org/docs/supported-platforms for the current list.
The latest source is available from https://www.isc.org/download/#BIND
Paste the output of `named -V` here.
-->
(Paste the output of `named -V`.)
### Steps to reproduce
<!--
This is extremely important! Be precise and use itemized lists, please.
Even if a default configuration is affected, please include the full configuration
files _you were testing with_.
Example:
1. Use _attached_ configuration file
2. Start BIND server with command: `named -g -c named.conf ...`
3. Simulate legitimate clients using command `dnsperf -S1 -d legit-queries ...`
4. Simulate attack traffic using command `dnsperf -S1 -d attack-queries ...`
-->
1.
2.
3.
(How one can reproduce the issue - this is very important.)
### What is the current *bug* behavior?
<!-- What actually happens. -->
(What actually happens.)
### What is the expected *correct* behavior?
<!-- What you should see instead. -->
(What you should see instead.)
### Relevant configuration files
<!-- Paste any relevant configuration files here - please use code blocks (```)
(Paste any relevant configuration files - please use code blocks (```)
to format console output. If submitting the contents of your
configuration file in a non-confidential issue, it is advisable to
obscure key secrets; this can be done automatically by using
`named-checkconf -px`. -->
configuration file in a non-confidential Issue, it is advisable to
obscure key secrets: this can be done automatically by using
`named-checkconf -px`.)
### Relevant logs
### Relevant logs and/or screenshots
<!-- Paste any relevant logs here - please use code blocks (```) to format console
output, logs, and code, as it's very hard to read otherwise. -->
(Paste any relevant logs - please use code blocks (```) to format console
output, logs, and code, as it's very hard to read otherwise.)
/label ~Bug
### Possible fixes
(If you can, link to the line of code that might be responsible for the
problem.)
/label ~bug

View File

@@ -1,8 +0,0 @@
Hi and thanks for filing an issue! It will be read with care by human beings.
It would be a tremendous help if you could follow these steps first:
- [ ] Search the existing issues in GitLab (both open and closed) to see if your report might be a duplicate. We have a large database here and many issues have already been fixed in the latest versions!
- [ ] Make sure this is **not** a support question. If you have specific trouble configuring or debugging your setup, please use the bind-users mailing list: https://lists.isc.org/mailman/listinfo/bind-users
- [ ] You have read and understood the "out in the open" support policy: https://blog.powerdns.com/2016/01/18/open-source-support-out-in-the-open/ . Even though it was written by the PowerDNS folks, we follow it as well!
Before continuing, **please select the appropriate issue template in the drop-down menu above, under the heading _Description_**.

View File

@@ -8,4 +8,4 @@
### Links / references
/label ~Feature
/label ~"feature request"

View File

@@ -1,122 +0,0 @@
<!--
THIS ISSUE TEMPLATE IS INTENDED ONLY FOR INTERNAL USE.
If the bug you are reporting is potentially security-related - for example,
if it involves an assertion failure or other crash in `named` that can be
triggered repeatedly - then please make sure that you make the new issue
confidential!
-->
| Quick Links | :link: |
| ------------------------ | ------------------------------------ |
| Incident Manager: | @user |
| Deputy Incident Manager: | @user |
| Public Disclosure Date: | YYYY-MM-DD |
| CVSS Score: | [0.0][cvss_score] |
| Security Advisory: | isc-private/printing-press!NNN |
| Mattermost Channel: | [CVE-YYYY-NNNN][mattermost_url] |
| Support Ticket: | [URL] |
| Release Checklist: | #NNNN |
[cvss_score]: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:X/AC:X/PR:X/UI:X/S:X/C:X/I:X/A:X&version=3.1
[mattermost_url]:
:bulb: **Click [here][checklist_explanations] (internal resource) for general information about the security incident handling process.**
[checklist_explanations]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations
### Earlier Than T-5
- [ ] [:link:][step_deputy] **(IM)** Pick a Deputy Incident Manager
- [ ] [:link:][step_respond] **(IM)** Respond to the bug reporter
- [ ] [:link:][step_public_mrs] **(SwEng)** Ensure there are no public merge requests which inadvertently disclose the issue
- [ ] [:link:][step_assign_cve_id] **(IM)** Assign a CVE identifier
- [ ] [:link:][step_note_cve_info] **(SwEng)** Update this issue with the assigned CVE identifier and the CVSS score
- [ ] [:link:][step_versions_affected] **(SwEng)** Determine the range of product versions affected (including the Subscription Edition)
- [ ] [:link:][step_workarounds] **(SwEng)** Determine whether workarounds for the problem exist
- [ ] [:link:][step_coordinate] **(SwEng)** If necessary, coordinate with other parties
- [ ] [:link:][step_earliest_prepare] **(Support)** Prepare "earliest" notification text and hand it off to Marketing
- [ ] [:link:][step_earliest_send] **(Marketing)** Update "earliest" notification document in SF portal and send bulk email to earliest customers
- [ ] [:link:][step_advisory_mr] **(Support)** Create a merge request for the Security Advisory and include all readily available information in it
- [ ] [:link:][step_reproducer_mr] **(SwEng)** Prepare a private merge request containing a system test reproducing the problem
- [ ] [:link:][step_notify_support] **(SwEng)** Notify Support when a reproducer is ready
- [ ] [:link:][step_code_analysis] **(SwEng)** Prepare a detailed explanation of the code flow triggering the problem
- [ ] [:link:][step_fix_mr] **(SwEng)** Prepare a private merge request with the fix
- [ ] [:link:][step_review_fix] **(SwEng)** Ensure the merge request with the fix is reviewed and has no outstanding discussions
- [ ] [:link:][step_review_docs] **(Support)** Review the documentation changes introduced by the merge request with the fix
- [ ] [:link:][step_backports] **(SwEng)** Prepare backports of the merge request addressing the problem for all affected (and still maintained) branches of a given product
- [ ] [:link:][step_finish_advisory] **(Support)** Finish preparing the Security Advisory
- [ ] [:link:][step_meta_issue] **(QA)** Create (or update) the private issue containing links to fixes & reproducers for all CVEs fixed in a given release cycle
- [ ] [:link:][step_merge_fixes] **(QA)** Merge the CVE fixes in CVE identifier order
- [ ] [:link:][step_patches] **(QA)** Prepare a standalone patch for the last stable release of each affected (and still maintained) product branch
- [ ] [:link:][step_asn_releases] **(QA)** Prepare ASN releases (as outlined in the Release Checklist)
### At T-5
- [ ] [:link:][step_asn_documents] **(Marketing)** Update the text on the T-5 (from the Printing Press project) and "earliest" ASN documents in the SF portal
- [ ] [:link:][step_asn_links] **(Marketing)** (BIND 9 only) Update the BIND -S information document in SF with download links to the new versions
- [ ] [:link:][step_asn_send] **(Marketing)** Bulk email eligible customers to check the SF portal
- [ ] [:link:][step_preannouncement] **(Marketing)** (BIND 9 only) Send a pre-announcement email to the *bind-announce* mailing list to alert users that the upcoming release will include security fixes
### At T-1
- [ ] [:link:][step_packager_emails] **(First IM)** Send notifications to OS packagers
### On the Day of Public Disclosure
- [ ] [:link:][step_clearance] **(IM)** Grant QA & Marketing clearance to proceed with public release
- [ ] [:link:][step_publish] **(QA/Marketing)** Publish the releases (as outlined in the release checklist)
- [ ] [:link:][step_matrix] **(Support)** (BIND 9 only) Add the new CVEs to the vulnerability matrix in the Knowledge Base
- [ ] [:link:][step_publish_advisory] **(Support)** Bump Document Version for the Security Advisory and publish it in the Knowledge Base
- [ ] [:link:][step_notifications] **(First IM)** Send notification emails to third parties
- [ ] [:link:][step_mitre] **(First IM)** Advise MITRE about the disclosed CVEs
- [ ] [:link:][step_merge_advisory] **(First IM)** Merge the Security Advisory merge request
- [ ] [:link:][step_embargo_end] **(IM)** Inform original reporter (if external) that the security disclosure process is complete
- [ ] [:link:][step_asn_clear] **(Marketing)** Update the SF portal to clear the ASN
- [ ] [:link:][step_customers] **(Marketing)** Email ASN recipients that the embargo is lifted
### After Public Disclosure
- [ ] [:link:][step_regression] **(QA)** Merge a regression test reproducing the bug into all affected (and still maintained) branches
[step_deputy]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#pick-a-deputy-incident-manager
[step_respond]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#respond-to-the-bug-reporter
[step_public_mrs]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#ensure-there-are-no-public-merge-requests-which-inadvertently-disclose-the-issue
[step_assign_cve_id]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#assign-a-cve-identifier
[step_note_cve_info]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-this-issue-with-the-assigned-cve-identifier-and-the-cvss-score
[step_versions_affected]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#determine-the-range-of-product-versions-affected-including-the-subscription-edition
[step_workarounds]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#determine-whether-workarounds-for-the-problem-exist
[step_coordinate]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#if-necessary-coordinate-with-other-parties
[step_earliest_prepare]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-earliest-notification-text-and-hand-it-off-to-marketing
[step_earliest_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-earliest-notification-document-in-sf-portal-and-send-bulk-email-to-earliest-customers
[step_advisory_mr]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#create-a-merge-request-for-the-security-advisory-and-include-all-readily-available-information-in-it
[step_reproducer_mr]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-private-merge-request-containing-a-system-test-reproducing-the-problem
[step_notify_support]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#notify-support-when-a-reproducer-is-ready
[step_code_analysis]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-detailed-explanation-of-the-code-flow-triggering-the-problem
[step_fix_mr]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-private-merge-request-with-the-fix
[step_review_fix]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#ensure-the-merge-request-with-the-fix-is-reviewed-and-has-no-outstanding-discussions
[step_review_docs]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#review-the-documentation-changes-introduced-by-the-merge-request-with-the-fix
[step_backports]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-backports-of-the-merge-request-addressing-the-problem-for-all-affected-and-still-maintained-branches-of-a-given-product
[step_finish_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#finish-preparing-the-security-advisory
[step_meta_issue]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#create-or-update-the-private-issue-containing-links-to-fixes-reproducers-for-all-cves-fixed-in-a-given-release-cycle
[step_changes]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-reserve-a-block-of-changes-placeholders-once-the-complete-set-of-vulnerabilities-fixed-in-a-given-release-cycle-is-determined
[step_merge_fixes]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-the-cve-fixes-in-cve-identifier-order
[step_patches]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-a-standalone-patch-for-the-last-stable-release-of-each-affected-and-still-maintained-product-branch
[step_asn_releases]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#prepare-asn-releases-as-outlined-in-the-release-checklist
[step_asn_documents]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-the-text-on-the-t-5-from-the-printing-press-project-and-earliest-asn-documents-in-the-sf-portal
[step_asn_links]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-update-the-bind-s-information-document-in-sf-with-download-links-to-the-new-versions
[step_asn_send]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bulk-email-eligible-customers-to-check-the-sf-portal
[step_preannouncement]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-send-a-pre-announcement-email-to-the-bind-announce-mailing-list-to-alert-users-that-the-upcoming-release-will-include-security-fixes
[step_packager_emails]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#send-notifications-to-os-packagers
[step_clearance]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#grant-qa-marketing-clearance-to-proceed-with-public-release
[step_publish]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#publish-the-releases-as-outlined-in-the-release-checklist
[step_matrix]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bind-9-only-add-the-new-cves-to-the-vulnerability-matrix-in-the-knowledge-base
[step_publish_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#bump-document-version-for-the-security-advisory-and-publish-it-in-the-knowledge-base
[step_notifications]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#send-notification-emails-to-third-parties
[step_mitre]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#advise-mitre-about-the-disclosed-cves
[step_merge_advisory]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-the-security-advisory-merge-request
[step_embargo_end]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#inform-original-reporter-if-external-that-the-security-disclosure-process-is-complete
[step_asn_clear]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#update-the-sf-portal-to-clear-the-asn
[step_customers]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#email-asn-recipients-that-the-embargo-is-lifted
[step_regression]: https://gitlab.isc.org/isc-private/isc-wiki/-/wikis/Security-Incident-Handling-Checklist-Explanations#merge-a-regression-test-reproducing-the-bug-into-all-affected-and-still-maintained-branches
/confidential

View File

@@ -0,0 +1,65 @@
## Release Schedule
**Tagging Deadline:**
**Public Release:**
## Release Checklist
## 2 Working Days Before the Tagging Deadline
- [ ] ***(QA)*** Check whether all issues assigned to the release milestone are resolved[^1].
- [ ] ***(QA)*** Ensure that there are no outstanding merge requests in the private repository[^1] (Subscription Edition only).
- [ ] ***(QA)*** Ensure all merge requests marked for backporting have been indeed backported.
## Before the Tagging Deadline
- [ ] ***(QA)*** Inform Support/Marketing of impending release (and give estimated release dates).
- [ ] ***(QA)*** Check Perflab to ensure there has been no unexplained drop in performance for the versions being released.
- [ ] ***(SwEng)*** Update API files for libraries with new version information.
- [ ] ***(SwEng)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(SwEng)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(SwEng)*** Update `CHANGES`.
- [ ] ***(SwEng)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(SwEng)*** Update `README.md`.
- [ ] ***(SwEng)*** Update `version`.
- [ ] ***(SwEng)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that all the above steps were performed correctly.
- [ ] ***(QA)*** Check that the contents of release notes match the merge requests comprising the releases.
- [ ] ***(QA)*** Check that the formatting is correct for text, PDF, and HTML versions of release notes.
- [ ] ***(SwEng)*** Tag the releases[^2]. (Tags may only be pushed to the public repository for releases which are *not* security releases.)
- [ ] ***(SwEng)*** If this is the first tag for a release (e.g. beta), create a release branch named `release_v9_X_Y` to allow development to continue on the maintenance branch whilst release engineering continues.
## Before the ASN Deadline (for ASN Releases) or the Public Release Date (for Regular Releases)
- [ ] ***(QA)*** Verify GitLab CI results for the tags created and prepare a QA report for the releases to be published.
- [ ] ***(QA)*** Request signatures for the tarballs, providing their location and checksums.
- [ ] ***(Signers)*** Validate tarball checksums, sign tarballs, and upload signatures.
- [ ] ***(QA)*** Verify tarball signatures and check tarball checksums again.
- [ ] ***(Support)*** Pre-publish ASN and/or Subscription Edition tarballs so that packages can be built.
- [ ] ***(QA)*** Build and test ASN and/or Subscription Edition packages.
- [ ] ***(QA)*** Notify Support that the releases have been prepared.
- [ ] ***(Support)*** Send out ASNs (if applicable).
## On the Day of Public Release
- [ ] ***(Support)*** Wait for clearance from Security Officer to proceed with the public release (if applicable).
- [ ] ***(Support)*** Place tarballs in public location on FTP site.
- [ ] ***(Support)*** Publish links to downloads on ISC website.
- [ ] ***(Support)*** Write release email to *bind-announce*.
- [ ] ***(Support)*** Write email to *bind-users* (if a major release).
- [ ] ***(Support)*** Update tickets in case of waiting support customers.
- [ ] ***(QA)*** Build and test any outstanding private packages.
- [ ] ***(QA)*** Build public packages (`*.deb`, RPMs).
- [ ] ***(QA)*** Inform Marketing of the release.
- [ ] ***(QA)*** Update the internal [BIND release dates wiki page](https://wiki.isc.org/bin/view/Main/BindReleaseDates) when public announcement has been made.
- [ ] ***(Marketing)*** Post short note to Twitter.
- [ ] ***(Marketing)*** Update [Wikipedia entry for BIND](https://en.wikipedia.org/wiki/BIND).
- [ ] ***(Marketing)*** Write blog article (if a major release).
- [ ] ***(QA)*** Ensure all new tags are annotated and signed.
- [ ] ***(SwEng)*** Push tags for the published releases to the public repository.
- [ ] ***(SwEng)*** Merge the automatically prepared `prep 9.X.Y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_X`).
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
[^2]: Preferred command line: `git tag -u <DEVELOPER_KEYID> -a -s -m "BIND 9.X.Y[alphatag]" v9_X_Y[alphatag]`, where `[alphatag]` is an optional string such as `b1`, `rc1`, etc.

View File

@@ -1,139 +0,0 @@
### Summary
<!--
Concisely summarize the bug encountered,
preferably in one paragraph or less.
-->
### BIND versions affected
<!--
Make sure you are testing with the **latest** supported version of BIND.
See https://kb.isc.org/docs/supported-platforms for the current list.
The latest source is available from https://www.isc.org/download/#BIND
Paste the output of `named -V` here.
-->
### Preconditions and assumptions
<!--
Is a specific setup needed?
Please check the BIND Security Assumptions chapter in the ARM:
https://bind9.readthedocs.io/en/latest/chapter7.html#security-assumptions
E.g. DNSSEC validation must be disabled, etc.
E.g. Resolver must be configured to forward to attacker's server via DNS-over-TLS, etc.
E.g. Authoritative server must be configured to transfer specific primary zone.
E.g. Attacker must be in posession of a key authorized to modify at least one zone.
E.g. Attacker can affect system clock on the server running BIND.
-->
### Attacker's abilities
<!--
What resources does an attacker need to have under their control to mount this attack?
E.g. If attacking an authoritative server, does the attacked have to have prior
relationship with it? "The authoritative server under attack needs to
transfer a malicious zone from attacker's authoritative server via TLS."
E.g. If attacking a resolver, does the attacker need the ability to send
arbitrary queries to the resolver under attack? Do they need to _also_ control
an authoritative server at the same time?
-->
### Impact
<!--
Who or what is the victim of the attack and what is the impact?
Is a third party receiving many packets generated by a reflection attack?
If the affected party is the BIND server itself, please quantify the impact
on legitimate clients:
E.g. After launching the attack, the answers-per-second metric for legitimate
traffic drops to 1/1000 within the first minute of the attack.
-->
### Steps to reproduce
<!--
This is extremely important! Be precise and use itemized lists, please.
Even if a default configuration is affected, please include the full configuration
files _you were testing with_.
Example:
1. Use the _attached_ configuration file
2. Start the BIND server with command: `named -g -c named.conf ...`
3. Simulate legitimate clients using the command `dnsperf -S1 -d legit-queries ...`
4. Simulate attack traffic using the command `dnsperf -S1 -d attack-queries ...`
-->
1.
2.
3.
### What is the current *bug* behavior?
<!--
Examples:
Legitimate QPS drops 1000x.
Memory consumption increases out of bounds and the server crashes.
The server crashes immediately.
-->
### What is the expected *correct* behavior?
<!--
If the attack causes resource exhaustion, what do you think the correct
behavior should be? Should BIND refuse to process more requests?
What heuristic do you propose to distinguish legitimate and attack traffic?
-->
### Relevant logs
<!--
Please provide log files from your testing. Include full named logs and also
the output from any testing tools (e.g. dnsperf, DNS Shotgun, kxdpgun, etc.)
If multiple log files are needed, make sure all the files have matching timestamps
so we can correlate log events across log files.
In the case of resource exhaustion attacks, please _also_ include system monitoring
data. You can use https://gitlab.isc.org/isc-projects/resource-monitor/ to
gather system-wide statistics.
-->
### Coordination
- Does this issue affect multiple implementations?
<!--
Issues affecting multiple implementations require very careful coordination. We
have to make sure the information does not leak to the public until vendors are ready to
release fixed versions. If it is a multi-vendor issue, we need to know about the situation
as soon as possible to start the (confidential!) coordination process within
DNS-OARC and other suitable fora.
Please list implementations you have tested.
-->
- Have you shared the information with anyone else?
<!--
Have you informed other affected vendors? Or maybe submitted a paper for
review?
-->
- What is your plan to publicize this issue?
<!--
E.g. we plan to go public during conference XYZ on 20XX-XX-XX
-->
### Acknowledgements
<!--
Please specify whether and how you would like to be publicly credited with
discovering the issue. We normally use the format:
First_name Last_name, Company_or_Team.
-->
<!-- DO NOT modify the following two lines. -->
/label ~Bug ~Security
/confidential

View File

@@ -1,27 +0,0 @@
Alan Clegg <aclegg@isc.org>
Alessio Podda <alessio@isc.org>
Aram Sargsyan <aram@isc.org>
Artem Boldariev <artem@isc.org> <artem@boldariev.com>
Curtis Blackburn <ckb@isc.org> <ckb@freebsd11.local>
Curtis Blackburn <ckb@isc.org> <ckb@isc.org>
Diego Fronza <diego@isc.org>
Evan Hunt <each@isc.org> Evan Hunt <fanf@isc.org>
Håvard Eidnes <he@uninett.no>
Jeremy C. Reed <jreed@isc.org> <jreed@docs.lab.isc.org>
Jeremy C. Reed <jreed@isc.org> <jreed@ISC.org>
Joey Salazar <joey@isc.org>
John H. DuBois III <johnd>
Mark Andrews <marka@isc.org>
Mark Andrews <marka@isc.org> <marka@daemon.lab.isc.org>
Mark Andrews <marka@isc.org> <marka@newdocs.lab.isc.org>
Matthijs Mekking <matthijs@isc.org> <github@pletterpet.nl>
Nicki Křížek <nicki@isc.org> <tkrizek@isc.org>
Ondřej Surý <ondrej@isc.org>
Ondřej Surý <ondrej@isc.org> <ondrej@openbsd-6-9.home.sury.org>
Ondřej Surý <ondrej@isc.org> <ondrej@sury.org>
Petr Menšík <pemensik@redhat.com>
Petr Menšík <pemensik@redhat.com> <pmensik@redhat.com>
Robert Edmonds <edmonds>
Tatuya JINMEI 神明達哉 <jinmei@isc.org>
Witold Kręcicki <wpk@isc.org>
Witold Kręcicki <wpk@isc.org> <wpk@culm.net>

View File

@@ -1,28 +1,9 @@
[IMPORTS]
deprecated-modules=
dns.resolver,
[MESSAGES CONTROL]
[MASTER]
disable=
C0103, # invalid-name
C0114, # missing-module-docstring
C0115, # missing-class-docstring
C0116, # missing-function-docstring
C0209, # consider-using-f-string
C0301, # line-too-long, handled better by black
C0302, # too-many-lines
C0415, # import-outside-toplevel
R0801, # duplicate-code
R0901, # too-many-ancestors
R0902, # too-many-instance-attributes
R0903, # too-few-public-methods
R0904, # too-many-public-methods
R0911, # too-many-return-statements
R0912, # too-many-branches
R0913, # too-many-arguments
R0914, # too-many-locals
R0915, # too-many-statements
R0916, # too-many-boolean-expressions
R0917, # too-many-positional-arguments

View File

@@ -1,18 +0,0 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
pre_build:
- python -m pip install -r https://gitlab.isc.org/isc-projects/bind9/-/raw/main/doc/arm/requirements.txt
# Build documentation in doc/arm/ with Sphinx
sphinx:
configuration: doc/arm/conf.py
# Build all formats
formats: all

View File

@@ -6,7 +6,8 @@ Source: https://gitlab.isc.org/isc-projects/bind9/
#
# Build system, data files from tests, and misc cruft
#
Files: **/*.after*
Files: **/README
**/*.after*
**/*.bad
**/*.batch
**/*.before*
@@ -21,48 +22,34 @@ Files: **/*.after*
**/*dig.out*
**/Makefile
**/Makefile.*
**/expect
**/testdata/*
.github/*
.gitlab/*
.mailmap
AUTHORS
CHANGES
COPYRIGHT
CODE_OF_CONDUCT
CONTRIBUTING
HISTORY
Kyuafile
Makefile
Makefile.*
OPTIONS
README
bin/named/bind9.xsl
bin/named/bind9.xsl.h
bin/tests/bigtest/zones
bin/tests/optional/rbt_test.out
bin/tests/system/checkdstool/dig.bat
bin/tests/system/checkdstool/*.db
bin/tests/system/checkzone/zones/bad-caa-rr.db
bin/tests/system/checkzone/zones/bad1.db
bin/tests/system/checkzone/zones/crashzone.db
bin/tests/system/dnstap/large-answer.fstrm
bin/tests/system/doth/CA/CA.cfg
bin/tests/system/doth/CA/README
bin/tests/system/doth/CA/index.txt
bin/tests/system/doth/CA/index.txt.attr
bin/tests/system/doth/CA/serial
bin/tests/system/formerr/badnsec3owner
bin/tests/system/formerr/badrecordname
bin/tests/system/formerr/dupans
bin/tests/system/formerr/dupquestion
bin/tests/system/formerr/keyclass
bin/tests/system/formerr/malformeddeltype
bin/tests/system/formerr/malformedrrsig
bin/tests/system/formerr/nametoolong
bin/tests/system/formerr/noquestions
bin/tests/system/formerr/optwrongname
bin/tests/system/formerr/qtypeasanswer
bin/tests/system/formerr/questionclass
bin/tests/system/formerr/shortquestion
bin/tests/system/formerr/shortrecord
bin/tests/system/formerr/tsignotlast
bin/tests/system/formerr/tsigwrongclass
bin/tests/system/formerr/twoquestionnames
bin/tests/system/formerr/twoquestiontypes
bin/tests/system/formerr/wrongclass
bin/tests/system/forward/CA/CA.cfg
bin/tests/system/forward/CA/README
bin/tests/system/forward/CA/index.txt
bin/tests/system/forward/CA/index.txt.attr
bin/tests/system/forward/CA/serial
bin/tests/system/isctest/vars/.ac_vars/*
bin/tests/system/formerr/twoquestions
bin/tests/system/journal/ns1/managed-keys.bind.in
bin/tests/system/journal/ns1/managed-keys.bind.jnl.in
bin/tests/system/journal/ns2/managed-keys.bind.in
@@ -70,20 +57,7 @@ Files: **/*.after*
bin/tests/system/keepalive/expected
bin/tests/system/legacy/ns6/edns512.db.signed
bin/tests/system/legacy/ns7/edns512-notcp.db.signed
bin/tests/system/masterfile/knowngood.include
bin/tests/system/masterfile/knowngood.ttl1
bin/tests/system/masterfile/knowngood.ttl2
bin/tests/system/notify/CA/CA.cfg
bin/tests/system/notify/CA/README
bin/tests/system/notify/CA/index.txt
bin/tests/system/notify/CA/index.txt.attr
bin/tests/system/notify/CA/serial
bin/tests/system/notify/ns4/named.port.in
bin/tests/system/nsupdate/CA/CA.cfg
bin/tests/system/nsupdate/CA/README
bin/tests/system/nsupdate/CA/index.txt
bin/tests/system/nsupdate/CA/index.txt.attr
bin/tests/system/nsupdate/CA/serial
bin/tests/system/nsupdate/commandlist
bin/tests/system/nsupdate/verylarge.in
bin/tests/system/org.isc.bind.system.plist
@@ -91,6 +65,8 @@ Files: **/*.after*
bin/tests/system/pipelined/inputb
bin/tests/system/pipelined/ref
bin/tests/system/pipelined/refb
bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt
bin/tests/system/pkcs11/usepkcs11
bin/tests/system/rsabigexponent/ns2/dsset-example.in
bin/tests/system/run.gdb
bin/tests/system/runtime/ctrl-chars
@@ -106,10 +82,7 @@ Files: **/*.after*
bin/tests/system/unknown/large.out
bin/tests/system/xfer/ans5/badkeydata
bin/tests/system/xfer/ans5/badmessageid
bin/tests/system/xfer/ans5/ednsformerr
bin/tests/system/xfer/ans5/ednsnotimp
bin/tests/system/xfer/ans5/goodaxfr
bin/tests/system/xfer/ans5/ixfrnotimp
bin/tests/system/xfer/ans5/partial
bin/tests/system/xfer/ans5/soamismatch
bin/tests/system/xfer/ans5/unknownkey
@@ -117,12 +90,12 @@ Files: **/*.after*
bin/tests/system/xfer/ans5/wrongkey
bin/tests/system/xfer/ans5/wrongname
bin/tests/system/xfer/knowngood.mapped
bind.keys
cocci/*.cocci
cocci/*.disabled
cocci/*.spatch
doc/arm/*.dia
doc/arm/*.png
doc/arm/isc-logo.pdf
doc/arm/requirements.txt
doc/man/*.1in
doc/man/*.5in
doc/man/*.8in
@@ -130,27 +103,26 @@ Files: **/*.after*
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: MPL-2.0
#
# DNSSEC Guide images
#
Files: doc/dnssec-guide/img/*.png
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: MPL-2.0
#
# Libtool Files
#
Files: m4/libtool.m4
Files: aclocal.m4
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/ltversion.m4
m4/lt~obsolete.m4
Copyright: Free Software Foundation, Inc.
License:
This file is free software; the Free Software Foundation gives unlimited
permission to copy and/or distribute it, with or without modifications, as long
as this notice is preserved.
License: GPL-3.0-or-later WITH Autoconf-exception-3.0
#
# DNSSEC Guide images
#
Files: doc/dnssec-guide/img/*.png
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: MPL-2.0
#
# DLZ Modules
@@ -184,23 +156,28 @@ Files: **/.clang-format
.clang-format
.clang-format.headers
.dir-locals.el
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitlab-ci.yml
.lgtm.yml
.pylintrc
.readthedocs.yaml
.tsan-suppress
.uncrustify.cfg
contrib/gitchangelog/changelog.rc.py
contrib/gitchangelog/relnotes.rc.py
config.guess
config.h.in
config.h.win32
config.threads.in
config.sub
configure
bin/tests/system/dlz/ns1/dns-root/*
doc/misc/*.zoneopt
doc/misc/options
doc/misc/rndc.grammar
sonar-project.properties
tests/bench/names.csv
doc/misc/options.active
install-sh
lib/dns/mapapi
mkinstalldirs
tsan-suppressions.txt
util/suppressions.txt
version
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0
@@ -222,9 +199,33 @@ License: CC0-1.0
# in a working source tree.
#
Files: **/platform.h
bin/python/*
bin/tests/optional/*
make/*
unit/unittest.sh
bin/tests/system/*.log
bin/tests/system/*.trs
fuzz/*.log
fuzz/*.trs
lib/*/tests/*.log
lib/*/tests/*.trs
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0
#
# Windows build system
#
Files: **/*.def
**/*.def.in
**/*.sln
**/*.sln.in
**/*.vcxproj.filters
**/*.vcxproj.filters.in
**/*.vcxproj
**/*.vcxproj.in
**/*.vcxproj.user
bin/win32/BINDInstall/BINDInstall.rc
bin/win32/BINDInstall/res/BINDInstall.ico
bin/win32/BINDInstall/res/BINDInstall.rc2
contrib/dlz/example/win32/dxdriver.dsp
contrib/dlz/example/win32/dxdriver.dsw
contrib/dlz/example/win32/dxdriver.mak
win32utils/GeoIP.diff
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0

View File

@@ -1,3 +0,0 @@
# Uninstrumented libraries
called_from_lib:libfstrm.so
race:dummyrpz

54
AUTHORS
View File

@@ -1,54 +0,0 @@
Mark Andrews
Andreas Gustafsson
Evan Hunt
Brian Wellington
Bob Halley
David Lawrence
Michael Graff
Michael Sawyer
Ondřej Surý
James Brister
Tatuya JINMEI 神明達哉
Francis Dupont
Michał Kępień
Danny Mayer
Mukund Sivaraman
Jeremy C. Reed
William King
Stephen Morris
Witold Kręcicki
Curtis Blackburn
Scott Mann
Rob Austein
Jim Reid
Eric Luce
Olafur Gudmundsson
Stephen Jacob
Damien Neil
Tony Finch
Jakob Schlyter
Petr Menšík
Vernon Schryver
Matt Nelson
Shane Kerr
Paul Ebersman
Ray Bellis
Shawn Routhier
Ben Cottrell
Tomas Hozza
johnd
Bill Parker
李昶
Kevin Chen
Jonathan Casey
Mary Stahl
Mathieu Arnold
David Hankins
Paul Hoffman
Paul Vixie
Brian Conry
Anay Panvalkar
colleen
Robert Edmonds
João Damas
Artem Boldariev (Артем Болдарєв)

19478
CHANGES Normal file

File diff suppressed because it is too large Load Diff

79
CODE_OF_CONDUCT Normal file
View File

@@ -0,0 +1,79 @@
CODE OF CONDUCT
BIND 9 Code of Conduct
Like the technical community as a whole, the BIND 9 team and community is
made up of a mixture of professionals and volunteers from all over the
world, working on every aspect of the mission - including mentorship,
teaching, and connecting people.
Diversity is one of our huge strengths, but it can also lead to
communication issues and unhappiness. To that end, we have a few ground
rules that we ask people to adhere to. This code applies equally to the
core development team, open source contributors and those seeking help and
guidance.
This isn't an exhaustive list of things that you can't do. Rather, take it
in the spirit in which it's intended - a guide to make it easier to enrich
all of us and the technical communities in which we participate.
This code of conduct applies to all spaces managed by the BIND 9 project
or Internet Systems Consortium. This includes chat, the mailing lists, the
issue tracker, and any other fora created by the project team which the
community uses for communication. In addition, violations of this code
outside these spaces may affect a person's ability to participate within
them.
If you believe someone is violating the code of conduct, we ask that you
report it by emailing conduct@isc.org. For more details please see our
Reporting Guidelines.
* Be friendly and patient.
* Be welcoming. We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not
limited to members of any race, ethnicity, culture, national origin,
colour, immigration status, social and economic class, educational
level, sex, sexual orientation, gender identity and expression, age,
size, family status, political belief, religion, and mental and
physical ability.
* Be considerate. Your work will be used by other people, and you in
turn will depend on the work of others. Any decision you take will
affect users and colleagues, and you should take those consequences
into account when making decisions. Remember that we're a world-wide
community, so you might not be communicating in someone else's primary
language.
* Be respectful. Not all of us will agree all the time, but disagreement
is no excuse for poor behavior and poor manners. We might all
experience some frustration now and then, but we cannot allow that
frustration to turn into a personal attack. It's important to remember
that a community where people feel uncomfortable or threatened is not
a productive one. Members of the BIND 9 community should be respectful
when dealing with other members as well as with people outside the
BIND 9 community.
* Be careful in the words that you choose. We are a community of
professionals, and we conduct ourselves professionally. Be kind to
others. Do not insult or put down other participants. Harassment and
other exclusionary behavior aren't acceptable. This includes, but is
not limited to:
+ Violent threats or language directed against another person.
+ Discriminatory jokes and language.
+ Posting sexually explicit or violent material.
+ Posting (or threatening to post) other people's personally
identifying information ("doxing").
+ Personal insults, especially those using racist or sexist terms.
+ Unwelcome sexual attention.
+ Advocating for, or encouraging, any of the above behavior.
+ Repeated harassment of others. In general, if someone asks you to
stop, then stop.
* When we disagree, try to understand why. Disagreements, both social
and technical, happen all the time and BIND 9 is no exception. It is
important that we resolve disagreements and differing views
constructively. Remember that we're different. The strength of BIND 9
comes from its varied community, people from a wide range of
backgrounds. Different people have different perspectives on issues.
Being unable to understand why someone holds a viewpoint doesn't mean
that they're wrong. Don't forget that it is human to err and blaming
each other doesn't get us anywhere. Instead, focus on helping to
resolve issues and learning from mistakes.
Original text courtesy of the Django Code of Conduct project.

189
CONTRIBUTING Normal file
View File

@@ -0,0 +1,189 @@
CONTRIBUTING
BIND 9 Source Access and Contributor Guidelines
May 28, 2020
Contents
1. Access to source code
2. Reporting bugs
3. Contributing code
Introduction
Thank you for using BIND 9!
BIND is open source software that implements the Domain Name System (DNS)
protocols for the Internet. It is a reference implementation of those
protocols, but it is also production-grade software, suitable for use in
high-volume and high-reliability applications. It is very widely used DNS
software, providing a robust and stable platform on top of which
organizations can build distributed computing systems with the knowledge
that those systems are fully compliant with published DNS standards.
BIND is and will always remain free and openly available. It can be used
and modified in any way by anyone.
BIND is maintained by Internet Systems Consortium, a public-benefit 501(c)
(3) nonprofit, using a "managed open source" approach: anyone can see the
source, but only ISC employees have commit access. In the past, the source
could only be seen once ISC had published a release; read access to the
source repository was restricted just as commit access was. That has
changed, as ISC now provides a public git repository of the BIND source
tree (see below).
At ISC, we're committed to building communities that are welcoming and
inclusive: environments where people are encouraged to share ideas, treat
each other with respect, and collaborate towards the best solutions. To
reinforce our commitment, ISC has adopted a slightly modified version of
the Django Code of Conduct for the BIND 9 project, as well as for the
conduct of our developers throughout the industry.
Access to source code
Public BIND releases are always available from the ISC FTP site.
A public-access git repository is also available at https://gitlab.isc.org
. This repository contains all public release branches. Upcoming releases
can be viewed in their current state at any time. Short-lived development
branches contain unreviewed work in progress. Commits which address
security vulnerablilities are withheld until after public disclosure.
You can browse the source online via https://gitlab.isc.org/isc-projects/
bind9
To clone the repository, use:
$ git clone https://gitlab.isc.org/isc-projects/bind9.git
Release branch names are of the form v9_X, where X represents the second
number in the BIND 9 version number. So, to check out the BIND 9.12
branch, use:
$ git checkout v9_12
Whenever a branch is ready for publication, a tag is placed of the form
v9_X_Y. The 9.12.0 release, for instance, is tagged as v9_12_0.
The branch in which the next major release is being developed is called
main.
Reporting bugs
Reports of flaws in the BIND package, including software bugs, errors in
the documentation, missing files in the tarball, suggested changes or
requests for new features, etc., can be filed using https://gitlab.isc.org
/isc-projects/bind9/issues.
Due to a large ticket backlog, we are sometimes slow to respond,
especially if a bug is cosmetic or if a feature request is vague or low in
priority, but we try at least to acknowledge legitimate bug reports within
a week.
ISC's GitLab system is publicly readable; however, you must have an
account to create a new issue. You can either register locally or use
credentials from an existing account at GitHub, GitLab, Google, Twitter,
or Facebook.
Reporting possible security issues
If you think you may be seeing a potential security vulnerability in BIND
(for example, a crash with REQUIRE, INSIST, or ASSERT failure), please
report it immediately by emailing to security-officer@isc.org. Plain-text
e-mail is not a secure choice for communications concerning undisclosed
security issues so please encrypt your communications to us if possible,
using the ISC Security Officer public key.
Do not discuss undisclosed security vulnerabilities on any public mailing
list. ISC has a long history of handling reported vulnerabilities promptly
and effectively and we respect and acknowledge responsible reporters.
ISC's Security Vulnerability Disclosure Policy is documented at https://
kb.isc.org/docs/aa-00861.
If you have a crash, you may want to consult "What to do if your BIND or
DHCP server has crashed."
Contributing code
BIND is licensed under the Mozilla Public License 2.0. Earlier versions
(BIND 9.10 and earlier) were licensed under the ISC License
ISC does not require an explicit copyright assignment for patch
contributions. However, by submitting a patch to ISC, you implicitly
certify that you are the author of the code, that you intend to relinquish
exclusive copyright, and that you grant permission to publish your work
under the open source license used for the BIND version(s) to which your
patch will be applied.
BIND code
Patches for BIND may be submitted directly via merge requests in ISC's
GitLab source repository for BIND.
Patches can also be submitted as diffs against a specific version of BIND
-- preferably the current top of the main branch. Diffs may be generated
using either git format-patch or git diff.
Those wanting to write code for BIND may be interested in the developer
information page, which includes information about BIND design and coding
practices, including discussion of internal APIs and overall system
architecture.
Every patch submitted is reviewed by ISC engineers following our code
review process before it is merged.
It may take considerable time to review patch submissions, especially if
they don't meet ISC style and quality guidelines. If a patch is a good
idea, we can and will do additional work to bring it up to par, but if
we're busy with other work, it may take us a long time to get to it.
To ensure your patch is acted on as promptly as possible, please:
* Try to adhere to the BIND 9 coding style.
* Run make check to ensure your change hasn't caused any functional
regressions.
* Document your work, both in the patch itself and in the accompanying
email.
* In patches that make non-trivial functional changes, include system
tests if possible; when introducing or substantially altering a
library API, include unit tests. See Testing for more information.
Changes to configure
If you need to make changes to configure, you should not edit it directly;
instead, edit configure.in, then run autoconf. Similarly, instead of
editing config.h.in directly, edit configure.in and run autoheader.
When submitting a patch as a diff, it's fine to omit the configure diffs
to save space. Just send the configure.in diffs and we'll generate the new
configure during the review process.
Documentation
All functional changes should be documented. There are three types of
documentation in the BIND source tree:
* Man pages are kept alongside the source code for the commands they
document, in files ending in .rst: for example, the named man page is
bin/named/named.rst.
* The BIND 9 Administrator Reference Manual is in the .rst files in doc/
arm/; the PDF and HTML versions are automatically generated from the
.rst files.
* API documentation is in the header file describing the API, in
Doxygen-formatted comments.
Patches to improve existing documentation are also very welcome!
Tests
BIND is a large and complex project. We rely heavily on continuous
automated testing and cannot merge new code without adequate test
coverage. Please see the "Testing" section of doc/dev/dev.md for more
information.
Thanks
Thank you for your interest in contributing to the ongoing development of
BIND 9.

View File

@@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
## BIND 9 Source Access and Contributor Guidelines
*Nov 26, 2024*
*May 28, 2020*
### Contents
@@ -71,14 +71,14 @@ To clone the repository, use:
> $ git clone https://gitlab.isc.org/isc-projects/bind9.git
Release branch names are of the form `bind-9.X`, where X represents the second
number in the BIND 9 version number. So, to check out the BIND 9.20
Release branch names are of the form `v9_X`, where X represents the second
number in the BIND 9 version number. So, to check out the BIND 9.12
branch, use:
> $ git checkout bind-9.20
> $ git checkout v9_12
Whenever a branch is ready for publication, a tag is placed of the
form `v9.X.Y`. The 9.20.0 release, for instance, is tagged as `v9.20.0`.
form `v9_X_Y`. The 9.12.0 release, for instance, is tagged as `v9_12_0`.
The branch in which the next major release is being developed is called
`main`.
@@ -102,7 +102,22 @@ Twitter, or Facebook.
### Reporting possible security issues
See `SECURITY.md`.
If you think you may be seeing a potential security vulnerability in BIND
(for example, a crash with REQUIRE, INSIST, or ASSERT failure), please
report it immediately by emailing to security-officer@isc.org. Plain-text
e-mail is not a secure choice for communications concerning undisclosed
security issues so please encrypt your communications to us if possible,
using the [ISC Security Officer public key](https://www.isc.org/pgpkey/).
Do not discuss undisclosed security vulnerabilities on any public mailing list.
ISC has a long history of handling reported vulnerabilities promptly and
effectively and we respect and acknowledge responsible reporters.
ISC's Security Vulnerability Disclosure Policy is documented at
[https://kb.isc.org/docs/aa-00861](https://kb.isc.org/docs/aa-00861).
If you have a crash, you may want to consult
["What to do if your BIND or DHCP server has crashed."](https://kb.isc.org/docs/aa-00340)
### <a name="contrib"></a>Contributing code
@@ -121,9 +136,8 @@ patch will be applied.
#### <a name="bind"></a>BIND code
Patches for BIND may be submitted directly via merge requests in
[ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source repository for
BIND. Please contact ISC and provide your GitLab username in order to be allowed
to fork the project and submit merge requests.
[ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source
repository for BIND.
Patches can also be submitted as diffs against a specific version of
BIND -- preferably the current top of the `main` branch. Diffs may
@@ -145,8 +159,8 @@ we're busy with other work, it may take us a long time to get to it.
To ensure your patch is acted on as promptly as possible, please:
* Try to adhere to the [BIND 9 coding style](doc/dev/style.md).
* Run unit and system tests to ensure your change hasn't caused any
functional regressions (these can be checked in the CI pipeline).
* Run `make check` to ensure your change hasn't caused any
functional regressions.
* Document your work, both in the patch itself and in the
accompanying email.
* In patches that make non-trivial functional changes, include system
@@ -157,12 +171,12 @@ To ensure your patch is acted on as promptly as possible, please:
##### Changes to `configure`
If you need to make changes to `configure`, you should not edit it
directly; instead, edit `configure.ac`, then run `autoconf`. Similarly,
instead of editing `config.h.in` directly, edit `configure.ac` and run
directly; instead, edit `configure.in`, then run `autoconf`. Similarly,
instead of editing `config.h.in` directly, edit `configure.in` and run
`autoheader`.
When submitting a patch as a diff, it's fine to omit the `configure`
diffs to save space. Just send the `configure.ac` diffs and we'll
diffs to save space. Just send the `configure.in` diffs and we'll
generate the new `configure` during the review process.
##### Documentation
@@ -174,7 +188,7 @@ of documentation in the BIND source tree:
they document, in files ending in `.rst`: for example, the
`named` man page is `bin/named/named.rst`.
* The *BIND 9 Administrator Reference Manual* is in the .rst files in
`doc/arm/`; the HTML version is automatically generated from
`doc/arm/`; the PDF and HTML versions are automatically generated from
the `.rst` files.
* API documentation is in the header file describing the API, in
Doxygen-formatted comments.

View File

@@ -1 +0,0 @@
LICENSE

View File

@@ -1,4 +1,4 @@
Copyright (C) 1996-2023 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2022 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -133,7 +133,7 @@ modification, are permitted provided that the following conditions are met:
3. Neither the name of the University nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -149,35 +149,35 @@ POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1997 - 2003 Kungliga Tekniska Högskolan
(Royal Institute of Technology, Stockholm, Sweden).
All rights reserved.
(Royal Institute of Technology, Stockholm, Sweden).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Institute nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
3. Neither the name of the Institute nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
@@ -367,25 +367,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@@ -1 +0,0 @@
doc/arm/changelog.rst

600
HISTORY Normal file
View File

@@ -0,0 +1,600 @@
HISTORY
Functional enhancements from prior major releases of BIND 9
BIND 9.14
BIND 9.14 (a stable branch based on the 9.13 development branch) includes
a number of changes from BIND 9.12 and earlier releases. New features
include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a
plugin.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root
zone.
* Secondary zones can now be configured as "mirror" zones; their
contents are transferred in as with traditional slave zones, but are
subject to DNSSEC validation and are not treated as authoritative data
when answering. This makes it easier to configure a local copy of the
root zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below
which DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with libidn2.
* "named -V" now outputs the default paths for files used by named and
other tools.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See https://dnsflagday.net for more details.
Cryptographic support has been modernized. BIND now uses the best
available pseudo-random number generator for the platform on which it's
built. Very old versions of OpenSSL are no longer supported. Cryptography
is now mandatory: building BIND without DNSSEC is no longer supported.
Special code to support certain legacy operating systems has also been
removed; see the doc/arm/platforms.rst file for details of supported
platforms. In addition to OpenSSL, BIND now requires support for IPv6,
threads, and standard atomic operations provided by the C compiler.
BIND 9.12
BIND 9.12 includes a number of changes from BIND 9.11 and earlier
releases. New features include:
* named and related libraries have been substantially refactored for
improved query performance -- particularly on delegation heavy zones
-- and for improved readability, maintainability, and testability.
* Code implementing the name server query processing logic has been
moved into a new libns library, for easier testing and use in tools
other than named.
* Cached, validated NSEC and other records can now be used to synthesize
NXDOMAIN responses.
* The DNS Response Policy Service API (DNSRPS) is now supported.
* Setting 'max-journal-size default' now limits the size of journal
files to twice the size of the zone.
* dnstap-read -x prints a hex dump of the wire format of each logged DNS
message.
* dnstap output files can now be configured to roll automatically when
reaching a given size.
* Log file timestamps can now also be formatted in ISO 8601 (local) or
ISO 8601 (UTC) formats.
* Logging channels and dnstap output files can now be configured to use
a timestamp as the suffix when rolling to a new file.
* 'named-checkconf -l' lists zones found in named.conf.
* Added support for the EDNS Padding and Keepalive options.
* 'new-zones-directory' option sets the location where the configuration
data for zones added by rndc addzone is stored.
* The default key algorithm in rndc-confgen is now hmac-sha256.
* filter-aaaa-on-v4 and filter-aaaa-on-v6 options are now available by
default without a configure option.
* The obsolete isc-hmac-fixup command has been removed.
BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
releases. New features include:
* Added support for Catalog Zones, a new method for provisioning
servers: a list of zones to be served is stored in a DNS zone, along
with their configuration parameters. Changes to the catalog zone are
propagated to slaves via normal AXFR/IXFR, whereupon the zones that
are listed in it are automatically added, deleted or reconfigured.
* Added support for "dnstap", a fast and flexible method of capturing
and logging DNS traffic.
* Added support for "dyndb", a new API for loading zone data from an
external database, developed by Red Hat for the FreeIPA project.
* "fetchlimit" quotas are now compiled in by default. These are for the
use of recursive resolvers that are are under high query load for
domains whose authoritative servers are nonresponsive or are
experiencing a denial of service attack:
+ "fetches-per-server" limits the number of simultaneous queries
that can be sent to any single authoritative server. The
configured value is a starting point; it is automatically adjusted
downward if the server is partially or completely non-responsive.
The algorithm used to adjust the quota can be configured via the
"fetch-quota-params" option.
+ "fetches-per-zone" limits the number of simultaneous queries that
can be sent for names within a single domain. (Note: Unlike
"fetches-per-server", this value is not self-tuning.)
+ New stats counters have been added to count queries spilled due to
these quotas.
* Added a new "dnssec-keymgr" key mainenance utility, which can generate
or update keys as needed to ensure that a zone's keys match a defined
DNSSEC policy.
* The experimental "SIT" feature in BIND 9.10 has been renamed "COOKIE"
and is no longer optional. EDNS COOKIE is a mechanism enabling clients
to detect off-path spoofed responses, and servers to detect
spoofed-source queries. Clients that identify themselves using COOKIE
options are not subject to response rate limiting (RRL) and can
receive larger UDP responses.
* SERVFAIL responses can now be cached for a limited time (defaulting to
1 second, with an upper limit of 30). This can reduce the frequency of
retries when a query is persistently failing.
* Added an "nsip-wait-recurse" switch to RPZ. This causes NSIP rules to
be skipped if a name server IP address isn't in the cache yet; the
address will be looked up and the rule will be applied on future
queries.
* Added a Python RNDC module. This allows multiple commands to sent over
a persistent RNDC channel, which saves time.
* The "controls" block in named.conf can now grant read-only "rndc"
access to specified clients or keys. Read-only clients could, for
example, check "rndc status" but could not reconfigure or shut down
the server.
* "rndc" commands can now return arbitrarily large amounts of text to
the caller.
* The zone serial number of a dynamically updatable zone can now be set
via "rndc signing -serial ". This allows inline-signing zones to be
set to a specific serial number.
* The new "rndc nta" command can be used to set a Negative Trust Anchor
(NTA), disabling DNSSEC validation for a specific domain; this can be
used when responses from a domain are known to be failing validation
due to administrative error rather than because of a spoofing attack.
Negative trust anchors are strictly temporary; by default they expire
after one hour, but can be configured to last up to one week.
* "rndc delzone" can now be used on zones that were not originally
created by "rndc addzone".
* "rndc modzone" reconfigures a single zone, without requiring the
entire server to be reconfigured.
* "rndc showzone" displays the current configuration of a zone.
* "rndc managed-keys" can be used to check the status of RFC 5011
managed trust anchors, or to force trust anchors to be refreshed.
* "max-cache-size" can now be set to a percentage of available memory.
The default is 90%.
* Update forwarding performance has been improved by allowing a single
TCP connection to be shared by multiple updates.
* The EDNS Client Subnet (ECS) option is now supported for authoritative
servers; if a query contains an ECS option then ACLs containing
"geoip" or "ecs" elements can match against the the address encoded in
the option. This can be used to select a view for a query, so that
different answers can be provided depending on the client network.
* The EDNS EXPIRE option has been implemented on the client side,
allowing a slave server to set the expiration timer correctly when
transferring zone data from another slave server.
* The key generation and manipulation tools (dnssec-keygen,
dnssec-settime, dnssec-importkey, dnssec-keyfromlabel) now take
"-Psync" and "-Dsync" options to set the publication and deletion
times of CDS and CDNSKEY parent-synchronization records. Both named
and dnssec-signzone can now publish and remove these records at the
scheduled times.
* A new "minimal-any" option reduces the size of UDP responses for query
type ANY by returning a single arbitrarily selected RRset instead of
all RRsets.
* A new "masterfile-style" zone option controls the formatting of text
zone files: When set to "full", a zone file is dumped in
single-line-per-record format.
* "serial-update-method" can now be set to "date". On update, the serial
number will be set to the current date in YYYYMMDDNN format.
* "dnssec-signzone -N date" sets the serial number to YYYYMMDDNN.
* "named -L " causes named to send log messages to the specified file by
default instead of to the system log.
* "dig +ttlunits" prints TTL values with time-unit suffixes: w, d, h, m,
s for weeks, days, hours, minutes, and seconds.
* "dig +unknownformat" prints dig output in RFC 3597 "unknown record"
presentation format.
* "dig +ednsopt" allows dig to set arbitrary EDNS options on requests.
* "dig +ednsflags" allows dig to set yet-to-be-defined EDNS flags on
requests.
* "mdig" is an alternate version of dig which sends multiple pipelined
TCP queries to a server. Instead of waiting for a response after
sending a query, it sends all queries immediately and displays
responses in the order received.
* "serial-query-rate" no longer controls NOTIFY messages. These are
separately controlled by "notify-rate" and "startup-notify-rate".
* "nsupdate" now performs "check-names" processing by default on records
to be added. This can be disabled with "check-names no".
* The statistics channel now supports DEFLATE compression, reducing the
size of the data sent over the network when querying statistics.
* New counters have been added to the statistics channel to track the
sizes of incoming queries and outgoing responses in histogram buckets,
as specified in RSSAC002.
* A new NXDOMAIN redirect method (option "nxdomain-redirect") has been
added, allowing redirection to a specified DNS namespace instead of a
single redirect zone.
* When starting up, named now ensures that no other named process is
already running.
* Files created by named to store information, including "mkeys" and
"nzf" files, are now named after their corresponding views unless the
view name contains characters incompatible with use as a filename. Old
style filenames (based on the hash of the view name) will still work.
BIND 9.10.0
BIND 9.10.0 includes a number of changes from BIND 9.9 and earlier
releases. New features include:
* DNS Response-rate limiting (DNS RRL), which blunts the impact of
reflection and amplification attacks, is always compiled in and no
longer requires a compile-time option to enable it.
* An experimental "Source Identity Token" (SIT) EDNS option is now
available. Similar to DNS Cookies as invented by Donald Eastlake 3rd,
these are designed to enable clients to detect off-path spoofed
responses, and to enable servers to detect spoofed-source queries.
Servers can be configured to send smaller responses to clients that
have not identified themselves using a SIT option, reducing the
effectiveness of amplification attacks. RRL processing has also been
updated; clients proven to be legitimate via SIT are not subject to
rate limiting. Use "configure --enable-sit" to enable this feature in
BIND.
* A new zone file format, "map", stores zone data in a format that can
be mapped directly into memory, allowing significantly faster zone
loading.
* "delv" (domain entity lookup and validation) is a new tool with
dig-like semantics for looking up DNS data and performing internal
DNSSEC validation. This allows easy validation in environments where
the resolver may not be trustworthy, and assists with troubleshooting
of DNSSEC problems. (NOTE: In previous development releases of BIND
9.10, this utility was called "delve". The spelling has been changed
to avoid confusion with the "delve" utility included with the Xapian
search engine.)
* Improved EDNS(0) processing for better resolver performance and
reliability over slow or lossy connections.
* A new "configure --with-tuning=large" option tunes certain compiled-in
constants and default settings to values better suited to large
servers with abundant memory. This can improve performance on such
servers, but will consume more memory and may degrade performance on
smaller systems.
* Substantial improvement in response-policy zone (RPZ) performance. Up
to 32 response-policy zones can be configured with minimal performance
loss.
* To improve recursive resolver performance, cache records which are
still being requested by clients can now be automatically refreshed
from the authoritative server before they expire, reducing or
eliminating the time window in which no answer is available in the
cache.
* New "rpz-client-ip" triggers and drop policies allowing response
policies based on the IP address of the client.
* ACLs can now be specified based on geographic location using the
MaxMind GeoIP databases. Use "configure --with-geoip" to enable.
* Zone data can now be shared between views, allowing multiple views to
serve the same zones authoritatively without storing multiple copies
in memory.
* New XML schema (version 3) for the statistics channel includes many
new statistics and uses a flattened XML tree for faster parsing. The
older schema is now deprecated.
* A new stylesheet, based on the Google Charts API, displays XML
statistics in charts and graphs on javascript-enabled browsers.
* The statistics channel can now provide data in JSON format as well as
XML.
* New stats counters track TCP and UDP queries received per zone, and
EDNS options received in total.
* The internal and export versions of the BIND libraries (libisc,
libdns, etc) have been unified so that external library clients can
use the same libraries as BIND itself.
* A new compile-time option, "configure --enable-native-pkcs11", allows
BIND 9 cryptography functions to use the PKCS#11 API natively, so that
BIND can drive a cryptographic hardware service module (HSM) directly
instead of using a modified OpenSSL as an intermediary. (Note: This
feature requires an HSM to have a full implementation of the PKCS#11
API; many current HSMs only have partial implementations. The new
"pkcs11-tokens" command can be used to check API completeness. Native
PKCS#11 is known to work with the Thales nShield HSM and with SoftHSM
version 2 from the Open DNSSEC project.)
* The new "max-zone-ttl" option enforces maximum TTLs for zones. This
can simplify the process of rolling DNSSEC keys by guaranteeing that
cached signatures will have expired within the specified amount of
time.
* "dig +subnet" sends an EDNS CLIENT-SUBNET option when querying.
* "dig +expire" sends an EDNS EXPIRE option when querying. When this
option is sent with an SOA query to a server that supports it, it will
report the expiry time of a slave zone.
* New "dnssec-coverage" tool to check DNSSEC key coverage for a zone and
report if a lapse in signing coverage has been inadvertently
scheduled.
* Signing algorithm flexibility and other improvements for the "rndc"
control channel.
* "named-checkzone" and "named-compilezone" can now read journal files,
allowing them to process dynamic zones.
* Multiple DLZ databases can now be configured. Individual zones can be
configured to be served from a specific DLZ database. DLZ databases
now serve zones of type "master" and "redirect".
* "rndc zonestatus" reports information about a specified zone.
* "named" now listens on IPv6 as well as IPv4 interfaces by default.
* "named" now preserves the capitalization of names when responding to
queries: for instance, a query for "example.com" may be answered with
"example.COM" if the name was configured that way in the zone file.
Some clients have a bug causing them to depend on the older behavior,
in which the case of the answer always matched the case of the query,
rather than the case of the name configured in the DNS. Such clients
can now be specified in the new "no-case-compress" ACL; this will
restore the older behavior of "named" for those clients only.
* new "dnssec-importkey" command allows the use of offline DNSSEC keys
with automatic DNSKEY management.
* New "named-rrchecker" tool to verify the syntactic correctness of
individual resource records.
* When re-signing a zone, the new "dnssec-signzone -Q" option drops
signatures from keys that are still published but are no longer
active.
* "named-checkconf -px" will print the contents of configuration files
with the shared secrets obscured, making it easier to share
configuration (e.g. when submitting a bug report) without revealing
private information.
* "rndc scan" causes named to re-scan network interfaces for changes in
local addresses.
* On operating systems with support for routing sockets, network
interfaces are re-scanned automatically whenever they change.
* "tsig-keygen" is now available as an alternate command name to use for
"ddns-confgen".
BIND 9.9.0
BIND 9.9.0 includes a number of changes from BIND 9.8 and earlier
releases. New features include:
* Inline signing, allowing automatic DNSSEC signing of master zones
without modification of the zonefile, or "bump in the wire" signing in
slaves.
* NXDOMAIN redirection.
* New 'rndc flushtree' command clears all data under a given name from
the DNS cache.
* New 'rndc sync' command dumps pending changes in a dynamic zone to
disk without a freeze/thaw cycle.
* New 'rndc signing' command displays or clears signing status records
in 'auto-dnssec' zones.
* NSEC3 parameters for 'auto-dnssec' zones can now be set prior to
signing, eliminating the need to initially sign with NSEC.
* Startup time improvements on large authoritative servers.
* Slave zones are now saved in raw format by default.
* Several improvements to response policy zones (RPZ).
* Improved hardware scalability by using multiple threads to listen for
queries and using finer-grained client locking
* The 'also-notify' option now takes the same syntax as 'masters', so it
can used named masterlists and TSIG keys.
* 'dnssec-signzone -D' writes an output file containing only DNSSEC
data, which can be included by the primary zone file.
* 'dnssec-signzone -R' forces removal of signatures that are not expired
but were created by a key which no longer exists.
* 'dnssec-signzone -X' allows a separate expiration date to be specified
for DNSKEY signatures from other signatures.
* New '-L' option to dnssec-keygen, dnssec-settime, and
dnssec-keyfromlabel sets the default TTL for the key.
* dnssec-dsfromkey now supports reading from standard input, to make it
easier to convert DNSKEY to DS.
* RFC 1918 reverse zones have been added to the empty-zones table per
RFC 6303.
* Dynamic updates can now optionally set the zone's SOA serial number to
the current UNIX time.
* DLZ modules can now retrieve the source IP address of the querying
client.
* 'request-ixfr' option can now be set at the per-zone level.
* 'dig +rrcomments' turns on comments about DNSKEY records, indicating
their key ID, algorithm and function
* Simplified nsupdate syntax and added readline support
BIND 9.8.0
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
releases. New features include:
* Built-in trust anchor for the root zone, which can be switched on via
"dnssec-validation auto;"
* Support for DNS64.
* Support for response policy zones (RPZ).
* Support for writable DLZ zones.
* Improved ease of configuration of GSS/TSIG for interoperability with
Active Directory
* Support for GOST signing algorithm for DNSSEC.
* Removed RTT Banding from server selection algorithm.
* New "static-stub" zone type.
* Allow configuration of resolver timeouts via "resolver-query-timeout"
option.
* The DLZ "dlopen" driver is now built by default.
* Added a new include file with function typedefs for the DLZ "dlopen"
driver.
* Made "--with-gssapi" default.
* More verbose error reporting from DLZ LDAP.
BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases. Most are intended to simplify DNSSEC configuration. New features
include:
* Fully automatic signing of zones by "named".
* Simplified configuration of DNSSEC Lookaside Validation (DLV).
* Simplified configuration of Dynamic DNS, using the "ddns-confgen"
command line tool or the "local" update-policy option. (As a side
effect, this also makes it easier to configure automatic zone
re-signing.)
* New named option "attach-cache" that allows multiple views to share a
single cache.
* DNS rebinding attack prevention.
* New default values for dnssec-keygen parameters.
* Support for RFC 5011 automated trust anchor maintenance
* Smart signing: simplified tools for zone signing and key maintenance.
* The "statistics-channels" option is now available on Windows.
* A new DNSSEC-aware libdns API for use by non-BIND9 applications
* On some platforms, named and other binaries can now print out a stack
backtrace on assertion failure, to aid in debugging.
* A "tools only" installation mode on Windows, which only installs dig,
host, nslookup and nsupdate.
* Improved PKCS#11 support, including Keyper support and explicit
OpenSSL engine selection.
BIND 9.6.0
* Full NSEC3 support
* Automatic zone re-signing
* New update-policy methods tcp-self and 6to4-self
* The BIND 8 resolver library, libbind, has been removed from the BIND 9
distribution and is now available as a separate download.
* Change the default pid file location from /var/run to /var/run/
{named,lwresd} for improved chroot/setuid support.
BIND 9.5.0
* GSS-TSIG support (RFC 3645).
* DHCID support.
* Experimental http server and statistics support for named via xml.
* More detailed statistics counters including those supported in BIND 8.
* Faster ACL processing.
* Use Doxygen to generate internal documentation.
* Efficient LRU cache-cleaning mechanism.
* NSID support.
BIND 9.4.0
* Implemented "additional section caching (or acache)", an internal
cache framework for additional section content to improve response
performance. Several configuration options were provided to control
the behavior.
* New notify type 'master-only'. Enable notify for master zones only.
* Accept 'notify-source' style syntax for query-source.
* rndc now allows addresses to be set in the server clauses.
* New option "allow-query-cache". This lets "allow-query" be used to
specify the default zone access level rather than having to have every
zone override the global value. "allow-query-cache" can be set at both
the options and view levels. If "allow-query-cache" is not set then
"allow-recursion" is used if set, otherwise "allow-query" is used if
set unless "recursion no;" is set in which case "none;" is used,
otherwise the default (localhost; localnets;) is used.
* rndc: the source address can now be specified.
* ixfr-from-differences now takes master and slave in addition to yes
and no at the options and view levels.
* Allow the journal's name to be changed via named.conf.
* 'rndc notify zone [class [view]]' resend the NOTIFY messages for the
specified zone.
* 'dig +trace' now randomly selects the next servers to try. Report if
there is a bad delegation.
* Improve check-names error messages.
* Make public the function to read a key file, dst_key_read_public().
* dig now returns the byte count for axfr/ixfr.
* allow-update is now settable at the options / view level.
* named-checkconf now checks the logging configuration.
* host now can turn on memory debugging flags with '-m'.
* Don't send notify messages to self.
* Perform sanity checks on NS records which refer to 'in zone' names.
* New zone option "notify-delay". Specify a minimum delay between sets
of NOTIFY messages.
* Extend adjusting TTL warning messages.
* Named and named-checkzone can now both check for non-terminal wildcard
records.
* "rndc freeze/thaw" now freezes/thaws all zones.
* named-checkconf now check acls to verify that they only refer to
existing acls.
* The server syntax has been extended to support a range of servers.
* Report differences between hints and real NS rrset and associated
address records.
* Preserve the case of domain names in rdata during zone transfers.
* Restructured the data locking framework using architecture dependent
atomic operations (when available), improving response performance on
multi-processor machines significantly. x86, x86_64, alpha, powerpc,
and mips are currently supported.
* UNIX domain controls are now supported.
* Add support for additional zone file formats for improving loading
performance. The masterfile-format option in named.conf can be used to
specify a non-default format. A separate command named-compilezone was
provided to generate zone files in the new format. Additionally, the
-I and -O options for dnssec-signzone specify the input and output
formats.
* dnssec-signzone can now randomize signature end times (dnssec-signzone
-j jitter).
* Add support for CH A record.
* Add additional zone data constancy checks. named-checkzone has
extended checking of NS, MX and SRV record and the hosts they
reference. named has extended post zone load checks. New zone options:
check-mx and integrity-check.
* edns-udp-size can now be overridden on a per server basis.
* dig can now specify the EDNS version when making a query.
* Added framework for handling multiple EDNS versions.
* Additional memory debugging support to track size and mctx arguments.
* Detect duplicates of UDP queries we are recursing on and drop them.
New stats category "duplicates".
* "USE INTERNAL MALLOC" is now runtime selectable.
* The lame cache is now done on a <qname,qclass,qtype> basis as some
servers only appear to be lame for certain query types.
* Limit the number of recursive clients that can be waiting for a single
query (<qname,qtype,qclass>) to resolve. New options clients-per-query
and max-clients-per-query.
* dig: report the number of extra bytes still left in the packet after
processing all the records.
* Support for IPSECKEY rdata type.
* Raise the UDP receive buffer size to 32k if it is less than 32k.
* x86 and x86_64 now have separate atomic locking implementations.
* named-checkconf now validates update-policy entries.
* Attempt to make the amount of work performed in a iteration self
tuning. The covers nodes clean from the cache per iteration, nodes
written to disk when rewriting a master file and nodes destroyed per
iteration when destroying a zone or a cache.
* ISC string copy API.
* Automatic empty zone creation for D.F.IP6.ARPA and friends. Note: RFC
1918 zones are not yet covered by this but are likely to be in a
future release.
* New options: empty-server, empty-contact, empty-zones-enable and
disable-empty-zone.
* dig now has a '-q queryname' and '+showsearch' options.
* host/nslookup now continue (default)/fail on SERVFAIL.
* dig now warns if 'RA' is not set in the answer when 'RD' was set in
the query. host/nslookup skip servers that fail to set 'RA' when 'RD'
is set unless a server is explicitly set.
* Integrate contributed DLZ code into named.
* Integrate contributed IDN code from JPNIC.
* libbind: corresponds to that from BIND 8.4.7.
BIND 9.3.0
* DNSSEC is now DS based (RFC 3658).
* DNSSEC lookaside validation.
* check-names is now implemented.
* rrset-order is more complete.
* IPv4/IPv6 transition support, dual-stack-servers.
* IXFR deltas can now be generated when loading master files,
ixfr-from-differences.
* It is now possible to specify the size of a journal, max-journal-size.
* It is now possible to define a named set of master servers to be used
in masters clause, masters.
* The advertised EDNS UDP size can now be set, edns-udp-size.
* allow-v6-synthesis has been obsoleted.
* Zones containing MD and MF will now be rejected.
* dig, nslookup name. now report "Not Implemented" as NOTIMP rather than
NOTIMPL. This will have impact on scripts that are looking for
NOTIMPL.
* libbind: corresponds to that from BIND 8.4.5.
BIND 9.2.0
* The size of the cache can now be limited using the "max-cache-size"
option.
* The server can now automatically convert RFC1886-style recursive
lookup requests into RFC2874-style lookups, when enabled using the new
option "allow-v6-synthesis". This allows stub resolvers that support
AAAA records but not A6 record chains or binary labels to perform
lookups in domains that make use of these IPv6 DNS features.
* Performance has been improved.
* The man pages now use the more portable "man" macros rather than the
"mandoc" macros, and are installed by "make install".
* The named.conf parser has been completely rewritten. It now supports
"include" directives in more places such as inside "view" statements,
and it no longer has any reserved words.
* The "rndc status" command is now implemented.
* rndc can now be configured automatically.
* A BIND 8 compatible stub resolver library is now included in lib/bind.
* OpenSSL has been removed from the distribution. This means that to use
DNSSEC, OpenSSL must be installed and the --with-openssl option must
be supplied to configure. This does not apply to the use of TSIG,
which does not require OpenSSL.
* The source distribution now builds on Windows. See win32utils/
readme1.txt and win32utils/win32-build.txt for details.
* This distribution also includes a new lightweight stub resolver
library and associated resolver daemon that fully support forward and
reverse lookups of both IPv4 and IPv6 addresses. This library is
considered experimental and is not a complete replacement for the BIND
8 resolver library. Applications that use the BIND 8 res_* functions
to perform DNS lookups or dynamic updates still need to be linked
against the BIND 8 libraries. For DNS lookups, they can also use the
new "getrrsetbyname()" API.
* BIND 9.2 is capable of acting as an authoritative server for DNSSEC
secured zones. This functionality is believed to be stable and
complete except for lacking support for verifications involving
wildcard records in secure zones.
* When acting as a caching server, BIND 9.2 can be configured to perform
DNSSEC secure resolution on behalf of its clients. This part of the
DNSSEC implementation is still considered experimental. For detailed
information about the state of the DNSSEC implementation, see the file
doc/misc/dnssec.

617
HISTORY.md Normal file
View File

@@ -0,0 +1,617 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
### Functional enhancements from prior major releases of BIND 9
#### BIND 9.14
BIND 9.14 (a stable branch based on the 9.13 development branch)
includes a number of changes from BIND 9.12 and earlier releases.
New features include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a plugin.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root zone.
* Secondary zones can now be configured as "mirror" zones; their contents
are transferred in as with traditional slave zones, but are subject to
DNSSEC validation and are not treated as authoritative data when
answering. This makes it easier to configure a local copy of the root
zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below which
DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with `libidn2`.
* "named -V" now outputs the default paths for files used by named
and other tools.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See [https://dnsflagday.net](https://dnsflagday.net)
for more details.
Cryptographic support has been modernized. BIND now uses the
best available pseudo-random number generator for the platform on which
it's built. Very old versions of OpenSSL are no longer supported.
Cryptography is now mandatory: building BIND without DNSSEC is no
longer supported.
Special code to support certain legacy operating systems has also
been removed; see the [doc/arm/platforms.rst](platforms) file for details
of supported platforms. In addition to OpenSSL, BIND now requires
support for IPv6, threads, and standard atomic operations provided
by the C compiler.
#### BIND 9.12
BIND 9.12 includes a number of changes from BIND 9.11 and earlier releases.
New features include:
* `named` and related libraries have been substantially refactored for
improved query performance -- particularly on delegation heavy zones --
and for improved readability, maintainability, and testability.
* Code implementing the name server query processing logic has been moved
into a new `libns` library, for easier testing and use in tools other
than `named`.
* Cached, validated NSEC and other records can now be used to synthesize
NXDOMAIN responses.
* The DNS Response Policy Service API (DNSRPS) is now supported.
* Setting `'max-journal-size default'` now limits the size of journal files
to twice the size of the zone.
* `dnstap-read -x` prints a hex dump of the wire format of each logged
DNS message.
* `dnstap` output files can now be configured to roll automatically when
reaching a given size.
* Log file timestamps can now also be formatted in ISO 8601 (local) or ISO
8601 (UTC) formats.
* Logging channels and `dnstap` output files can now be configured to use a
timestamp as the suffix when rolling to a new file.
* `'named-checkconf -l'` lists zones found in `named.conf`.
* Added support for the EDNS Padding and Keepalive options.
* 'new-zones-directory' option sets the location where the configuration
data for zones added by rndc addzone is stored.
* The default key algorithm in `rndc-confgen` is now hmac-sha256.
* `filter-aaaa-on-v4` and `filter-aaaa-on-v6` options are now available
by default without a configure option.
* The obsolete `isc-hmac-fixup` command has been removed.
#### BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
releases. New features include:
- Added support for Catalog Zones, a new method for provisioning servers: a
list of zones to be served is stored in a DNS zone, along with their
configuration parameters. Changes to the catalog zone are propagated to
slaves via normal AXFR/IXFR, whereupon the zones that are listed in it
are automatically added, deleted or reconfigured.
- Added support for "dnstap", a fast and flexible method of capturing and
logging DNS traffic.
- Added support for "dyndb", a new API for loading zone data from an
external database, developed by Red Hat for the FreeIPA project.
- "fetchlimit" quotas are now compiled in by default. These are for the
use of recursive resolvers that are are under high query load for domains
whose authoritative servers are nonresponsive or are experiencing a
denial of service attack:
- "fetches-per-server" limits the number of simultaneous queries that
can be sent to any single authoritative server. The configured value
is a starting point; it is automatically adjusted downward if the
server is partially or completely non-responsive. The algorithm used
to adjust the quota can be configured via the "fetch-quota-params"
option.
- "fetches-per-zone" limits the number of simultaneous queries that can
be sent for names within a single domain. (Note: Unlike
"fetches-per-server", this value is not self-tuning.)
- New stats counters have been added to count queries spilled due to
these quotas.
- Added a new "dnssec-keymgr" key mainenance utility, which can generate or
update keys as needed to ensure that a zone's keys match a defined DNSSEC
policy.
- The experimental "SIT" feature in BIND 9.10 has been renamed "COOKIE" and
is no longer optional. EDNS COOKIE is a mechanism enabling clients to
detect off-path spoofed responses, and servers to detect spoofed-source
queries. Clients that identify themselves using COOKIE options are not
subject to response rate limiting (RRL) and can receive larger UDP
responses.
- SERVFAIL responses can now be cached for a limited time (defaulting to 1
second, with an upper limit of 30). This can reduce the frequency of
retries when a query is persistently failing.
- Added an "nsip-wait-recurse" switch to RPZ. This causes NSIP rules to be
skipped if a name server IP address isn't in the cache yet; the address
will be looked up and the rule will be applied on future queries.
- Added a Python RNDC module. This allows multiple commands to sent over a
persistent RNDC channel, which saves time.
- The "controls" block in named.conf can now grant read-only "rndc" access
to specified clients or keys. Read-only clients could, for example, check
"rndc status" but could not reconfigure or shut down the server.
- "rndc" commands can now return arbitrarily large amounts of text to the
caller.
- The zone serial number of a dynamically updatable zone can now be set via
"rndc signing -serial <number> <zonename>". This allows inline-signing
zones to be set to a specific serial number.
- The new "rndc nta" command can be used to set a Negative Trust Anchor
(NTA), disabling DNSSEC validation for a specific domain; this can be
used when responses from a domain are known to be failing validation due
to administrative error rather than because of a spoofing attack.
Negative trust anchors are strictly temporary; by default they expire
after one hour, but can be configured to last up to one week.
- "rndc delzone" can now be used on zones that were not originally created
by "rndc addzone".
- "rndc modzone" reconfigures a single zone, without requiring the entire
server to be reconfigured.
- "rndc showzone" displays the current configuration of a zone.
- "rndc managed-keys" can be used to check the status of RFC 5011 managed
trust anchors, or to force trust anchors to be refreshed.
- "max-cache-size" can now be set to a percentage of available memory. The
default is 90%.
- Update forwarding performance has been improved by allowing a single TCP
connection to be shared by multiple updates.
- The EDNS Client Subnet (ECS) option is now supported for authoritative
servers; if a query contains an ECS option then ACLs containing "geoip"
or "ecs" elements can match against the the address encoded in the
option. This can be used to select a view for a query, so that different
answers can be provided depending on the client network.
- The EDNS EXPIRE option has been implemented on the client side, allowing
a slave server to set the expiration timer correctly when transferring
zone data from another slave server.
- The key generation and manipulation tools (dnssec-keygen, dnssec-settime,
dnssec-importkey, dnssec-keyfromlabel) now take "-Psync" and "-Dsync"
options to set the publication and deletion times of CDS and CDNSKEY
parent-synchronization records. Both named and dnssec-signzone can now
publish and remove these records at the scheduled times.
- A new "minimal-any" option reduces the size of UDP responses for query
type ANY by returning a single arbitrarily selected RRset instead of all
RRsets.
- A new "masterfile-style" zone option controls the formatting of text zone
files: When set to "full", a zone file is dumped in
single-line-per-record format.
- "serial-update-method" can now be set to "date". On update, the serial
number will be set to the current date in YYYYMMDDNN format.
- "dnssec-signzone -N date" sets the serial number to YYYYMMDDNN.
- "named -L <filename>" causes named to send log messages to the specified
file by default instead of to the system log.
- "dig +ttlunits" prints TTL values with time-unit suffixes: w, d, h, m, s
for weeks, days, hours, minutes, and seconds.
- "dig +unknownformat" prints dig output in RFC 3597 "unknown record"
presentation format.
- "dig +ednsopt" allows dig to set arbitrary EDNS options on requests.
- "dig +ednsflags" allows dig to set yet-to-be-defined EDNS flags on
requests.
- "mdig" is an alternate version of dig which sends multiple pipelined TCP
queries to a server. Instead of waiting for a response after sending a
query, it sends all queries immediately and displays responses in the
order received.
- "serial-query-rate" no longer controls NOTIFY messages. These are
separately controlled by "notify-rate" and "startup-notify-rate".
- "nsupdate" now performs "check-names" processing by default on records to
be added. This can be disabled with "check-names no".
- The statistics channel now supports DEFLATE compression, reducing the
size of the data sent over the network when querying statistics.
- New counters have been added to the statistics channel to track the sizes
of incoming queries and outgoing responses in histogram buckets, as
specified in RSSAC002.
- A new NXDOMAIN redirect method (option "nxdomain-redirect") has been
added, allowing redirection to a specified DNS namespace instead of a
single redirect zone.
- When starting up, named now ensures that no other named process is
already running.
- Files created by named to store information, including "mkeys" and "nzf"
files, are now named after their corresponding views unless the view name
contains characters incompatible with use as a filename. Old style
filenames (based on the hash of the view name) will still work.
#### BIND 9.10.0
BIND 9.10.0 includes a number of changes from BIND 9.9 and earlier
releases. New features include:
- DNS Response-rate limiting (DNS RRL), which blunts the
impact of reflection and amplification attacks, is always
compiled in and no longer requires a compile-time option
to enable it.
- An experimental "Source Identity Token" (SIT) EDNS option
is now available. Similar to DNS Cookies as invented by
Donald Eastlake 3rd, these are designed to enable clients
to detect off-path spoofed responses, and to enable servers
to detect spoofed-source queries. Servers can be configured
to send smaller responses to clients that have not identified
themselves using a SIT option, reducing the effectiveness of
amplification attacks. RRL processing has also been updated;
clients proven to be legitimate via SIT are not subject to
rate limiting. Use "configure --enable-sit" to enable this
feature in BIND.
- A new zone file format, "map", stores zone data in a
format that can be mapped directly into memory, allowing
significantly faster zone loading.
- "delv" (domain entity lookup and validation) is a new tool
with dig-like semantics for looking up DNS data and performing
internal DNSSEC validation. This allows easy validation in
environments where the resolver may not be trustworthy, and
assists with troubleshooting of DNSSEC problems. (NOTE:
In previous development releases of BIND 9.10, this utility
was called "delve". The spelling has been changed to avoid
confusion with the "delve" utility included with the Xapian
search engine.)
- Improved EDNS(0) processing for better resolver performance
and reliability over slow or lossy connections.
- A new "configure --with-tuning=large" option tunes certain
compiled-in constants and default settings to values better
suited to large servers with abundant memory. This can
improve performance on such servers, but will consume more
memory and may degrade performance on smaller systems.
- Substantial improvement in response-policy zone (RPZ)
performance. Up to 32 response-policy zones can be
configured with minimal performance loss.
- To improve recursive resolver performance, cache records
which are still being requested by clients can now be
automatically refreshed from the authoritative server
before they expire, reducing or eliminating the time
window in which no answer is available in the cache.
- New "rpz-client-ip" triggers and drop policies allowing
response policies based on the IP address of the client.
- ACLs can now be specified based on geographic location
using the MaxMind GeoIP databases. Use "configure
--with-geoip" to enable.
- Zone data can now be shared between views, allowing
multiple views to serve the same zones authoritatively
without storing multiple copies in memory.
- New XML schema (version 3) for the statistics channel
includes many new statistics and uses a flattened XML tree
for faster parsing. The older schema is now deprecated.
- A new stylesheet, based on the Google Charts API, displays
XML statistics in charts and graphs on javascript-enabled
browsers.
- The statistics channel can now provide data in JSON
format as well as XML.
- New stats counters track TCP and UDP queries received
per zone, and EDNS options received in total.
- The internal and export versions of the BIND libraries
(libisc, libdns, etc) have been unified so that external
library clients can use the same libraries as BIND itself.
- A new compile-time option, "configure --enable-native-pkcs11",
allows BIND 9 cryptography functions to use the PKCS#11 API
natively, so that BIND can drive a cryptographic hardware
service module (HSM) directly instead of using a modified
OpenSSL as an intermediary. (Note: This feature requires an
HSM to have a full implementation of the PKCS#11 API; many
current HSMs only have partial implementations. The new
"pkcs11-tokens" command can be used to check API completeness.
Native PKCS#11 is known to work with the Thales nShield HSM
and with SoftHSM version 2 from the Open DNSSEC project.)
- The new "max-zone-ttl" option enforces maximum TTLs for
zones. This can simplify the process of rolling DNSSEC keys
by guaranteeing that cached signatures will have expired
within the specified amount of time.
- "dig +subnet" sends an EDNS CLIENT-SUBNET option when
querying.
- "dig +expire" sends an EDNS EXPIRE option when querying.
When this option is sent with an SOA query to a server
that supports it, it will report the expiry time of
a slave zone.
- New "dnssec-coverage" tool to check DNSSEC key coverage
for a zone and report if a lapse in signing coverage has
been inadvertently scheduled.
- Signing algorithm flexibility and other improvements
for the "rndc" control channel.
- "named-checkzone" and "named-compilezone" can now read
journal files, allowing them to process dynamic zones.
- Multiple DLZ databases can now be configured. Individual
zones can be configured to be served from a specific DLZ
database. DLZ databases now serve zones of type "master"
and "redirect".
- "rndc zonestatus" reports information about a specified zone.
- "named" now listens on IPv6 as well as IPv4 interfaces
by default.
- "named" now preserves the capitalization of names
when responding to queries: for instance, a query for
"example.com" may be answered with "example.COM" if the
name was configured that way in the zone file. Some
clients have a bug causing them to depend on the older
behavior, in which the case of the answer always matched
the case of the query, rather than the case of the name
configured in the DNS. Such clients can now be specified
in the new "no-case-compress" ACL; this will restore the
older behavior of "named" for those clients only.
- new "dnssec-importkey" command allows the use of offline
DNSSEC keys with automatic DNSKEY management.
- New "named-rrchecker" tool to verify the syntactic
correctness of individual resource records.
- When re-signing a zone, the new "dnssec-signzone -Q" option
drops signatures from keys that are still published but are
no longer active.
- "named-checkconf -px" will print the contents of configuration
files with the shared secrets obscured, making it easier to
share configuration (e.g. when submitting a bug report)
without revealing private information.
- "rndc scan" causes named to re-scan network interfaces for
changes in local addresses.
- On operating systems with support for routing sockets,
network interfaces are re-scanned automatically whenever
they change.
- "tsig-keygen" is now available as an alternate command
name to use for "ddns-confgen".
#### BIND 9.9.0
BIND 9.9.0 includes a number of changes from BIND 9.8 and earlier
releases. New features include:
- Inline signing, allowing automatic DNSSEC signing of
master zones without modification of the zonefile, or
"bump in the wire" signing in slaves.
- NXDOMAIN redirection.
- New 'rndc flushtree' command clears all data under a given
name from the DNS cache.
- New 'rndc sync' command dumps pending changes in a dynamic
zone to disk without a freeze/thaw cycle.
- New 'rndc signing' command displays or clears signing status
records in 'auto-dnssec' zones.
- NSEC3 parameters for 'auto-dnssec' zones can now be set prior
to signing, eliminating the need to initially sign with NSEC.
- Startup time improvements on large authoritative servers.
- Slave zones are now saved in raw format by default.
- Several improvements to response policy zones (RPZ).
- Improved hardware scalability by using multiple threads
to listen for queries and using finer-grained client locking
- The 'also-notify' option now takes the same syntax as
'masters', so it can used named masterlists and TSIG keys.
- 'dnssec-signzone -D' writes an output file containing only DNSSEC
data, which can be included by the primary zone file.
- 'dnssec-signzone -R' forces removal of signatures that are
not expired but were created by a key which no longer exists.
- 'dnssec-signzone -X' allows a separate expiration date to
be specified for DNSKEY signatures from other signatures.
- New '-L' option to dnssec-keygen, dnssec-settime, and
dnssec-keyfromlabel sets the default TTL for the key.
- dnssec-dsfromkey now supports reading from standard input,
to make it easier to convert DNSKEY to DS.
- RFC 1918 reverse zones have been added to the empty-zones
table per RFC 6303.
- Dynamic updates can now optionally set the zone's SOA serial
number to the current UNIX time.
- DLZ modules can now retrieve the source IP address of
the querying client.
- 'request-ixfr' option can now be set at the per-zone level.
- 'dig +rrcomments' turns on comments about DNSKEY records,
indicating their key ID, algorithm and function
- Simplified nsupdate syntax and added readline support
#### BIND 9.8.0
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
releases. New features include:
- Built-in trust anchor for the root zone, which can be
switched on via "dnssec-validation auto;"
- Support for DNS64.
- Support for response policy zones (RPZ).
- Support for writable DLZ zones.
- Improved ease of configuration of GSS/TSIG for
interoperability with Active Directory
- Support for GOST signing algorithm for DNSSEC.
- Removed RTT Banding from server selection algorithm.
- New "static-stub" zone type.
- Allow configuration of resolver timeouts via
"resolver-query-timeout" option.
- The DLZ "dlopen" driver is now built by default.
- Added a new include file with function typedefs
for the DLZ "dlopen" driver.
- Made "--with-gssapi" default.
- More verbose error reporting from DLZ LDAP.
#### BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases. Most are intended to simplify DNSSEC configuration.
New features include:
- Fully automatic signing of zones by "named".
- Simplified configuration of DNSSEC Lookaside Validation (DLV).
- Simplified configuration of Dynamic DNS, using the "ddns-confgen"
command line tool or the "local" update-policy option. (As a side
effect, this also makes it easier to configure automatic zone
re-signing.)
- New named option "attach-cache" that allows multiple views to
share a single cache.
- DNS rebinding attack prevention.
- New default values for dnssec-keygen parameters.
- Support for RFC 5011 automated trust anchor maintenance
- Smart signing: simplified tools for zone signing and key
maintenance.
- The "statistics-channels" option is now available on Windows.
- A new DNSSEC-aware libdns API for use by non-BIND9 applications
- On some platforms, named and other binaries can now print out
a stack backtrace on assertion failure, to aid in debugging.
- A "tools only" installation mode on Windows, which only installs
dig, host, nslookup and nsupdate.
- Improved PKCS#11 support, including Keyper support and explicit
OpenSSL engine selection.
#### BIND 9.6.0
- Full NSEC3 support
- Automatic zone re-signing
- New update-policy methods tcp-self and 6to4-self
- The BIND 8 resolver library, libbind, has been removed from the BIND 9
distribution and is now available as a separate download.
- Change the default pid file location from /var/run to
/var/run/{named,lwresd} for improved chroot/setuid support.
#### BIND 9.5.0
- GSS-TSIG support (RFC 3645).
- DHCID support.
- Experimental http server and statistics support for named via xml.
- More detailed statistics counters including those supported in BIND 8.
- Faster ACL processing.
- Use Doxygen to generate internal documentation.
- Efficient LRU cache-cleaning mechanism.
- NSID support.
BIND 9.4.0
- Implemented "additional section caching (or acache)", an internal cache
framework for additional section content to improve response performance.
Several configuration options were provided to control the behavior.
- New notify type 'master-only'. Enable notify for master zones only.
- Accept 'notify-source' style syntax for query-source.
- rndc now allows addresses to be set in the server clauses.
- New option "allow-query-cache". This lets "allow-query" be used to
specify the default zone access level rather than having to have every
zone override the global value. "allow-query-cache" can be set at both
the options and view levels. If "allow-query-cache" is not set then
"allow-recursion" is used if set, otherwise "allow-query" is used if set
unless "recursion no;" is set in which case "none;" is used, otherwise
the default (localhost; localnets;) is used.
- rndc: the source address can now be specified.
- ixfr-from-differences now takes master and slave in addition to yes and
no at the options and view levels.
- Allow the journal's name to be changed via named.conf.
- 'rndc notify zone [class [view]]' resend the NOTIFY messages for the
specified zone.
- 'dig +trace' now randomly selects the next servers to try. Report if
there is a bad delegation.
- Improve check-names error messages.
- Make public the function to read a key file, dst_key_read_public().
- dig now returns the byte count for axfr/ixfr.
- allow-update is now settable at the options / view level.
- named-checkconf now checks the logging configuration.
- host now can turn on memory debugging flags with '-m'.
- Don't send notify messages to self.
- Perform sanity checks on NS records which refer to 'in zone' names.
- New zone option "notify-delay". Specify a minimum delay between sets of
NOTIFY messages.
- Extend adjusting TTL warning messages.
- Named and named-checkzone can now both check for non-terminal wildcard
records.
- "rndc freeze/thaw" now freezes/thaws all zones.
- named-checkconf now check acls to verify that they only refer to existing
acls.
- The server syntax has been extended to support a range of servers.
- Report differences between hints and real NS rrset and associated address
records.
- Preserve the case of domain names in rdata during zone transfers.
- Restructured the data locking framework using architecture dependent
atomic operations (when available), improving response performance on
multi-processor machines significantly. x86, x86_64, alpha, powerpc, and
mips are currently supported.
- UNIX domain controls are now supported.
- Add support for additional zone file formats for improving loading
performance. The masterfile-format option in named.conf can be used to
specify a non-default format. A separate command named-compilezone was
provided to generate zone files in the new format. Additionally, the -I
and -O options for dnssec-signzone specify the input and output formats.
- dnssec-signzone can now randomize signature end times (dnssec-signzone -j
jitter).
- Add support for CH A record.
- Add additional zone data constancy checks. named-checkzone has extended
checking of NS, MX and SRV record and the hosts they reference. named
has extended post zone load checks. New zone options: check-mx and
integrity-check.
- edns-udp-size can now be overridden on a per server basis.
- dig can now specify the EDNS version when making a query.
- Added framework for handling multiple EDNS versions.
- Additional memory debugging support to track size and mctx arguments.
- Detect duplicates of UDP queries we are recursing on and drop them. New
stats category "duplicates".
- "USE INTERNAL MALLOC" is now runtime selectable.
- The lame cache is now done on a <qname,qclass,qtype> basis as some
servers only appear to be lame for certain query types.
- Limit the number of recursive clients that can be waiting for a single
query (<qname,qtype,qclass>) to resolve. New options clients-per-query
and max-clients-per-query.
- dig: report the number of extra bytes still left in the packet after
processing all the records.
- Support for IPSECKEY rdata type.
- Raise the UDP receive buffer size to 32k if it is less than 32k.
- x86 and x86_64 now have separate atomic locking implementations.
- named-checkconf now validates update-policy entries.
- Attempt to make the amount of work performed in a iteration self tuning.
The covers nodes clean from the cache per iteration, nodes written to
disk when rewriting a master file and nodes destroyed per iteration when
destroying a zone or a cache.
- ISC string copy API.
- Automatic empty zone creation for D.F.IP6.ARPA and friends. Note: RFC
1918 zones are not yet covered by this but are likely to be in a future
release.
- New options: empty-server, empty-contact, empty-zones-enable and
disable-empty-zone.
- dig now has a '-q queryname' and '+showsearch' options.
- host/nslookup now continue (default)/fail on SERVFAIL.
- dig now warns if 'RA' is not set in the answer when 'RD' was set in the
query. host/nslookup skip servers that fail to set 'RA' when 'RD' is set
unless a server is explicitly set.
- Integrate contributed DLZ code into named.
- Integrate contributed IDN code from JPNIC.
- libbind: corresponds to that from BIND 8.4.7.
#### BIND 9.3.0
- DNSSEC is now DS based (RFC 3658).
- DNSSEC lookaside validation.
- check-names is now implemented.
- rrset-order is more complete.
- IPv4/IPv6 transition support, dual-stack-servers.
- IXFR deltas can now be generated when loading master files,
ixfr-from-differences.
- It is now possible to specify the size of a journal, max-journal-size.
- It is now possible to define a named set of master servers to be used in
masters clause, masters.
- The advertised EDNS UDP size can now be set, edns-udp-size.
- allow-v6-synthesis has been obsoleted.
- Zones containing MD and MF will now be rejected.
- dig, nslookup name. now report "Not Implemented" as NOTIMP rather than
NOTIMPL. This will have impact on scripts that are looking for NOTIMPL.
- libbind: corresponds to that from BIND 8.4.5.
#### BIND 9.2.0
- The size of the cache can now be limited using the "max-cache-size"
option.
- The server can now automatically convert RFC1886-style recursive lookup
requests into RFC2874-style lookups, when enabled using the new option
"allow-v6-synthesis". This allows stub resolvers that support AAAA
records but not A6 record chains or binary labels to perform lookups in
domains that make use of these IPv6 DNS features.
- Performance has been improved.
- The man pages now use the more portable "man" macros rather than the
"mandoc" macros, and are installed by "make install".
- The named.conf parser has been completely rewritten. It now supports
"include" directives in more places such as inside "view" statements, and
it no longer has any reserved words.
- The "rndc status" command is now implemented.
- rndc can now be configured automatically.
- A BIND 8 compatible stub resolver library is now included in lib/bind.
- OpenSSL has been removed from the distribution. This means that to use
DNSSEC, OpenSSL must be installed and the --with-openssl option must be
supplied to configure. This does not apply to the use of TSIG, which
does not require OpenSSL.
- The source distribution now builds on Windows. See
win32utils/readme1.txt and win32utils/win32-build.txt for details.
- This distribution also includes a new lightweight stub resolver library
and associated resolver daemon that fully support forward and reverse
lookups of both IPv4 and IPv6 addresses. This library is considered
experimental and is not a complete replacement for the BIND 8 resolver
library. Applications that use the BIND 8 `res_*` functions to perform
DNS lookups or dynamic updates still need to be linked against the BIND 8
libraries. For DNS lookups, they can also use the new "getrrsetbyname()"
API.
- BIND 9.2 is capable of acting as an authoritative server for DNSSEC
secured zones. This functionality is believed to be stable and complete
except for lacking support for verifications involving wildcard records
in secure zones.
- When acting as a caching server, BIND 9.2 can be configured to perform
DNSSEC secure resolution on behalf of its clients. This part of the
DNSSEC implementation is still considered experimental. For detailed
information about the state of the DNSSEC implementation, see the file
doc/misc/dnssec.

15
Kyuafile Normal file
View File

@@ -0,0 +1,15 @@
-- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
--
-- SPDX-License-Identifier: MPL-2.0
--
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, you can obtain one at https://mozilla.org/MPL/2.0/.
--
-- See the COPYRIGHT file distributed with this work for additional
-- information regarding copyright ownership.
syntax(2)
test_suite('bind9')
include('lib/Kyuafile')

View File

@@ -1 +0,0 @@
As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program.

View File

@@ -1,117 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice

View File

@@ -1,30 +0,0 @@
include $(top_srcdir)/Makefile.top
SUBDIRS = . lib doc
# build libtest before fuzz/* and bin/tests
SUBDIRS += tests
# run fuzz tests before system tests
SUBDIRS += fuzz bin
BUILT_SOURCES += bind.keys.h
CLEANFILES += bind.keys.h
bind.keys.h: bind.keys Makefile
${PERL} ${top_srcdir}/util/bindkeys.pl ${top_srcdir}/bind.keys > $@
.PHONY: doc
EXTRA_DIST = \
bind.keys \
util/bindkeys.pl \
util/dtrace.sh \
contrib \
COPYRIGHT \
LICENSE \
*.md
dist-hook:
find $(distdir) -type f -name .gitignore -delete
git rev-parse --short HEAD | cut -b1-7 > $(distdir)/srcid

View File

@@ -1,59 +0,0 @@
SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
SPHINX_V_1 = -n
SPHINX_W = -W
AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@)
AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@)
AM_V_SPHINX_0 = @echo " SPHINX $@";
SPHINXBUILDDIR = $(builddir)/_build
LF = \n
RNDC_CONF = .. |rndc_conf| replace:: ``$(sysconfdir)/rndc.conf``
RNDC_KEY = .. |rndc_key| replace:: ``$(sysconfdir)/rndc.key``
NAMED_CONF = .. |named_conf| replace:: ``$(sysconfdir)/named.conf``
NAMED_PID = .. |named_pid| replace:: ``$(runstatedir)/named.pid``
SESSION_KEY = .. |session_key| replace:: ``$(runstatedir)/session.key``
export RST_EPILOG = $(RNDC_CONF)$(LF)$(RNDC_KEY)$(LF)$(NAMED_CONF)$(LF)$(BIND_KEYS)$(LF)$(NAMED_PID)$(LF)$(SESSION_KEY)
common_SPHINXOPTS = \
$(SPHINX_W) \
-c $(srcdir) \
-a \
$(SPHINX_V)
ALLSPHINXOPTS = \
$(common_SPHINXOPTS) \
-D rst_epilog="$$(printf "$${RST_EPILOG}")" \
$(SPHINXOPTS) \
$(srcdir)
_ = @
man_RNDC_CONF = .. |rndc_conf| replace:: ``$(_)sysconfdir$(_)/rndc.conf``
man_RNDC_KEY = .. |rndc_key| replace:: ``$(_)sysconfdir$(_)/rndc.key``
man_NAMED_CONF = .. |named_conf| replace:: ``$(_)sysconfdir$(_)/named.conf``
man_BIND_KEYS = .. |bind_keys| replace:: ``$(_)sysconfdir$(_)/bind.keys``
man_NAMED_PID = .. |named_pid| replace:: ``$(_)runstatedir$(_)/named.pid``
man_SESSION_KEY = .. |session_key| replace:: ``$(_)runstatedir$(_)/session.key``
export man_RST_EPILOG = $(man_RNDC_CONF)$(LF)$(man_RNDC_KEY)$(LF)$(man_NAMED_CONF)$(LF)$(man_BIND_KEYS)$(LF)$(man_NAMED_PID)$(LF)$(man_SESSION_KEY)
man_SPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="@""PACKAGE_VERSION@" \
-D today="@""RELEASE_DATE@" \
-D release="@""PACKAGE_VERSION@" \
-D rst_epilog="$$(printf "$${man_RST_EPILOG}")" \
$(SPHINXOPTS) \
$(srcdir)
AM_V_SED = $(AM_V_SED_@AM_V@)
AM_V_SED_ = $(AM_V_SED_@AM_DEFAULT_V@)
AM_V_SED_0 = @echo " SED $@";
AM_V_CFG_TEST = $(AM_V_CFG_TEST_@AM_V@)
AM_V_CFG_TEST_ = $(AM_V_CFG_TEST_@AM_DEFAULT_V@)
AM_V_CFG_TEST_0 = @echo " CFG_GEN $@";

View File

@@ -1,20 +0,0 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
AM_V_DTRACE = $(AM_V_DTRACE_@AM_V@)
AM_V_DTRACE_ = $(AM_V_DTRACE_@AM_DEFAULT_V@)
AM_V_DTRACE_0 = @echo " DTRACE $@";
BUILT_SOURCES += probes.h
CLEANFILES += probes.h probes.o
probes.h: Makefile probes.d
$(AM_V_DTRACE)$(DTRACE) -s $(srcdir)/probes.d -h -o $@
probes.lo: Makefile probes.d $(DTRACE_DEPS)
$(AM_V_DTRACE)$(LIBTOOL) --mode=compile --tag=CC $(DTRACE) -s $(srcdir)/probes.d -G -o $@ $(DTRACE_OBJS)
if HAVE_DTRACE
if !HOST_MACOS
DTRACE_LIBADD = probes.lo
endif
endif

111
Makefile.in Normal file
View File

@@ -0,0 +1,111 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
PANDOC = @PANDOC@
W3M = @W3M@
VERSION=@BIND9_VERSION@
SUBDIRS = make lib fuzz bin doc
TARGETS =
PREREQS = bind.keys.h
MANOBJS = README HISTORY OPTIONS CONTRIBUTING CODE_OF_CONDUCT
@BIND9_MAKE_RULES@
newrr:
cd lib/dns; ${MAKE} newrr
bind.keys.h: ${top_srcdir}/bind.keys ${srcdir}/util/bindkeys.pl
${PERL} ${srcdir}/util/bindkeys.pl < ${top_srcdir}/bind.keys > $@
distclean::
rm -f config.cache config.h config.log config.status TAGS
rm -f libtool configure.lineno
rm -f util/conf.sh docutil/docbook2man-wrapper.sh
# XXX we should clean libtool stuff too. Only do this after we add rules
# to make it.
maintainer-clean::
rm -f configure
rm -f bind.keys.h
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
doc man:: ${MANOBJS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sysconfdir}
install:: installdirs
${INSTALL_DATA} ${top_srcdir}/bind.keys ${DESTDIR}${sysconfdir}
uninstall::
rm -f ${DESTDIR}${sysconfdir}/bind.keys
test check:
@if test -n "`${PERL} ${top_srcdir}/bin/tests/system/testsock.pl 2>/dev/null || echo fail`"; then \
echo I: NOTE: The tests were not run because they require that; \
echo I: the IP addresses 10.53.0.1 through 10.53.0.8 are configured; \
echo I: as alias addresses on the loopback interface. Please run; \
echo I: \'bin/tests/system/ifconfig.sh up\' as root to configure; \
echo I: them, then rerun the tests. Run make force-test to run the; \
echo I: tests anyway.; \
exit 1; \
fi
${MAKE} test-force
force-test: test-force
test-force:
status=0; \
(cd fuzz && ${MAKE} check) || status=1; \
(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
(test -f ${top_builddir}/unit/unittest.sh && \
$(SHELL) ${top_builddir}/unit/unittest.sh) || status=1; \
exit $$status
README: README.md
${PANDOC} --email-obfuscation=none -s --metadata title="README" -f markdown-smart -t html README.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
HISTORY: HISTORY.md
${PANDOC} --email-obfuscation=none -s --metadata title="HISTORY" -f markdown-smart -t html HISTORY.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
OPTIONS: OPTIONS.md
${PANDOC} --email-obfuscation=none -s --metadata title="OPTIONS" -f markdown-smart -t html OPTIONS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CONTRIBUTING: CONTRIBUTING.md
${PANDOC} --email-obfuscation=none -s --metadata title="CONTRIBUTING" -f markdown-smart -t html CONTRIBUTING.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CODE_OF_CONDUCT: CODE_OF_CONDUCT.md
${PANDOC} --email-obfuscation=none -s --metadata title="CODE OF CONDUCT" -f markdown-smart -t html CODE_OF_CONDUCT.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
unit::
sh ${top_builddir}/unit/unittest.sh
clean::

View File

@@ -1,28 +0,0 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
unit-local: check
if HAVE_CMOCKA
TESTS = $(check_PROGRAMS)
endif HAVE_CMOCKA
LOG_COMPILER = $(top_builddir)/tests/unit-test-driver.sh
AM_CFLAGS += \
-I$(top_srcdir)/tests/include \
$(TEST_CFLAGS)
AM_CPPFLAGS += \
$(CMOCKA_CFLAGS) \
-DNAMED_PLUGINDIR=\"$(pkglibdir)\" \
-DTESTS_DIR=\"$(abs_srcdir)\"
LDADD += \
$(top_builddir)/tests/libtest/libtest.la \
$(CMOCKA_LIBS)
if HAVE_JEMALLOC
AM_CFLAGS += $(JEMALLOC_CFLAGS)
LDADD += $(JEMALLOC_LIBS)
endif

View File

@@ -1,73 +0,0 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
AM_CFLAGS = \
$(STD_CFLAGS)
AM_CPPFLAGS = \
$(STD_CPPFLAGS) \
-include $(top_builddir)/config.h \
-I$(srcdir)/include
AM_LDFLAGS = \
$(STD_LDFLAGS)
LDADD =
BUILT_SOURCES =
CLEANFILES =
if HOST_MACOS
AM_LDFLAGS += \
-Wl,-flat_namespace
endif HOST_MACOS
if HAVE_JEMALLOC
LIBISC_CFLAGS = $(JEMALLOC_CFLAGS)
LIBISC_LIBS = $(JEMALLOC_LIBS)
else
LIBISC_CFLAGS =
LIBISC_LIBS =
endif
LIBISC_CFLAGS += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/isc/include \
-I$(top_builddir)/lib/isc/include
LIBISC_LIBS += $(top_builddir)/lib/isc/libisc.la
if HAVE_DTRACE
LIBISC_DTRACE = $(top_builddir)/lib/isc/probes.lo
endif
LIBDNS_CFLAGS = \
-I$(top_srcdir)/lib/dns/include \
-I$(top_builddir)/lib/dns/include
LIBDNS_LIBS = \
$(top_builddir)/lib/dns/libdns.la
if HAVE_DTRACE
LIBDNS_DTRACE = $(top_builddir)/lib/dns/probes.lo
endif
LIBNS_CFLAGS = \
-I$(top_srcdir)/lib/ns/include
LIBNS_LIBS = \
$(top_builddir)/lib/ns/libns.la
if HAVE_DTRACE
LIBNS_DTRACE = $(top_builddir)/lib/ns/probes.lo
endif
LIBISCCFG_CFLAGS = \
-I$(top_srcdir)/lib/isccfg/include
LIBISCCFG_LIBS = \
$(top_builddir)/lib/isccfg/libisccfg.la
LIBISCCC_CFLAGS = \
-I$(top_srcdir)/lib/isccc/include/
LIBISCCC_LIBS = \
$(top_builddir)/lib/isccc/libisccc.la

1
NEWS
View File

@@ -1 +0,0 @@
doc/arm/changelog.rst

28
OPTIONS Normal file
View File

@@ -0,0 +1,28 @@
OPTIONS
Setting the STD_CDEFINES environment variable before running configure can
be used to enable certain compile-time options that are not explicitly
defined in configure.
Some of these settings are:
Setting Description
Overwrite memory with tag values when allocating
-DISC_MEM_DEFAULTFILL=1 or freeing it; this impairs performance but
makes debugging of memory problems easier.
Don't track memory allocations by file and line
-DISC_MEM_TRACKLINES=0 number; this improves performance but makes
debugging more difficult.
-DISC_FACILITY=LOG_LOCAL0 Change the default syslog facility for named
-DNS_CLIENT_DROPPORT=0 Disable dropping queries from particular
well-known ports:
-DCHECK_SIBLING=0 Don't check sibling glue in named-checkzone
-DCHECK_LOCAL=0 Don't check out-of-zone addresses in
named-checkzone
-DNS_RUN_PID_DIR=0 Create default PID files in ${localstatedir}/run
rather than ${localstatedir}/run/named/
Disable the use of inline functions to implement
-DISC_BUFFER_USEINLINE=0 the isc_buffer API: this reduces performance but
may be useful when debugging
-DISC_HEAP_CHECK Test heap consistency after every heap
operation; used when debugging

View File

@@ -10,20 +10,20 @@ file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
Setting the `CPPFLAGS` environment variable before running `configure`
can be used to enable certain compile-time options that are not
explicitly defined in `configure`.
Setting the `STD_CDEFINES` environment variable before running `configure`
can be used to enable certain compile-time options that are not explicitly
defined in `configure`.
Some of these settings are:
| Setting | Description |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `-DCHECK_LOCAL=0` | Don't check out-of-zone addresses in `named-checkzone` |
| `-DCHECK_SIBLING=0` | Don't check sibling glue in `named-checkzone` |
| `-DISC_FACILITY=LOG_LOCAL0` | Change the default syslog facility for `named` |
| `-DISC_HEAP_CHECK` | Test heap consistency after every heap operation; used when debugging |
| `-DISC_MEM_DEFAULTFILL=1` | Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier |
| `-DISC_MEM_TRACKLINES=0` | Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult |
| `-DNAMED_RUN_PID_DIR=0` | Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/` |
| `-DNS_CLIENT_DROPPORT=0` | Disable dropping queries from particular well-known ports |
| `-DOPENSSL_API_COMPAT=10100` | Build using the deprecated OpenSSL APIs so that the `engine` API is available when building with OpenSSL 3.0.0 for PKCS#11 support |
|Setting |Description |
|-----------------------------------|----------------------------------------|
|`-DISC_MEM_DEFAULTFILL=1`|Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier.|
|`-DISC_MEM_TRACKLINES=0`|Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult.|
|<nobr>`-DISC_FACILITY=LOG_LOCAL0`</nobr>|Change the default syslog facility for `named`|
|`-DNS_CLIENT_DROPPORT=0`|Disable dropping queries from particular well-known ports:|
|`-DCHECK_SIBLING=0`|Don't check sibling glue in `named-checkzone`|
|`-DCHECK_LOCAL=0`|Don't check out-of-zone addresses in `named-checkzone`|
|`-DNS_RUN_PID_DIR=0`|Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/`|
|`-DISC_BUFFER_USEINLINE=0`|Disable the use of inline functions to implement the `isc_buffer` API: this reduces performance but may be useful when debugging |
|`-DISC_HEAP_CHECK`|Test heap consistency after every heap operation; used when debugging|

244
README Normal file
View File

@@ -0,0 +1,244 @@
README
BIND 9
Contents
1. Introduction
2. Reporting bugs and getting help
3. Contributing to BIND
4. BIND 9.16 features
5. Building BIND
6. macOS
7. Dependencies
8. Compile-time options
9. Automated testing
10. Documentation
11. Change log
12. Acknowledgments
Introduction
BIND (Berkeley Internet Name Domain) is a complete, highly portable
implementation of the DNS (Domain Name System) protocol.
The BIND name server, named, is able to serve as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
implements views for split-horizon DNS, automatic DNSSEC zone signing and
key management, catalog zones to facilitate provisioning of zone data
throughout a name server constellation, response policy zones (RPZ) to
protect clients from malicious data, response rate limiting (RRL) and
recursive query limits to reduce distributed denial of service attacks,
and many other advanced DNS features. BIND also includes a suite of
administrative tools, including the dig and delv DNS lookup tools,
nsupdate for dynamic DNS zone updates, rndc for remote name server
administration, and more.
BIND 9 began as a complete re-write of the BIND architecture that was used
in versions 4 and 8. Internet Systems Consortium (https://www.isc.org), a
501(c)(3) public benefit corporation dedicated to providing software and
services in support of the Internet infrastructure, developed BIND 9 and
is responsible for its ongoing maintenance and improvement. BIND is open
source software licensed under the terms of the Mozilla Public License,
version 2.0.
For a summary of features introduced in past major releases of BIND, see
the file HISTORY.
For a detailed list of changes made throughout the history of BIND 9, see
the file CHANGES. See below for details on the CHANGES file format.
For up-to-date versions and release notes, see https://www.isc.org/
download/.
For information about supported platforms, see the "Supported Platforms"
section in the BIND 9 Administrator Reference Manual.
Reporting bugs and getting help
To report non-security-sensitive bugs or request new features, you may
open an Issue in the BIND 9 project on the ISC GitLab server at https://
gitlab.isc.org/isc-projects/bind9.
Please note that, unless you explicitly mark the newly created Issue as
"confidential", it will be publicly readable. Please do not include any
information in bug reports that you consider to be confidential unless the
issue has been marked as such. In particular, if submitting the contents
of your configuration file in a non-confidential Issue, it is advisable to
obscure key secrets: this can be done automatically by using
named-checkconf -px.
If the bug you are reporting is a potential security issue, such as an
assertion failure or other crash in named, please do NOT use GitLab to
report it. Instead, send mail to security-officer@isc.org using our
OpenPGP key to secure your message. (Information about OpenPGP and links
to our key can be found at https://www.isc.org/pgpkey.) Please do not
discuss the bug on any public mailing list.
For a general overview of ISC security policies, read the Knowledge Base
article at https://kb.isc.org/docs/aa-00861.
Professional support and training for BIND are available from ISC at
https://www.isc.org/support.
To join the BIND Users mailing list, or view the archives, visit https://
lists.isc.org/mailman/listinfo/bind-users.
If you're planning on making changes to the BIND 9 source code, you may
also want to join the BIND Workers mailing list, at https://lists.isc.org/
mailman/listinfo/bind-workers.
Contributing to BIND
ISC maintains a public git repository for BIND; details can be found at
http://www.isc.org/git/.
Information for BIND contributors can be found in the following files: -
General information: CONTRIBUTING.md - Code of Conduct: CODE_OF_CONDUCT.md
- BIND 9 code style: doc/dev/style.md - BIND architecture and developer
guide: doc/dev/dev.md
Patches for BIND may be submitted as merge requests in the ISC GitLab
server at at https://gitlab.isc.org/isc-projects/bind9/merge_requests.
By default, external contributors don't have ability to fork BIND in the
GitLab server, but if you wish to contribute code to BIND, you may request
permission to do so. Thereafter, you can create git branches and directly
submit requests that they be reviewed and merged.
If you prefer, you may also submit code by opening a GitLab Issue and
including your patch as an attachment, preferably generated by git
format-patch.
BIND 9.16 features
BIND 9.16 is the current stable branch of BIND 9. It includes all changes
from the 9.15 development branch, updating the previous stable branch,
9.14. New features include:
* New dnssec-policy statement to configure a key and signing policy for
zones, enabling automatic key regeneration and rollover.
* New network manager based on libuv.
* Added support for the new GeoIP2 geolocation API, libmaxminddb.
* Improved DNSSEC trust anchor configuration using the trust-anchors
statement, permitting configuration of trust anchors in DS as well as
DNSKEY format.
* YAML output for dig, mdig, and delv.
Building BIND
For information about building BIND 9, see the "Building BIND 9" section
in the BIND 9 Administrator Reference Manual.
Automated testing
A system test suite can be run with make test. The system tests require
you to configure a set of virtual IP addresses on your system (this allows
multiple servers to run locally and communicate with one another). These
IP addresses can be configured by running the command bin/tests/system/
ifconfig.sh up as root.
Some tests require Perl and the Net::DNS and/or IO::Socket::INET6 modules,
and will be skipped if these are not available. Some tests require Python
and the dnspython module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework. To
build them, use configure --with-cmocka. Execution of tests is done by the
Kyua test execution engine; if the kyua command is available, then unit
tests can be run via make test or make unit.
Documentation
The BIND 9 Administrator Reference Manual is included with the source
distribution, in DocBook XML, HTML, and PDF format, in the doc/arm
directory.
Some of the programs in the BIND 9 distribution have man pages in their
directories. In particular, the command line options of named are
documented in bin/named/named.8.
Frequently (and not-so-frequently) asked questions and their answers can
be found in the ISC Knowledge Base at https://kb.isc.org.
Additional information on various subjects can be found in other README
files throughout the source tree.
Change log
A detailed list of all changes that have been made throughout the
development BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
the change that was made; these categories are:
Category Description
[func] New feature
[bug] General bug fix
[security] Fix for a significant security flaw
[experimental] Used for new features when the syntax or other aspects of
the design are still in flux and may change
[port] Portability enhancement
[maint] Updates to built-in data such as root server addresses and
keys
[tuning] Changes to built-in configuration defaults and constants to
improve performance
[performance] Other changes to improve server performance
[protocol] Updates to the DNS protocol such as new RR types
[test] Changes to the automatic tests, not affecting server
functionality
[cleanup] Minor corrections and refactoring
[doc] Documentation
[contrib] Changes to the contributed tools and libraries in the
'contrib' subdirectory
Used in the main development branch to reserve change
[placeholder] numbers for use in other branches, e.g., when fixing a bug
that only exists in older releases
In general, [func] and [experimental] tags will only appear in new-feature
releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
Bug report identifiers
Most notes in the CHANGES file include a reference to a bug report or
issue number. Prior to 2018, these were usually of the form [RT #NNN] and
referred to entries in the "bind9-bugs" RT database, which was not open to
the public. More recent entries use the form [GL #NNN] or, less often, [GL
!NNN], which, respectively, refer to issues or merge requests in the
GitLab database. Most of these are publicly readable, unless they include
information which is confidential or security sensitive.
To look up a GitLab issue by its number, use the URL https://
gitlab.isc.org/isc-projects/bind9/issues/NNN. To look up a merge request,
use https://gitlab.isc.org/isc-projects/bind9/merge_requests/NNN.
In rare cases, an issue or merge request number may be followed with the
letter "P". This indicates that the information is in the private ISC
GitLab instance, which is not visible to the public.
Acknowledgments
* The original development of BIND 9 was underwritten by the following
organizations:
Sun Microsystems, Inc.
Hewlett Packard
Compaq Computer Corporation
IBM
Process Software Corporation
Silicon Graphics, Inc.
Network Associates, Inc.
U.S. Defense Information Systems Agency
USENIX Association
Stichting NLnet - NLnet Foundation
Nominum, Inc.
* This product includes software developed by the OpenSSL Project for
use in the OpenSSL Toolkit. http://www.OpenSSL.org/
* This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com)
* This product includes software written by Tim Hudson
(tjh@cryptsoft.com)

164
README.md
View File

@@ -17,38 +17,47 @@ information regarding copyright ownership.
1. [Introduction](#intro)
1. [Reporting bugs and getting help](#help)
1. [Contributing to BIND](#contrib)
1. [BIND 9.16 features](#features)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
1. [Compile-time options](#opts)
1. [Automated testing](#testing)
1. [Documentation](#doc)
1. [Change log](#changes)
1. [Acknowledgments](#ack)
### <a name="intro"/> Introduction
BIND (Berkeley Internet Name Domain) is a complete, highly portable
implementation of the Domain Name System (DNS) protocol.
implementation of the DNS (Domain Name System) protocol.
The BIND name server, `named`, can act as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
The BIND name server, `named`, is able to serve as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
implements views for split-horizon DNS, automatic DNSSEC zone signing and
key management, catalog zones to facilitate provisioning of zone data
throughout a name server constellation, response policy zones (RPZ) to
protect clients from malicious data, response rate limiting (RRL) and
recursive query limits to reduce distributed denial of service attacks,
and many other advanced DNS features. BIND also includes a suite of
and many other advanced DNS features. BIND also includes a suite of
administrative tools, including the `dig` and `delv` DNS lookup tools,
`nsupdate` for dynamic DNS zone updates, `rndc` for remote name server
administration, and more.
BIND 9 began as a complete rewrite of the BIND architecture that was
BIND 9 began as a complete re-write of the BIND architecture that was
used in versions 4 and 8. Internet Systems Consortium
([https://www.isc.org](https://www.isc.org)), a 501(c)(3) US public benefit
([https://www.isc.org](https://www.isc.org)), a 501(c)(3) public benefit
corporation dedicated to providing software and services in support of the
Internet infrastructure, developed BIND 9 and is responsible for its
ongoing maintenance and improvement. BIND is open source software
ongoing maintenance and improvement. BIND is open source software
licensed under the terms of the Mozilla Public License, version 2.0.
For a summary of features introduced in past major releases of BIND,
see the file [HISTORY](HISTORY.md).
For a detailed list of changes made throughout the history of BIND 9, see
the [changelog](doc/arm/changelog.rst).
the file [CHANGES](CHANGES). See [below](#changes) for details on the
CHANGES file format.
For up-to-date versions and release notes, see
[https://www.isc.org/download/](https://www.isc.org/download/).
@@ -60,25 +69,32 @@ Administrator Reference Manual.
### <a name="help"/> Reporting bugs and getting help
To report non-security-sensitive bugs or request new features, you may
open an issue in the BIND 9 project on the
open an Issue in the BIND 9 project on the
[ISC GitLab server](https://gitlab.isc.org) at
[https://gitlab.isc.org/isc-projects/bind9](https://gitlab.isc.org/isc-projects/bind9).
Please note that, unless you explicitly mark the newly created issue as
"confidential," it will be publicly readable. Please do not include any
Please note that, unless you explicitly mark the newly created Issue as
"confidential", it will be publicly readable. Please do not include any
information in bug reports that you consider to be confidential unless
the issue has been marked as such. In particular, if submitting the
contents of your configuration file in a non-confidential issue, it is
advisable to obscure key secrets; this can be done automatically by
the issue has been marked as such. In particular, if submitting the
contents of your configuration file in a non-confidential Issue, it is
advisable to obscure key secrets: this can be done automatically by
using `named-checkconf -px`.
For information about ISC's Security Vulnerability Disclosure Policy and
information about reporting potential security issues, please see
`SECURITY.md`.
If the bug you are reporting is a potential security issue, such as an
assertion failure or other crash in `named`, please do *NOT* use GitLab to
report it. Instead, send mail to
[security-officer@isc.org](mailto:security-officer@isc.org) using our
OpenPGP key to secure your message. (Information about OpenPGP and links
to our key can be found at
[https://www.isc.org/pgpkey](https://www.isc.org/pgpkey).) Please do not
discuss the bug on any public mailing list.
For a general overview of ISC security policies, read the Knowledge Base
article at [https://kb.isc.org/docs/aa-00861](https://kb.isc.org/docs/aa-00861).
Professional support and training for BIND are available from
ISC. Contact us at [https://www.isc.org/contact](https://www.isc.org/contact)
for more information.
ISC at [https://www.isc.org/support](https://www.isc.org/support).
To join the __BIND Users__ mailing list, or view the archives, visit
[https://lists.isc.org/mailman/listinfo/bind-users](https://lists.isc.org/mailman/listinfo/bind-users).
@@ -90,7 +106,7 @@ may also want to join the __BIND Workers__ mailing list, at
### <a name="contrib"/> Contributing to BIND
ISC maintains a public git repository for BIND; details can be found
at [https://www.isc.org/sourceaccess/](https://www.isc.org/sourceaccess/).
at [http://www.isc.org/git/](http://www.isc.org/git/).
Information for BIND contributors can be found in the following files:
- General information: [CONTRIBUTING.md](CONTRIBUTING.md)
@@ -100,76 +116,114 @@ Information for BIND contributors can be found in the following files:
Patches for BIND may be submitted as
[merge requests](https://gitlab.isc.org/isc-projects/bind9/merge_requests)
on the [ISC GitLab server](https://gitlab.isc.org).
in the [ISC GitLab server](https://gitlab.isc.org) at
at [https://gitlab.isc.org/isc-projects/bind9/merge_requests](https://gitlab.isc.org/isc-projects/bind9/merge_requests).
By default, external contributors do not have the ability to fork BIND on the
GitLab server; if you wish to contribute code to BIND, you may request
By default, external contributors don't have ability to fork BIND in the
GitLab server, but if you wish to contribute code to BIND, you may request
permission to do so. Thereafter, you can create git branches and directly
submit requests that they be reviewed and merged.
If you prefer, you may also submit code by opening a
[GitLab issue](https://gitlab.isc.org/isc-projects/bind9/issues) and
[GitLab Issue](https://gitlab.isc.org/isc-projects/bind9/issues) and
including your patch as an attachment, preferably generated by
`git format-patch`.
### <a name="build"/> Building BIND 9
### <a name="features"/> BIND 9.16 features
BIND 9.16 is the current stable branch of BIND 9. It includes all
changes from the 9.15 development branch, updating the previous stable
branch, 9.14. New features include:
* New `dnssec-policy` statement to configure a key and signing policy
for zones, enabling automatic key regeneration and rollover.
* New network manager based on `libuv`.
* Added support for the new GeoIP2 geolocation API, `libmaxminddb`.
* Improved DNSSEC trust anchor configuration using the `trust-anchors`
statement, permitting configuration of trust anchors in DS as well as
DNSKEY format.
* YAML output for `dig`, `mdig`, and `delv`.
### <a name="build"/> Building BIND
For information about building BIND 9, see the
["Building BIND 9"](doc/arm/build.inc.rst) section in the BIND 9
["Building BIND 9"](doc/arm/build.rst) section in the BIND 9
Administrator Reference Manual.
### <a name="testing"/> Automated testing
A system test suite can be run with `make check`. The system tests require
A system test suite can be run with `make test`. The system tests require
you to configure a set of virtual IP addresses on your system (this allows
multiple servers to run locally and communicate with each other). These
multiple servers to run locally and communicate with one another). These
IP addresses can be configured by running the command
`bin/tests/system/ifconfig.sh up` as root.
Some tests require Perl and the `Net::DNS` and/or `IO::Socket::IP` modules,
and are skipped if these are not available. Some tests require Python
and the `dnspython` module and are skipped if these are not available.
Some tests require Perl and the `Net::DNS` and/or `IO::Socket::INET6` modules,
and will be skipped if these are not available. Some tests require Python
and the `dnspython` module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework. To build
them, use `configure --with-cmocka`. Execution of tests is done by the automake
parallel test driver; unit tests are also run by `make check`.
Unit tests are implemented using the [CMocka unit testing framework](https://cmocka.org/).
To build them, use `configure --with-cmocka`. Execution of tests is done
by the [Kyua test execution engine](https://github.com/jmmv/kyua); if the
`kyua` command is available, then unit tests can be run via `make test`
or `make unit`.
### <a name="doc"/> Documentation
The *BIND 9 Administrator Reference Manual* (ARM) is included with the source
distribution, and in .rst format, in the `doc/arm`
directory. The HTML version is automatically generated and can
be viewed at [https://bind9.readthedocs.io/en/latest/index.html](https://bind9.readthedocs.io/en/latest/index.html).
The *BIND 9 Administrator Reference Manual* is included with the source
distribution, in DocBook XML, HTML, and PDF format, in the `doc/arm`
directory.
The PDF version can be built by running:
cd doc/arm/
sphinx-build -b latex . pdf/
make -C pdf/ all-pdf
The above requires TeX Live in order to work. The PDF will be written to
`doc/arm/pdf/Bv9ARM.pdf`.
Man pages for some of the programs in the BIND 9 distribution
are also included in the BIND ARM.
Some of the programs in the BIND 9 distribution have man pages in their
directories. In particular, the command line options of `named` are
documented in `bin/named/named.8`.
Frequently (and not-so-frequently) asked questions and their answers
can be found in the ISC Knowledgebase at
can be found in the ISC Knowledge Base at
[https://kb.isc.org](https://kb.isc.org).
Additional information on various subjects can be found in other
`README` files throughout the source tree.
### <a name="changes"/> Change log
A detailed list of all changes that have been made throughout the
development BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
the change that was made; these categories are:
|Category |Description |
|-------------- |-----------------------------------------------|
| [func] | New feature |
| [bug] | General bug fix |
| [security] | Fix for a significant security flaw |
| [experimental] | Used for new features when the syntax or other aspects of the design are still in flux and may change |
| [port] | Portability enhancement |
| [maint] | Updates to built-in data such as root server addresses and keys |
| [tuning] | Changes to built-in configuration defaults and constants to improve performance |
| [performance] | Other changes to improve server performance |
| [protocol] | Updates to the DNS protocol such as new RR types |
| [test] | Changes to the automatic tests, not affecting server functionality |
| [cleanup] | Minor corrections and refactoring |
| [doc] | Documentation |
| [contrib] | Changes to the contributed tools and libraries in the 'contrib' subdirectory |
| [placeholder] | Used in the main development branch to reserve change numbers for use in other branches, e.g., when fixing a bug that only exists in older releases |
In general, [func] and [experimental] tags will only appear in new-feature
releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
#### Bug report identifiers
Most notes in the ARM Changelog appendix include a reference to a bug report or
Most notes in the CHANGES file include a reference to a bug report or
issue number. Prior to 2018, these were usually of the form `[RT #NNN]`
and referred to entries in the "bind9-bugs" RT database, which was not open
to the public. More recent entries use the form `[GL #NNN]` or, less often,
`[GL !NNN]`, which, respectively, refer to issues or merge requests in the
GitLab database. Most of these are publicly readable, unless they include
information which is confidential or security-sensitive.
information which is confidential or security sensitive.
To look up a GitLab issue by its number, use the URL
[https://gitlab.isc.org/isc-projects/bind9/issues/NNN](https://gitlab.isc.org/isc-projects/bind9/issues).
@@ -199,7 +253,7 @@ GitLab instance, which is not visible to the public.
* This product includes software developed by the OpenSSL Project for use
in the OpenSSL Toolkit.
[https://www.OpenSSL.org/](https://www.OpenSSL.org/)
[http://www.OpenSSL.org/](http://www.OpenSSL.org/)
* This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com).
* This product includes software written by Tim Hudson (tjh@cryptsoft.com).
(eay@cryptsoft.com)
* This product includes software written by Tim Hudson (tjh@cryptsoft.com)

View File

@@ -1,35 +0,0 @@
<!--
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
# Security Policy
ISC's Security Vulnerability Disclosure Policy is documented in the
relevant [ISC Knowledgebase article][1].
## Reporting possible security issues
If you think you may be seeing a potential security vulnerability in
BIND (for example, a crash with a REQUIRE, INSIST, or ASSERT failure),
please report it immediately by [opening a confidential GitLab issue][2]
(preferred) or emailing bind-security@isc.org.
Please do not discuss undisclosed security vulnerabilities on any public
mailing list. ISC has a long history of handling reported
vulnerabilities promptly and effectively and we respect and acknowledge
responsible reporters.
If you have a crash, you may want to consult the Knowledgebase article
entitled ["What to do if your BIND or DHCP server has crashed"][3].
[1]: https://kb.isc.org/docs/aa-00861
[2]: https://gitlab.isc.org/isc-projects/bind9/-/issues/new?issue[confidential]=true&issuable_template=Bug
[3]: https://kb.isc.org/docs/aa-00340

388
aclocal.m4 vendored Normal file
View File

@@ -0,0 +1,388 @@
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
# Copyright (C) 2006-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
m4_include([m4/ax_check_compile_flag.m4])
m4_include([m4/ax_check_openssl.m4])
m4_include([m4/ax_gcc_func_attribute.m4])
m4_include([m4/ax_posix_shell.m4])
m4_include([m4/ax_pthread.m4])
m4_include([m4/ax_restore_flags.m4])
m4_include([m4/ax_save_flags.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])

15
autogen.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Run this script after modifying configure.in to generate configure
autoreconf -f -i

View File

@@ -1 +0,0 @@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen tests plugins

20
bin/Makefile.in Normal file
View File

@@ -0,0 +1,20 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \
@NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ plugins tests
TARGETS =
@BIND9_MAKE_RULES@

View File

@@ -1,32 +0,0 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBISCCFG_CFLAGS)
AM_CPPFLAGS += \
-DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
noinst_LTLIBRARIES = libcheck-tool.la
libcheck_tool_la_SOURCES = \
check-tool.h \
check-tool.c
LDADD += \
libcheck-tool.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBNS_LIBS) \
$(LIBISCCFG_LIBS)
bin_PROGRAMS = named-checkconf named-checkzone
install-exec-hook:
ln -f $(DESTDIR)$(bindir)/named-checkzone \
$(DESTDIR)$(bindir)/named-compilezone
uninstall-hook:
-rm -f $(DESTDIR)$(bindir)/named-compilezone

88
bin/check/Makefile.in Normal file
View File

@@ -0,0 +1,88 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${NS_INCLUDES} ${BIND9_INCLUDES} ${DNS_INCLUDES} \
${ISCCFG_INCLUDES} ${ISC_INCLUDES} ${OPENSSL_CFLAGS}
CDEFINES = -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @NO_LIBTOOL_ISCLIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
NSLIBS = ../../lib/ns/libns.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
NSDEPENDLIBS = ../../lib/ns/libns.@A@
LIBS = ${ISCLIBS} @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
SUBDIRS =
# Alphabetically
TARGETS = named-checkconf@EXEEXT@ named-checkzone@EXEEXT@
# Alphabetically
SRCS = named-checkconf.c named-checkzone.c check-tool.c
@BIND9_MAKE_RULES@
named-checkconf.@O@: named-checkconf.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkconf.c
named-checkzone.@O@: named-checkzone.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkzone.c
named-checkconf@EXEEXT@: named-checkconf.@O@ check-tool.@O@ ${ISCDEPLIBS} \
${NSDEPENDLIBS} ${DNSDEPLIBS} ${ISCCFGDEPLIBS} ${BIND9DEPLIBS}
export BASEOBJS="named-checkconf.@O@ check-tool.@O@"; \
export LIBS0="${BIND9LIBS} ${NSLIBS} ${ISCCFGLIBS} ${DNSLIBS}"; \
${FINALBUILDCMD}
named-checkzone@EXEEXT@: named-checkzone.@O@ check-tool.@O@ ${ISCDEPLIBS} \
${NSDEPENDLIBS} ${DNSDEPLIBS}
export BASEOBJS="named-checkzone.@O@ check-tool.@O@"; \
export LIBS0="${NSLIBS} ${ISCCFGLIBS} ${DNSLIBS}"; \
${FINALBUILDCMD}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
uninstall::
rm -f ${DESTDIR}${sbindir}/named-compilezone@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkconf@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkzone@EXEEXT@
clean distclean::
rm -f ${TARGETS} r1.htm

View File

@@ -14,16 +14,20 @@
/*! \file */
#include <inttypes.h>
#include <netdb.h>
#include <stdbool.h>
#include <stdio.h>
#ifdef _WIN32
#include <Winsock2.h>
#endif /* ifdef _WIN32 */
#include <isc/buffer.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/netdb.h>
#include <isc/print.h>
#include <isc/region.h>
#include <isc/result.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/symtab.h>
@@ -40,6 +44,7 @@
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dns/types.h>
#include <dns/zone.h>
@@ -73,7 +78,7 @@
#define ERR_IS_MXCNAME 6
#define ERR_IS_SRVCNAME 7
static const char *dbtype[] = { ZONEDB_DEFAULT };
static const char *dbtype[] = { "rbt" };
int debug = 0;
const char *journal = NULL;
@@ -88,13 +93,12 @@ bool dochecksrv = false;
bool docheckns = false;
#endif /* if CHECK_LOCAL */
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_CHECKMX |
DNS_ZONEOPT_CHECKDUPRR | DNS_ZONEOPT_CHECKSPF |
DNS_ZONEOPT_MANYERRORS | DNS_ZONEOPT_CHECKNAMES |
DNS_ZONEOPT_CHECKINTEGRITY |
#if CHECK_SIBLING
DNS_ZONEOPT_CHECKSIBLING |
#endif /* if CHECK_SIBLING */
DNS_ZONEOPT_CHECKSVCB | DNS_ZONEOPT_CHECKWILDCARD |
DNS_ZONEOPT_CHECKWILDCARD |
DNS_ZONEOPT_WARNMXCNAME | DNS_ZONEOPT_WARNSRVCNAME;
/*
@@ -146,14 +150,14 @@ logged(char *key, int value) {
isc_result_t result;
if (symtab == NULL) {
return false;
return (false);
}
result = isc_symtab_lookup(symtab, key, value, NULL);
if (result == ISC_R_SUCCESS) {
return true;
return (true);
}
return false;
return (false);
}
static bool
@@ -177,7 +181,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
aaaa->type == dns_rdatatype_aaaa);
if (a == NULL || aaaa == NULL) {
return answer;
return (answer);
}
memset(&hints, 0, sizeof(hints));
@@ -234,7 +238,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0 */
return true;
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -243,7 +247,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return true;
return (true);
}
/*
@@ -371,7 +375,7 @@ checkmissing:
}
}
freeaddrinfo(ai);
return answer;
return (answer);
}
static bool
@@ -434,7 +438,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
}
}
freeaddrinfo(ai);
return answer;
return (answer);
case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
@@ -448,7 +452,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return true;
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -457,7 +461,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return true;
return (true);
}
}
@@ -521,7 +525,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
}
}
freeaddrinfo(ai);
return answer;
return (answer);
case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
@@ -535,7 +539,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return true;
return (true);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -544,7 +548,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return true;
return (true);
}
}
@@ -573,7 +577,97 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
ISC_R_SUCCESS);
*logp = log;
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
/*% scan the zone for oversize TTLs */
static isc_result_t
check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
isc_result_t result;
dns_db_t *db = NULL;
dns_dbversion_t *version = NULL;
dns_dbnode_t *node = NULL;
dns_dbiterator_t *dbiter = NULL;
dns_rdatasetiter_t *rdsiter = NULL;
dns_rdataset_t rdataset;
dns_fixedname_t fname;
dns_name_t *name;
name = dns_fixedname_initname(&fname);
dns_rdataset_init(&rdataset);
CHECK(dns_zone_getdb(zone, &db));
INSIST(db != NULL);
CHECK(dns_db_newversion(db, &version));
CHECK(dns_db_createiterator(db, 0, &dbiter));
for (result = dns_dbiterator_first(dbiter); result == ISC_R_SUCCESS;
result = dns_dbiterator_next(dbiter))
{
result = dns_dbiterator_current(dbiter, &node, name);
if (result == DNS_R_NEWORIGIN) {
result = ISC_R_SUCCESS;
}
CHECK(result);
CHECK(dns_db_allrdatasets(db, node, version, 0, 0, &rdsiter));
for (result = dns_rdatasetiter_first(rdsiter);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(rdsiter))
{
dns_rdatasetiter_current(rdsiter, &rdataset);
if (rdataset.ttl > maxttl) {
char nbuf[DNS_NAME_FORMATSIZE];
char tbuf[255];
isc_buffer_t b;
isc_region_t r;
dns_name_format(name, nbuf, sizeof(nbuf));
isc_buffer_init(&b, tbuf, sizeof(tbuf) - 1);
CHECK(dns_rdatatype_totext(rdataset.type, &b));
isc_buffer_usedregion(&b, &r);
r.base[r.length] = 0;
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/%s TTL %d exceeds "
"maximum TTL %d",
nbuf, tbuf, rdataset.ttl, maxttl);
dns_rdataset_disassociate(&rdataset);
CHECK(ISC_R_RANGE);
}
dns_rdataset_disassociate(&rdataset);
}
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
CHECK(result);
dns_rdatasetiter_destroy(&rdsiter);
dns_db_detachnode(db, &node);
}
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
}
if (rdsiter != NULL) {
dns_rdatasetiter_destroy(&rdsiter);
}
if (dbiter != NULL) {
dns_dbiterator_destroy(&dbiter);
}
if (version != NULL) {
dns_db_closeversion(db, &version, false);
}
if (db != NULL) {
dns_db_detach(&db);
}
return (result);
}
/*% load the zone */
@@ -596,7 +690,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
zonename, filename, classname);
}
dns_zone_create(&zone, mctx, 0);
CHECK(dns_zone_create(&zone, mctx));
dns_zone_settype(zone, dns_zone_primary);
@@ -606,18 +700,13 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
CHECK(dns_zone_setorigin(zone, origin));
dns_zone_setdbtype(zone, 1, (const char *const *)dbtype);
if (strcmp(filename, "-") == 0) {
CHECK(dns_zone_setstream(zone, stdin, fileformat,
&dns_master_style_default));
} else {
CHECK(dns_zone_setfile(zone, filename, fileformat,
&dns_master_style_default));
}
CHECK(dns_zone_setfile(zone, filename, fileformat,
&dns_master_style_default));
if (journal != NULL) {
CHECK(dns_zone_setjournal(zone, journal));
}
region.base = UNCONST(classname);
DE_CONST(classname, region.base);
region.length = strlen(classname);
CHECK(dns_rdataclass_fromtext(&rdclass, &region));
@@ -639,6 +728,14 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_zone_load(zone, false));
/*
* When loading map files we can't catch oversize TTLs during
* load, so we check for them here.
*/
if (fileformat == dns_masterformat_map && maxttl != 0) {
CHECK(check_ttls(zone, maxttl));
}
if (zonep != NULL) {
*zonep = zone;
zone = NULL;
@@ -648,7 +745,7 @@ cleanup:
if (zone != NULL) {
dns_zone_detach(&zone);
}
return result;
return (result);
}
/*% dump the zone */
@@ -679,7 +776,7 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
"could not open output "
"file \"%s\" for writing\n",
filename);
return ISC_R_FAILURE;
return (ISC_R_FAILURE);
}
}
@@ -689,5 +786,27 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
(void)isc_stdio_close(output);
}
return result;
return (result);
}
#ifdef _WIN32
void
InitSockets(void) {
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
fprintf(stderr, "WSAStartup() failed: %d\n", err);
exit(1);
}
}
void
DestroySockets(void) {
WSACleanup();
}
#endif /* ifdef _WIN32 */

View File

@@ -11,7 +11,8 @@
* information regarding copyright ownership.
*/
#pragma once
#ifndef CHECK_TOOL_H
#define CHECK_TOOL_H
/*! \file */
@@ -41,6 +42,13 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion);
#ifdef _WIN32
void
InitSockets(void);
void
DestroySockets(void);
#endif /* ifdef _WIN32 */
extern int debug;
extern const char *journal;
extern bool nomerge;
@@ -50,3 +58,5 @@ extern bool dochecksrv;
extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
#endif /* ifndef CHECK_TOOL_H */

View File

@@ -18,12 +18,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
#include <isc/dir.h>
#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/util.h>
@@ -33,17 +33,21 @@
#include <dns/log.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/result.h>
#include <dns/rootns.h>
#include <dns/zone.h>
#include <isccfg/check.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
#include "check-tool.h"
static const char *program = "named-checkconf";
static bool loadplugins = true;
isc_log_t *logc = NULL;
#define CHECK(r) \
@@ -54,16 +58,16 @@ isc_log_t *logc = NULL;
} while (0)
/*% usage */
noreturn static void
usage(void);
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
fprintf(stderr,
"usage: %s [-achijlvz] [-p [-x]] [-t directory] "
"usage: %s [-chijlvz] [-p [-x]] [-t directory] "
"[named.conf]\n",
program);
exit(EXIT_SUCCESS);
exit(1);
}
/*% directory callback */
@@ -86,10 +90,10 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
cfg_obj_log(obj, logc, ISC_LOG_ERROR,
"change directory to '%s' failed: %s\n", directory,
isc_result_totext(result));
return result;
return (result);
}
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
static bool
@@ -97,10 +101,10 @@ get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL) {
return false;
return (false);
}
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS) {
return true;
return (true);
}
}
}
@@ -116,7 +120,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
for (i = 0;; i++) {
if (maps[i] == NULL) {
return false;
return (false);
}
checknames = NULL;
result = cfg_map_get(maps[i], "check-names", &checknames);
@@ -125,7 +129,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
}
if (checknames != NULL && !cfg_obj_islist(checknames)) {
*obj = checknames;
return true;
return (true);
}
for (element = cfg_list_first(checknames); element != NULL;
element = cfg_list_next(element))
@@ -139,7 +143,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
continue;
}
*obj = cfg_tuple_get(value, "mode");
return true;
return (true);
}
}
}
@@ -152,23 +156,23 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
isc_textregion_t r;
if (zfile == NULL) {
return ISC_R_FAILURE;
return (ISC_R_FAILURE);
}
r.base = UNCONST(zclass);
DE_CONST(zclass, r.base);
r.length = strlen(zclass);
result = dns_rdataclass_fromtext(&rdclass, &r);
if (result != ISC_R_SUCCESS) {
return result;
return (result);
}
result = dns_rootns_create(mctx, rdclass, zfile, &db);
if (result != ISC_R_SUCCESS) {
return result;
return (result);
}
dns_db_detach(&db);
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
/*% configure the zone */
@@ -224,33 +228,33 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
printf("%s %s %s in-view %s\n", zname, zclass, view, inview);
}
if (inviewobj != NULL) {
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "type", &typeobj);
if (typeobj == NULL) {
return ISC_R_FAILURE;
return (ISC_R_FAILURE);
}
if (list) {
const char *ztype = cfg_obj_asstring(typeobj);
printf("%s %s %s %s\n", zname, zclass, view, ztype);
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
/*
* Skip checks when using an alternate data source.
*/
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL &&
strcmp(ZONEDB_DEFAULT, cfg_obj_asstring(dbobj)) != 0)
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
{
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "dlz", &dlzobj);
if (dlzobj != NULL) {
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "file", &fileobj);
@@ -264,16 +268,16 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
* master and redirect
*/
if (strcasecmp(cfg_obj_asstring(typeobj), "hint") == 0) {
return configure_hint(zfile, zclass, mctx);
return (configure_hint(zfile, zclass, mctx));
} else if ((strcasecmp(cfg_obj_asstring(typeobj), "primary") != 0) &&
(strcasecmp(cfg_obj_asstring(typeobj), "master") != 0) &&
(strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
{
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
/*
* Is the redirect zone configured as a secondary?
* Is the redirect zone configured as a slave?
*/
if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
cfg_map_get(zoptions, "primaries", &primariesobj);
@@ -282,12 +286,12 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
if (primariesobj != NULL) {
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
}
if (zfile == NULL) {
return ISC_R_FAILURE;
return (ISC_R_FAILURE);
}
obj = NULL;
@@ -399,17 +403,6 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options |= DNS_ZONEOPT_CHECKSPF;
}
obj = NULL;
if (get_maps(maps, "check-svcb", &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKSVCB;
} else {
zone_options &= ~DNS_ZONEOPT_CHECKSVCB;
}
} else {
zone_options |= DNS_ZONEOPT_CHECKSVCB;
}
obj = NULL;
if (get_maps(maps, "check-wildcard", &obj)) {
if (cfg_obj_asboolean(obj)) {
@@ -448,6 +441,8 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
masterformat = dns_masterformat_text;
} else if (strcasecmp(masterformatstr, "raw") == 0) {
masterformat = dns_masterformat_raw;
} else if (strcasecmp(masterformatstr, "map") == 0) {
masterformat = dns_masterformat_map;
} else {
UNREACHABLE();
}
@@ -463,9 +458,9 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass,
isc_result_totext(result));
dns_result_totext(result));
}
return result;
return (result);
}
/*% configure a view */
@@ -500,7 +495,7 @@ configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
result = tresult;
}
}
return result;
return (result);
}
static isc_result_t
@@ -510,11 +505,11 @@ config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
if (!cfg_obj_isstring(classobj)) {
*classp = defclass;
return ISC_R_SUCCESS;
return (ISC_R_SUCCESS);
}
r.base = UNCONST(cfg_obj_asstring(classobj));
DE_CONST(cfg_obj_asstring(classobj), r.base);
r.length = strlen(r.base);
return dns_rdataclass_fromtext(classp, &r);
return (dns_rdataclass_fromtext(classp, &r));
}
/*% load zones from the configuration */
@@ -572,15 +567,15 @@ load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
}
cleanup:
return result;
return (result);
}
static void
output(void *closure, const char *text, int textlen) {
UNUSED(closure);
if (fwrite(text, 1, textlen, stdout) != (size_t)textlen) {
isc_result_t *result = closure;
perror("fwrite");
*result = ISC_R_FAILURE;
exit(1);
}
}
@@ -592,21 +587,20 @@ main(int argc, char **argv) {
cfg_obj_t *config = NULL;
const char *conffile = NULL;
isc_mem_t *mctx = NULL;
isc_result_t result = ISC_R_SUCCESS;
bool cleanup_dst = false;
isc_result_t result;
int exit_status = 0;
bool load_zones = false;
bool list_zones = false;
bool print = false;
bool nodeprecate = false;
unsigned int flags = 0;
unsigned int checkflags = BIND_CHECK_PLUGINS | BIND_CHECK_ALGORITHMS;
isc_commandline_errprint = false;
/*
* Process memory debugging argument first.
*/
#define CMDLINE_FLAGS "acdhijlm:t:pvxz"
#define CMDLINE_FLAGS "cdhijlm:t:pvxz"
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (c) {
case 'm':
@@ -622,6 +616,12 @@ main(int argc, char **argv) {
{
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
}
if (strcasecmp(isc_commandline_argument, "size") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
}
if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGCTX;
}
break;
default:
break;
@@ -633,12 +633,8 @@ main(int argc, char **argv) {
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != EOF) {
switch (c) {
case 'a':
checkflags &= ~BIND_CHECK_ALGORITHMS;
break;
case 'c':
checkflags &= ~BIND_CHECK_PLUGINS;
loadplugins = false;
break;
case 'd':
@@ -665,7 +661,7 @@ main(int argc, char **argv) {
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chroot: %s\n",
isc_result_totext(result));
CHECK(result);
exit(1);
}
break;
@@ -674,9 +670,8 @@ main(int argc, char **argv) {
break;
case 'v':
printf("%s\n", PACKAGE_VERSION);
result = ISC_R_SUCCESS;
goto cleanup;
printf(VERSION "\n");
exit(0);
case 'x':
flags |= CFG_PRINTER_XKEY;
@@ -696,27 +691,25 @@ main(int argc, char **argv) {
}
FALLTHROUGH;
case 'h':
isc_mem_detach(&mctx);
usage();
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
CHECK(ISC_R_FAILURE);
exit(1);
}
}
if (((flags & CFG_PRINTER_XKEY) != 0) && !print) {
fprintf(stderr, "%s: -x cannot be used without -p\n", program);
CHECK(ISC_R_FAILURE);
exit(1);
}
if (print && list_zones) {
fprintf(stderr, "%s: -l cannot be used with -p\n", program);
CHECK(ISC_R_FAILURE);
exit(1);
}
if (isc_commandline_index + 1 < argc) {
isc_mem_detach(&mctx);
usage();
}
if (argv[isc_commandline_index] != NULL) {
@@ -726,48 +719,53 @@ main(int argc, char **argv) {
conffile = NAMED_CONFFILE;
}
CHECK(setup_logging(mctx, stdout, &logc));
#ifdef _WIN32
InitSockets();
#endif /* ifdef _WIN32 */
CHECK(dst_lib_init(mctx, NULL));
cleanup_dst = true;
RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS);
CHECK(cfg_parser_create(mctx, logc, &parser));
dns_result_register();
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
if (nodeprecate) {
cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true);
}
cfg_parser_setcallback(parser, directory_callback, NULL);
CHECK(cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config));
CHECK(isccfg_check_namedconf(config, checkflags, logc, mctx));
if (load_zones || list_zones) {
CHECK(load_zones_fromconfig(config, mctx, list_zones));
if (cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config) !=
ISC_R_SUCCESS)
{
exit(1);
}
if (print) {
cfg_printx(config, flags, output, &result);
result = bind9_check_namedconf(config, loadplugins, logc, mctx);
if (result != ISC_R_SUCCESS) {
exit_status = 1;
}
cleanup:
if (config != NULL) {
cfg_obj_destroy(parser, &config);
if (result == ISC_R_SUCCESS && (load_zones || list_zones)) {
result = load_zones_fromconfig(config, mctx, list_zones);
if (result != ISC_R_SUCCESS) {
exit_status = 1;
}
}
if (parser != NULL) {
cfg_parser_destroy(&parser);
if (print && exit_status == 0) {
cfg_printx(config, flags, output, NULL);
}
cfg_obj_destroy(parser, &config);
if (cleanup_dst) {
dst_lib_destroy();
}
cfg_parser_destroy(&parser);
if (logc != NULL) {
isc_log_destroy(&logc);
}
isc_log_destroy(&logc);
if (mctx != NULL) {
isc_mem_destroy(&mctx);
}
isc_mem_destroy(&mctx);
return result == ISC_R_SUCCESS ? 0 : 1;
#ifdef _WIN32
DestroySockets();
#endif /* ifdef _WIN32 */
return (exit_status);
}

View File

@@ -11,8 +11,6 @@
.. highlight: console
.. iscman:: named-checkconf
.. program:: named-checkconf
.. _man_named-checkconf:
named-checkconf - named configuration file syntax checking tool
@@ -21,96 +19,77 @@ named-checkconf - named configuration file syntax checking tool
Synopsis
~~~~~~~~
:program:`named-checkconf` [**-achjlvz**] [**-p** [**-x** ]] [**-t** directory] {filename}
:program:`named-checkconf` [**-chjlvz**] [**-p** [**-x** ]] [**-t** directory] {filename}
Description
~~~~~~~~~~~
:program:`named-checkconf` checks the syntax, but not the semantics, of a
:iscman:`named` configuration file. The file, along with all files included by it, is parsed and checked for syntax
``named-checkconf`` checks the syntax, but not the semantics, of a
``named`` configuration file. The file, along with all files included by it, is parsed and checked for syntax
errors. If no file is specified,
|named_conf| is read by default.
``/etc/named.conf`` is read by default.
Note: files that :iscman:`named` reads in separate parser contexts, such as
``rndc.conf`` or ``rndc.key``, are not automatically read by
:program:`named-checkconf`. Configuration errors in these files may cause
:iscman:`named` to fail to run, even if :program:`named-checkconf` was
successful. However, :program:`named-checkconf` can be run on these files
explicitly.
Note: files that ``named`` reads in separate parser contexts, such as
``rndc.key`` and ``bind.keys``, are not automatically read by
``named-checkconf``. Configuration errors in these files may cause
``named`` to fail to run, even if ``named-checkconf`` was successful.
However, ``named-checkconf`` can be run on these files explicitly.
Options
~~~~~~~
.. option:: -a
Don't check the `dnssec-policy`'s DNSSEC key algorithms against
those supported by the crypto provider. This is useful when checking
a `named.conf` intended to be run on another machine with possibly a
different set of supported DNSSEC key algorithms.
.. option:: -h
``-h``
This option prints the usage summary and exits.
.. option:: -j
When loading a zonefile, this option instructs :iscman:`named` to read the journal if it exists.
.. option:: -l
``-j``
When loading a zonefile, this option instructs ``named`` to read the journal if it exists.
``-l``
This option lists all the configured zones. Each line of output contains the zone
name, class (e.g. IN), view, and type (e.g. primary or secondary).
.. option:: -c
``-c``
This option specifies that only the "core" configuration should be checked. This suppresses the loading of
plugin modules, and causes all parameters to ``plugin`` statements to
be ignored.
.. option:: -i
``-i``
This option ignores warnings on deprecated options.
.. option:: -p
``-p``
This option prints out the ``named.conf`` and included files in canonical form if
no errors were detected. See also the ``-x`` option.
This option prints out the :iscman:`named.conf` and included files in canonical form if
no errors were detected. See also the :option:`-x` option.
.. option:: -t directory
This option instructs :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
``-t directory``
This option instructs ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
:iscman:`named`.
``named``.
.. option:: -v
This option prints the version of the :program:`named-checkconf` program and exits.
.. option:: -x
``-v``
This option prints the version of the ``named-checkconf`` program and exits.
``-x``
When printing the configuration files in canonical form, this option obscures
shared secrets by replacing them with strings of question marks
(``?``). This allows the contents of :iscman:`named.conf` and related files
(``?``). This allows the contents of ``named.conf`` and related files
to be shared - for example, when submitting bug reports -
without compromising private data. This option cannot be used without
:option:`-p`.
``-p``.
.. option:: -z
This option performs a test load of all zones of type ``primary`` found in :iscman:`named.conf`.
.. option:: filename
``-z``
This option performs a test load of all zones of type ``primary`` found in ``named.conf``.
``filename``
This indicates the name of the configuration file to be checked. If not specified,
it defaults to |named_conf|.
it defaults to ``/etc/named.conf``.
Return Values
~~~~~~~~~~~~~
:program:`named-checkconf` returns an exit status of 1 if errors were detected
``named-checkconf`` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:iscman:`named(8) <named>`, :iscman:`named-checkzone(8) <named-checkzone>`, BIND 9 Administrator Reference Manual.
:manpage:`named(8)`, :manpage:`named-checkzone(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -17,15 +17,16 @@
#include <stdbool.h>
#include <stdlib.h>
#include <isc/attributes.h>
#include <isc/app.h>
#include <isc/commandline.h>
#include <isc/dir.h>
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/result.h>
#include <isc/print.h>
#include <isc/socket.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
@@ -37,6 +38,7 @@
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#include <dns/result.h>
#include <dns/types.h>
#include <dns/zone.h>
@@ -57,13 +59,13 @@ static enum { progmode_check, progmode_compile } progmode;
if (result != ISC_R_SUCCESS) { \
if (!quiet) \
fprintf(stderr, "%s() returned %s\n", \
function, isc_result_totext(result)); \
function, dns_result_totext(result)); \
return (result); \
} \
} while (0)
noreturn static void
usage(void);
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
@@ -76,10 +78,10 @@ usage(void) {
"[-i (full|full-sibling|local|local-sibling|none)] "
"[-M (ignore|warn|fail)] [-S (ignore|warn|fail)] "
"[-W (ignore|warn)] "
"%s zonename [ (filename|-) ]\n",
"%s zonename filename\n",
prog_name,
progmode == progmode_check ? "[-o filename]" : "-o filename");
exit(EXIT_FAILURE);
exit(1);
}
static void
@@ -94,7 +96,7 @@ int
main(int argc, char **argv) {
int c;
char *origin = NULL;
const char *filename = NULL;
char *filename = NULL;
isc_log_t *lctx = NULL;
isc_result_t result;
char classname_in[] = "IN";
@@ -147,12 +149,15 @@ main(int argc, char **argv) {
UNREACHABLE();
}
/* When compiling, disable checks by default */
/* Compilation specific defaults */
if (progmode == progmode_compile) {
zone_options = 0;
docheckmx = false;
docheckns = false;
dochecksrv = false;
zone_options |= (DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_FATALNS |
DNS_ZONEOPT_CHECKSPF | DNS_ZONEOPT_CHECKDUPRR |
DNS_ZONEOPT_CHECKNAMES |
DNS_ZONEOPT_CHECKNAMESFAIL |
DNS_ZONEOPT_CHECKWILDCARD);
} else {
zone_options |= (DNS_ZONEOPT_CHECKDUPRR | DNS_ZONEOPT_CHECKSPF);
}
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
@@ -160,8 +165,8 @@ main(int argc, char **argv) {
isc_commandline_errprint = false;
while ((c = isc_commandline_parse(argc, argv,
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:C:"
"DF:M:S:T:W:")) != EOF)
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:DF:"
"M:S:T:W:")) != EOF)
{
switch (c) {
case 'c':
@@ -206,7 +211,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -i: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -240,7 +245,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -k: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -251,7 +256,7 @@ main(int argc, char **argv) {
if (*endp != '\0') {
fprintf(stderr, "source serial number "
"must be numeric");
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -262,7 +267,7 @@ main(int argc, char **argv) {
if (*endp != '\0') {
fprintf(stderr, "maximum TTL "
"must be numeric");
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -279,7 +284,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -n: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -296,7 +301,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -m: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -321,7 +326,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -r: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -334,7 +339,7 @@ main(int argc, char **argv) {
fprintf(stderr,
"unknown or unsupported style: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -344,30 +349,18 @@ main(int argc, char **argv) {
fprintf(stderr, "isc_dir_chroot: %s: %s\n",
isc_commandline_argument,
isc_result_totext(result));
exit(EXIT_FAILURE);
exit(1);
}
break;
case 'v':
printf("%s\n", PACKAGE_VERSION);
exit(EXIT_SUCCESS);
printf(VERSION "\n");
exit(0);
case 'w':
workdir = isc_commandline_argument;
break;
case 'C':
if (ARGCMP("check-svcb:fail")) {
zone_options |= DNS_ZONEOPT_CHECKSVCB;
} else if (ARGCMP("check-svcb:ignore")) {
zone_options &= ~DNS_ZONEOPT_CHECKSVCB;
} else {
fprintf(stderr, "invalid argument to -C: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
}
break;
case 'D':
dumpzone++;
break;
@@ -385,7 +378,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -M: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -402,7 +395,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -S: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -414,7 +407,7 @@ main(int argc, char **argv) {
} else {
fprintf(stderr, "invalid argument to -T: %s\n",
isc_commandline_argument);
exit(EXIT_FAILURE);
exit(1);
}
break;
@@ -438,7 +431,7 @@ main(int argc, char **argv) {
default:
fprintf(stderr, "%s: unhandled option -%c\n", prog_name,
isc_commandline_option);
exit(EXIT_FAILURE);
exit(1);
}
}
@@ -447,7 +440,7 @@ main(int argc, char **argv) {
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chdir: %s: %s\n", workdir,
isc_result_totext(result));
exit(EXIT_FAILURE);
exit(1);
}
}
@@ -460,10 +453,12 @@ main(int argc, char **argv) {
inputformat = dns_masterformat_raw;
fprintf(stderr, "WARNING: input format raw, version "
"ignored\n");
} else if (strcasecmp(inputformatstr, "map") == 0) {
inputformat = dns_masterformat_map;
} else {
fprintf(stderr, "unknown file format: %s\n",
inputformatstr);
exit(EXIT_FAILURE);
exit(1);
}
}
@@ -481,12 +476,14 @@ main(int argc, char **argv) {
rawversion > 1U)
{
fprintf(stderr, "unknown raw format version\n");
exit(EXIT_FAILURE);
exit(1);
}
} else if (strcasecmp(outputformatstr, "map") == 0) {
outputformat = dns_masterformat_map;
} else {
fprintf(stderr, "unknown file format: %s\n",
outputformatstr);
exit(EXIT_FAILURE);
exit(1);
}
}
@@ -517,29 +514,24 @@ main(int argc, char **argv) {
logdump = false;
}
if (argc - isc_commandline_index < 1 ||
argc - isc_commandline_index > 2)
{
if (isc_commandline_index + 2 != argc) {
usage();
}
#ifdef _WIN32
InitSockets();
#endif /* ifdef _WIN32 */
isc_mem_create(&mctx);
if (!quiet) {
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx) ==
ISC_R_SUCCESS);
}
dns_result_register();
origin = argv[isc_commandline_index++];
if (isc_commandline_index == argc) {
/* "-" will be interpreted as stdin */
filename = "-";
} else {
filename = argv[isc_commandline_index];
}
isc_commandline_index++;
filename = argv[isc_commandline_index++];
result = load_zone(mctx, origin, filename, inputformat, classname,
maxttl, &zone);
@@ -570,6 +562,8 @@ main(int argc, char **argv) {
isc_log_destroy(&lctx);
}
isc_mem_destroy(&mctx);
return (result == ISC_R_SUCCESS) ? 0 : 1;
#ifdef _WIN32
DestroySockets();
#endif /* ifdef _WIN32 */
return ((result == ISC_R_SUCCESS) ? 0 : 1);
}

View File

@@ -13,8 +13,6 @@
.. BEWARE: Do not forget to edit also named-compilezone.rst!
.. iscman:: named-checkzone
.. program:: named-checkzone
.. _man_named-checkzone:
named-checkzone - zone file validation tool
@@ -23,62 +21,45 @@ named-checkzone - zone file validation tool
Synopsis
~~~~~~~~
:program:`named-checkzone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-C** mode] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-o** filename] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {zonename} {filename}
:program:`named-checkzone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-o** filename] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {zonename} {filename}
Description
~~~~~~~~~~~
:program:`named-checkzone` checks the syntax and integrity of a zone file. It
performs the same checks as :iscman:`named` does when loading a zone. This
makes :program:`named-checkzone` useful for checking zone files before
``named-checkzone`` checks the syntax and integrity of a zone file. It
performs the same checks as ``named`` does when loading a zone. This
makes ``named-checkzone`` useful for checking zone files before
configuring them into a name server.
Options
~~~~~~~
.. option:: -d
``-d``
This option enables debugging.
.. option:: -h
``-h``
This option prints the usage summary and exits.
.. option:: -q
``-q``
This option sets quiet mode, which only sets an exit code to indicate
successful or failed completion.
.. option:: -v
``-v``
This option prints the version of the ``named-checkzone`` program and exits.
This option prints the version of the :program:`named-checkzone` program and exits.
.. option:: -j
When loading a zone file, this option tells :iscman:`named` to read the journal if it exists. The journal
``-j``
When loading a zone file, this option tells ``named`` to read the journal if it exists. The journal
file name is assumed to be the zone file name with the
string ``.jnl`` appended.
.. option:: -J filename
When loading the zone file, this option tells :iscman:`named` to read the journal from the given file, if
it exists. This implies :option:`-j`.
.. option:: -c class
``-J filename``
When loading the zone file, this option tells ``named`` to read the journal from the given file, if
it exists. This implies ``-j``.
``-c class``
This option specifies the class of the zone. If not specified, ``IN`` is assumed.
.. option:: -C mode
This option controls check mode on zone files when loading.
Possible modes are ``check-svcb:fail`` and ``check-svcb:ignore``.
``check-svcb:fail`` turns on additional checks on ``_dns`` SVCB
records and ``check-svcb:ignore`` disables these checks. The
default is ``check-svcb:fail``.
.. option:: -i mode
``-i mode``
This option performs post-load zone integrity checks. Possible modes are
``full`` (the default), ``full-sibling``, ``local``,
``local-sibling``, and ``none``.
@@ -104,70 +85,59 @@ Options
Mode ``none`` disables the checks.
.. option:: -f format
``-f format``
This option specifies the format of the zone file. Possible formats are
``text`` (the default), and ``raw``.
.. option:: -F format
``text`` (the default), ``raw``, and ``map``.
``-F format``
This option specifies the format of the output file specified. For
:program:`named-checkzone`, this does not have any effect unless it dumps
``named-checkzone``, this does not have any effect unless it dumps
the zone contents.
Possible formats are ``text`` (the default), which is the standard
textual representation of the zone, and ``raw`` and ``raw=N``, which
store the zone in a binary format for rapid loading by :iscman:`named`.
textual representation of the zone, and ``map``, ``raw``, and ``raw=N``, which
store the zone in a binary format for rapid loading by ``named``.
``raw=N`` specifies the format version of the raw zone file: if ``N`` is
0, the raw file can be read by any version of :iscman:`named`; if N is 1, the
0, the raw file can be read by any version of ``named``; if N is 1, the
file can only be read by release 9.9.0 or higher. The default is 1.
.. option:: -k mode
``-k mode``
This option performs ``check-names`` checks with the specified failure mode.
Possible modes are ``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -l ttl
``-l ttl``
This option sets a maximum permissible TTL for the input file. Any record with a
TTL higher than this value causes the zone to be rejected. This
is similar to using the ``max-zone-ttl`` option in :iscman:`named.conf`.
is similar to using the ``max-zone-ttl`` option in ``named.conf``.
.. option:: -L serial
When compiling a zone to ``raw`` format, this option sets the "source
``-L serial``
When compiling a zone to ``raw`` or ``map`` format, this option sets the "source
serial" value in the header to the specified serial number. This is
expected to be used primarily for testing purposes.
.. option:: -m mode
``-m mode``
This option specifies whether MX records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn`` (the default), and
``ignore``.
.. option:: -M mode
``-M mode``
This option checks whether a MX record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -n mode
``-n mode``
This option specifies whether NS records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -o filename
``-o filename``
This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
the zone output is written to standard output.
.. option:: -r mode
``-r mode``
This option checks for records that are treated as different by DNSSEC but are
semantically equal in plain DNS. Possible modes are ``fail``,
``warn`` (the default), and ``ignore``.
.. option:: -s style
``-s style``
This option specifies the style of the dumped zone file. Possible styles are
``full`` (the default) and ``relative``. The ``full`` format is most
suitable for processing automatically by a separate script.
@@ -176,56 +146,48 @@ Options
the zone contents. It also does not have any meaning if the output format
is not text.
.. option:: -S mode
``-S mode``
This option checks whether an SRV record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -t directory
This option tells :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
``-t directory``
This option tells ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
:iscman:`named`.
.. option:: -T mode
``named``.
``-T mode``
This option checks whether Sender Policy Framework (SPF) records exist and issues a
warning if an SPF-formatted TXT record is not also present. Possible
modes are ``warn`` (the default) and ``ignore``.
.. option:: -w directory
This option instructs :iscman:`named` to chdir to ``directory``, so that relative filenames in master file
``-w directory``
This option instructs ``named`` to chdir to ``directory``, so that relative filenames in master file
``$INCLUDE`` directives work. This is similar to the directory clause in
:iscman:`named.conf`.
.. option:: -D
``named.conf``.
``-D``
This option dumps the zone file in canonical format.
.. option:: -W mode
``-W mode``
This option specifies whether to check for non-terminal wildcards. Non-terminal
wildcards are almost always the result of a failure to understand the
wildcard matching algorithm (:rfc:`4592`). Possible modes are ``warn``
(the default) and ``ignore``.
.. option:: zonename
``zonename``
This indicates the domain name of the zone being checked.
.. option:: filename
``filename``
This is the name of the zone file.
Return Values
~~~~~~~~~~~~~
:program:`named-checkzone` returns an exit status of 1 if errors were detected
``named-checkzone`` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:iscman:`named(8) <named>`, :iscman:`named-checkconf(8) <named-checkconf>`, :iscman:`named-compilezone(8) <named-compilezone>`, :rfc:`1035`, BIND 9 Administrator Reference
Manual.
:manpage:`named(8)`, :manpage:`named-checkconf(8)`, :manpage:`named-compilezone(8)`,
:rfc:`1035`, BIND 9 Administrator Reference Manual.

View File

@@ -13,8 +13,6 @@
.. BEWARE: Do not forget to edit also named-checkzone.rst!
.. iscman:: named-compilezone
.. program:: named-compilezone
.. _man_named-compilezone:
named-compilezone - zone file converting tool
@@ -23,73 +21,50 @@ named-compilezone - zone file converting tool
Synopsis
~~~~~~~~
:program:`named-compilezone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-C** mode] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
:program:`named-compilezone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
Description
~~~~~~~~~~~
:program:`named-compilezone` checks the syntax and integrity of a zone file,
``named-compilezone`` checks the syntax and integrity of a zone file,
and dumps the zone contents to a specified file in a specified format.
Unlike :program:`named-checkzone`, zone contents are not strictly checked
by default. If the output is to be used as an actual zone file to be loaded
by :iscman:`named`, then the check levels should be manually configured to
be at least as strict as those specified in the :iscman:`named` configuration
file.
Running :program:`named-checkzone` on the input prior to compiling will
ensure that the zone compiles with the default requirements of
:iscman:`named`.
It applies strict check levels by default, since the
dump output is used as an actual zone file loaded by ``named``.
When manually specified otherwise, the check levels must at least be as
strict as those specified in the ``named`` configuration file.
Options
~~~~~~~
.. option:: -d
``-d``
This option enables debugging.
.. option:: -h
``-h``
This option prints the usage summary and exits.
.. option:: -q
``-q``
This option sets quiet mode, which only sets an exit code to indicate
successful or failed completion.
.. option:: -v
``-v``
This option prints the version of the ``named-checkzone`` program and exits.
This option prints the version of the :iscman:`named-checkzone` program and exits.
.. option:: -j
When loading a zone file, this option tells :iscman:`named` to read the journal if it exists. The journal
``-j``
When loading a zone file, this option tells ``named`` to read the journal if it exists. The journal
file name is assumed to be the zone file name with the
string ``.jnl`` appended.
.. option:: -J filename
When loading the zone file, this option tells :iscman:`named` to read the journal from the given file, if
it exists. This implies :option:`-j`.
.. option:: -c class
``-J filename``
When loading the zone file, this option tells ``named`` to read the journal from the given file, if
it exists. This implies ``-j``.
``-c class``
This option specifies the class of the zone. If not specified, ``IN`` is assumed.
.. option:: -C mode
This option controls check mode on zone files when loading.
Possible modes are ``check-svcb:fail`` and ``check-svcb:ignore``.
``check-svcb:fail`` turns on additional checks on ``_dns`` SVCB
records and ``check-svcb:ignore`` disables these checks. The
default is ``check-svcb:ignore``.
.. option:: -i mode
``-i mode``
This option performs post-load zone integrity checks. Possible modes are
``full``, ``full-sibling``, ``local``,
``local-sibling``, and ``none`` (the default).
``full`` (the default), ``full-sibling``, ``local``,
``local-sibling``, and ``none``.
Mode ``full`` checks that MX records refer to A or AAAA records
(both in-zone and out-of-zone hostnames). Mode ``local`` only
@@ -112,128 +87,109 @@ Options
Mode ``none`` disables the checks.
.. option:: -f format
``-f format``
This option specifies the format of the zone file. Possible formats are
``text`` (the default), and ``raw``.
.. option:: -F format
``text`` (the default), ``raw``, and ``map``.
``-F format``
This option specifies the format of the output file specified. For
:iscman:`named-checkzone`, this does not have any effect unless it dumps
``named-checkzone``, this does not have any effect unless it dumps
the zone contents.
Possible formats are ``text`` (the default), which is the standard
textual representation of the zone, and ``raw`` and ``raw=N``, which
store the zone in a binary format for rapid loading by :iscman:`named`.
textual representation of the zone, and ``map``, ``raw``, and ``raw=N``, which
store the zone in a binary format for rapid loading by ``named``.
``raw=N`` specifies the format version of the raw zone file: if ``N`` is
0, the raw file can be read by any version of :iscman:`named`; if N is 1, the
0, the raw file can be read by any version of ``named``; if N is 1, the
file can only be read by release 9.9.0 or higher. The default is 1.
.. option:: -k mode
``-k mode``
This option performs ``check-names`` checks with the specified failure mode.
Possible modes are ``fail``, ``warn``, and ``ignore`` (the default).
.. option:: -l ttl
Possible modes are ``fail`` (the default), ``warn``, and ``ignore``.
``-l ttl``
This option sets a maximum permissible TTL for the input file. Any record with a
TTL higher than this value causes the zone to be rejected. This
is similar to using the ``max-zone-ttl`` option in :iscman:`named.conf`.
is similar to using the ``max-zone-ttl`` option in ``named.conf``.
.. option:: -L serial
When compiling a zone to ``raw`` format, this option sets the "source
``-L serial``
When compiling a zone to ``raw`` or ``map`` format, this option sets the "source
serial" value in the header to the specified serial number. This is
expected to be used primarily for testing purposes.
.. option:: -m mode
``-m mode``
This option specifies whether MX records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn``, and
``ignore`` (the default).
.. option:: -M mode
addresses. Possible modes are ``fail``, ``warn`` (the default), and
``ignore``.
``-M mode``
This option checks whether a MX record refers to a CNAME. Possible modes are
``fail``, ``warn``, and ``ignore`` (the default).
.. option:: -n mode
``fail``, ``warn`` (the default), and ``ignore``.
``-n mode``
This option specifies whether NS records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn``, and
``ignore`` (the default).
.. option:: -o filename
addresses. Possible modes are ``fail`` (the default), ``warn``, and
``ignore``.
``-o filename``
This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
the zone output is written to standard output. This is mandatory for :program:`named-compilezone`.
.. option:: -r mode
the zone output is written to standard output. This is mandatory for ``named-compilezone``.
``-r mode``
This option checks for records that are treated as different by DNSSEC but are
semantically equal in plain DNS. Possible modes are ``fail``,
``warn``, and ``ignore`` (the default).
.. option:: -s style
``warn`` (the default), and ``ignore``.
``-s style``
This option specifies the style of the dumped zone file. Possible styles are
``full`` (the default) and ``relative``. The ``full`` format is most
suitable for processing automatically by a separate script.
The relative format is more human-readable and is thus
suitable for editing by hand.
.. option:: -S mode
``-S mode``
This option checks whether an SRV record refers to a CNAME. Possible modes are
``fail``, ``warn``, and ``ignore`` (the default).
``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -t directory
This option tells :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
``-t directory``
This option tells ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
:iscman:`named`.
.. option:: -T mode
``named``.
``-T mode``
This option checks whether Sender Policy Framework (SPF) records exist and issues a
warning if an SPF-formatted TXT record is not also present. Possible
modes are ``warn`` and ``ignore`` (the default).
modes are ``warn`` (the default) and ``ignore``.
.. option:: -w directory
This option instructs :iscman:`named` to chdir to ``directory``, so that relative filenames in master file
``-w directory``
This option instructs ``named`` to chdir to ``directory``, so that relative filenames in master file
``$INCLUDE`` directives work. This is similar to the directory clause in
:iscman:`named.conf`.
.. option:: -D
``named.conf``.
``-D``
This option dumps the zone file in canonical format. This is always enabled for
:program:`named-compilezone`.
.. option:: -W mode
``named-compilezone``.
``-W mode``
This option specifies whether to check for non-terminal wildcards. Non-terminal
wildcards are almost always the result of a failure to understand the
wildcard matching algorithm (:rfc:`4592`). Possible modes are ``warn``
and ``ignore`` (the default).
.. option:: zonename
(the default) and ``ignore``.
``zonename``
This indicates the domain name of the zone being checked.
.. option:: filename
``filename``
This is the name of the zone file.
Return Values
~~~~~~~~~~~~~
:program:`named-compilezone` returns an exit status of 1 if errors were detected
``named-compilezone`` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:iscman:`named(8) <named>`, :iscman:`named-checkconf(8) <named-checkconf>`, :iscman:`named-checkzone(8) <named-checkzone>`, :rfc:`1035`,
BIND 9 Administrator Reference Manual.
:manpage:`named(8)`, :manpage:`named-checkconf(8)`, :manpage:`named-checkzone(8)`,
:rfc:`1035`, BIND 9 Administrator Reference Manual.

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{03A96113-CB14-43AA-AEB2-48950E3915C5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkconf</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checktool</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{66028555-7DD5-4016-B601-9EF9A1EE8BFA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkzone</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
copy /Y named-checkzone.ilk named-compilezone.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,30 +0,0 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
-DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\"
LDADD += \
libconfgen.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
noinst_LTLIBRARIES = libconfgen.la
libconfgen_la_SOURCES = \
include/confgen/os.h \
keygen.c \
keygen.h \
os.c \
util.c \
util.h
sbin_PROGRAMS = tsig-keygen rndc-confgen
install-exec-hook:
ln -f $(DESTDIR)$(sbindir)/tsig-keygen \
$(DESTDIR)$(sbindir)/ddns-confgen
uninstall-hook:
-rm -f $(DESTDIR)$(sbindir)/ddns-confgen

97
bin/confgen/Makefile.in Normal file
View File

@@ -0,0 +1,97 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES}
CDEFINES =
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @NO_LIBTOOL_ISCLIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
RNDCLIBS = ${ISCCFGLIBS} ${ISCCCLIBS} ${BIND9LIBS} ${DNSLIBS} ${ISCLIBS} @LIBS@
RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@
CONFDEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
SRCS= rndc-confgen.c ddns-confgen.c
SUBDIRS = unix
TARGETS = rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@
UOBJS = unix/os.@O@
@BIND9_MAKE_RULES@
rndc-confgen.@O@: rndc-confgen.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\" \
-c ${srcdir}/rndc-confgen.c
ddns-confgen.@O@: ddns-confgen.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c ${srcdir}/ddns-confgen.c
rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS}
export BASEOBJS="rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
${FINALBUILDCMD}
ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS}
export BASEOBJS="ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
${FINALBUILDCMD}
# make a link in the build directory to assist with testing
tsig-keygen@EXEEXT@: ddns-confgen@EXEEXT@
rm -f tsig-keygen@EXEEXT@
${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} rndc-confgen@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ddns-confgen@EXEEXT@ ${DESTDIR}${sbindir}
(cd ${DESTDIR}${sbindir}; rm -f tsig-keygen@EXEEXT@; ${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@)
uninstall::
rm -f ${DESTDIR}${sbindir}/tsig-keygen@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/ddns-confgen@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/rndc-confgen@EXEEXT@
clean distclean maintainer-clean::
rm -f ${TARGETS}

311
bin/confgen/ddns-confgen.c Normal file
View File

@@ -0,0 +1,311 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/**
* ddns-confgen generates configuration files for dynamic DNS. It can
* be used as a convenient alternative to writing the ddns.key file
* and the corresponding key and update-policy statements in named.conf.
*/
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "keygen.h"
#include "util.h"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen } progmode;
bool verbose = false; /* needed by util.c but not used here */
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
static void
usage(int status) {
if (progmode == progmode_confgen) {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [-k keyname] [-q] [-s name | -z zone]\n\
-a alg: algorithm (default hmac-sha256)\n\
-k keyname: name of the key as it will be used in named.conf\n\
-s name: domain name to be updated using the created key\n\
-z zone: name of the zone as it will be used in named.conf\n\
-q: quiet mode: print the key, with no explanatory text\n",
progname);
} else {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [keyname]\n\
-a alg: algorithm (default hmac-sha256)\n\n",
progname);
}
exit(status);
}
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
bool quiet = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
const char *keyname = NULL;
const char *zone = NULL;
const char *self_domain = NULL;
char *keybuf = NULL;
dns_secalg_t alg = DST_ALG_HMACSHA256;
const char *algname;
int keysize = 256;
int len = 0;
int ch;
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS) {
memmove(program, "tsig-keygen", 11);
}
progname = program;
/*
* Libtool doesn't preserve the program name prior to final
* installation. Remove the libtool prefix ("lt-").
*/
if (strncmp(progname, "lt-", 3) == 0) {
progname += 3;
}
#define PROGCMP(X) \
(strcasecmp(progname, X) == 0 || strcasecmp(progname, X ".exe") == 0)
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
UNREACHABLE();
}
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "a:hk:Mmr:qs:y:z:")) !=
-1)
{
switch (ch) {
case 'a':
algname = isc_commandline_argument;
alg = alg_fromtext(algname);
if (alg == DST_ALG_UNKNOWN) {
fatal("Unsupported algorithm '%s'", algname);
}
keysize = alg_bits(alg);
break;
case 'h':
usage(0);
case 'k':
case 'y':
if (progmode == progmode_confgen) {
keyname = isc_commandline_argument;
} else {
usage(1);
}
break;
case 'M':
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen) {
quiet = true;
} else {
usage(1);
}
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
case 's':
if (progmode == progmode_confgen) {
self_domain = isc_commandline_argument;
} else {
usage(1);
}
break;
case 'z':
if (progmode == progmode_confgen) {
zone = isc_commandline_argument;
} else {
usage(1);
}
break;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(1);
} else {
usage(0);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(1);
}
}
if (progmode == progmode_keygen) {
keyname = argv[isc_commandline_index++];
}
POST(argv);
if (self_domain != NULL && zone != NULL) {
usage(1); /* -s and -z cannot coexist */
}
if (argc > isc_commandline_index) {
usage(1);
}
/* Use canonical algorithm name */
algname = alg_totext(alg);
isc_mem_create(&mctx);
if (keyname == NULL) {
const char *suffix = NULL;
keyname = ((progmode == progmode_keygen) ? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL) {
suffix = self_domain;
} else if (zone != NULL) {
suffix = zone;
}
if (suffix != NULL) {
len = strlen(keyname) + strlen(suffix) + 2;
keybuf = isc_mem_get(mctx, len);
snprintf(keybuf, len, "%s.%s", keyname, suffix);
keyname = (const char *)keybuf;
}
}
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
generate_key(mctx, alg, keysize, &key_txtbuffer);
if (!quiet) {
printf("\
# To activate this key, place the following in named.conf, and\n\
# in a separate keyfile on the system or systems from which nsupdate\n\
# will be run:\n");
}
printf("\
key \"%s\" {\n\
algorithm %s;\n\
secret \"%.*s\";\n\
};\n",
keyname, algname, (int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer));
if (!quiet) {
if (self_domain != NULL) {
printf("\n\
# Then, in the \"zone\" statement for the zone containing the\n\
# name \"%s\", place an \"update-policy\" statement\n\
# like this one, adjusted as needed for your preferred permissions:\n\
update-policy {\n\
grant %s name %s ANY;\n\
};\n",
self_domain, keyname, self_domain);
} else if (zone != NULL) {
printf("\n\
# Then, in the \"zone\" definition statement for \"%s\",\n\
# place an \"update-policy\" statement like this one, adjusted as \n\
# needed for your preferred permissions:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
zone, keyname);
} else {
printf("\n\
# Then, in the \"zone\" statement for each zone you wish to dynamically\n\
# update, place an \"update-policy\" statement granting update permission\n\
# to this key. For example, the following statement grants this key\n\
# permission to update any name within the zone:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
keyname);
}
printf("\n\
# After the keyfile has been placed, the following command will\n\
# execute nsupdate using this key:\n\
nsupdate -k <keyfile>\n");
}
if (keybuf != NULL) {
isc_mem_put(mctx, keybuf, len);
}
if (show_final_mem) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);
return (0);
}

View File

@@ -13,8 +13,6 @@
.. BEWARE: Do not forget to edit also tsig-keygen.rst!
.. iscman:: ddns-confgen
.. program:: ddns-confgen
.. _man_ddns-confgen:
ddns-confgen - TSIG key generation tool
@@ -27,70 +25,64 @@ Synopsis
Description
~~~~~~~~~~~
:program:`ddns-confgen` is an utility that generates keys for use in TSIG signing.
``ddns-confgen`` is an utility that generates keys for use in TSIG signing.
The resulting keys can be used, for example, to secure dynamic DNS updates
to a zone, or for the :iscman:`rndc` command channel.
to a zone, or for the ``rndc`` command channel.
The key name can specified using :option:`-k` parameter and defaults to ``ddns-key``.
The key name can specified using ``-k`` parameter and defaults to ``ddns-key``.
The generated key is accompanied by configuration text and instructions that
can be used with :iscman:`nsupdate` and :iscman:`named` when setting up dynamic DNS,
can be used with ``nsupdate`` and ``named`` when setting up dynamic DNS,
including an example ``update-policy`` statement.
(This usage is similar to the :iscman:`rndc-confgen` command for setting up
(This usage is similar to the ``rndc-confgen`` command for setting up
command-channel security.)
Note that :iscman:`named` itself can configure a local DDNS key for use with
:option:`nsupdate -l`; it does this when a zone is configured with
``update-policy local;``. :program:`ddns-confgen` is only needed when a more
elaborate configuration is required: for instance, if :iscman:`nsupdate` is to
Note that ``named`` itself can configure a local DDNS key for use with
``nsupdate -l``; it does this when a zone is configured with
``update-policy local;``. ``ddns-confgen`` is only needed when a more
elaborate configuration is required: for instance, if ``nsupdate`` is to
be used from a remote system.
Options
~~~~~~~
.. option:: -a algorithm
``-a algorithm``
This option specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512. The default is hmac-sha256. Options are
case-insensitive, and the "hmac-" prefix may be omitted.
.. option:: -h
``-h``
This option prints a short summary of options and arguments.
.. option:: -k keyname
``-k keyname``
This option specifies the key name of the DDNS authentication key. The
default is ``ddns-key`` when neither the :option:`-s` nor :option:`-z` option is
default is ``ddns-key`` when neither the ``-s`` nor ``-z`` option is
specified; otherwise, the default is ``ddns-key`` as a separate label
followed by the argument of the option, e.g., ``ddns-key.example.com.``
The key name must have the format of a valid domain name, consisting of
letters, digits, hyphens, and periods.
.. option:: -q
``-q``
This option enables quiet mode, which prints only the key, with no
explanatory text or usage examples. This is essentially identical to
:iscman:`tsig-keygen`.
.. option:: -s name
``tsig-keygen``.
``-s name``
This option generates a configuration example to allow dynamic updates
of a single hostname. The example :iscman:`named.conf` text shows how to set
of a single hostname. The example ``named.conf`` text shows how to set
an update policy for the specified name using the "name" nametype. The
default key name is ``ddns-key.name``. Note that the "self" nametype
cannot be used, since the name to be updated may differ from the key
name. This option cannot be used with the :option:`-z` option.
.. option:: -z zone
name. This option cannot be used with the ``-z`` option.
``-z zone``
This option generates a configuration example to allow
dynamic updates of a zone. The example :iscman:`named.conf` text shows how
dynamic updates of a zone. The example ``named.conf`` text shows how
to set an update policy for the specified zone using the "zonesub"
nametype, allowing updates to all subdomain names within that zone.
This option cannot be used with the :option:`-s` option.
This option cannot be used with the ``-s`` option.
See Also
~~~~~~~~
:iscman:`nsupdate(1) <nsupdate>`, :iscman:`named.conf(5) <named.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.
:manpage:`nsupdate(1)`, :manpage:`named.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -13,7 +13,8 @@
/*! \file */
#pragma once
#ifndef RNDC_OS_H
#define RNDC_OS_H 1
#include <stdio.h>
@@ -31,3 +32,5 @@ set_user(FILE *fd, const char *user);
*/
ISC_LANG_ENDDECLS
#endif /* ifndef RNDC_OS_H */

View File

@@ -21,9 +21,12 @@
#include <isc/buffer.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <pk11/site.h>
#include <dns/keyvalues.h>
#include <dns/name.h>
@@ -33,6 +36,29 @@
#include "util.h"
/*%
* Convert algorithm type to string.
*/
const char *
alg_totext(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return ("hmac-md5");
case DST_ALG_HMACSHA1:
return ("hmac-sha1");
case DST_ALG_HMACSHA224:
return ("hmac-sha224");
case DST_ALG_HMACSHA256:
return ("hmac-sha256");
case DST_ALG_HMACSHA384:
return ("hmac-sha384");
case DST_ALG_HMACSHA512:
return ("hmac-sha512");
default:
return ("(unknown)");
}
}
/*%
* Convert string to algorithm type.
*/
@@ -44,24 +70,24 @@ alg_fromtext(const char *name) {
}
if (strcasecmp(p, "md5") == 0) {
return DST_ALG_HMACMD5;
return (DST_ALG_HMACMD5);
}
if (strcasecmp(p, "sha1") == 0) {
return DST_ALG_HMACSHA1;
return (DST_ALG_HMACSHA1);
}
if (strcasecmp(p, "sha224") == 0) {
return DST_ALG_HMACSHA224;
return (DST_ALG_HMACSHA224);
}
if (strcasecmp(p, "sha256") == 0) {
return DST_ALG_HMACSHA256;
return (DST_ALG_HMACSHA256);
}
if (strcasecmp(p, "sha384") == 0) {
return DST_ALG_HMACSHA384;
return (DST_ALG_HMACSHA384);
}
if (strcasecmp(p, "sha512") == 0) {
return DST_ALG_HMACSHA512;
return (DST_ALG_HMACSHA512);
}
return DST_ALG_UNKNOWN;
return (DST_ALG_UNKNOWN);
}
/*%
@@ -71,19 +97,19 @@ int
alg_bits(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return 128;
return (128);
case DST_ALG_HMACSHA1:
return 160;
return (160);
case DST_ALG_HMACSHA224:
return 224;
return (224);
case DST_ALG_HMACSHA256:
return 256;
return (256);
case DST_ALG_HMACSHA384:
return 384;
return (384);
case DST_ALG_HMACSHA512:
return 512;
return (512);
default:
return 0;
return (0);
}
}
@@ -124,7 +150,7 @@ generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
DO("generate key",
dst_key_generate(dns_rootname, alg, keysize, 0, 0, DNS_KEYPROTO_ANY,
dns_rdataclass_in, NULL, mctx, &key, NULL));
dns_rdataclass_in, mctx, &key, NULL));
isc_buffer_init(&key_rawbuffer, &key_rawsecret, sizeof(key_rawsecret));
@@ -151,7 +177,7 @@ void
write_key_file(const char *keyfile, const char *user, const char *keyname,
isc_buffer_t *secret, dns_secalg_t alg) {
isc_result_t result;
const char *algname = dst_hmac_algorithm_totext(alg);
const char *algname = alg_totext(alg);
FILE *fd = NULL;
DO("create keyfile", isc_file_safecreate(keyfile, &fd));
@@ -174,4 +200,5 @@ write_key_file(const char *keyfile, const char *user, const char *keyname,
if (fclose(fd)) {
fatal("fclose(%s) failed\n", keyfile);
}
fprintf(stderr, "wrote key file \"%s\"\n", keyfile);
}

View File

@@ -11,7 +11,8 @@
* information regarding copyright ownership.
*/
#pragma once
#ifndef RNDC_KEYGEN_H
#define RNDC_KEYGEN_H 1
/*! \file */
@@ -39,3 +40,5 @@ int
alg_bits(dns_secalg_t alg);
ISC_LANG_ENDDECLS
#endif /* RNDC_KEYGEN_H */

View File

@@ -1,36 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <confgen/os.h>
int
set_user(FILE *fd, const char *user) {
struct passwd *pw;
pw = getpwnam(user);
if (pw == NULL) {
errno = EINVAL;
return -1;
}
return fchown(fileno(fd), pw->pw_uid, -1);
}

View File

@@ -27,18 +27,20 @@
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
#include <pk11/site.h>
#include <dns/keyvalues.h>
#include <dns/name.h>
@@ -60,8 +62,8 @@ bool verbose = false;
const char *keyfile, *keydef;
noreturn static void
usage(int status);
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
static void
usage(int status) {
@@ -75,7 +77,6 @@ Usage:\n\
-c keyfile: specify an alternate key file (requires -a)\n\
-k keyname: the name as it will be used in named.conf and rndc.conf\n\
-p port: the port named will listen on and rndc will connect to\n\
-q: suppress printing written key path\n\
-s addr: the address to which rndc should connect\n\
-t chrootdir: write a keyfile in chrootdir as well (requires -a)\n\
-u user: set the keyfile owner to \"user\" (requires -a)\n",
@@ -104,7 +105,6 @@ main(int argc, char **argv) {
char *chrootdir = NULL;
char *user = NULL;
bool keyonly = false;
bool quiet = false;
int len;
keydef = keyfile = RNDC_KEYFILE;
@@ -146,8 +146,7 @@ main(int argc, char **argv) {
keyfile = isc_commandline_argument;
break;
case 'h':
usage(EXIT_SUCCESS);
break;
usage(0);
case 'k':
case 'y': /* Compatible with rndc -y. */
keyname = isc_commandline_argument;
@@ -166,9 +165,6 @@ main(int argc, char **argv) {
isc_commandline_argument);
}
break;
case 'q':
quiet = true;
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
@@ -193,15 +189,15 @@ main(int argc, char **argv) {
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(EXIT_FAILURE);
usage(1);
} else {
usage(EXIT_SUCCESS);
usage(0);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(EXIT_FAILURE);
exit(1);
}
}
@@ -210,7 +206,7 @@ main(int argc, char **argv) {
POST(argv);
if (argc > 0) {
usage(EXIT_FAILURE);
usage(1);
}
if (alg == DST_ALG_HMACMD5) {
@@ -222,7 +218,7 @@ main(int argc, char **argv) {
if (keysize < 0) {
keysize = alg_bits(alg);
}
algname = dst_hmac_algorithm_totext(alg);
algname = alg_totext(alg);
isc_mem_create(&mctx);
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
@@ -232,9 +228,6 @@ main(int argc, char **argv) {
if (keyonly) {
write_key_file(keyfile, chrootdir == NULL ? user : NULL,
keyname, &key_txtbuffer, alg);
if (!quiet) {
printf("wrote key file \"%s\"\n", keyfile);
}
if (chrootdir != NULL) {
char *buf;
@@ -244,9 +237,6 @@ main(int argc, char **argv) {
(*keyfile != '/') ? "/" : "", keyfile);
write_key_file(buf, user, keyname, &key_txtbuffer, alg);
if (!quiet) {
printf("wrote key file \"%s\"\n", buf);
}
isc_mem_put(mctx, buf, len);
}
} else {
@@ -290,5 +280,5 @@ options {\n\
isc_mem_destroy(&mctx);
return 0;
return (0);
}

View File

@@ -11,8 +11,6 @@
.. highlight: console
.. iscman:: rndc-confgen
.. program:: rndc-confgen
.. _man_rndc-confgen:
rndc-confgen - rndc key generation tool
@@ -26,96 +24,83 @@ Synopsis
Description
~~~~~~~~~~~
:program:`rndc-confgen` generates configuration files for :iscman:`rndc`. It can be
used as a convenient alternative to writing the :iscman:`rndc.conf` file and
the corresponding ``controls`` and ``key`` statements in :iscman:`named.conf`
by hand. Alternatively, it can be run with the :option:`-a` option to set up a
``rndc.key`` file and avoid the need for a :iscman:`rndc.conf` file and a
``rndc-confgen`` generates configuration files for ``rndc``. It can be
used as a convenient alternative to writing the ``rndc.conf`` file and
the corresponding ``controls`` and ``key`` statements in ``named.conf``
by hand. Alternatively, it can be run with the ``-a`` option to set up a
``rndc.key`` file and avoid the need for a ``rndc.conf`` file and a
``controls`` statement altogether.
Options
~~~~~~~
.. option:: -a
This option sets automatic :iscman:`rndc` configuration, which creates a file
|rndc_key| that is read by both :iscman:`rndc` and :iscman:`named` on startup.
``-a``
This option sets automatic ``rndc`` configuration, which creates a file ``rndc.key``
in ``/etc`` (or a different ``sysconfdir`` specified when BIND
was built) that is read by both ``rndc`` and ``named`` on startup.
The ``rndc.key`` file defines a default command channel and
authentication key allowing :iscman:`rndc` to communicate with :iscman:`named` on
authentication key allowing ``rndc`` to communicate with ``named`` on
the local host with no further configuration.
If a more elaborate configuration than that generated by
:option:`rndc-confgen -a` is required, for example if rndc is to be used
remotely, run :program:`rndc-confgen` without the :option:`-a` option
and set up :iscman:`rndc.conf` and :iscman:`named.conf` as directed.
.. option:: -A algorithm
``rndc-confgen -a`` is required, for example if rndc is to be used
remotely, run ``rndc-confgen`` without the ``-a`` option
and set up ``rndc.conf`` and ``named.conf`` as directed.
``-A algorithm``
This option specifies the algorithm to use for the TSIG key. Available choices
are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, and
hmac-sha512. The default is hmac-sha256.
.. option:: -b keysize
``-b keysize``
This option specifies the size of the authentication key in bits. The size must be between
1 and 512 bits; the default is the hash size.
.. option:: -c keyfile
This option is used with the :option:`-a` option to specify an alternate location for
``-c keyfile``
This option is used with the ``-a`` option to specify an alternate location for
``rndc.key``.
.. option:: -h
``-h``
This option prints a short summary of the options and arguments to
:program:`rndc-confgen`.
``rndc-confgen``.
.. option:: -k keyname
This option specifies the key name of the :iscman:`rndc` authentication key. This must be a
``-k keyname``
This option specifies the key name of the ``rndc`` authentication key. This must be a
valid domain name. The default is ``rndc-key``.
.. option:: -p port
``-p port``
This option specifies the command channel port where ``named`` listens for
connections from ``rndc``. The default is 953.
This option specifies the command channel port where :iscman:`named` listens for
connections from :iscman:`rndc`. The default is 953.
.. option:: -q
This option prevets printing the written path in automatic configuration mode.
.. option:: -s address
This option specifies the IP address where :iscman:`named` listens for command-channel
connections from :iscman:`rndc`. The default is the loopback address
``-s address``
This option specifies the IP address where ``named`` listens for command-channel
connections from ``rndc``. The default is the loopback address
127.0.0.1.
.. option:: -t chrootdir
This option is used with the :option:`-a` option to specify a directory where :iscman:`named`
``-t chrootdir``
This option is used with the ``-a`` option to specify a directory where ``named``
runs chrooted. An additional copy of the ``rndc.key`` is
written relative to this directory, so that it is found by the
chrooted :iscman:`named`.
chrooted ``named``.
.. option:: -u user
This option is used with the :option:`-a` option to set the owner of the generated ``rndc.key`` file.
If :option:`-t` is also specified, only the file in the chroot
``-u user``
This option is used with the ``-a`` option to set the owner of the generated ``rndc.key`` file.
If ``-t`` is also specified, only the file in the chroot
area has its owner changed.
Examples
~~~~~~~~
To allow :iscman:`rndc` to be used with no manual configuration, run:
To allow ``rndc`` to be used with no manual configuration, run:
``rndc-confgen -a``
To print a sample :iscman:`rndc.conf` file and the corresponding ``controls`` and
``key`` statements to be manually inserted into :iscman:`named.conf`, run:
To print a sample ``rndc.conf`` file and the corresponding ``controls`` and
``key`` statements to be manually inserted into ``named.conf``, run:
:program:`rndc-confgen`
``rndc-confgen``
See Also
~~~~~~~~
:iscman:`rndc(8) <rndc>`, :iscman:`rndc.conf(5) <rndc.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.
:manpage:`rndc(8)`, :manpage:`rndc.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -1,300 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/**
* tsig-keygen generates TSIG keys that can be used in named configuration
* files for dynamic DNS.
*/
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "keygen.h"
#include "util.h"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen } progmode;
bool verbose = false; /* needed by util.c but not used here */
noreturn static void
usage(int status);
static void
usage(int status) {
if (progmode == progmode_confgen) {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [-k keyname] [-q] [-s name | -z zone]\n\
-a alg: algorithm (default hmac-sha256)\n\
-k keyname: name of the key as it will be used in named.conf\n\
-s name: domain name to be updated using the created key\n\
-z zone: name of the zone as it will be used in named.conf\n\
-q: quiet mode: print the key, with no explanatory text\n",
progname);
} else {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [keyname]\n\
-a alg: algorithm (default hmac-sha256)\n\n",
progname);
}
exit(status);
}
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
bool quiet = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
const char *keyname = NULL;
const char *zone = NULL;
const char *self_domain = NULL;
char *keybuf = NULL;
dns_secalg_t alg = DST_ALG_HMACSHA256;
const char *algname;
int keysize = 256;
int len = 0;
int ch;
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS) {
memmove(program, "tsig-keygen", 11);
}
progname = program;
/*
* Libtool doesn't preserve the program name prior to final
* installation. Remove the libtool prefix ("lt-").
*/
if (strncmp(progname, "lt-", 3) == 0) {
progname += 3;
}
#define PROGCMP(X) \
(strcasecmp(progname, X) == 0 || strcasecmp(progname, X ".exe") == 0)
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
UNREACHABLE();
}
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "a:hk:Mmr:qs:y:z:")) !=
-1)
{
switch (ch) {
case 'a':
algname = isc_commandline_argument;
alg = alg_fromtext(algname);
if (alg == DST_ALG_UNKNOWN) {
fatal("Unsupported algorithm '%s'", algname);
}
keysize = alg_bits(alg);
break;
case 'h':
usage(EXIT_SUCCESS);
case 'k':
case 'y':
if (progmode == progmode_confgen) {
keyname = isc_commandline_argument;
} else {
usage(EXIT_FAILURE);
}
break;
case 'M':
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen) {
quiet = true;
} else {
usage(EXIT_FAILURE);
}
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
case 's':
if (progmode == progmode_confgen) {
self_domain = isc_commandline_argument;
} else {
usage(EXIT_FAILURE);
}
break;
case 'z':
if (progmode == progmode_confgen) {
zone = isc_commandline_argument;
} else {
usage(EXIT_FAILURE);
}
break;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(EXIT_FAILURE);
} else {
usage(EXIT_SUCCESS);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(EXIT_FAILURE);
}
}
if (progmode == progmode_keygen) {
keyname = argv[isc_commandline_index++];
}
POST(argv);
if (self_domain != NULL && zone != NULL) {
usage(EXIT_FAILURE); /* -s and -z cannot coexist */
}
if (argc > isc_commandline_index) {
usage(EXIT_FAILURE);
}
/* Use canonical algorithm name */
algname = dst_hmac_algorithm_totext(alg);
isc_mem_create(&mctx);
if (keyname == NULL) {
const char *suffix = NULL;
keyname = ((progmode == progmode_keygen) ? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL) {
suffix = self_domain;
} else if (zone != NULL) {
suffix = zone;
}
if (suffix != NULL) {
len = strlen(keyname) + strlen(suffix) + 2;
keybuf = isc_mem_get(mctx, len);
snprintf(keybuf, len, "%s.%s", keyname, suffix);
keyname = (const char *)keybuf;
}
}
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
generate_key(mctx, alg, keysize, &key_txtbuffer);
if (!quiet) {
printf("\
# To activate this key, place the following in named.conf, and\n\
# in a separate keyfile on the system or systems from which nsupdate\n\
# will be run:\n");
}
printf("\
key \"%s\" {\n\
algorithm %s;\n\
secret \"%.*s\";\n\
};\n",
keyname, algname, (int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer));
if (!quiet) {
if (self_domain != NULL) {
printf("\n\
# Then, in the \"zone\" statement for the zone containing the\n\
# name \"%s\", place an \"update-policy\" statement\n\
# like this one, adjusted as needed for your preferred permissions:\n\
update-policy {\n\
grant %s name %s ANY;\n\
};\n",
self_domain, keyname, self_domain);
} else if (zone != NULL) {
printf("\n\
# Then, in the \"zone\" definition statement for \"%s\",\n\
# place an \"update-policy\" statement like this one, adjusted as \n\
# needed for your preferred permissions:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
zone, keyname);
} else {
printf("\n\
# Then, in the \"zone\" statement for each zone you wish to dynamically\n\
# update, place an \"update-policy\" statement granting update permission\n\
# to this key. For example, the following statement grants this key\n\
# permission to update any name within the zone:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
keyname);
}
printf("\n\
# After the keyfile has been placed, the following command will\n\
# execute nsupdate using this key:\n\
nsupdate -k <keyfile>\n");
}
if (keybuf != NULL) {
isc_mem_put(mctx, keybuf, len);
}
if (show_final_mem) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);
return 0;
}

View File

@@ -13,8 +13,6 @@
.. BEWARE: Do not forget to edit also ddns-confgen.rst!
.. iscman:: tsig-keygen
.. program:: tsig-keygen
.. _man_tsig-keygen:
tsig-keygen - TSIG key generation tool
@@ -27,10 +25,9 @@ Synopsis
Description
~~~~~~~~~~~
:program:`tsig-keygen` is an utility that generates keys for use with TSIG
(Transaction Signatures) as defined in :rfc:`2845`. The resulting keys can be used,
for example, to secure dynamic DNS updates to a zone, or for the :iscman:`rndc`
command channel.
``tsig-keygen`` is an utility that generates keys for use in TSIG signing.
The resulting keys can be used, for example, to secure dynamic DNS updates
to a zone, or for the ``rndc`` command channel.
A domain name can be specified on the command line to be used as the name
of the generated key. If no name is specified, the default is ``tsig-key``.
@@ -38,18 +35,16 @@ of the generated key. If no name is specified, the default is ``tsig-key``.
Options
~~~~~~~
.. option:: -a algorithm
``-a algorithm``
This option specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512. The default is hmac-sha256. Options are
case-insensitive, and the "hmac-" prefix may be omitted.
.. option:: -h
``-h``
This option prints a short summary of options and arguments.
See Also
~~~~~~~~
:iscman:`nsupdate(1) <nsupdate>`, :iscman:`named.conf(5) <named.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.
:manpage:`nsupdate(1)`, :manpage:`named.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -0,0 +1,30 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include -I${srcdir}/../include \
${DNS_INCLUDES} ${ISC_INCLUDES}
CDEFINES =
CWARNINGS =
OBJS = os.@O@
SRCS = os.c
TARGETS = ${OBJS}
@BIND9_MAKE_RULES@

36
bin/confgen/unix/os.c Normal file
View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <confgen/os.h>
int
set_user(FILE *fd, const char *user) {
struct passwd *pw;
pw = getpwnam(user);
if (pw == NULL) {
errno = EINVAL;
return (-1);
}
return (fchown(fileno(fd), pw->pw_uid, -1));
}

View File

@@ -13,15 +13,13 @@
/*! \file */
#include "util.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <isc/tls.h>
#include "util.h"
#include <isc/print.h>
extern bool verbose;
extern const char *progname;
@@ -34,7 +32,7 @@ notify(const char *fmt, ...) {
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
fputs("\n", stderr);
}
}
@@ -47,5 +45,5 @@ fatal(const char *format, ...) {
vfprintf(stderr, format, args);
va_end(args);
fprintf(stderr, "\n");
_exit(EXIT_FAILURE);
exit(1);
}

View File

@@ -11,13 +11,14 @@
* information regarding copyright ownership.
*/
#pragma once
#ifndef RNDC_UTIL_H
#define RNDC_UTIL_H 1
/*! \file */
#include <isc/attributes.h>
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/platform.h>
#define NS_CONTROL_PORT 953
@@ -36,7 +37,10 @@ ISC_LANG_BEGINDECLS
void
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
noreturn void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_PLATFORM_NORETURN_PRE void
fatal(const char *format, ...)
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
ISC_LANG_ENDDECLS
#endif /* RNDC_UTIL_H */

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\keygen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\confgen\os.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="os.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{64964B03-4815-41F0-9057-E766A94AF197}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>confgentool</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\confgen\os.h" />
<ClInclude Include="..\keygen.h" />
<ClInclude Include="..\util.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c" />
<ClCompile Include="..\util.c" />
<ClCompile Include="os.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1EA4FC64-F33B-4A50-970A-EA052BBE9CF1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ddnsconfgen</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>ddns-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>ddns-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y ddns-confgen.exe tsig-keygen.exe
copy /Y ddns-confgen.ilk tsig-keygen.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y ddns-confgen.exe tsig-keygen.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

27
bin/confgen/win32/os.c Normal file
View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#include <errno.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <confgen/os.h>
int
set_user(FILE *fd, const char *user) {
return (0);
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1E2C1635-3093-4D59-80E7-4743AC10F22F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rndcconfgen</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,23 +0,0 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
-I$(top_builddir)/include \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(OPENSSL_CFLAGS)
AM_CPPFLAGS += \
-DSYSCONFDIR=\"${sysconfdir}\"
bin_PROGRAMS = delv
delv_SOURCES = \
delv.c
delv_LDADD = \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBNS_LIBS) \
$(LIBISCCFG_LIBS)

70
bin/delv/Makefile.in Normal file
View File

@@ -0,0 +1,70 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} \
${OPENSSL_CFLAGS}
CDEFINES = -DVERSION=\"${VERSION}\" \
-DSYSCONFDIR=\"${sysconfdir}\"
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @NO_LIBTOOL_ISCLIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@
IRSLIBS = ../../lib/irs/libirs.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
IRSDEPLIBS = ../../lib/irs/libirs.@A@
DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
SUBDIRS =
TARGETS = delv@EXEEXT@
OBJS = delv.@O@
SRCS = delv.c
@BIND9_MAKE_RULES@
delv@EXEEXT@: delv.@O@ ${DEPLIBS}
export BASEOBJS="delv.@O@"; \
export LIBS0="${DNSLIBS}"; \
${FINALBUILDCMD}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
install:: delv@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
delv@EXEEXT@ ${DESTDIR}${bindir}
uninstall::
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/delv@EXEEXT@
clean distclean maintainer-clean::
rm -f ${TARGETS}

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,6 @@
.. highlight: console
.. iscman:: delv
.. program:: delv
.. _man_delv:
delv - DNS lookup and validation utility
@@ -32,10 +30,10 @@ Synopsis
Description
~~~~~~~~~~~
:program:`delv` is a tool for sending DNS queries and validating the results,
using the same internal resolver and validator logic as :iscman:`named`.
``delv`` is a tool for sending DNS queries and validating the results,
using the same internal resolver and validator logic as ``named``.
:program:`delv` sends to a specified name server all queries needed to
``delv`` sends to a specified name server all queries needed to
fetch and validate the requested data; this includes the original
requested query, subsequent queries to follow CNAME or DNAME chains,
queries for DNSKEY, and DS records to establish a chain of trust for
@@ -44,25 +42,25 @@ simulates the behavior of a name server configured for DNSSEC validating
and forwarding.
By default, responses are validated using the built-in DNSSEC trust anchor
for the root zone ("."). Records returned by :program:`delv` are either fully
for the root zone ("."). Records returned by ``delv`` are either fully
validated or were not signed. If validation fails, an explanation of the
failure is included in the output; the validation process can be traced
in detail. Because :program:`delv` does not rely on an external server to carry
in detail. Because ``delv`` does not rely on an external server to carry
out validation, it can be used to check the validity of DNS responses in
environments where local name servers may not be trustworthy.
Unless it is told to query a specific name server, :program:`delv` tries
Unless it is told to query a specific name server, ``delv`` tries
each of the servers listed in ``/etc/resolv.conf``. If no usable server
addresses are found, :program:`delv` sends queries to the localhost
addresses are found, ``delv`` sends queries to the localhost
addresses (127.0.0.1 for IPv4, ::1 for IPv6).
When no command-line arguments or options are given, :program:`delv`
When no command-line arguments or options are given, ``delv``
performs an NS query for "." (the root zone).
Simple Usage
~~~~~~~~~~~~
A typical invocation of :program:`delv` looks like:
A typical invocation of ``delv`` looks like:
::
@@ -70,143 +68,125 @@ A typical invocation of :program:`delv` looks like:
where:
.. option:: server
``server``
is the name or IP address of the name server to query. This can be an
IPv4 address in dotted-decimal notation or an IPv6 address in
colon-delimited notation. When the supplied ``server`` argument is a
hostname, :program:`delv` resolves that name before querying that name
hostname, ``delv`` resolves that name before querying that name
server (note, however, that this initial lookup is *not* validated by
DNSSEC).
If no ``server`` argument is provided, :program:`delv` consults
If no ``server`` argument is provided, ``delv`` consults
``/etc/resolv.conf``; if an address is found there, it queries the
name server at that address. If either of the :option:`-4` or :option:`-6`
name server at that address. If either of the ``-4`` or ``-6``
options is in use, then only addresses for the corresponding
transport are tried. If no usable addresses are found, :program:`delv`
transport are tried. If no usable addresses are found, ``delv``
sends queries to the localhost addresses (127.0.0.1 for IPv4, ::1
for IPv6).
.. option:: name
``name``
is the domain name to be looked up.
.. option:: type
``type``
indicates what type of query is required - ANY, A, MX, etc.
``type`` can be any valid query type. If no ``type`` argument is
supplied, :program:`delv` performs a lookup for an A record.
supplied, ``delv`` performs a lookup for an A record.
Options
~~~~~~~
.. option:: -a anchor-file
``-a anchor-file``
This option specifies a file from which to read DNSSEC trust anchors. The default
is ``/etc/bind.keys``, which is included with BIND 9 and contains one
or more trust anchors for the root zone (".").
This option specifies a file from which to read an alternate
DNSSEC root zone trust anchor.
Keys that do not match the root zone name are ignored. An alternate
key name can be specified using the ``+root=NAME`` options.
By default, keys that do not match the root zone name (`.`) are
ignored. If an alternate key name is desired, it can be
specified using the :option:`+root` option.
Note: When reading trust anchors, :program:`delv` treats
``trust-anchors``, ``initial-key``, and ``static-key`` identically. That
is, for a managed key, it is the *initial* key that is trusted;
:rfc:`5011` key management is not supported. :program:`delv` does not
consult the managed-keys database maintained by :iscman:`named`. This
means that if the default key built in to :program:`delv` is revoked,
:program:`delv` must be updated to a newer version in order to continue
validating.
.. option:: -b address
Note: When reading the trust anchor file, ``delv`` treats ``trust-anchors``,
``initial-key``, and ``static-key`` identically. That is, for a managed key,
it is the *initial* key that is trusted; :rfc:`5011` key management is not
supported. ``delv`` does not consult the managed-keys database maintained by
``named``, which means that if either of the keys in ``/etc/bind.keys`` is
revoked and rolled over, ``/etc/bind.keys`` must be updated to
use DNSSEC validation in ``delv``.
``-b address``
This option sets the source IP address of the query to ``address``. This must be
a valid address on one of the host's network interfaces, or ``0.0.0.0``,
or ``::``. An optional source port may be specified by appending
``#<port>``
.. option:: -c class
``-c class``
This option sets the query class for the requested data. Currently, only class
"IN" is supported in :program:`delv` and any other value is ignored.
.. option:: -d level
"IN" is supported in ``delv`` and any other value is ignored.
``-d level``
This option sets the systemwide debug level to ``level``. The allowed range is
from 0 to 99. The default is 0 (no debugging). Debugging traces from
:program:`delv` become more verbose as the debug level increases. See the
:option:`+mtrace`, :option:`+rtrace`, and :option:`+vtrace` options below for
``delv`` become more verbose as the debug level increases. See the
``+mtrace``, ``+rtrace``, and ``+vtrace`` options below for
additional debugging details.
.. option:: -h
This option displays the :program:`delv` help usage output and exits.
.. option:: -i
``-h``
This option displays the ``delv`` help usage output and exits.
``-i``
This option sets insecure mode, which disables internal DNSSEC validation. (Note,
however, that this does not set the CD bit on upstream queries. If the
server being queried is performing DNSSEC validation, then it does
not return invalid data; this can cause :program:`delv` to time out. When it
not return invalid data; this can cause ``delv`` to time out. When it
is necessary to examine invalid data to debug a DNSSEC problem, use
:option:`dig +cd`.)
.. option:: -m
``dig +cd``.)
``-m``
This option enables memory usage debugging.
.. option:: -p port#
``-p port#``
This option specifies a destination port to use for queries, instead of the
standard DNS port number 53. This option is used with a name
server that has been configured to listen for queries on a
non-standard port number.
.. option:: -q name
``-q name``
This option sets the query name to ``name``. While the query name can be
specified without using the :option:`-q` option, it is sometimes necessary to
specified without using the ``-q`` option, it is sometimes necessary to
disambiguate names from types or classes (for example, when looking
up the name "ns", which could be misinterpreted as the type NS, or
"ch", which could be misinterpreted as class CH).
.. option:: -t type
``-t type``
This option sets the query type to ``type``, which can be any valid query type
supported in BIND 9 except for zone transfer types AXFR and IXFR. As
with :option:`-q`, this is useful to distinguish query-name types or classes
with ``-q``, this is useful to distinguish query-name types or classes
when they are ambiguous. It is sometimes necessary to disambiguate
names from types.
The default query type is "A", unless the :option:`-x` option is supplied
The default query type is "A", unless the ``-x`` option is supplied
to indicate a reverse lookup, in which case it is "PTR".
.. option:: -v
This option prints the :program:`delv` version and exits.
.. option:: -x addr
``-v``
This option prints the ``delv`` version and exits.
``-x addr``
This option performs a reverse lookup, mapping an address to a name. ``addr``
is an IPv4 address in dotted-decimal notation, or a colon-delimited
IPv6 address. When :option:`-x` is used, there is no need to provide the
``name`` or ``type`` arguments; :program:`delv` automatically performs a
IPv6 address. When ``-x`` is used, there is no need to provide the
``name`` or ``type`` arguments; ``delv`` automatically performs a
lookup for a name like ``11.12.13.10.in-addr.arpa`` and sets the
query type to PTR. IPv6 addresses are looked up using nibble format
under the IP6.ARPA domain.
.. option:: -4
``-4``
This option forces ``delv`` to only use IPv4.
This option forces :program:`delv` to only use IPv4.
.. option:: -6
This option forces :program:`delv` to only use IPv6.
``-6``
This option forces ``delv`` to only use IPv6.
Query Options
~~~~~~~~~~~~~
:program:`delv` provides a number of query options which affect the way results
``delv`` provides a number of query options which affect the way results
are displayed, and in some cases the way lookups are performed.
Each query option is identified by a keyword preceded by a plus sign
@@ -215,121 +195,69 @@ the string ``no`` to negate the meaning of that keyword. Other keywords
assign values to options like the timeout interval. They have the form
``+keyword=value``. The query options are:
.. option:: +cdflag, +nocdflag
``+[no]cdflag``
This option controls whether to set the CD (checking disabled) bit in queries
sent by :program:`delv`. This may be useful when troubleshooting DNSSEC
sent by ``delv``. This may be useful when troubleshooting DNSSEC
problems from behind a validating resolver. A validating resolver
blocks invalid responses, making it difficult to retrieve them
for analysis. Setting the CD flag on queries causes the resolver
to return invalid responses, which :program:`delv` can then validate
to return invalid responses, which ``delv`` can then validate
internally and report the errors in detail.
.. option:: +class, +noclass
``+[no]class``
This option controls whether to display the CLASS when printing a record. The
default is to display the CLASS.
.. option:: +hint=FILE, +nohint
This option specifies a filename from which to load root hints;
this will be used to find the root name servers when name server
mode (``delv +ns``) is in use. If the option is not specified,
built-in root hints will be used.
.. option:: +ns, +nons
This option toggles name server mode. When this option is in use,
the ``delv`` process instantiates a full recursive resolver, and uses
that to look up the requested query name and type. Turning on this
option also activates ``+mtrace``, ``+strace`` and ``+rtrace``, so that
every iterative query will be logged, including the full response messages
from each authoritatve server. These logged messages will be written
to ``stdout`` rather than ``stderr`` as usual, so that the full trace
can be captured more easily.
This is intended to be similar to the behavior of ``dig +trace``, but
because it uses the same code as ``named``, it much more accurately
replicates the behavior of a recursive name server with a cold cache
that is processing a recursive query.
.. option:: +qmin[=MODE], +noqmin
When used with ``+ns``, this option enables QNAME minimization mode.
Valid options of MODE are ``relaxed`` and ``strict``. By default,
QNAME minimization is disabled. If ``+qmin`` is specified but MODE
is omitted, then ``relaxed`` mode will be used.
.. option:: +ttl, +nottl
``+[no]ttl``
This option controls whether to display the TTL when printing a record. The
default is to display the TTL.
.. option:: +rtrace, +nortrace
This option toggles resolver fetch logging. This reports the name and
type of each query sent by :program:`delv` in the process of carrying
out the resolution and validation process, including the original query
and all subsequent queries to follow CNAMEs and to establish a chain of
trust for DNSSEC validation.
``+[no]rtrace``
This option toggles resolver fetch logging. This reports the name and type of each
query sent by ``delv`` in the process of carrying out the resolution
and validation process, including the original query
and all subsequent queries to follow CNAMEs and to establish a chain
of trust for DNSSEC validation.
This is equivalent to setting the debug level to 1 in the "resolver"
logging category. Setting the systemwide debug level to 1 using the
:option:`-d` option produces the same output, but affects other
``-d`` option produces the same output, but affects other
logging categories as well.
.. option:: +mtrace, +nomtrace
This option toggles logging of messages received. This produces
a detailed dump of the responses received by :program:`delv` in the
process of carrying out the resolution and validation process.
``+[no]mtrace``
This option toggles message logging. This produces a detailed dump of the
responses received by ``delv`` in the process of carrying out the
resolution and validation process.
This is equivalent to setting the debug level to 10 for the "packets"
module of the "resolver" logging category. Setting the systemwide
debug level to 10 using the :option:`-d` option produces the same
debug level to 10 using the ``-d`` option produces the same
output, but affects other logging categories as well.
.. option:: +strace, +nostrace
This option toggles logging of messages sent. This produces a detailed
dump of the queries sent by :program:`delv` in the process of carrying
out the resolution and validation process. Turning on this option
also activates ``+mtrace``.
This is equivalent to setting the debug level to 11 for the "packets"
module of the "resolver" logging category. Setting the systemwide
debug level to 11 using the :option:`-d` option produces the same
output, but affects other logging categories as well.
.. option:: +vtrace, +novtrace
``+[no]vtrace``
This option toggles validation logging. This shows the internal process of the
validator as it determines whether an answer is validly signed,
unsigned, or invalid.
This is equivalent to setting the debug level to 3 for the
"validator" module of the "dnssec" logging category. Setting the
systemwide debug level to 3 using the :option:`-d` option produces the
systemwide debug level to 3 using the ``-d`` option produces the
same output, but affects other logging categories as well.
.. option:: +short, +noshort
``+[no]short``
This option toggles between verbose and terse answers. The default is to print the answer in a
verbose form.
.. option:: +comments, +nocomments
``+[no]comments``
This option toggles the display of comment lines in the output. The default is to
print comments.
.. option:: +rrcomments, +norrcomments
``+[no]rrcomments``
This option toggles the display of per-record comments in the output (for example,
human-readable key information about DNSKEY records). The default is
to print per-record comments.
.. option:: +crypto, +nocrypto
``+[no]crypto``
This option toggles the display of cryptographic fields in DNSSEC records. The
contents of these fields are unnecessary to debug most DNSSEC
validation failures and removing them makes it easier to see the
@@ -337,86 +265,62 @@ assign values to options like the timeout interval. They have the form
they are replaced by the string ``[omitted]`` or, in the DNSKEY case, the
key ID is displayed as the replacement, e.g. ``[ key id = value ]``.
.. option:: +restarts
When name server mode (``delv +ns``) is in use, this option sets the
maximum number of CNAME queries to follow before terminating resolution.
This prevents ``delv`` from hanging in the event of a CNAME loop.
The default is 11.
.. option:: +maxqueries
This option specifies the maximum number of queries to send to resolve
a name before giving up. The default is 50.
.. option:: +maxtotalqueries
This option specifies the maximum number of queries to send to resolve
a client request before giving up. The default is 200.
.. option:: +trust, +notrust
``+[no]trust``
This option controls whether to display the trust level when printing a record.
The default is to display the trust level.
.. option:: +split[=W], +nosplit
``+[no]split[=W]``
This option splits long hex- or base64-formatted fields in resource records into
chunks of ``W`` characters (where ``W`` is rounded up to the nearest
multiple of 4). ``+nosplit`` or ``+split=0`` causes fields not to be
split at all. The default is 56 characters, or 44 characters when
multiline mode is active.
.. option:: +all, +noall
This option sets or clears the display options :option:`+comments`,
:option:`+rrcomments`, and :option:`+trust` as a group.
.. option:: +multiline, +nomultiline
``+[no]all``
This option sets or clears the display options ``+[no]comments``,
``+[no]rrcomments``, and ``+[no]trust`` as a group.
``+[no]multiline``
This option prints long records (such as RRSIG, DNSKEY, and SOA records) in a
verbose multi-line format with human-readable comments. The default
is to print each record on a single line, to facilitate machine
parsing of the :program:`delv` output.
parsing of the ``delv`` output.
.. option:: +dnssec, +nodnssec
This option indicates whether to display RRSIG records in the :program:`delv` output.
The default is to do so. Note that (unlike in :iscman:`dig`) this does
``+[no]dnssec``
This option indicates whether to display RRSIG records in the ``delv`` output.
The default is to do so. Note that (unlike in ``dig``) this does
*not* control whether to request DNSSEC records or to
validate them. DNSSEC records are always requested, and validation
always occurs unless suppressed by the use of :option:`-i` or
:option:`+noroot`.
.. option:: +root[=ROOT], +noroot
always occurs unless suppressed by the use of ``-i`` or
``+noroot``.
``+[no]root[=ROOT]``
This option indicates whether to perform conventional DNSSEC validation, and if so,
specifies the name of a trust anchor. The default is to validate using a
trust anchor of "." (the root zone), for which there is a built-in key. If
specifying a different trust anchor, then :option:`-a` must be used to specify a
specifying a different trust anchor, then ``-a`` must be used to specify a
file containing the key.
.. option:: +tcp, +notcp
``+[no]tcp``
This option controls whether to use TCP when sending queries. The default is to
use UDP unless a truncated response has been received.
.. option:: +unknownformat, +nounknownformat
``+[no]unknownformat``
This option prints all RDATA in unknown RR-type presentation format (:rfc:`3597`).
The default is to print RDATA for known types in the type's
presentation format.
.. option:: +yaml, +noyaml
``+[no]yaml``
This option prints response data in YAML format.
Files
~~~~~
``/etc/bind.keys``
``/etc/resolv.conf``
See Also
~~~~~~~~
:iscman:`dig(1) <dig>`, :iscman:`named(8) <named>`, :rfc:`4034`, :rfc:`4035`, :rfc:`4431`, :rfc:`5074`, :rfc:`5155`.
:manpage:`dig(1)`, :manpage:`named(8)`, :rfc:`4034`, :rfc:`4035`, :rfc:`4431`, :rfc:`5074`, :rfc:`5155`.

Some files were not shown because too many files have changed in this diff Show More