Commit Graph

41415 Commits

Author SHA1 Message Date
Nicki Křížek
14bbdfc7b9 Update BIND version to 9.20.0 v9.20.0 2024-07-08 15:01:00 +02:00
Nicki Křížek
c299dece45 Add a CHANGES marker 2024-07-08 14:58:59 +02:00
Nicki Křížek
844864041c Merge branch 'nicki/prepare-documentation-for-bind-9.20.0' into 'v9.20.0-release'
Prepare documentation for BIND 9.20.0

See merge request isc-private/bind9!710
2024-07-08 12:55:47 +00:00
Nicki Křížek
3489840948 Update documentation for 9.20.0 2024-07-08 14:53:01 +02:00
Nicki Křížek
890ebd3fd3 Create release notes for 9.20.0 2024-07-08 14:53:01 +02:00
Nicki Křížek
1fa52674e1 Extend max-types-per-name documentation 2024-07-08 14:53:01 +02:00
Nicki Křížek
322110a797 Document new -J option for dnssec-signzone and dnssec-verify 2024-07-08 14:53:01 +02:00
Nicki Křížek
b3423bb347 Reorder release notes 2024-07-08 14:53:01 +02:00
Nicki Křížek
6d44c8fcbd Tweak and reword release notes 2024-07-08 14:53:00 +02:00
Nicki Křížek
10d2aceb02 Add release note for [GL #4708] 2024-07-08 14:53:00 +02:00
Nicki Křížek
a624b8c541 Add release note for [GL #4736] 2024-07-08 14:53:00 +02:00
Nicki Křížek
0a584eb318 Add release note for [GL #3472] 2024-07-08 14:53:00 +02:00
Nicki Křížek
e847f32a36 Prepare release notes for BIND 9.19.25
This version won't be released. This commit is just a preparation for
9.20.0.
2024-07-08 14:53:00 +02:00
Nicki Křížek
3d307f869d Add another placeholder for [GL #4480]
(cherry picked from commit 1680916d67)
2024-07-08 14:52:58 +02:00
Nicki Křížek
99309ce8ae Merge branch 'tcp-reset-connection-on-failed-send' into 'v9.20.0-release'
[CVE-2024-0760 (part 3)] Reset the TCP connection on a failed send

See merge request isc-private/bind9!721
2024-07-03 15:50:58 +00:00
Artem Boldariev
5781ff3a93 Drop expired but not accepted TCP connections
This commit ensures that we are not attempting to accept an expired
TCP connection as we are not interested in any data that could have
been accumulated in its internal buffers. Now we just drop them for
good.
2024-07-03 15:03:02 +03:00
Ondřej Surý
bf9fd2a6ff Reset the TCP connection on a failed send
When sending fails, the ns__client_request() would not reset the
connection and continue as nothing is happening.  This comes from the
model that we don't care about failed UDP sends because datagrams are
unreliable anyway, but it greatly affects TCP connections with
keep-alive.

The worst case scenario is as follows:

1. the 3-way TCP handshake gets completed
2. the libuv calls the "uv_connection_cb" callback
3. the TCP connection gets queue because of the tcp-clients quota
4. the TCP client sends as many DNS messages as the buffers allow
5. the TCP connection gets dropped by the client due to the timeout
6. the TCP connection gets accepted by the server
7. the data already sent by the client gets read
8. all sending fails immediately because the TCP connection is dead
9. we consume all the data in the buffer in a very tight loop

As it doesn't make sense to trying to process more data on the TCP
connection when the sending is failing, drop the connection immediately
on the first sending error.
2024-07-03 09:07:20 +02:00
Ondřej Surý
1c0564d715 Remove ns_query_init() cannot fail, remove the error paths
As ns_query_init() cannot fail now, remove the error paths, especially
in ns__client_setup() where we now don't have to care what to do with
the connection if setting up the client could fail.  It couldn't fail
even before, but now it's formal.
2024-07-03 09:05:51 +02:00
Ondřej Surý
bc3e713317 Throttle the reading when writes are asynchronous
Be more aggressive when throttling the reading - when we can't send the
outgoing TCP synchronously with uv_try_write(), we start throttling the
reading immediately instead of waiting for the send buffers to fill up.

This should not affect behaved clients that read the data from the TCP
on the other end.
2024-07-03 08:45:39 +02:00
Nicki Křížek
92a73bca2d Merge branch '3405-security-limit-the-number-of-resource-records-in-rrset-nxdomain' into 'v9.20.0-release'
[CVE-2024-1737 (part 2)] Be smarter about refusing to add many RR types to the database

See merge request isc-private/bind9!712
2024-07-02 11:05:37 +00:00
Ondřej Surý
4089f4e2c3 Add more tests for adding many RR types to the database
More reclimit tests that test various scenarios adding combinations of
priority and non-priority RR types into the database.
2024-07-01 12:49:02 +02:00
Ondřej Surý
57cd34441a Be smarter about refusing to add many RR types to the database
Instead of outright refusing to add new RR types to the cache, be a bit
smarter:

1. If the new header type is in our priority list, we always add either
   positive or negative entry at the beginning of the list.

2. If the new header type is negative entry, and we are over the limit,
   we mark it as ancient immediately, so it gets evicted from the cache
   as soon as possible.

3. Otherwise add the new header after the priority headers (or at the
   head of the list).

4. If we are over the limit, evict the last entry on the normal header
   list.
2024-07-01 12:48:51 +02:00
Ondřej Surý
58f660cf2b Make the resolver qtype ANY test order agnostic
Instead of relying on a specific order of the RR types in the databases
pick the first RR type as returned from the cache.
2024-07-01 12:47:30 +02:00
Ondřej Surý
b27c6bcce8 Expand the list of the priority types and move it to db_p.h
Add HTTPS, SVCB, SRV, PTR, NAPTR, DNSKEY and TXT records to the list of
the priority types that are put at the beginning of the slabheader list
for faster access and to avoid eviction when there are more types than
the max-types-per-name limit.
2024-07-01 12:47:30 +02:00
Nicki Křížek
b8522e5b8e Merge branch 'tcp-do-not-unthrottle-on_isc_nm_read' into 'v9.20.0-release'
[CVE-2024-0760 (part 2)] Do not un-throttle TCP connections on isc_nm_read()

See merge request isc-private/bind9!708
2024-06-25 08:54:47 +00:00
Artem Boldariev
55b1a093ea Do not un-throttle TCP connections on isc_nm_read()
Due to omission it was possible to un-throttle a TCP connection
previously throttled due to the peer not reading back data we are
sending.

In particular, that affected DoH code, but it could also affect other
transports (the current or future ones) that pause/resume reading
according to its internal state.
2024-06-12 13:44:37 +03:00
Nicki Křížek
f149ecc81a Merge branch '4507-confidential-clear-zversion' into 'v9.20.0-release'
[CVE-2024-4076] serve-stale zversion crash

See merge request isc-private/bind9!631
2024-06-10 15:51:03 +00:00
Matthijs Mekking
6f58d2c6fa Add release note for [GL #4507] 2024-06-10 17:47:55 +02:00
Mark Andrews
d8a4851e90 Add CHANGES note for [GL #4507] 2024-06-10 17:47:15 +02:00
Mark Andrews
e52c2a654b Clear qctx->zversion
Clear qctx->zversion when clearing qctx->zrdataset et al in
lib/ns/query.c:qctx_freedata.  The uncleared pointer could lead to
an assertion failure if zone data needed to be re-saved which could
happen with stale data support enabled.
2024-06-10 17:45:38 +02:00
Nicki Křížek
b2cfdba565 Merge branch '4480-sig0-can-be-used-to-exhaust-cpu-resources-v6' into 'v9.20.0-release'
[CVE-2024-1975] Mitigate SIG(0) CPU resources exhaustion attack vectors

See merge request isc-private/bind9!689
2024-06-10 15:44:34 +00:00
Petr Špaček
9370acd3a7 Require local KEYs for SIG(0) verification
This is additional hardening. There is no known use-case for KEY RRs
from DNS cache and it potentially allows attackers to put weird keys
into cache.
2024-06-10 17:36:45 +02:00
Aram Sargsyan
d69fab1530 Mark SIG(0) quota settings as experimantal
A different solution in the future might be adopted depending
on feedback and other new information, so it makes sense to mark
these options as EXPERIMENTAL until we have more data.
2024-06-10 17:36:45 +02:00
Aram Sargsyan
54ddd848fe Avoid running get_matching_view() asynchronously on an error path
Also create a new ns_client_async_reset() static function to decrease
code duplication.
2024-06-10 17:35:40 +02:00
Aram Sargsyan
a2b61c0a65 Test that named checks maximum two keys for SIG(0)-signed messages
Send three updates with three different keys, and expect that one
of them should fail.

Also retain more artifacts for neighboring nsupdate calls.
2024-06-10 17:35:39 +02:00
Aram Sargsyan
be482311de Add a release note for [GL #4480] 2024-06-10 17:35:36 +02:00
Aram Sargsyan
3bb9241bec Add a CHANGES note for [GL #4480] 2024-06-10 17:34:09 +02:00
Aram Sargsyan
7ca9bd6014 Limit the number of keys for SIG(0) message verification
Check at most two KEY RRs agains a SIG(0) signature. This should
limit potential abuse and at the same time allow key rollover.
2024-06-10 17:33:11 +02:00
Aram Sargsyan
70ff4a3f85 Run resolver message signature checking asynchronously 2024-06-10 17:33:11 +02:00
Aram Sargsyan
ad489c44df Remove sig0checks-quota-maxwait-ms support
Waiting for a quota to appear complicates things and wastes
rosources on timer management. Just answer with REFUSE if
there is no quota.
2024-06-10 17:33:11 +02:00
Aram Sargsyan
f0cde05e06 Implement asynchronous view matching for SIG(0)-signed queries
View matching on an incoming query checks the query's signature,
which can be a CPU-heavy task for a SIG(0)-signed message. Implement
an asynchronous mode of the view matching function which uses the
offloaded signature checking facilities, and use it for the incoming
queries.
2024-06-10 17:33:10 +02:00
Aram Sargsyan
710bf9b938 Implement asynchronous message signature verification
Add support for using the offload threadpool to perform message
signature verifications. This should allow check SIG(0)-signed
messages without affecting the worker threads.
2024-06-10 17:33:10 +02:00
Aram Sargsyan
7f013ad05d Remove dns_message_rechecksig()
This is a tiny helper function which is used only once and can be
replaced with two function calls instead. Removing this makes
supporting asynchronous signature checking less complicated.
2024-06-10 17:33:10 +02:00
Aram Sargsyan
bbc866d0cb Document the SIG(0) signature checking quota options
Add documentation entries for the 'sig0checks-quota',
'sig0checks-quota-maxwait-ms', and 'sig0checks-quota-exempt'
optoins.
2024-06-10 17:33:10 +02:00
Aram Sargsyan
c7f79a0353 Add a quota for SIG(0) signature checks
In order to protect from a malicious DNS client that sends many
queries with a SIG(0)-signed message, add a quota of simultaneously
running SIG(0) checks.

This protection can only help when named is using more than one worker
threads. For example, if named is running with the '-n 4' option, and
'sig0checks-quota 2;' is used, then named will make sure to not use
more than 2 workers for the SIG(0) signature checks in parallel, thus
leaving the other workers to serve the remaining clients which do not
use SIG(0)-signed messages.

That limitation is going to change when SIG(0) signature checks are
offloaded to "slow" threads in a future commit.

The 'sig0checks-quota-exempt' ACL option can be used to exempt certain
clients from the quota requirements using their IP or network addresses.

The 'sig0checks-quota-maxwait-ms' option is used to define a maximum
amount of time for named to wait for a quota to appear. If during that
time no new quota becomes available, named will answer to the client
with DNS_R_REFUSED.
2024-06-10 17:33:08 +02:00
Nicki Křížek
24e8cc7b38 Merge branch '3405-security-limit-the-number-of-resource-records-in-rrset' into 'v9.20.0-release'
Limit the number of RRs in RRSets

See merge request isc-private/bind9!694
2024-06-10 15:01:48 +00:00
Evan Hunt
1bf7795b38 Add CHANGES and release note for [GL #3403] 2024-06-10 16:57:29 +02:00
Matthijs Mekking
c1ac8b6ad0 Log rekey failure as error if too many records
By default we log a rekey failure on debug level. We should probably
change the log level to error. We make an exception for when the zone
is not loaded yet, it often happens at startup that a rekey is
run before the zone is fully loaded.
2024-06-10 16:55:12 +02:00
Matthijs Mekking
82635e56d8 Log error when update fails
The new "too many records" error can make an update fail without the
error being logged. This commit fixes that.
2024-06-10 16:55:12 +02:00
Evan Hunt
7dd6b47ace fix a memory leak that could occur when signing
when signatures were not added because of too many types already
existing at a node, the diff was not being cleaned up; this led to
a memory leak being reported at shutdown.
2024-06-10 16:55:12 +02:00