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

41264 Commits

Author SHA1 Message Date
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
Mark Andrews
e84615629f Properly update 'maxtype'
'maxtype' should be checked to see if it should be updated whenever
a type is added to the type map.
2024-05-16 10:20:49 +10:00
Ondřej Surý
333d1881f9 Merge branch 'ondrej/isc_httpd-reference-counting' into 'main'
Properly attach/detach isc_httpd in case read ends earlier than send

See merge request isc-projects/bind9!9037
2024-05-15 12:32:15 +00:00
Ondřej Surý
eb862ce509 Properly attach/detach isc_httpd in case read ends earlier than send
An assertion failure would be triggered when sending the TCP data ends
after the TCP reading gets closed.  Implement proper reference counting
for the isc_httpd object.
2024-05-15 12:22:10 +02:00
Michał Kępień
5fd3530741 Merge branch '4719-placeholder' into 'main'
Add placeholder for GL #4719

See merge request isc-projects/bind9!9036
2024-05-15 08:21:55 +00:00
Michał Kępień
ea6032146c Add placeholder for GL #4719 2024-05-15 10:20:19 +02:00
Evan Hunt
0748847400 Merge branch '4717-qp-lookup-creates-incorrect-chain' into 'main'
Fix dns_qp_lookup() chain inconsistency after fix_iterator()

Closes #4717

See merge request isc-projects/bind9!9028
2024-05-14 20:36:11 +00:00
Matthijs Mekking
730e532cac Test check_predecessors with chain
In addition to testing check_qpchain in combination with qpiter,
test check_predecessors in combination with a qpchain.
2024-05-14 12:58:46 -07:00
Evan Hunt
b6815de316 Fix QP chain on partial match
When searching for a requested name in dns_qp_lookup(), we may add
a leaf node to the QP chain, then subsequently determine that the
branch we were on was a dead end. When that happens, the chain can be
left holding a pointer to a node that is *not* an ancestor of the
requested name.

We correct for this by unwinding any chain links with an offset
value greater or equal to that of the node we found.
2024-05-14 12:58:46 -07:00
Petr Špaček
5d96f11693 Unit test to demonstrate issue #4717
Iterator in lookup() call must be non-NULL to trigger the issue.
Run chain tests twice, once without iterator and second time with
iterator.
2024-05-14 12:58:46 -07:00
Matthijs Mekking
91de4f6490 Refactor fix_iterator
The code below the if/else construction could only be run if the 'if'
code path was taken. Move the code into the 'if' code block so that
it is more easier to read.
2024-05-14 12:58:46 -07:00
Nicki Křížek
ac569ad544 Merge branch 'nicki/add-mailmap' into 'main'
Add .mailmap to the git repo

See merge request isc-projects/bind9!9025
2024-05-14 11:28:00 +00:00
Nicki Křížek
986013a708 Add .mailmap to the git repo
Mailmap can be used to unify the display name in standard git tools.
2024-05-14 13:05:45 +02:00
Michal Nowak
d9fbbd537d Merge branch 'mnowak/pytest_rewrite_include-multiplecfg' into 'main'
Rewrite include-multiplecfg system test to pytest

See merge request isc-projects/bind9!8806
2024-05-14 10:46:10 +00:00
Michal Nowak
e9e8753306 Rewrite include-multiplecfg system test to pytest 2024-05-14 11:45:55 +02:00
Michal Nowak
77a42f8875 Use isctest.run.cmd() helper function in tests 2024-05-14 11:45:55 +02:00
Tom Krizek
a9f3fb3db5 Add isctest.run.cmd() helper function 2024-05-14 11:45:55 +02:00
Aydın Mercan
4f34011ccc Merge branch 'aydin/author-expand' into 'main'
Expand list in chaos authors response

See merge request isc-projects/bind9!9026
2024-05-13 09:57:25 +00:00
Aydın Mercan
df862f9fef Expand list in chaos authors response
The list isn't exactly maintained but it helped with some BIND history
tracking and is basically harmless so it might be worth holding onto it.
I have adapted the name to ASCII so IDN support won't be necessary.
2024-05-13 11:24:29 +03:00
Aydın Mercan
aa860b3ab1 Merge branch '4668-request-to-add-a-new-statistic-recursive-client-high-water-in-rndc-status-and-stats-channel' into 'main'
Add new statistics variable for recursive client high-water

Closes #4668

See merge request isc-projects/bind9!9023
2024-05-10 10:52:51 +00:00
Aydın Mercan
d6dd51bb1b Added CHANGES and release note for [GL #4668] 2024-05-10 12:08:52 +03:00
Aydın Mercan
e037520b92 Keep track of the recursive clients highwater
The high-water allows administrators to better tune the recursive
clients limit without having to to poll the statistics channel in high
rates to get this number.
2024-05-10 12:08:52 +03:00
Aydın Mercan
09e4fb2ffa Return the old counter value in isc_stats_increment
Returning the value allows for better high-water tracking without
running into edge cases like the following:

0. The counter is at value X
1. Increment the value (X+1)
2. The value is decreased multiple times in another threads (X+1-Y)
3. Get the value (X+1-Y)
4. Update-if-greater misses the X+1 value which should have been the
   high-water
2024-05-10 12:08:52 +03:00
Nicki Křížek
ced011f05a Merge branch 'tkrizek/pytest-conf-cleanup' into 'main'
Define environment variables in pytest instead of conf.sh

See merge request isc-projects/bind9!8800
2024-05-09 16:26:26 +00:00
Nicki Křížek
faeec83b64 Ensure OPENSSL_CONF is a file if it exists
Prevent unexpected behavior in cases where the OPENSSL_CONF path would
exist, but it wouldn't point to a file.
2024-05-09 17:08:11 +02:00
Nicki Křížek
ac7c657d19 Move isctest.var initialization to conftest.py
The environment variable initialization requires logging to be set up
first. Ensure the initialization is delayed until loggers have been set
up.
2024-05-09 17:08:11 +02:00
Tom Krizek
2a09f632ab Use a dedicated file for each autoconf variable
To avoid any escaping issues or messing with a language-specific format
when the variable has to be parsed, create a dedicated file for each
variable that is obtained from autoconf.
2024-05-09 17:08:10 +02:00
Tom Krizek
b99cdfab9d Allow failure of cross-version-config test
The test is bound to fail until it is executed against a new release
which will include the pytest env var refactoring.
2024-05-09 17:08:10 +02:00
Tom Krizek
2d1f348483 Move env var initialization to isctest.vars
Make sure all initialization takes place in isctest.vars.__init__ and
export the initial env vars there. Remove the no longer needed env
fixture and use os.environ instead.
2024-05-09 17:08:10 +02:00
Tom Krizek
1f6f2234d8 Move dir env var handling to isctest.vars.dirs 2024-05-09 17:08:10 +02:00
Tom Krizek
41cb553bdd Move port env vars into isctest.vars.ports module
The fixture for port assignment isn't needed, replace it with the common
way of handling environment variables.
2024-05-09 17:08:10 +02:00
Tom Krizek
cca26efe52 Don't export openssl-related env vars unless set
If OPENSSL_CONF is exported as an empty string, it will cause issues on
rhel9fips. Allow the environment variables to be set and exported, but
make sure to only export them if they have been set by the user.
2024-05-09 17:08:09 +02:00
Tom Krizek
b100ce4c88 Parse openssl-related vars in pytest
The openssl config needs to be parsed for some tests that use SoftHSM2.
Rewrite the parsing to python and ensure the required variables are
properly set test-wide.
2024-05-09 17:08:09 +02:00
Tom Krizek
e531bfc3b3 Adjust .gitlab-ci env var detection with sed
The environment variables set by autoconf were moved to autoconf.py.
2024-05-09 17:08:09 +02:00
Tom Krizek
46433ae17b Coalesce system test variables
Provide a single point of access to all the variables used by tests. Use
a custom dict-like structure to access the underlying data without
making a copy. This allows the individual modules to update the contents
at runtime, which is used for some variables.
2024-05-09 17:08:09 +02:00
Tom Krizek
308a8727e5 Format conf.sh with shfmt
No manual changes in this commit - simply running shfmt for proper shell
code formatting.
2024-05-09 17:08:09 +02:00
Tom Krizek
8c6e6758b5 Load env vars in shell-only processing of conf.sh
While this isn't required for pytest operation and execution of the
system test suite, it can be handy to allow test script development and
debugging. Especially setup scripts often source conf.sh and expect
environment variables to be loaded. If these scripts are executed
stand-alone, the environment variables need to be loaded from the python
package.
2024-05-09 17:08:09 +02:00