Commit Graph
29541 Commits
Author SHA1 Message Date
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
Mark AndrewsandMichał Kępień 561f87d9e6 Add Release Note for [GL #2950] 2022-03-03 13:33:00 +01:00
Petr ŠpačekandMichał Kępień 5d7905fc54 Add CHANGES note for [GL #2950] 2022-03-03 13:33:00 +01:00
Mark AndrewsandMichał Kępień 42f8c538d3 Look for zones deeper than the current domain or forward name
When caching glue, we need to ensure that there is no closer
source of truth for the name. If the owner name for the glue
record would be answered by a locally configured zone, do not
cache.
2022-03-03 13:33:00 +01:00
Mark AndrewsandMichał Kępień 4a144fae16 Check cached names for possible "forward only" clause
When caching additional and glue data *not* from a forwarder, we must
check that there is no "forward only" clause covering the owner name
that would take precedence.  Such names would normally be allowed by
baliwick rules, but a "forward only" zone introduces a new baliwick
scope.
2022-03-03 13:33:00 +01:00
Mark AndrewsandMichał Kępień 590f8698fc Check that the forward declaration is unchanged and not overridden
If we are using a fowarder, in addition to checking that names to
be cached are subdomains of the forwarded namespace, we must also
check that there are no subsidiary forwarded namespaces which would
take precedence. To be safe, we don't cache any responses if the
forwarding configuration has changed since the query was sent.
2022-03-03 13:33:00 +01:00
Mark AndrewsandMichał Kępień e8df2802ac Add additional name checks when using a forwarder
When using a forwarder, check that the owner name of response
records are within the bailiwick of the forwarded name space.
2022-03-03 13:33:00 +01:00
Michal Nowak 37d0a8f4c0 Merge branch 'mnowak/make-cocci-parallel-v9_11' into 'v9_11'
[v9_11] Run spatch jobs in parallel

See merge request isc-projects/bind9!5834
2022-02-14 20:00:14 +00:00
Michal Nowak 86a544be5c Run spatch jobs in parallel
Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.

(cherry picked from commit 48c44fe6d4)
2022-02-14 20:25:38 +01:00
Michal Nowak 5c80284b59 Merge branch 'mnowak/coverity-scan-2021.12-v9_11' into 'v9_11'
[v9_11] Update Coverity Scan CI job to 2021.12.1

See merge request isc-projects/bind9!5831
2022-02-14 18:13:00 +00:00
Michal Nowak d90e44f9a0 Update Coverity Scan CI job to 2021.12.1
(cherry picked from commit f0edf07fbc)
2022-02-14 18:59:25 +01:00
Michal Nowak 8997c29593 Merge branch 'mnowak/year-2022-v9_11' into 'v9_11'
[v9_11] Update copyrights to 2022

See merge request isc-projects/bind9!5683
2022-01-03 15:50:49 +00:00
Michal Nowak 0e585e88d3 Update copyrights to 2022
(cherry picked from commit befd654e)
2022-01-03 12:16:45 +01:00
Michal Nowak 8d96225fd9 Merge branch 'mnowak/make-debian-11-bullseye-base-image-v9_11' into 'v9_11'
[v9_11] Make bullseye the base image

See merge request isc-projects/bind9!5671
2021-12-23 15:59:20 +00:00
Michal Nowak 4b96bed836 Use /dev/urandom as BIND 9.11 randomness source
This prevents resolver timeouts for the reference (BIND 9.11) servers
used in respdiff tests run on Debian 11 "bullseye".

--with-randomdev=/dev/urandom is part of the "configure" template.

(cherry picked from commit 4d7e343813)
2021-12-23 15:57:44 +01:00
Michal Nowak e984b39816 Make bullseye the base image
"buster" jobs are now only going to be run in scheduled pipelines.

"--without-gssapi" ./configure option of "bullseye" before it became the
base image is dropped from "bullseye"-the-base-image because it reduces
gcov coverage by 0.38 % (651 lines) and is used in Debian 9 "stretch".

"--enable-openssl-hash" is on purpose not being tested because it fails
linking when either of --with-ecdsa, --with-gost, --with-eddsa, or
--with-aes is used as well because it can't find f.e. HMAC_CTX_new() as
"-lcrypto" is missing:

    /usr/bin/ld: ../../lib/isc/libisc.a(hmacmd5.o): in function `isc_hmacmd5_init':
    /root/bind9/lib/isc/hmacmd5.c:49: undefined reference to `HMAC_CTX_new'
    /usr/bin/ld: /root/bind9/lib/isc/hmacmd5.c:51: undefined reference to `EVP_md5'
    /usr/bin/ld: /root/bind9/lib/isc/hmacmd5.c:51: undefined reference to `HMAC_Init_ex'

BIND 9.11 is in security-fixes-only-mode and configure.ac code should
not be fixed to include "-lcrypto" in this corner case; better eliminate
a pairwise hint.

(cherry picked from commit 910d595fbc)
2021-12-23 15:57:28 +01:00
Michal Nowak 1352db115d Merge branch 'mnowak/respdiff-job-dependency-fix-v9_11' into 'v9_11'
[v9_11] Execute respdiff jobs out-of-order

See merge request isc-projects/bind9!5667
2021-12-22 14:42:32 +00:00