2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00
Commit Graph

41300 Commits

Author SHA1 Message Date
Ondřej Surý
3310cac2b0 Create the new database for AXFR from the dns_zone API
The `axfr_makedb()` didn't set the loop on the newly created database,
effectively killing delayed cleaning on such database.  Move the
database creation into dns_zone API that knows all the gory details of
creating new database suitable for the zone.
2024-05-29 08:30:19 +02:00
Petr Špaček
37ae380e97 Merge branch 'stepan/hypothesis' into 'main'
Expand the wildcard system test with wider use of hypothesis

See merge request isc-projects/bind9!8461
2024-05-28 13:17:32 +00:00
Štěpán Balážik
9584a7bdcd Add a helper for uncompressed length of dnspython's dns.name.Name
This is useful for generating using hypothesis but also for other
cases.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
bb1e5cfa09 Move hypothesis strategies to isctest for later reuse
`isctest.hypothesis` seems to be a nice place to have these.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
f55cacbbfd Disable deadlines for hypothesis tests when running in CI
The times it takes to run tests CI vary significantly enough
that it makes hypothesis test reach their deadlines and fail randomly
marking the tests as flaky.

This commit disables the deadlines when running in CI.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
9943172566 Test nested wildcard special case in the respective system test
See final remark of RFC 4592 2.2.1. for details.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
d0cfbd398e Expand the wildcard system test with wider use of hypothesis
The queries are now generated more generally (i. e. they have
multiple labels, etc.).
2024-05-28 12:12:16 +00:00
Štěpán Balážik
5d738cd9ed Add hypothesis strategies for generating DNS names and company
The most important being `dns_names` that generates dns.name.Name
objects based on given paramaters.

No guarantees are given when it comes the uniformity of generated
samples, however it plays nicely with the hypothesis' shrinking
algorithm.

Once we use hypothesis more widely (in at least one more test) this file
should be moved for it to be reused easily.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
e7d46ad8ba Extend isctest package with more utility functions
Check for more rcodes and various properties needed in the wildcard
test. Add a `name` module for various dns.name.Name operations (with
`prepend_label` function only now).

Expose `timeout` as a parameter of `query.tcp`/`query.udp`.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
02d1c5fc89 Silent pylint's line-too-long warning as it's handled better by black
Black allows the lines with string literals to be longer, which is
convenient for descriptive error messages.
2024-05-28 12:12:16 +00:00
Nicki Křížek
8cdfccf140 Merge branch 'nicki/use-bind-team-gitlab-tokens' into 'main'
Use bind-team tokens for CI gitlab access

See merge request isc-projects/bind9!9067
2024-05-27 11:13:34 +00:00
Nicki Křížek
d391f0c958 Use BIND_TEAM_WRITE_TOKEN for autobackport bot
This is done to unify the token usage across our repositories to
simplify token maintenance.
2024-05-27 13:03:13 +02:00
Nicki Křížek
6767172bc0 Use BIND_TEAM_API_TOKEN for danger bot
This is done to unify the token usage across our repositories to
simplify token maintenance.
2024-05-27 13:03:10 +02:00
Ondřej Surý
b70ef5e5a4 Merge branch 'ondrej/cleanup-dns_db' into 'main'
Cleanup the dns_cache unit

See merge request isc-projects/bind9!9064
2024-05-25 09:48:34 +00:00
Aram Sargsyan
4d3c31b928 fixup! Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main' 2024-05-25 11:47:33 +02:00
Ondřej Surý
3feabc8a22 Cleanup the dns_cache unit
Remove duplicate code and use ISC_REFCOUNT_{DECL,IMPL} macros.
2024-05-25 11:47:33 +02:00
Michal Nowak
08eef0fa0d Merge branch 'mnowak/cross-version-config-tests-drop-allow_failure-true' into 'main'
Drop "allow_failure: true" in cross-version-config-tests job

See merge request isc-projects/bind9!9044
2024-05-24 11:44:39 +00:00
Michal Nowak
c58dd6e78f Workaround temporary cross-version-config-tests limitation
The system test from the BIND 9.19.24 release does not include the
isctest/vars/autoconf.py file from 9.19.25-dev, and therefore the job
will fail before the 9.19.25 release is published. In the meantime,
consider using the conf.sh file.
2024-05-24 11:01:40 +02:00
Nicki Křížek
e712cf613f Fix oversight in cross-version-config test
This is a followup for 5e7b3d9ef36b199e2d24d385593a8e2f7d541b65. The
change slipped by during refactoring and this line wasn't updated.
2024-05-24 11:00:09 +02:00
Michal Nowak
8d99ce28e8 Revert "Allow failure of cross-version-config test"
This reverts commit b99cdfab9d.
2024-05-24 10:59:27 +02:00
Ondřej Surý
7e87e2657a Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'
Refactor the common buffer manipulation in rdataslab.c in macros

See merge request isc-projects/bind9!9063
2024-05-24 08:29:54 +00:00
Ondřej Surý
03ed19cf71 Refactor the common buffer manipulation in rdataslab.c in macros
The rdataslab.c was full of code like this:

        length = raw[0] * 256 + raw[1];

and

        count2 = *current2++ * 256;
        count2 += *current2++;

Refactor code like this into peek_uint16() and get_uint16 macros
to prevent code repetition and possible mistakes when copy and
pasting the same code over and over.

As a side note for an entertainment of a careful reader of the commit
messages: The byte manipulation was changed from multiplication and
addition to shift with or.

The difference in the assembly looks like this:

MUL and ADD:

	movzx   eax, BYTE PTR [rdi]
        movzx   edi, BYTE PTR [rdi+1]
        sal     eax, 8
        or      edi, eax

SHIFT and OR:

        movzx   edi, WORD PTR [rdi]
        rol     di, 8
        movzx   edi, di

If the result and/or buffer is then being used after the macro call,
there's more differences in favor of the SHIFT+OR solution.
2024-05-24 09:52:45 +02:00
Michal Nowak
c8289279f0 Merge branch 'mnowak/alpine-3.20' into 'main'
Add Alpine Linux 3.20

See merge request isc-projects/bind9!9059
2024-05-23 11:19:26 +00:00
Michal Nowak
6f22e79ef9 Add Alpine Linux 3.20 2024-05-23 10:58:25 +02:00
Michal Nowak
1f5143e066 Merge branch 'mnowak/short-stress-tests-should-keep-artifacts' into 'main'
Short stress tests should keep artifacts

See merge request isc-projects/bind9!9056
2024-05-22 10:55:18 +00:00
Michal Nowak
aa72747c80 Short stress tests should keep artifacts 2024-05-22 10:46:28 +02:00
Aydın Mercan
4de93e86fa Merge branch 'aydin/fix-trace' into 'main'
Fix typing mistakes in trace macros

See merge request isc-projects/bind9!9050
2024-05-20 11:45:22 +00:00
Aydın Mercan
03a59cbb04 reinsert accidentally removed + in db trace
It only affects development when using `DNS_DB_TRACE`.
2024-05-17 18:11:23 -07:00
Aydın Mercan
49e62ee186 fix typing mistakes in trace macros
The detach function declaration in `ISC__REFCOUNT_TRACE_DECL` had an
returned an accidental implicit int. While not allowed since C99, it
became an error by default in GCC 14.

`ISC_REFCOUNT_TRACE_IMPL` and `ISC_REFCOUNT_STATIC_TRACE_IMPL` expanded
into the wrong macros, trying to declare it again with the wrong number
of parameters.
2024-05-17 18:11:23 -07:00
Evan Hunt
5972a80714 Merge branch '4730-clang-format-header-file-changes' into 'main'
Resolve "Clang format header file changes"

Closes #4730

See merge request isc-projects/bind9!9047
2024-05-17 23:18:47 +00:00
Mark Andrews
1697011af6 Ignore reformat sources with up-to-date clang-format-18 2024-05-17 16:03:46 -07:00
Mark Andrews
b7de2c7cb9 Clang-format header file changes 2024-05-17 16:03:21 -07:00
Arаm Sаrgsyаn
add3a6ee8c Merge branch 'aram/mr8937-changes-placeholder' into 'main'
Add a CHANGES placeholder for [GL !8937]

See merge request isc-projects/bind9!9049
2024-05-17 10:48:23 +00:00
Aram Sargsyan
563ed741bf Add a CHANGES placeholder for [GL !8937] 2024-05-17 10:20:48 +00:00
Mark Andrews
8246465513 Merge branch '4726-increase-formerr-coverage-in-message-parsing' into 'main'
Resolve "Increase FORMERR coverage in message parsing"

Closes #4726

See merge request isc-projects/bind9!9034
2024-05-17 05:16:48 +00:00
Mark Andrews
6e9ed4983e add test cases for several FORMERR code paths:
- duplicated question
  - duplicated answer
  - qtype as an answer
  - two question types
  - question names
  - nsec3 bad owner name
  - short record
  - short question
  - mismatching question class
  - bad record owner name
  - mismatched class in record
  - mismatched KEY class
  - OPT wrong owner name
  - invalid RRSIG "covers" type
  - UPDATE malformed delete type
  - TSIG wrong class
  - TSIG not the last record
2024-05-17 13:39:22 +10:00
Evan Hunt
6a9ac65f0c Merge branch '4683-qpzone-tsan-fix' into 'main'
replace qpzone node attributes with atomics

Closes #4683

See merge request isc-projects/bind9!9033
2024-05-17 00:33:48 +00:00
Evan Hunt
9c882f1e69 replace qpzone node attriutes with atomics
there were TSAN error reports because of conflicting uses of
node->dirty and node->nsec, which were in the same qword.

this could be resolved by separating them, but we could also
make them into atomic values and remove some node locking.
2024-05-17 00:33:35 +00:00
Matthijs Mekking
bcc6039bf5 Merge branch 'matthijs-qp-set-iterator' into 'main'
Rewrite fix_iterator()

See merge request isc-projects/bind9!9038
2024-05-16 09:50:08 +00:00
Matthijs Mekking
82e9d93c0b Two more qp test cases
Add two more cases that should select different predecessors from
different twigs.
2024-05-16 09:49:41 +00:00
Matthijs Mekking
f882101265 Rewrite qp fix_iterator()
The fix_iterator() function had a lot of bugs in it and while fixing
them, the number of corner cases and the complexity of the function
got out of hand. Rewrite the function with the following modifications:

The function now requires that the iterator is pointing to a leaf node.
This removes the cases we have to deal when the iterator was left on a
dead branch.

From the leaf node, pop up the iterator stack until we encounter the
branch where the offset point is before the point where the search key
differs. This will bring us to the right branch, or at the first
unmatched node, in which case we pop up to the parent branch. From
there it is easier to retrieve the predecessor.

Once we are at the right branch, all we have to do is find the right
twig (which is either the twig for the character at the position where
the search key differs, or the previous twig) and walk down from there
to the greatest leaf or, in case there is no good twig, get the
previous twig from the successor and get the greatest leaf from there.

If there is no previous twig to select in this branch, because every
leaf from this branch node is greater than the one we wanted, we need
to pop up the stack again and resume at the parent branch. This is
achieved by calling prevleaf().
2024-05-16 09:49:41 +00:00
Matthijs Mekking
8b8c16d7a4 Get anyleaf when qp lookup is on a dead end branch
Move the fix_iterator out of the loop and only call it when we found
a leaf node. This leaf node may be the wrong leaf node, but fix_iterator
should correct that.

Also, when we don't need to set the iterator, just get any leaf. We
only need to have a leaf for the qpkey_compare and the end result does
not matter if compare was against an ancestor leaf or any leaf below
that point.
2024-05-16 09:49:41 +00:00
Michal Nowak
6b89d66ce8 Merge tag 'v9.19.24' 2024-05-16 11:37:12 +02:00
Mark Andrews
ed5b9b0898 Merge branch '4517-dnssec-verify-reports-errors-in-nsec3-chain' into 'main'
Resolve "dnssec-verify reports errors in NSEC3 chain"

Closes #4517

See merge request isc-projects/bind9!8631
2024-05-16 01:52:55 +00:00
Mark Andrews
e4dbf4be8e Add CHANGES note for [GL #4517] 2024-05-16 10:28:27 +10:00
Mark Andrews
dd13f41ae1 Don't sign non-apex DNSKEY records
DNSKEY can only be validated if it is signed by itself.  Stop
attempting to sign non apex DNSKEY RRsets.
2024-05-16 10:28:27 +10:00
Mark Andrews
315ad2df7a Remove invalid DNSKEY RRset from zone 2024-05-16 10:28:27 +10:00
Mark Andrews
122111f75e Add regression test data for [GL #4517]
An obscured DNSKEY RRset at a delegation was incorrectly added to
the NSEC/NSEC3 type bit map leading to zone verification failures.
This adds such a RRset to the test zone.
2024-05-16 10:28:27 +10:00
Mark Andrews
b3efc15be4 Fail if there are non apex DNSKEYs
DNSSEC only works when DNSKEYs are self signed.  This only occurs
when the DNSKEY RRset is at the apex.  Cause dnssec-signzone to
fail if it attempts to sign an non-apex DNSKEY RRset.
2024-05-16 10:28:27 +10:00
Mark Andrews
ec3c624814 Properly build the NSEC/NSEC3 type bit map
DNSKEY was incorrectly being added to the NESC/NSEC3 type bit map
when it was obscured by the delegation.  This lead to zone verification
failures.
2024-05-16 10:27:49 +10:00