Commit Graph

34951 Commits

Author SHA1 Message Date
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