Commit Graph

38452 Commits

Author SHA1 Message Date
Mark Andrews
0add293477 Fail processing incoming DNS message on first validation failure
Stop processing the DNS validation when first validation failure occurs
in the DNS message.
2024-02-01 21:47:29 +01:00
Mark Andrews
439e16e4de Skip revoked keys when selecting DNSKEY in the validation loop
Don't select revoked keys when iterating through DNSKEYs in the DNSSEC
validation routines.
2024-02-01 21:47:29 +01:00
Ondřej Surý
1b3b0cef22 Split fast and slow task queues
Change the taskmgr (and thus netmgr) in a way that it supports fast and
slow task queues.  The fast queue is used for incoming DNS traffic and
it will pass the processing to the slow queue for sending outgoing DNS
messages and processing resolver messages.

In the future, more tasks might get moved to the slow queues, so the
cached and authoritative DNS traffic can be handled without being slowed
down by operations that take longer time to process.
2024-02-01 21:47:29 +01:00
Michał Kępień
b7685dd452 Merge branch '4234-confidential-parser-regression-9.18' into 'v9.18.23-release'
[9.18] fix a message parsing regression

See merge request isc-private/bind9!633
2024-02-01 20:27:15 +00:00
Michał Kępień
48324b06d0 Add a CHANGES entry
(cherry picked from commit 04ba284e1a)
2024-02-01 21:24:26 +01:00
Aram Sargsyan
cf34bccf4c fix another message parsing regression
The fix for CVE-2023-4408 introduced a regression in the message
parser, which could cause a crash if an rdata type that can only
occur in the question was found in another section.

(cherry picked from commit 510f1de8a6)
2024-02-01 21:24:26 +01:00
Evan Hunt
6d70ccd128 fix a message parsing regression
the fix for CVE-2023-4408 introduced a regression in the message
parser, which could cause a crash if duplicate rdatasets were found
in the question section. this commit ensures that rdatasets are
correctly disassociated and freed when this occurs.

(cherry picked from commit 4c19d35614)
2024-02-01 21:24:26 +01:00
Artem Boldariev
b626567984 Merge branch '4487-dot-ensure-that-no-more-than-one-message-from-a-server-is-processed' into 'v9.18.23-release'
Fix reading extra messages in TLS DNS in client mode

See merge request isc-private/bind9!635
2024-01-22 10:23:17 +00:00
Artem Boldariev
6b9ccae537 Modify CHANGES [GL #4487]
Mention that TLS DNS will not process more than one message at a time
when that was not expected.
2024-01-18 22:54:08 +02:00
Artem Boldariev
a15c5b1687 Add a unit test which would fail on excessive reads
This commit adds a unit tests which would fail/crash/abort if
excessive reads were possible.

See [GL #4487]
2024-01-18 22:53:43 +02:00
Artem Boldariev
7b390a7fb6 Fix reading extra messages in TLS DNS in client mode
When connecting to a remote party the TLS DNS code could process more
than one message at a time despite the fact that it is expected that
we should stop after every DNS message.

Every DNS message is handled and consumed from the input buffer by
isc__nm_process_sock_buffer(). However, as opposed to TCP DNS code, it
can be called more than once when processing incoming data from a
server (see tls_cycle_input()). That, in turn means that we can
process more than one message at a time. Some higher level code might
not expect that, as it breaks the contract.

In particular, in the original report that happened during
isc__nm_async_tlsdnsshutdown() call: when shutting down multiple calls
to tls_cycle() are possible (each possibly leading to a
isc__nm_process_sock_buffer()). If there are any non processed
messages left, for any of the messages left the read callback will be
called even when it is not expected as there were no preceding
isc_nm_read().

To keep TCP DNS and TLS DNS code in sync, we make a similar change to
it as well, although it should not matter.
2024-01-17 22:35:25 +02:00
Michal Nowak
0a6472be29 Update BIND version for release 2024-01-05 14:46:13 +01:00
Michal Nowak
791cdac410 Add a CHANGES marker 2024-01-05 14:45:55 +01:00
Michal Nowak
e08dec4ff0 Merge branch 'michal/prepare-documentation-for-bind-9.18.22' into 'v9.18.22-release'
Prepare documentation for BIND 9.18.22

See merge request isc-private/bind9!625
2024-01-05 13:43:20 +00:00
Michał Kępień
0eb83555ea Fix Danger rules for flagging release note issues
The logic contained in dangerfile.py incorrectly warns about missing
release note changes for merge requests preparing release documentation
as such merge requests rename files in the doc/notes/ directory.  This
(correctly) causes these files to be passed to dangerfile.py via
danger.git.created_files and danger.git.deleted_files rather than via
danger.git.modified_files, which in turn causes the logic checking the
use of the "Release Notes" label to assume that no release notes are
added, removed, or modified by a given merge request.

Fix by considering all types of file changes (modifications, additions,
and removals - which also covers file renaming) when checking whether a
given merge request modifies release notes.  Update the warning messages
accordingly.

However, when trying to find release notes added by a given merge
request, deleted files must not be considered.  Tweak the logic looking
for GitLab identifiers in the release notes added by a given merge
request so that it only scans modified and added (or renamed) files.

(cherry picked from commit 0fec404c64)
2024-01-05 12:55:58 +01:00
Michał Kępień
6901452117 Tweak and reword release notes 2024-01-05 12:55:58 +01:00
Michał Kępień
8c875b2f1b Prepare release notes for BIND 9.18.22 2024-01-05 12:55:58 +01:00
Michał Kępień
febc027ea4 Merge branch '4383-limit-tree-pruning-overhead-9.18' into 'v9.18.22-release'
[9.18] Limit isc_task_send() overhead for tree pruning

See merge request isc-private/bind9!620
2024-01-05 11:45:42 +00:00
Michał Kępień
4ddf9fa508 Add CHANGES entry for GL #4383
(cherry picked from commit 04df558d57)
2024-01-05 12:38:16 +01:00
Michał Kępień
a9af1ac5ae Limit isc_task_send() overhead for tree pruning
Instead of issuing a separate isc_task_send() call for every RBTDB node
that triggers tree pruning, maintain a list of nodes from which tree
pruning can be started from and only issue an isc_task_send() call if
pruning has not yet been triggered by another RBTDB node.

In some older BIND 9 branches, the extra queuing overhead eliminated by
this change could be remotely exploited to cause excessive memory use.
Due to architectural shift, this branch is not vulnerable to that issue,
but applying the fix to the latter is nevertheless deemed prudent for
consistency and to make the code future-proof.

(cherry picked from commit 24381cc36d)
2024-01-05 12:38:16 +01:00
Michał Kępień
efbe5b660d Merge branch '4334-confidential-dns64-and-serve-stale-bind-9.18' into 'v9.18.22-release'
[9.18] [CVE-2023-5679] Fix a bad interaction between DNS64 and serve-stale

See merge request isc-private/bind9!602
2024-01-05 11:26:58 +00:00
Mark Andrews
b818821087 Add release note for [GL #4334]
(cherry picked from commit c4faf5c69f)
2024-01-05 12:20:25 +01:00
Mark Andrews
67b9347057 Add CHANGES note for [GL #4334]
(cherry picked from commit 26671f8c47)
2024-01-05 12:20:25 +01:00
Mark Andrews
f7e137f321 Restore dns64 state during serve-stale processing
If we are in the process of looking for the A records as part of
dns64 processing and the server-stale timeout triggers, redo the
dns64 changes that had been made to the orignal qctx.

(cherry picked from commit 1fcc483df1)
2024-01-05 12:20:25 +01:00
Michał Kępień
c747f1ca6f Merge branch '4281-confidential-redirect-rfc1918-check-failure-bind-9.18' into 'v9.18.22-release'
[9.18] [CVE-2023-5517] Fix handling of RFC 1918 reverse queries with "nxdomain-redirect" enabled

See merge request isc-private/bind9!612
2024-01-05 11:12:59 +00:00
Mark Andrews
349d9d3fee Add release note for [GL #4281]
(cherry picked from commit 2fbafc2675)
2024-01-05 12:03:59 +01:00
Mark Andrews
121473e8b5 Add CHANGES note for [GL #4281]
(cherry picked from commit 0748965b7c)
2024-01-05 12:03:59 +01:00
Mark Andrews
b42b1fe051 Save the correct result value to resume with nxdomain-redirect
The wrong result value was being saved for resumption with
nxdomain-redirect when performing the fetch.  This lead to an assert
when checking that RFC 1918 reverse queries where not leaking to
the global internet.

(cherry picked from commit 9d0fa07c5e)
2024-01-05 12:03:59 +01:00
Michał Kępień
7f39a9888b Merge branch '4234-confidential-use-hashmap-when-parsing-9.18' into 'v9.18.22-release'
[9.18] [CVE-2023-4408] Use hashtable when parsing DNS messages

See merge request isc-private/bind9!585
2024-01-05 10:58:01 +00:00
Ondřej Surý
968d0a1415 Add CHANGES and release note for [GL #4234]
(cherry picked from commit 30d27928cf)
2024-01-05 11:50:23 +01:00
Ondřej Surý
849c05adf4 Use hashtable when parsing a message
When parsing messages use a hashtable instead of a linear search to
reduce the amount of work done in findname when there's more than one
name in the section.

There are two hashtables:

1) hashtable for owner names - that's constructed for each section when
we hit the second name in the section and destroyed right after parsing
that section;

2) per-name hashtable - for each name in the section, we construct a new
hashtable for that name if there are more than one rdataset for that
particular name.

(cherry picked from commit b8a9631754)
2024-01-05 11:50:23 +01:00
Michał Kępień
346b26823c Merge branch '4182-confidential-fix-races-in-dns-tsigkey-find-9.18' into 'v9.18.22-release'
[9.18] Address race in dns_tsigkey_find()

See merge request isc-private/bind9!622
2024-01-05 10:30:14 +00:00
Mark Andrews
0a8367e17b Add CHANGES note for [GL #4182]
(cherry picked from commit a62cda787f)
2024-01-05 11:19:58 +01:00
Mark Andrews
f46a81932f Address race in dns_tsigkey_find()
Restart the process with a write lock if we discover an expired key
while holding the read lock.

(cherry picked from commit d2ba96488e)
2024-01-05 11:19:58 +01:00
Aydın Mercan
75677d375e Merge branch '4467-fix-stats-export-overflow-v9_18' into 'bind-9.18'
[9.18] Avoid overflow during statistics dump

See merge request isc-projects/bind9!8574
2024-01-03 18:20:17 +00:00
Aydın Mercan
a83c749115 Use <isc/atomic.h> instead of <stdatomic.h> directly in <isc/types.h> 2024-01-03 20:36:35 +03:00
Aydın Mercan
6c0ae4ef6e Move atomic statscounter next to the non-atomic definition
(cherry picked from commit 9c4dd863a6)
2024-01-03 20:36:35 +03:00
Aydın Mercan
9601763943 Use a non-atomic counter when passing to stats dumper
(cherry picked from commit bb96142a17)
2024-01-03 20:36:35 +03:00
Petr Špaček
b913d44ce6 Add CHANGES and release note for [GL #4467]
(cherry picked from commit b57c37d8c5)
2024-01-03 20:36:27 +03:00
Petr Špaček
d33b0f9ddb Avoid overflow during statistics dump
Related: !1493
Fixes: #4467
(cherry picked from commit 7b0115e331)
2024-01-03 20:10:27 +03:00
Mark Andrews
0c49507b1b Merge branch '4513-system-tests-fail-with-net-dns-1-42-bind-9.18' into 'bind-9.18'
[9.18] Resolve "System tests fail with Net::DNS 1.42"

See merge request isc-projects/bind9!8618
2024-01-03 02:24:43 +00:00
Mark Andrews
b831223b3e Support Net::DNS::Nameserver 1.42
In Net::DNS 1.42 $ns->main_loop no longer loops.  Use current methods
for starting the server, wait for SIGTERM then cleanup child processes
using $ns->stop_server(), then remove the pid file.

(cherry picked from commit c2c59dea60)
2024-01-03 11:57:59 +11:00
Mark Andrews
8f4e5f51fd Merge branch '4495-conversion-from-nsec3-to-nsec-removes-the-nsec3param-too-early-bind-9.18' into 'bind-9.18'
[9.18] Resolve "Conversion from NSEC3 to NSEC removes the NSEC3PARAM too early" !8578

See merge request isc-projects/bind9!8610
2024-01-03 00:04:53 +00:00
Mark Andrews
1a52dccd32 Handle multiple NSEC3PARAM records in tests
When transitioning from one NSEC3 chain to another it is legal for
there to be multiple complete chains in the zone with multiple
NSEC3PARAM records.  Handle this intermediate state by checking
for the expected length in the loop.
2024-01-03 09:25:43 +11:00
Mark Andrews
d5aa22ec74 Add CHANGES for [GL #1794] and [GL #4459]
(cherry picked from commit 9b5ed853d0)
2024-01-03 09:25:43 +11:00
Matthijs Mekking
b9fc29cb95 Regression check for NSEC3 to NSEC3 conversion
When changing the NSEC3 chain, the new NSEC3 chain must be built before
the old NSEC3PARAM is removed.  Check each delta in the conversion to
ensure this ordering is met.

(cherry picked from commit 1d6b892e04)
2024-01-03 09:25:43 +11:00
Mark Andrews
7e24befc2a Regression check for NSEC3 to NSEC conversion
When transitioning from NSEC3 to NSEC the NSEC3 must be built before
the NSEC3PARAM is removed.  Check each delta in the conversion to
ensure this ordering is met.

(cherry picked from commit 7d90c056b0)
2024-01-03 09:25:43 +11:00
Mark Andrews
d78df5f96d Don't delete the NSEC3PARAM immediately
Wait until the new NSEC or NSEC3 chain is generated then it should
be deleted.

(cherry picked from commit f3ae88d84e)
2023-12-21 22:07:53 +11:00
Tom Krizek
52770b05d3 Merge branch 'tkrizek/update-sphinx_rtd_theme-9.18' into 'bind-9.18'
[9.18] Update sphinx_rtd_theme and docutils

See merge request isc-projects/bind9!8604
2023-12-21 10:08:50 +00:00
Tom Krizek
916b121e42 Update sphinx_rtd_theme and docutils
(cherry picked from commit 4156fa09d9)
2023-12-21 10:33:26 +01:00