Commit Graph
29557 Commits
Author SHA1 Message Date
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
Michał KępieńandMichal Nowak 9e2b882df8 Bound the amount of work performed for delegations
Limit the amount of database lookups that can be triggered in
fctx_getaddresses() (i.e. when determining the name server addresses to
query next) by setting a hard limit on the number of NS RRs processed
for any delegation encountered.  Without any limit in place, named can
be forced to perform large amounts of database lookups per each query
received, which severely impacts resolver performance.

The limit used (20) is an arbitrary value that is considered to be big
enough for any sane DNS delegation.
2022-12-21 16:08:37 +01:00
Tom Krizek 5fb4f32ecb Merge branch 'tkrizek/danger-backports-v9_11' into 'v9_11'
Check backport workflow in danger CI [v9_11]

See merge request isc-projects/bind9!7247
2022-12-16 14:08:41 +00:00
Tom Krizek 6129b0a210 danger: check backport commits for original commit IDs
A full backport must have all the commit from the original MR and the
original commit IDs must be referenced in the backport commit messages.

If the criteria above is not met, the MR should be marked as a partial
backport. In that case, any discrepencies are only logged as informative
messages rather than failures.

(cherry picked from commit c617f97784)
2022-12-16 15:06:57 +01:00
Tom Krizek 57d4fa8e43 danger: check that original MR has been merged
When checking a backport MR, ensure that the original MR has been merged
already. This is vital for followup checks that verify commit IDs from
original commits are present in backport commit messages.

(cherry picked from commit 89530f1a1c)
2022-12-16 15:06:57 +01:00
Tom Krizek 9e08b09ee1 danger: check backport links to the original MR
When doing archeology, it is much easier to find stuff if it's properly
linked. This check ensures that backport MR are linked to their original
MR via a "Backport of !XXXX" message.

The regular expression is fairly broad and has been tested to accept the
following variants of the message:
Backport of MR !XXXX
Backport of: !XXXX
backport of mr !XXXX
Backport of   !XXXX
Backport of https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/XXXX

(cherry picked from commit 12e0b05738)
2022-12-16 15:06:57 +01:00
Tom Krizek 0ab540acec danger: ensure target branch is in the MR title
Having the MR title clearly marked in its title can be very useful when
looking through older issues/MRs.

This check also ensures that the version from the version label matches
the proper version branch (i.e. v9.16 must be marked with [v9_16]).

(cherry picked from commit 14b027cf83)
2022-12-16 15:06:55 +01:00
Tom Krizek 5a3bddf8a7 danger: support partial backport label
Treat the Backport::Partial label as a backport as well.

(cherry picked from commit 1c0c1ba8b9)
2022-12-16 14:26:36 +01:00
Petr Špaček 5349dbc6c1 Merge branch '2950-cache-acceptance-rules-test-v9_11' into 'v9_11'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios [v9_11]

See merge request isc-projects/bind9!6108
2022-04-08 10:35:16 +00:00
Mark AndrewsandPetr Špaček 29f08170f0 Add tests for forwarder cache poisoning scenarios
- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).

- v9_11 backport: Revert primary/secondary to master/slave,
  backport rndc helper, backport ns8 config.

(cherry picked from commit bf3fffff67)
2022-04-08 11:52:01 +02:00
Ondřej Surý 34ff98acd8 Merge branch 'ondrej-save-tsan-files-with-txt-extension-v9_11' into 'v9_11'
Save parsed tsan files with .txt extension

See merge request isc-projects/bind9!6022
2022-03-23 19:33:52 +00:00
Ondřej Surý 097682a6f4 Save parsed tsan files with .txt extension
When the parse tsan files have text extension they can be viewed
directly in the GitLab web UI without downloading them locally.

(cherry picked from commit 80582073a5)
2022-03-23 20:32:33 +01:00
Michał Kępień 2883faec25 Merge branch 'v9_11_37-release' into 'v9_11'
Merge 9.11.37 release branch

See merge request isc-projects/bind9!5992
2022-03-16 23:30:39 +00:00
Tinderbox User 796133c72d Merge branch 'prep-release' into security-v9_11 v9.11.37 2022-03-07 09:17:26 +00:00
Tinderbox User 13959be49e prep 9.11.37 2022-03-07 09:17:17 +00:00
Michał Kępień 870bc4a270 Merge branch 'michal/prepare-documentation-for-bind-9.11.37' into 'security-v9_11'
Prepare documentation for BIND 9.11.37

See merge request isc-private/bind9!394
2022-03-07 08:55:27 +00:00
Michał Kępień 8718e9f468 Prepare release notes for BIND 9.11.37 2022-03-04 15:52:02 +01:00
Michał Kępień fc9cb6cf91 Merge branch '2950-confidential-cache-acceptance-rules-v9_11' into 'security-v9_11'
[CVE-2021-25220] [v9_11] prevent cache poisoning from forwarder responses

See merge request isc-private/bind9!381
2022-03-03 14:51:08 +00:00
Petr ŠpačekandMichał Kępień d4b1efbcbd Avoid use of compound literals
Compound literals are not used in BIND 9.11, in order to ensure backward
compatibility with ancient compilers.  Rework the relevant parts of the
BIND 9.11 backport of the CVE-2021-25220 fix so that compound literals
are not used.
2022-03-03 13:33:00 +01:00