Commit Graph
29621 Commits
Author SHA1 Message Date
Petr ŠpačekandNicki Křížek df27b977fe Add CHANGES note for [GL #4480]
(cherry picked from commit 6eda4f465aa75eb6d66a27f2d7a3dfae7611ecf9)
2024-07-24 12:15:23 +02:00
Aram SargsyanandNicki Křížek cd9b8b9552 Adapt the upforwd test to the SIG(0) removal
Change the check so that update with SIG(0) is expected to fail.

(cherry picked from commit 5f7558f6dbb0527c08caf281299245ab8de268cd)
2024-07-24 12:15:23 +02:00
Petr ŠpačekandNicki Křížek a2f3590ceb Adapt the tsiggss test to the SIG(0) removal
Test that SIG(0) signer is NOT sent to the external socket for
authorization. It MUST NOT be considered a valid signature by
any chance.

Also check that the signer's name does not appear in authsock.pl
output.

(cherry picked from commit cf8838085905171fbc00747eb210e8b8284ca0e1)
2024-07-24 12:15:23 +02:00
Aram SargsyanandNicki Křížek daa96442c4 Enable stdout autoflush in authsock.pl
With enabled buffering the output gets lost when the process
receives a TERM signal. Disable the buffering.

(cherry picked from commit a0311dfb6e2a51f89dfa8b200b96a0f4675fb654)
2024-07-24 12:15:22 +02:00
Petr ŠpačekandNicki Křížek 9dc5c3709f Remove support for SIG(0) message verification
(cherry picked from commit 857fd5c346e3309ee8e280c29174b46579af5a13)
2024-07-24 12:15:21 +02:00
Nicki Křížek f8e5f90aad [9.11][CVE-2024-1737 (part 2)] Be smarter about refusing to add many RR types to the database
Add HTTPS, SVCB, SRV, PTR, NAPTR, DNSKEY and TXT records to the list of
the priority types that are put at the beginning of the slabheader list
for faster access and to avoid eviction when there are more types than
the max-types-per-name limit.

(cherry picked from commit b27c6bcce8)

---

Backport of MR https://gitlab.isc.org/isc-private/bind9/-/merge_requests/712

Related https://gitlab.isc.org/isc-projects/bind9/-/issues/3405

Merge branch '3405-limit-the-number-of-resource-records-in-rrset-nxdomain-9.11' into 'bind-9.11'

See merge request isc-projects/bind9!9171
2024-07-24 10:10:27 +00:00
Ondřej SurýandNicki Křížek e4d7ce686b Be smarter about refusing to add many RR types to the database
Instead of outright refusing to add new RR types to the cache, be a bit
smarter:

1. If the new header type is in our priority list, we always add either
   positive or negative entry at the beginning of the list.

2. If the new header type is negative entry, and we are over the limit,
   we mark it as ancient immediately, so it gets evicted from the cache
   as soon as possible.

3. Otherwise add the new header after the priority headers (or at the
   head of the list).

4. If we are over the limit, evict the last entry on the normal header
   list.

(cherry picked from commit 57cd34441a)
2024-07-24 11:06:03 +02:00
Ondřej SurýandNicki Křížek 3e0a67e4bd Expand the list of the priority types
Add HTTPS, SVCB, SRV, PTR, NAPTR, DNSKEY and TXT records to the list of
the priority types that are put at the beginning of the slabheader list
for faster access and to avoid eviction when there are more types than
the max-types-per-name limit.

(cherry picked from commit b27c6bcce8)
2024-07-24 11:06:03 +02:00
Nicki Křížek 5f25fd9462 [9.11][CVE-2024-1737] Add a limit to the number of RRs in RRSets
Previously, the number of RRs in the RRSets were internally unlimited.
As the data structure that holds the RRs is just a linked list, and
there are places where we just walk through all of the RRs, adding an
RRSet with huge number of RRs inside would slow down processing of said
RRSets.

The fix for end-of-life branches make the limit compile-time only for
simplicity and the limit can be changed at the compile time by adding
following define to CFLAGS:

    -DDNS_RDATASET_MAX_RECORDS=<limit>

Backport of https://gitlab.isc.org/isc-private/bind9/-/merge_requests/698

See isc-projects/bind9#3405

Merge branch '3405-limit-the-number-of-resource-records-in-rrset-9.11' into 'bind-9.11'

See merge request isc-projects/bind9!9169
2024-07-24 08:55:54 +00:00
Ondřej Surý 3f10d6eff0 Add a limit to the number of RR types for single name
Previously, the number of RR types for a single owner name was limited
only by the maximum number of the types (64k).  As the data structure
that holds the RR types for the database node is just a linked list, and
there are places where we just walk through the whole list (again and
again), adding a large number of RR types for a single owner named with
would slow down processing of such name (database node).

Add a hard-coded limit (100) to cap the number of the RR types for a single
owner.  The limit can be changed at the compile time by adding following
define to CFLAGS:

    -DDNS_RBTDB_MAX_RTYPES=<limit>

(cherry picked from commit 538b843d84f49ba5125ff545e3d0cf1c8434a8f2)
2024-06-05 09:02:14 +02:00
Ondřej Surý b9b5485b22 Add a limit to the number of RRs in RRSets
Previously, the number of RRs in the RRSets were internally unlimited.
As the data structure that holds the RRs is just a linked list, and
there are places where we just walk through all of the RRs, adding an
RRSet with huge number of RRs inside would slow down processing of said
RRSets.

The fix for end-of-life branches make the limit compile-time only for
simplicity and the limit can be changed at the compile time by adding
following define to CFLAGS:

    -DDNS_RDATASET_MAX_RECORDS=<limit>

(cherry picked from commit c5c4d00c38530390c9e1ae4c98b65fbbadfe9e5e)
(cherry picked from commit 7f705778af729ada7fec36ac4b456c73329bd996)
2024-06-05 09:02:14 +02:00
Michal Nowak 93c9df4659 Merge branch 'mnowak/drop-broken-jobs' into 'bind-9.11'
[9.11] Drop "stress" tests and pairwise jobs

See merge request isc-projects/bind9!9081
2024-05-31 10:35:37 +00:00
Michal Nowak 6b31e3a64c Drop "stress" tests
In non-EoL branches these jobs were ported to AWS, older configurations
won't work.
2024-05-31 10:06:08 +02:00
Michal Nowak a68218692e Drop pairwise job
Just porting the job to Debian "bookworm" won't work:

    ../../../lib/dns/openssl_link.c:246:9: error: 'ENGINE_load_builtin_engines' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
      246 |         ENGINE_load_builtin_engines();
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-31 10:04:13 +02:00
Nicki Křížek c5c25044a6 Merge branch 'nicki/use-bind-team-gitlab-tokens-9.11' into 'bind-9.11'
[9.11] Use bind-team tokens for CI gitlab access

See merge request isc-projects/bind9!9070
2024-05-27 11:37:19 +00:00
Nicki Křížek 223741db81 Use BIND_TEAM_API_TOKEN for danger bot
This is done to unify the token usage across our repositories to
simplify token maintenance.

(cherry picked from commit 6767172bc0)
2024-05-27 11:28:16 +00:00
Michal Nowak c9d7e61b51 Merge branch 'mnowak/update-urls-and-paths-for-the-bind-9-qa-repository-9.11' into 'bind-9.11'
[9.11] Update URLs and paths for the BIND 9 QA repository

See merge request isc-projects/bind9!8993
2024-04-29 13:21:56 +00:00
Michał KępieńandMichal Nowak 0d6fbb18c8 Update URLs and paths for the BIND 9 QA repository
Since the BIND 9 QA repository has been made public, adjust the relevant
URLs and paths used in .gitlab-ci.yml so that they work with the public
version of that repository.

(cherry picked from commit 25ec1d79e4)
2024-04-29 13:25:58 +02:00
Michał Kępień d21b6fe29c Merge branch 'michal/extract-changes-checks-to-a-separate-gitlab-ci-job-9.11' into 'bind-9.11'
[9.11] Extract CHANGES checks to a separate GitLab CI job

See merge request isc-projects/bind9!8930
2024-03-29 08:00:35 +00:00
Michał Kępień e189749d2a Do not check CHANGES in pre-release pipelines
Since pre-release testing is usually carried out for branches in which
CHANGES entries are intentionally malformed to prevent entry numbering
conflicts down the road, do not run the "changes" GitLab CI job in
pipelines that are triggered by a parent pipeline (which can currently
only be a pre-release testing pipeline) to prevent triggering job
failures that would be meaningless anyway.

(cherry picked from commit 8c2503947f)
2024-03-29 08:55:45 +01:00
Michał Kępień 175b4af118 Extract CHANGES checks to a separate GitLab CI job
Checking the contents of the CHANGES file currently requires invoking
multiple shell scripts.  These invocations are conflated with those for
other test scripts in the "misc" GitLab CI job.  Extract the commands
checking the contents of the CHANGES file to a separate GitLab CI job,
"changes", to improve readability.  Remove similar checks for the
CHANGES.SE file altogether as they are only relevant for BIND -S and
therefore should not be present in an open source branch.

(cherry picked from commit 1335e139f2)
2024-03-29 08:55:45 +01:00
Michał Kępień f412d4f851 Merge branch 'michal/add-pipelines-to-ci-job-trigger-lists-9.11' into 'bind-9.11'
[9.11] Add "pipelines" to CI job trigger lists

See merge request isc-projects/bind9!8929
2024-03-29 07:54:32 +00:00
Michał Kępień c864ed2e0e Add "pipelines" to CI job trigger lists
To enable GitLab CI jobs in other projects to trigger pipelines in the
BIND 9 project using their CI_JOB_TOKEN, add "pipelines" to the relevant
GitLab CI job trigger lists.
2024-03-29 08:52:51 +01:00
Michal Nowak 96284dc1c3 Merge branch 'mnowak/disable-dnstap-in-ci' into 'bind-9.11'
[9.11] Disable dnstap testing globally

See merge request isc-projects/bind9!8917
2024-03-28 10:21:13 +00:00
Michal Nowak 29798de0e9 Disable dnstap testing globally
The dnstap system test fails permanently. Given that we don't have the
resources to investigate and fix the issue in this EoL branch, turn off
dnstap globally.

    I:dnstap:checking that named-checkconf detects no error in good-fstrm-set-reopen-interval.conf
    I:dnstap:wait for servers to finish loading
    I:dnstap:checking initial message counts
    I:dnstap:checking UDP message counts
    I:dnstap:ns3        3 expected 4
    I:dnstap:failed
    I:dnstap:checking TCP message counts
    I:dnstap:checking AUTH_QUERY message counts
    I:dnstap:checking AUTH_RESPONSE message counts
    I:dnstap:checking CLIENT_QUERY message counts
    I:dnstap:checking CLIENT_RESPONSE message counts
    I:dnstap:ns3        1 expected 2
    I:dnstap:failed

But enable dnstap in Debian "stretch" CI jobs to ensure it builds and
gets at least minimal testing.
2024-03-27 10:37:52 +01:00
Michal Nowak b8dbe274eb Merge branch 'mnowak/replace-IO-Socket-INET6-with-IO-Socket-IP-9.11' into 'bind-9.11'
[9.11] IO::Socket::INET6 has been replaced by IO::Socket::IP

See merge request isc-projects/bind9!8913
2024-03-26 16:46:21 +00:00
Mark AndrewsandMichal Nowak bd96046b8c IO::Socket::INET6 has been replaced by IO::Socket::IP
IO::Socket::INET6 is no longer being maintained and its functionality
has been replaced by IO::Socket::IP.

(cherry picked from commit d1983adc22)
(cherry picked from commit fff8de8430)
2024-03-26 14:06:13 +01:00
Ondřej Surý 4634f25cc2 Merge branch 'bug/9.11/4424-nothread-fixes-2' into 'bind-9.11'
Additional fixes to non-thread version

See merge request isc-projects/bind9!8792
2024-02-28 14:19:36 +00:00
Petr Menšík 53fcfb8b8f Additional fixes to non-thread version
Correct some errors in previous non-threaded changes. With these changes
unit tests in non-threaded versions pass again.

Related to [GL #4424] and [GL #4459], fixup of !8786.
2024-02-28 14:13:46 +01:00
Ondřej Surý 6db15e8b68 Merge branch 'bug/9.11/4424-nothread-fixes' into 'bind-9.11'
Add normal task queue also to non-thread version

See merge request isc-projects/bind9!8786
2024-02-26 21:31:34 +00:00
Petr Menšík 74b170bf3c Add normal task queue also to non-thread version
Non-thread builds are used by us for dhcp package. Make it working
again.

Related to [GL #4424] and [GL #4459].
2024-02-26 21:36:10 +01:00
Ondřej Surý f6ae189614 Merge branch '4595-fix-expire-lru-headers-race-9.11' into 'bind-9.11'
[9.11] Do not use header_prev in expire_lru_headers

See merge request isc-projects/bind9!8778
2024-02-23 14:51:44 +00:00
Mark AndrewsandOndřej Surý 80cf02da24 Add CHANGES note for [GL #4495]
(cherry picked from commit 4f8539ac23)
2024-02-23 12:40:16 +01:00
Mark AndrewsandOndřej Surý f88f21b7d8 Do not use header_prev in expire_lru_headers
dns__cacherbt_expireheader can unlink / free header_prev underneath
it.  Use ISC_LIST_TAIL after calling dns__cacherbt_expireheader
instead to get the next pointer to be processed.

(cherry picked from commit 7ce2e86024)
2024-02-23 12:40:16 +01:00
Michał Kępień c1a9bfd873 Merge branch 'ondrej/split-taskmgr-9.11' into 'bind-9.11'
[9.11] [CVE-2023-50387] Fix KeyTrap

See merge request isc-projects/bind9!8769
2024-02-22 12:29:26 +00:00
Ondřej SurýandMichał Kępień 76e3f639f5 Add CHANGES and release note for [GL #4424] 2024-02-22 13:22:01 +01:00
Ondřej SurýandMichał Kępień b38552cca7 Optimize selecting the signing key
Don't parse the crypto data before parsing and matching the id and the
algorithm.
2024-02-22 13:22:01 +01:00
Ondřej SurýandMichał Kępień 75faeefcab Don't iterate from start every time we select new signing key
Improve the selecting of the new signing key by remembering where
we stopped the iteration and just continue from that place instead
of iterating from the start over and over again each time.
2024-02-22 13:22:01 +01:00
Ondřej SurýandMichał Kępień db083a2172 Add normal and slow task queues
Split the task manager queues into normal and slow task queues, so we
can move the tasks that blocks processing for a long time (like DNSSEC
validation) into the slow queue which doesn't block fast
operations (like responding from the cache).  This mitigates the whole
class of KeyTrap-like issues.
2024-02-22 13:22:01 +01:00
Mark AndrewsandMichał Kępień 8b7ecba988 Fail the DNSSEC validation on the first failure
Be more strict when encountering DNSSEC validation failures - fail on
the first failure.  This will break domains that have DNSSEC signing
keys with duplicate key ids, but this is something that's much easier
to fix on the authoritative side, so we are just going to be strict
on the resolver side where it is causing performance problems.
2024-02-22 13:22:01 +01:00
Michał Kępień 92b4f88bc8 Merge branch '4234-use-hashmap-when-parsing-9.11' into 'bind-9.11'
[9.11] [CVE-2023-4408] Use hashtable when parsing a message

See merge request isc-projects/bind9!8768
2024-02-22 11:48:15 +00:00
Ondřej SurýandMichał Kępień 1f9bbe1fe3 Add a system test for mixed-case data for the same owner
We were missing a test where a single owner name would have multiple
types with a different case.  The generated RRSIGs and NSEC records will
then have different case than the signed records and message parser have
to cope with that and treat everything as the same owner.

(cherry picked from commit c8b623d87f)
2024-02-22 12:00:47 +01:00
Ondřej SurýandMichał Kępień 418b379359 Fix case insensitive matching in isc_ht hash table implementation
The case insensitive matching in isc_ht was basically completely broken
as only the hashvalue computation was case insensitive, but the key
comparison was always case sensitive.

(cherry picked from commit c462d65b2f)
2024-02-22 12:00:47 +01:00
Mark AndrewsandMichał Kępień c6026cbbaa Apply various tweaks specific to BIND 9.11 2024-02-22 12:00:47 +01:00
Evan HuntandMichał Kępień bbbcaf8b2e 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-22 12:00:47 +01:00
Evan HuntandMichał Kępień 98ab8c81cc 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-22 12:00:47 +01:00
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