Commit graph

37731 commits

Author SHA1 Message Date
Mark Andrews
3bdab2d111 Properly select active rdatasets when iterating across node
Active rdatasets where not being properly selected in rdatasetiter_first
and rdatasetiter_next.
2022-12-07 22:20:02 +00:00
Mark Andrews
e49f83499a Check TTLs of mixed TTL ANY response with expired records 2022-12-07 22:20:02 +00:00
Mark Andrews
90249e4aa5 Revert "Fix rndc dumpdb -expired for stuck cache contents"
This reverts commit f8d866c6ef.
2022-12-07 22:20:02 +00:00
Mark Andrews
bc64205c58 Merge branch '3724-update-dig-tcp-documentation' into 'main'
Resolve "Update dig +tcp documentation"

Closes #3724

See merge request isc-projects/bind9!7172
2022-12-07 21:59:25 +00:00
Mark Andrews
b5951f0411 Add reference to +tcp for +ignore 2022-12-07 21:38:18 +00:00
Ondřej Surý
7dc6984367 Merge branch '3676-remove-operating-system-resource-limits' into 'main'
Mark setting operating system limits from named.conf as ancient

Closes #3676

See merge request isc-projects/bind9!7079
2022-12-07 18:50:30 +00:00
Ondřej Surý
01c58e6d40
Add CHANGES and release note for [GL #3676] 2022-12-07 19:42:55 +01:00
Ondřej Surý
e2262c2112
Remove isc_resource API and set limits directly in named_os unit
The only function left in the isc_resource API was setting the file
limit.  Replace the whole unit with a simple getrlimit to check the
maximum value of RLIMIT_NOFILE and set the maximum back to rlimit_cur.

This is more compatible than trying to set RLIMIT_UNLIMITED on the
RLIMIT_NOFILE as it doesn't work on Linux (see man 5 proc on
/proc/sys/fs/nr_open), neither it does on Darwin kernel (see man 2
getrlimit).

The only place where the maximum value could be raised under privileged
user would be BSDs, but the `named_os_adjustnofile()` were not called
there before.  We would apply the increased limits only on Linux and Sun
platforms.
2022-12-07 19:40:00 +01:00
Ondřej Surý
0c62c0bdb7
Mark setting operating system limits from named.conf as ancient
After deprecating the operating system limits settings (coresize,
datasize, files and stacksize), mark them as ancient and remove the code
that sets the values from config.
2022-12-07 19:40:00 +01:00
Ondřej Surý
0d3936646d Merge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test' into 'main'
Fix missing zone_check() call in checkds test

See merge request isc-projects/bind9!7161
2022-12-07 18:14:34 +00:00
Ondřej Surý
718831bfcc
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.
2022-12-07 19:14:10 +01:00
Ondřej Surý
fd97400586 Merge branch '3708-remove-dead-code-from-dns_cache-unit' into 'main'
Remove dead code from dns_cache_flush()

Closes #3708

See merge request isc-projects/bind9!7141
2022-12-07 18:11:32 +00:00
Ondřej Surý
715343c31d
Remove dead code from dns_cache_flush()
After removing the cache cleaning mechanism, we don't need to db
iterator in dns_cache_flush() anymore.
2022-12-07 19:11:08 +01:00
Ondřej Surý
3df650f3b4 Merge branch '3183-send-shutdown-to-ns_client-on-shutdown' into 'main'
Propagate the shutdown event to the recursing ns_client(s)

Closes #3183

See merge request isc-projects/bind9!7027
2022-12-07 17:08:24 +00:00
Ondřej Surý
48059a1bc2
Add CHANGES and release notes for [GL #3183] 2022-12-07 18:06:35 +01:00
Ondřej Surý
5111258e7a
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).
2022-12-07 18:05:36 +01:00
Ondřej Surý
198b815e0b Merge branch '3712-fix-reference-counting-in-dns_adb-get_attached_entry' into 'main'
Fix reference counting in get_attached_entry

Closes #3712

See merge request isc-projects/bind9!7168
2022-12-07 15:16:50 +00:00
Ondřej Surý
c2be97eeff Fix reference counting in get_attached_entry
When get_attached_entry() encounters entry that would be expired, it
needs to get reference to the entry before calling maybe_expire_entry(),
so the ADB entry doesn't get destroyed inside the its own lock.
2022-12-07 16:16:22 +01:00
Matthijs Mekking
406de85309 Merge branch 'matthijs-document-ns-minimal-responses' into 'main'
Document NS queries are excempt from minimal-responses

See merge request isc-projects/bind9!7072
2022-12-07 11:19:20 +00:00
Matthijs Mekking
f7b477f6ea Document NS queries are excempt from minimal-responses
Also document that DNSKEY, DS, CDNSKEY, and CDS never do additional
section processing.
2022-12-07 11:37:55 +01:00
Michal Nowak
e5afd7c50c Merge branch 'mnowak/asan-tsan-respdiff-jobs' into 'main'
Add ASAN- and TSAN-enabled respdiff jobs

See merge request isc-projects/bind9!7115
2022-12-07 07:26:21 +00:00
Michal Nowak
4f23de554c
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.
2022-12-07 07:28:03 +01:00
Michal Nowak
9856296666
Extract TSAN parsing code 2022-12-07 07:28:03 +01:00
Mark Andrews
8f6a0c85ea Merge branch '3683-use-after-free-in-catalog-zone-processing' into 'main'
Resolve "use after free in catalog zone processing"

Closes #3683

See merge request isc-projects/bind9!7137
2022-12-06 22:29:46 +00:00
Mark Andrews
9843da3423 Add release note for [GL #3683] 2022-12-07 09:04:49 +11:00
Mark Andrews
72402e1710 Add CHANGES note for [GL #3683] 2022-12-07 09:04:48 +11:00
Mark Andrews
bca84c8601 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.
2022-12-07 09:04:08 +11:00
Mark Andrews
b1086a5561 Add missing DbC magic checks
Checking for value != NULL is not sufficient to detect use after
free errors.
2022-12-07 09:04:08 +11:00
Mark Andrews
35839e91d8 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.
2022-12-07 09:04:08 +11:00
Mark Andrews
f13e71e551 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.
2022-12-07 09:04:08 +11:00
Arаm Sаrgsyаn
629f66ea8e Merge branch '3678-serve-stale-servfailing-unexpectedly' into 'main'
Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

Closes #3678

See merge request isc-projects/bind9!7096
2022-12-06 14:53:16 +00:00
Aram Sargsyan
5b5f3a0ea7 Add a CHANGES note for [GL #3678] 2022-12-06 13:28:49 +00:00
Matthijs Mekking
86a80e723f 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.
2022-12-06 13:26:53 +00:00
Aram Sargsyan
21faf44ef7 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.
2022-12-06 13:26:53 +00:00
Mark Andrews
84a7be327e Merge branch '3697-reject-zones-with-ds-records-not-at-delegations' into 'main'
Resolve "Reject zones with DS records not at delegations"

Closes #3697

See merge request isc-projects/bind9!7116
2022-12-06 13:07:00 +00:00
Mark Andrews
fbb2f67e8d Add CHANGES note for [GL #3697] 2022-12-06 23:28:11 +11:00
Mark Andrews
e8e40e2e01 Check that DS records are only present at delegations
This extends the integrity check to look for stray DS records
in the zone.
2022-12-06 23:27:40 +11:00
Mark Andrews
8ab496b6e1 Merge branch '3721-the-nslookup-command-does-not-obey-the-port-option-when-record-type-any-is-used' into 'main'
Resolve "The nslookup command does not obey the port option when record type ANY is used."

Closes #3721

See merge request isc-projects/bind9!7162
2022-12-05 22:19:23 +00:00
Mark Andrews
27168dbf43 Add CHANGES note for [GL #3721] 2022-12-06 08:58:58 +11:00
Mark Andrews
8caa94bdf1 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.
2022-12-06 08:58:58 +11:00
Mark Andrews
e9c4192ee5 Add checks for 'host' 2022-12-06 08:58:58 +11:00
Mark Andrews
c367dd1b0b Check ANY lookup using nslookup 2022-12-06 08:57:48 +11:00
Mark Andrews
3914aba26d Merge branch '3633-cid-361427-error-handling-issues-in-lib-dns-rdata-c' into 'main'
Resolve "CID 361427: Error handling issues in lib/dns/rdata.c"

Closes #3633

See merge request isc-projects/bind9!7056
2022-12-04 23:16:53 +00:00
Mark Andrews
94008863de Add RUNTIME_CHECK for dns_rdata_tostruct 2022-12-04 21:41:02 +00:00
Artem Boldariev
e3ffe756dc Merge branch 'artem-tls-check-for-recv_cb' into 'main'
TLS: check for sock->recv_cb when handling received data

See merge request isc-projects/bind9!7158
2022-12-02 12:11:41 +00:00
Artem Boldariev
bed5e2bb08 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.
2022-12-02 13:20:37 +02:00
Artem Boldariev
69db33e7a5 Merge branch 'artem-tls-doh-listeners-avoid-acessing-non-atomic-flags-on-handshake-or-accept' into 'main'
TLS and DoH: Avoid accessing non-atomic listener socket flags during HS/when accepting a caonnection

See merge request isc-projects/bind9!7155
2022-12-02 11:18:56 +00:00
Artem Boldariev
8b7e123528 DoH: Avoid accessing non-atomic listener socket flags when accepting
This commit ensures that the non-atomic flags inside a DoH listener
socket object (and associated worker) are accessed when doing accept
for a connection only from within the context of the dedicated thread,
but not other worker threads.

The purpose of this commit is to avoid TSAN errors during
isc__nmsocket_closing() calls. It is a continuation of
4b5559cd8f.
2022-12-02 12:16:12 +02:00
Artem Boldariev
4d0c226375 TLS: Avoid accessing non-atomic listener socket flags during HS
This commit ensures that the non-atomic flags inside a TLS listener
socket object (and associated worker) are accessed when doing
handshake for a connection only from within the context of the
dedicated thread, but not other worker threads.

The purpose of this commit is to avoid TSAN errors during
isc__nmsocket_closing() calls. It is a continuation of
4b5559cd8f.
2022-12-02 12:16:12 +02:00
Tom Krizek
fc991fa79d Merge branch 'tkrizek/system-tests-prereqs' into 'main'
Unify system test feature detection and add missing prerequisites

See merge request isc-projects/bind9!7151
2022-12-02 09:44:29 +00:00