Commit graph

35610 commits

Author SHA1 Message Date
Michał Kępień
1237d73cd1
Fix map offsets in the "masterformat" system test
The "masterformat" system test attempts to check named-checkzone
behavior when it is fed corrupt map-format zone files.  However, despite
the RBTDB and RBT structures having evolved over the years, the offsets
at which a valid map-format zone file is malformed by the "masterformat"
test have not been updated accordingly, causing the relevant checks to
introduce a different type of corruption than they were originally meant
to cause:

  - the "bad node header" check originally mangled the 'type' member of
    the rdatasetheader_t structure for cname.example.nil,

  - the "bad node data" check originally mangled the 'serial' and
    'rdh_ttl' members of the rdatasetheader_t structure for
    aaaa.example.nil.

Update the offsets at which the map-format zone file is malformed at by
the "masterformat" system test so that the relevant checks fulfill their
original purpose again.
2024-01-05 12:40:50 +01:00
Michał Kępień
f66150204c
Add CHANGES entry and release note for GL #4383
(cherry picked from commit 04df558d57)
2024-01-05 12:40:50 +01:00
Michał Kępień
c3377cbfaa
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.

The extra queuing overhead eliminated by this change could be remotely
exploited to cause excessive memory use.

As this change modifies struct dns_rbtnode by adding a new 'prunelink'
member to it, bump MAPAPI to prevent any attempts of loading map-format
zone files created using older BIND 9 versions.

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

See merge request isc-private/bind9!603
2024-01-05 11:29:58 +00:00
Mark Andrews
549d860b33
Add release note for [GL #4334]
(cherry picked from commit c4faf5c69f)
2024-01-05 12:24:05 +01:00
Mark Andrews
10bfb3de95
Add CHANGES note for [GL #4334]
(cherry picked from commit 26671f8c47)
2024-01-05 12:24:05 +01:00
Mark Andrews
7db2796507
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:24:05 +01:00
Michał Kępień
283efdde69 Merge branch '4281-confidential-redirect-rfc1918-check-failure-bind-9.16' into 'v9.16.46-release'
[9.16] [CVE-2023-5517] Fix handling of RFC 1918 reverse queries with "nxdomain-redirect" enabled

See merge request isc-private/bind9!613
2024-01-05 11:17:32 +00:00
Mark Andrews
20754ea186
Add release note for [GL #4281]
(cherry picked from commit 2fbafc2675)
2024-01-05 12:10:22 +01:00
Mark Andrews
47d4c0e5a6
Add CHANGES note for [GL #4281]
(cherry picked from commit 0748965b7c)
2024-01-05 12:10:22 +01:00
Mark Andrews
c732624936
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:10:22 +01:00
Michał Kępień
770bb71ce7 Merge branch '4234-confidential-use-hashmap-when-parsing-9.16' into 'v9.16.46-release'
[9.16] [CVE-2023-4408] Use hashtable when parsing DNS messages

See merge request isc-private/bind9!586
2024-01-05 10:58:57 +00:00
Matthijs Mekking
c44965af33
Fix windows build, remove external symbols
The functions dns_message_find and dns_message_movename have been
removed. Remove the symbols from libdns.def.in to fix the windows
build.
2024-01-05 11:52:05 +01:00
Ondřej Surý
1b76796c18
Add CHANGES and release note for [GL #4234]
(cherry picked from commit 30d27928cf)
2024-01-05 11:52:05 +01:00
Ondřej Surý
a4baf32415
Backport isc_ht API changes from BIND 9.18
To prevent allocating large hashtable in dns_message, we need to
backport the improvements to isc_ht API from BIND 9.18+ that includes
support for case insensitive keys and incremental rehashing of the
hashtables.
2024-01-05 11:52:05 +01:00
Ondřej Surý
608707b4f5
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:52:05 +01:00
Michał Kępień
fc0434cc3b Merge branch '4182-confidential-fix-races-in-dns-tsigkey-find-9.16' into 'v9.16.46-release'
[9.16] Address race in dns_tsigkey_find()

See merge request isc-private/bind9!623
2024-01-05 10:33:56 +00:00
Mark Andrews
12a476fa9b
Add CHANGES note for [GL #4182]
(cherry picked from commit a62cda787f)
2024-01-05 11:28:25 +01:00
Mark Andrews
ec28eb05db
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:28:25 +01:00
Mark Andrews
f6b7fa0338 Merge branch '4513-system-tests-fail-with-net-dns-1-42-bind-9.16' into 'bind-9.16'
[9.16] Resolve "System tests fail with Net::DNS 1.42"

See merge request isc-projects/bind9!8619
2024-01-03 01:30:58 +00:00
Mark Andrews
16f3d79052 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 12:01:14 +11:00
Tom Krizek
719a8ee0e2 Merge branch 'tkrizek/update-sphinx_rtd_theme-9.16' into 'bind-9.16'
[9.16] Update sphinx_rtd_theme and docutils

See merge request isc-projects/bind9!8605
2023-12-20 17:55:08 +00:00
Tom Krizek
c309a04c88
Update sphinx_rtd_theme and docutils
(cherry picked from commit 4156fa09d9)
2023-12-20 18:05:24 +01:00
Mark Andrews
771b12a747 Merge branch '4498-gl-4495-followup-regression-test-was-too-strict-bind-9.16' into 'bind-9.16'
[9.16] Resolve "[GL #4494] followup: regression test was too strict" !8590

See merge request isc-projects/bind9!8599
2023-12-20 01:13:41 +00:00
Mark Andrews
ea7b92a348 The NSEC3 -> NSEC private record may be added later
Check each delta for the NSEC3 -> NSEC private record addition
as it may be added in the second delta.

(cherry picked from commit 80a4dff986)
2023-12-20 11:13:01 +11:00
Mark Andrews
00c5f362f2 Merge branch '4494-add_sigs-was-using-the-wrong-time-in-kasp-mode-bind-9.16' into 'bind-9.16'
[9.16] Resolve "add_sigs was using the wrong time in kasp mode"

See merge request isc-projects/bind9!8589
2023-12-19 02:36:23 +00:00
Mark Andrews
f9bf12d216 Add CHANGES note for [GL #4494]
(cherry picked from commit 94b00f44ae)
2023-12-19 12:57:33 +11:00
Mark Andrews
ba706a170d Regression check for missing RRSIGs
When transitioning from NSEC3 to NSEC the added records where not
being signed because the wrong time was being used to determine if
a key should be used or not.  Check that these records are actually
signed.

(cherry picked from commit bdb42d3838)
2023-12-19 12:56:57 +11:00
Mark Andrews
9c9adc137c Use 'now' rather than 'inception' in 'add_sigs'
When kasp support was added 'inception' was used as a proxy for
'now' and resulted in signatures not being generated or the wrong
signatures being generated.  'inception' is the time to be set
in the signatures being generated and is usually in the past to
allow for clock skew.  'now' determines what keys are to be used
for signing.

(cherry picked from commit 6066e41948)
2023-12-19 12:55:03 +11:00
Arаm Sаrgsyаn
2ffc27f76e Merge branch '4477-tests-statschannel-loadtime-bugfix-9.16' into 'bind-9.16'
[9.16] Resolve "statschannel test intermittently fails with incorrect zone loadtime"

See merge request isc-projects/bind9!8584
2023-12-18 10:57:20 +00:00
Aram Sargsyan
13dab06f60 Fix a statschannel system test zone loadtime issue
The check_loaded() function compares the zone's loadtime value and
an expected loadtime value, which is based on the zone file's mtime
extracted from the filesystem.

For the secondary zones there may be cases, when the zone file isn't
ready yet before the zone transfer is complete and the zone file is
dumped to the disk, so a so zero value mtime is retrieved.

In such cases wait one second and retry until timeout. Also modify
the affected check to allow a possible difference of the same amount
of seconds as the chosen timeout value.

(cherry picked from commit 4e94ff2541)
2023-12-18 09:39:11 +00:00
Michal Nowak
0e282066fb Merge branch 'mnowak/do-not-consider-bind9.xsl.h-in-docs-job-check' into 'bind-9.16'
Do not consider bin/named/bind9.xsl.h in docs job check

See merge request isc-projects/bind9!8568
2023-12-12 12:46:43 +00:00
Michal Nowak
eb5ae97083
Do not consider bin/named/bind9.xsl.h in docs job check
The BIND 9.16 build system occasionally produces a bin/named/bind9.xsl.h
file that differs slightly from the version in the bind-9.16 branch due
to a race condition. This poses an issue for the "docs" CI job, which
executes the "maintainer-clean" make target, regenerates the
bin/named/bind9.xsl.h file, and checks for differences with the
committed file. The race condition causes discrepancies in this check.

Since this problem doesn't occur in BIND 9.18+, we can hide it by adding
bin/named/bind9.xsl.h to the list of files excluded from the check.
2023-12-12 11:43:15 +01:00
Michal Nowak
11310cca77 Merge branch 'mnowak/alpine-3.19-9.16' into 'bind-9.16'
[9.16] Add Alpine Linux 3.19

See merge request isc-projects/bind9!8567
2023-12-12 10:43:04 +00:00
Michal Nowak
e34a8141a0
Add Alpine Linux 3.19
(cherry picked from commit 1fc56d705e)
2023-12-12 11:13:17 +01:00
Michal Nowak
7e033d1d28 Merge branch 'mnowak/replace-danger-python-with-hazard-9.16' into 'bind-9.16'
[9.16] Replace danger-python with Hazard

See merge request isc-projects/bind9!8564
2023-12-11 17:24:39 +00:00
Tom Krizek
d37c4d6380
Handle empty MR description in dangerfile
A merge request might have no description at all (i.e. None, rather than
an empty string). This might happen when the MR is created via an API.
Check a description is present before trying to find a backport string
in it.

(cherry picked from commit 4f70f5bd7c)
2023-12-11 17:52:20 +01:00
Michał Kępień
c2d041f1fd
Improve determining the lines added by a branch
Since the list of lines added to Git-tracked text files in a given
branch is not part of the Danger DSL [1], it is determined using custom
code in dangerfile.py.  The current implementation of that logic is less
than perfect as it examines the diff between the current tip of the
target branch and the source branch rather than the diff between the
merge base of the two branches and the source branch.  Consider a Git
history like this:

    *   F (target)
    ...
    *   E
    *   D
    *   C
    | * B (source)
    |/
    *   A (merge base)

If danger-python or Hazard are run for commit B, the current logic for
determining the list of added lines in dangerfile.py examines the diff
between commits F and B rather than between commits A and B.  Therefore,
the added_lines() function returns not just the lines added by commit B
on top of commit A, but also the list of lines that were removed between
commits A and F, which leads to confusing results.

Fix by using the triple-dot diff operator in the Git invocation whose
output is used as the source of information for determining the list of
lines added by a given branch.

Since Hazard fetches the target branch itself when it is run, remove the
explicit "git fetch" invocation that fetches the target branch from
GitLab (shortening its local history to a single commit in the process)
before "git diff" is invoked.

[1] https://danger.systems/js/reference.html#GitDSL

(cherry picked from commit 43126e81e6)
2023-12-11 17:52:18 +01:00
Michal Nowak
f9115f00bc
Replace danger-python with Hazard
Hazard is a minimal danger-python replacement.

(cherry picked from commit 08ce1bc45f)
2023-12-11 17:52:11 +01:00
Evan Hunt
fdabdc158e Merge branch '3498-glue-rehash-overflow-bind-9.16' into 'bind-9.16'
[9.16] correctly limit hash resize to RBTDB_GLUE_TABLE_MAX_BITS

See merge request isc-projects/bind9!8552
2023-12-06 20:15:31 +00:00
Evan Hunt
0361d6ab70 correctly limit hash resize to RBTDB_GLUE_TABLE_MAX_BITS
Use < instead of <= when testing the new new hash bits size,
otherwise it can exceed the limit.

(cherry picked from commit 8f73814469)
2023-12-06 11:45:19 -08:00
Mark Andrews
c7786ea1e2 Merge branch '4433-supplied-buffer-too-large-in-wire_test-c-bind-9.16' into 'bind-9.16'
[9.16] Resolve "Supplied Buffer Too Large in wire_test.c"

See merge request isc-projects/bind9!8545
2023-12-05 22:33:48 +00:00
Mark Andrews
e5e8e3f226 Adjust comment to have correct message limit value
(cherry picked from commit 560c245971)
2023-12-06 09:06:31 +11:00
Mark Andrews
c9147530fd Adjust message buffer sizes in test code
(cherry picked from commit cbfcdbc199)
2023-12-06 09:06:31 +11:00
Mark Andrews
057c12d29a Check that buffer length in dns_message_renderbegin
The maximum DNS message size is 65535 octets. Check that the buffer
being passed to dns_message_renderbegin does not exceed this as the
compression code assumes that all offsets are no bigger than this.

(cherry picked from commit a069513234)
2023-12-06 09:06:31 +11:00
Michal Nowak
ad4b76921a Merge branch 'mnowak/drop-openbsd-system-test-job-9.16' into 'bind-9.16'
[9.16] Drop OpenBSD system test CI job

See merge request isc-projects/bind9!8541
2023-12-05 16:51:16 +00:00
Michal Nowak
4a6398501e
Drop OpenBSD system test CI job
The system tests on OpenBSD consistently exhibit lower stability
compared to our other CI platforms. Some of these challenges are
intrinsic to the system test itself and require attention. However,
there are OpenBSD issues, which seem to be more widespread on this
platform than others. In our daily CI pipelines, OpenBSD system tests
often bear the brunt of all failed CI jobs.

It's possible that our OpenBSD CI image could be optimized, but we
currently lack the domain-specific knowledge needed to make
improvements.

(cherry picked from commit 2ab292c169)
2023-12-05 17:46:20 +01:00
Tom Krizek
ec0a756f6c Merge branch '4421-deprecate-AES-based-DNS-cookies-9.16' into 'bind-9.16'
[9.16] Deprecate AES algorithm for DNS cookies

See merge request isc-projects/bind9!8487
2023-12-05 12:35:39 +00:00
Ondřej Surý
f2a2ec92b9
Add CHANGES and release note for [GL #4421]
(cherry picked from commit 2a3b3beaf1)
2023-12-05 10:57:00 +01:00
Ondřej Surý
62cf6b2e7f
Deprecate AES algorithm for DNS cookies
The AES algorithm for DNS cookies was being kept for legacy reasons,
and it can be safely removed in the next major release.  Mark is as
deprecated, so the `named-checkconf` prints a warning when in use.

(cherry picked from commit 67d14b0ee5)
2023-12-05 10:56:19 +01:00