Commit Graph
29575 Commits
Author SHA1 Message Date
Matthijs MekkingandMichał Kępień 1296d37687 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.

(cherry picked from commit c44965af33)
2024-02-22 12:00:47 +01:00
Ondřej SurýandMichał Kępień 40a0656e6a Add CHANGES for [GL #4234]
(cherry picked from commit 30d27928cf)
2024-02-22 12:00:47 +01:00
Ondřej SurýandMichał Kępień 2fc28056b3 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.

(cherry picked from commit a4baf32415)
2024-02-22 12:00:47 +01:00
Ondřej SurýandMichał Kępień 0ceed03ebe 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-02-22 12:00:47 +01:00
Michal Nowak cb24cbf135 Merge branch '4556-misc-ci-fixes' into 'bind-9.11'
Various BIND 9.11 (EoL) CI fixes

See merge request isc-projects/bind9!8747
2024-02-16 15:22:06 +00:00
Michal Nowak 8a34183623 Drop scan-build CI job
This job won't pass without a BIND 9 code change. Something we must
avoid to prevent delivering security patches that might not apply
cleanly for someone without this purely CI-related code change.
2024-02-16 11:08:32 +01:00
Michal Nowak 2b76e82c01 Drop Windows CI jobs 2024-02-16 11:08:32 +01:00
Michal Nowak 470955818a Drop rolling distributions from CI
BIND 9.11 can't keep up with rolling distributions.
2024-02-16 11:08:32 +01:00
Tom KrizekandMichal Nowak 5b6b544613 Update the TEST_PARALLEL_JOBS value in CI
The tests have been executed with four jobs for a long time because the
TEST_PARALLEL_JOBS variable was set to 4 in the project's CI/CD
Variables Settings. The variable was recently dropped in favor of
.gitlab-ci.yaml one and now needs to be streamlined with the rest of
BIND 9 maintained branches.

(cherry picked from commit 03d7b45d81)
(cherry picked from commit 6a975344a2)
2024-02-16 11:08:32 +01:00
Michał KępieńandMichal Nowak 6696e99ea2 Temporarily disable dnstap for OL7 builds in CI
The "dnstap" system test started to fail very frequently for BIND 9.16
builds running in Oracle Linux 7 Docker containers spawned by GitLab CI.
The test used to be perfectly stable on that platform for the exact same
source tree, so the problem could not have been triggered by a bad code
change.  Temporarily disable dnstap for Oracle Linux 7 builds prepared
in GitLab CI until the issue is fixed as it virtually prevents the
relevant GitLab CI jobs from being able to succeed.

See isc-projects/bind9#4240

(cherry picked from commit 8078e7de05)
2024-02-16 11:08:32 +01:00
Michal Nowak c419f714bd Bump MAX_DISAGREEMENTS_PERCENTAGE of respdiff-third-party 2024-02-16 11:08:32 +01:00
Michal Nowak 80181ff310 Drop qpdf check from "docs" CI job
qpdf is not present in any CI image, but mandoc is present in Debian
"bookworm".
2024-02-16 11:08:32 +01:00
Michal Nowak 4d9c9e6f91 Move respdiff to Debian "bookworm" 2024-02-16 11:08:32 +01:00
Michal Nowak 3df4331b5a Run most Docker CI jobs in AWS with autoscaler 2024-02-16 11:08:32 +01:00
Michal Nowak 07738b7976 Drop gcov CI job
The gcovr tooling is not present in the Debian "bullseye" anymore and is
unlikely to be very useful even if ported to Debian "bookworm".
2024-02-16 11:08:32 +01:00
Michal Nowak 7d10de301b Drop pylint CI job
BIND 9.11 python scripts can't be kept up with newer pylint versions.
2024-02-16 11:08:32 +01:00
Michal Nowak cfecb9766c Drop flake8
flake8 is not present in CI images anymore.
2024-02-16 11:08:32 +01:00
Michal Nowak 59035bbac7 Drop "noatomics" CI jobs
The "noatomics" scenario is not being tested.
2024-02-16 11:08:32 +01:00
Michal Nowak 1dff62d07d Replace danger-python with Hazard
Hazard is a minimal danger-python replacement.

(cherry picked from commit 08ce1bc45f)
2024-02-16 11:08:32 +01:00
Michal Nowak 0aa6c96847 Drop copyright checks from the "misc" CI job
These check are not present in more recent BIND 9 branches and we don't
intend to maintain them for BIND 9.11.
2024-02-16 11:08:32 +01:00
Michal Nowak 55710d696b Move PKCS11 CI job to Debian "bullseye"
Fedora images lost PKCS11 tools a long time ago, Debian "bullseye"
retains them.
2024-02-16 11:08:32 +01:00
Michal Nowak f1265e7657 Drop clang-format CI job
BIND 9.11 was formated with Clang 13, which is not present in the CI
anymore. Any code formating is now permissible.
2024-02-16 11:08:32 +01:00
Mark AndrewsandMichal Nowak c010c0dac4 Disable error on warning
Otherwise "unused variables" and other errors pop up during compilation.
2024-02-16 11:08:22 +01:00
Mark AndrewsandMichal Nowak 41d8765387 Add more python versions 2024-02-16 11:08:22 +01:00
Petr MenšíkandMichal Nowak 5d92f09a18 Move ignore case indication to flags passed to re
Recent python does not make parsetab.py successfully, because some token
regexp is starting with ?i flag. Remove that flag from regex and pass it
as extra flags parameter instead.
2024-02-16 11:08:22 +01:00
Mark AndrewsandMichal Nowak 15e0d73171 Use Clang 17
Clang 13 is not in the CI image anymore.
2024-02-16 10:35:21 +01:00
Mark AndrewsandMichal Nowak 6215d5011f 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-02-16 10:35:18 +01:00
Ondřej Surý 24f926466a Merge branch 'ondrej/various-rbtdb-fixes-9.11' into 'bind-9.11'
[9.11] Fix missing RRSIG for CNAME with different slabheader order

See merge request isc-projects/bind9!8706
2024-02-08 09:02:40 +00:00
Ondřej Surý 6e9ca588b3 Add CHANGES note for [GL !8675]
(cherry picked from commit 6e81717cff)
2024-02-08 09:51:38 +01:00
Ondřej Surý 8f62e95d3e Optimize cname_and_other_data to stop as earliest as possible
Stop the cname_and_other_data processing if we already know that the
result is true.  Also, we know that CNAME will be placed in the priority
headers, so we can stop looking for CNAME if we haven't found CNAME and
we are past the priority headers.

(cherry picked from commit 3f774c2a8a)
2024-02-08 09:47:58 +01:00
Ondřej Surý 23a4652346 Optimize the slabheader placement for certain RRTypes
Mark the infrastructure RRTypes as "priority" types and place them at
the beginning of the rdataslab header data graph.  The non-priority
types either go right after the priority types (if any).

(cherry picked from commit 3ac482be7f)
2024-02-08 09:46:19 +01:00
Ondřej Surý 08ac45897b Fix missing RRSIG for CNAME with different slabheader order
The cachedb was missing piece of code (already found in zonedb) that
would make lookups in the slabheaders to miss the RRSIGs for CNAME if
the order of CNAME and RRSIG(CNAME) was reversed in the node->data.

(cherry picked from commit 5070c7f5c7)
2024-02-08 09:45:13 +01:00
Michał Kępień 43a2e6aa69 Merge branch '4152-limit-isccc_cc_fromwire-recursion-depth-bind-9.11' into 'bind-9.11'
[9.11] Limit isccc_cc_fromwire recursion depth

See merge request isc-projects/bind9!8329
2023-09-22 10:44:35 +00:00
Mark AndrewsandMichał Kępień 3dd408cd14 Add CHANGES note for [GL #4152]
(cherry picked from commit 6af8d39ea2)
2023-09-22 12:40:39 +02:00
Mark AndrewsandMichał Kępień 639e5b671c Limit isccc_cc_fromwire recursion depth
Named and rndc do not need a lot of recursion so the depth is
set to 10.

(cherry picked from commit 820b0cceef)
2023-09-22 12:40:39 +02:00
Tom Krizek e7cae0d9e0 Merge branch '4055-improve-the-overmem-cache-cleaning-9.11' into 'bind-9.11'
[9.11] [CVE-2023-2828] Improve RBT overmem cache cleaning

See merge request isc-projects/bind9!8059
2023-07-26 15:05:09 +00:00
Mark AndrewsandTom Krizek 9ce42b7b56 Fix for GitLab 15.0: cobertura replaced by coverage_report
From Gitlab 15.0 release notes:

   artifacts:reports:cobertura keyword

   As of GitLab 15.0, the artifacts:reports:cobertura keyword has
   been replaced by artifacts:reports:coverage_report. Cobertura
   is the only supported report file, but this is the first step
   towards GitLab supporting other report types.

(cherry picked from commit 008032d268)
2023-07-26 16:48:40 +02:00
Ondřej SurýandMichal Nowak d03a4483e7 Add CHANGES note for [GL #4055] 2023-06-08 11:56:19 +02:00
Ondřej Surý 0b12907a1c Improve RBT overmem cache cleaning
When cache memory usage is over the configured cache size (overmem) and
we are cleaning unused entries, it might not be enough to clean just two
entries if the entries to be expired are smaller than the newly added
rdata.  This could be abused by an attacker to cause a remote Denial of
Service by possibly running out of the operating system memory.

Currently, the addrdataset() tries to do a single TTL-based cleaning
considering the serve-stale TTL and then optionally moves to overmem
cleaning if we are in that condition.  Then the overmem_purge() tries to
do another single TTL based cleaning from the TTL heap and then continue
with LRU-based cleaning up to 2 entries cleaned.

Squash the TTL-cleaning mechanism into single call from addrdataset(),
but ignore the serve-stale TTL if we are currently overmem.

Then instead of having a fixed number of entries to clean, pass the size
of newly added rdatasetheader to the overmem_purge() function and
cleanup at least the size of the newly added data.  This prevents the
cache going over the configured memory limit (`max-cache-size`).

Additionally, refactor the overmem_purge() function to reduce for-loop
nesting for readability.
2023-06-02 12:22:49 +02:00
Michal Nowak a5e2394863 Merge branch '3487-eddsa-verify-leak-v9_11' into 'v9_11'
[CVE-2022-38178][v9_11] eddsa verify leak

See merge request isc-projects/bind9!7242
2022-12-21 15:47:51 +00:00
Michal Nowak d1d31eafa5 Add EDDSA variant of mkeys system test
In order to trigger the EDDSA verify memory leak, use the algorithm in
the mkeys system test accordingly.
2022-12-21 16:43:09 +01:00
Mark AndrewsandMichal Nowak f652243efb Add CHANGES note for [GL #3487] 2022-12-21 16:43:08 +01:00
Mark AndrewsandMichal Nowak 917d7fe753 Free ctx on invalid siglen 2022-12-21 16:42:23 +01:00
Michal Nowak 7bb0b31472 Merge branch '3487-ecdsa-verify-leak-v9_11' into 'v9_11'
[CVE-2022-38177][v9_11] ecdsa verify leak

See merge request isc-projects/bind9!7241
2022-12-21 15:40:18 +00:00
Mark AndrewsandMichal Nowak d9d042a53b mkeys: use $DEFAULT_ALGORITHM
(cherry picked from commit 78fa082999)
2022-12-21 16:20:28 +01:00
Mark AndrewsandMichal Nowak 47af52a15a Add CHANGES note for [GL #3487] 2022-12-21 16:20:28 +01:00
Mark AndrewsandMichal Nowak 4c369e802b Free eckey on siglen mismatch 2022-12-21 16:20:28 +01:00
Michal Nowak 846b74b56f Merge branch '3394-cve-2022-2795-v9_11' into 'v9_11'
[CVE-2022-2795] [v9_11] Bound the amount of work performed for delegations

See merge request isc-projects/bind9!7240
2022-12-21 15:17:59 +00:00
Michał KępieńandMichal Nowak f7b9bb5518 Add tests for CVE-2022-2795
Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.
2022-12-21 16:08:37 +01:00
Michał KępieńandMichal Nowak 032650b037 Add CHANGES entry for GL #3394 2022-12-21 16:08:37 +01:00