Commit graph

37082 commits

Author SHA1 Message Date
Tom Krizek
f4d0b2dca9
Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'"
This reverts commit 81b6f17e7c, reversing
changes made to ea47a9c100.

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

See merge request isc-projects/bind9!7188
2022-12-08 01:03:23 +00:00
Mark Andrews
2ddf710e40 Add CHANGES note for [GL #3613]
(cherry picked from commit 485e968087)
2022-12-07 23:59:36 +00:00
Mark Andrews
d218c7f2f3 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-07 23:59:36 +00:00
Mark Andrews
47239b45e6 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-07 23:59:36 +00:00
Mark Andrews
6f998bbe51 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-07 23:59:36 +00:00
Mark Andrews
434b53281b 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-07 23:59:36 +00:00
Mark Andrews
52a9db2180 Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-07 23:59:36 +00:00
Mark Andrews
50caecea06 Revert "Fix rndc dumpdb -expired for stuck cache contents"
This reverts commit f8d866c6ef.

(cherry picked from commit 90249e4aa5)
2022-12-07 23:59:36 +00:00
Mark Andrews
2cc91f65c4 Merge branch '3724-update-dig-tcp-documentation-v9_18' into 'v9_18'
Add reference to +tcp for +ignore [v9_18]

See merge request isc-projects/bind9!7186
2022-12-07 23:13:46 +00:00
Mark Andrews
f8ce443684 Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:29:35 +11:00
Ondřej Surý
6c0577ad81 Merge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test-v9_18' into 'v9_18'
Fix missing zone_check() call in checkds test [v9.18]

See merge request isc-projects/bind9!7182
2022-12-07 18:46:48 +00:00
Ondřej Surý
5164ba8d71
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:34:42 +01:00
Ondřej Surý
31eed6a31f Merge branch '3183-send-shutdown-to-ns_client-on-shutdown-v9_18' into 'v9_18'
Propagate the shutdown event to the recursing ns_client(s) [v9.18]

See merge request isc-projects/bind9!7028
2022-12-07 18:33:27 +00:00
Ondřej Surý
2cb02a417a
Add CHANGES and release notes for [GL #3183]
(cherry picked from commit d3f1639c16e7777a52d66c2dccd8b43a08a0750b)
2022-12-07 18:09:06 +01:00
Ondřej Surý
85e35d4c27
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:08:29 +01:00
Ondřej Surý
d3ae26fa8e Merge branch '3386-nxdomain-serve-stale-v9_18' into 'v9_18'
don't keep stale NXDOMAIN cache entries [v9.18]

See merge request isc-projects/bind9!7180
2022-12-07 16:58:35 +00:00
Evan Hunt
265d606fd3
CHANGES and release note for [GL #3386]
(cherry picked from commit 15f08ca961)
2022-12-07 17:46:53 +01:00
Evan Hunt
2b78a2f9fa
don't keep stale NXDOMAIN cache entries
when serve-stale is enabled, NXDOMAIN cache entries are no longer
preserved after the normal negative cache TTL, in order to reduce
unnecessary cache memory consumption.

(cherry picked from commit f1485ca145)
2022-12-07 17:21:00 +01:00
Matthijs Mekking
b6df5bfe2b Merge branch 'matthijs-document-ns-minimal-responses-v9_18' into 'v9_18'
Document NS queries are excempt from minimal-responses

See merge request isc-projects/bind9!7176
2022-12-07 12:09:20 +00:00
Matthijs Mekking
7694e5019c 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:06:43 +01:00
Michal Nowak
f275e9896b Merge branch 'mnowak/asan-tsan-respdiff-jobs-v9_18' into 'v9_18'
[v9_18] Add ASAN- and TSAN-enabled respdiff jobs

See merge request isc-projects/bind9!7173
2022-12-07 09:40:47 +00:00
Michal Nowak
af03ec8987
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 08:28:16 +01:00
Michal Nowak
865bc5c250
Extract TSAN parsing code
(cherry picked from commit 9856296666)
2022-12-07 08:27:56 +01:00
Mark Andrews
9dd77f770c Merge branch '3683-use-after-free-in-catalog-zone-processing-v9_18' into 'v9_18'
Resolve "use after free in catalog zone processing" [v9_18]

See merge request isc-projects/bind9!7170
2022-12-06 23:30:49 +00:00
Mark Andrews
c8fa438768 Add release note for [GL #3683]
(cherry picked from commit 9843da3423)
2022-12-07 09:45:21 +11:00
Mark Andrews
569b7b20da Add CHANGES note for [GL #3683]
(cherry picked from commit 72402e1710)
2022-12-07 09:44:35 +11:00
Mark Andrews
814ae11d19 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 09:44:35 +11:00
Mark Andrews
1e6a12091f 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:44:35 +11:00
Mark Andrews
6e2a33dd4c 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:44:35 +11:00
Mark Andrews
90822519eb 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:44:30 +11:00
Arаm Sаrgsyаn
81b6f17e7c Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'
[v9_18] Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

See merge request isc-projects/bind9!7166
2022-12-06 15:01:29 +00:00
Michał Kępień
a4547a1093 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:47:51 +00:00
Aram Sargsyan
f92b3b496f Add a CHANGES note for [GL #3678]
(cherry picked from commit 5b5f3a0ea7)
2022-12-06 13:47:38 +00:00
Matthijs Mekking
65443cb59f 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:47:22 +00:00
Aram Sargsyan
4ae4f1fd48 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:46:55 +00:00
Mark Andrews
ea47a9c100 Merge branch '3721-the-nslookup-command-does-not-obey-the-port-option-when-record-type-any-is-used-v9_18' into 'v9_18'
Resolve "The nslookup command does not obey the port option when record type ANY is used." [v9_18]

See merge request isc-projects/bind9!7164
2022-12-06 00:11:32 +00:00
Mark Andrews
0033c12002 Add CHANGES note for [GL #3721]
(cherry picked from commit 27168dbf43)
2022-12-06 09:22:39 +11:00
Mark Andrews
0569fa0d25 Remember that the port was set in host and nslookup
Set 'port_set = true;' so that the TCP/DOT/DOH code doesn't reset
the port when making connections.

(cherry picked from commit 8caa94bdf1)
2022-12-06 09:21:43 +11:00
Mark Andrews
e1234f66c6 Add checks for 'host'
(cherry picked from commit e9c4192ee5)
2022-12-06 09:21:43 +11:00
Mark Andrews
375918493e Check ANY lookup using nslookup
(cherry picked from commit c367dd1b0b)
2022-12-06 09:21:43 +11:00
Artem Boldariev
825c40697e Merge branch 'artem-tls-tcp-compatibility-fixes-v9-18' into 'v9_18'
[Partial backport to 9.18] TLS Stream: TCP transport compatibility fixes

See merge request isc-projects/bind9!7160
2022-12-02 21:45:54 +00:00
Artem Boldariev
f921cb4579 TLS: take 'sock->recv_read' flag into assumption
For compatibility with TCP this commit adds some trivial logic related
to 'sock->recv_read' flag processing.
2022-12-02 15:37:41 +02:00
Artem Boldariev
c1c22ad69a TLS stream: always handle send callbacks asynchronously
This commit ensures that send callbacks are always called from within
the context of its worker thread even in the case of
shuttigdown/inactive socket, just like TCP transport does and with
which TLS attempts to be as compatible as possible.

(cherry picked from commit 2bfc079946)
2022-12-02 15:37:41 +02:00
Artem Boldariev
66bec1d886 TLS Stream: use ISC_R_CANCELLED error when shutting down
This commit changes ISC_R_NOTCONNECTED error code to ISC_R_CANCELLED
when attempting to start reading data on the shutting down socket in
order to make its behaviour compatible with that of TCP and not break
the common code in the unit tests.

(cherry picked from commit ef659365ce)
2022-12-02 15:37:41 +02:00
Artem Boldariev
fbec0ece73 Merge branch 'artem-tls-check-for-recv_cb-v9-18' into 'v9_18'
TLS: check for sock->recv_cb when handling received data

See merge request isc-projects/bind9!7159
2022-12-02 13:31:42 +00:00
Artem Boldariev
fc637fbdc3 TLS: check for sock->recv_cb when handling received data
This commit adds a check if 'sock->recv_cb' might have been nullified
during the call to 'sock->recv_cb'. That could happen, e.g. by an
indirect call to 'isc_nmhandle_close()' from within the callback when
wrapping up.

In this case, let's close the TLS connection.

(cherry picked from commit bed5e2bb08)
2022-12-02 14:29:36 +02:00
Tom Krizek
90b924be13 Merge branch 'tkrizek/system-tests-prereqs-v9_18' into 'v9_18'
Unify system test feature detection and add missing prerequisites [v9_18]

See merge request isc-projects/bind9!7156
2022-12-02 11:33:38 +00:00
Tom Krizek
ca4ebedf02
Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 10:45:21 +01:00
Tom Krizek
5a0d5c6e6f
Add libnghttp2 prerequisite for doth system test
While some of these tests are for DoT which doesn't require nghttp2,
the server configs won't allow the server to start without nghttp2
support during compile time.

It might be possible to split these tests into DoT and DoH and only
require nghttp2 for DoH tests, but since almost all of our CI jobs are
compiled with nghttp2, we wouldn't gain a lot of coverage, so it's
probably not worth the effort.

(cherry picked from commit f514604613)
2022-12-02 10:45:21 +01:00