2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

40440 Commits

Author SHA1 Message Date
Mark Andrews
4e16bbce15 Use custom bindkeys-file in tests
Ensure the test doesn't use the system's bind.keys file by using the
bindkeys-file statement.
2023-12-18 23:46:03 +00:00
Mark Andrews
de812433f5 Merge branch '4138-dig-in-9-19-13-crashes-when-cancelling-with-ctrl-c-a-pending-query-to-to-a-not-reachable-tcp' into 'main'
Resolve "dig in 9.19.13 crashes, when cancelling (with CTRL+C) a pending query to to a not reachable TCP port"

Closes #4138

See merge request isc-projects/bind9!8554
2023-12-18 23:31:00 +00:00
Mark Andrews
06e565944b Add CHANGES not for [GL #4138] 2023-12-19 09:44:05 +11:00
Mark Andrews
ae24792ea2 Handle ISC_R_SHUTTINGDOWN in dighost.c:tcp_connected
dig was making further queries after SIGINT was recieved rather
than shutting down as expected.
2023-12-19 09:43:15 +11:00
Michał Kępień
270c51f328 Merge branch '4497-trust-anchor-telemetry-is-no-longer-experimental' into 'main'
"trust-anchor-telemetry" is no longer experimental

Closes #4497

See merge request isc-projects/bind9!8585
2023-12-18 14:12:22 +00:00
Michał Kępień
693fee4836
Add CHANGES entry for GL #4497 2023-12-18 15:11:39 +01:00
Michał Kępień
b1baf7af3a
"trust-anchor-telemetry" is no longer experimental
Remove the CFG_CLAUSEFLAG_EXPERIMENTAL flag from the
"trust-anchor-telemetry" statement as the behavior of the latter has not
been changed since its initial implementation and there are currently no
plans to do so.  This silences a relevant log message that was emitted
even when the feature was explicitly disabled.
2023-12-18 15:11:39 +01:00
Michał Kępień
67a58784b7 Merge branch '4213-fix-reference-counting-in-do_nsfetch' into 'main'
Fix reference counting in do_nsfetch()

Closes #4213

See merge request isc-projects/bind9!8580
2023-12-18 10:35:20 +00:00
Michał Kępień
2a3b6d1406
Fix reference counting in do_nsfetch()
Each function queuing a do_nsfetch() call using isc_async_run() is
expected to increase the given zone's internal reference count
(zone->irefs), which is then correspondingly decreased in either
do_nsfetch() itself (when the dns_resolver_createfetch() fails) or in
nsfetch_done() (when recursion is finished).

However, do_nsfetch() can also return early if either the zone itself or
the relevant view's resolver object is being shut down.  In that case,
do_nsfetch() simply returns without decreasing the internal reference
count for the zone.  This leaves a dangling zone reference around, which
leads to hangs during named shutdown.

Fix by executing the same cleanup code for early returns from
do_nsfetch() as for a failed dns_resolver_createfetch() call in that
function as the reference count will not be decreased in nsfetch_done()
in any of these cases.
2023-12-18 11:33:43 +01:00
Michał Kępień
e0096df669 Merge branch '4060-prevent-an-infinite-loop-in-shutdown_listener' into 'main'
Prevent an infinite loop in shutdown_listener()

Closes #4060

See merge request isc-projects/bind9!8581
2023-12-18 10:07:35 +00:00
Michał Kępień
2d75c96874
Prevent an infinite loop in shutdown_listener()
The loop in shutdown_listener() assumes that the reference count for
every controlconnection_t object on the listener->connections linked
list will drop down to zero after the conn_shutdown() call in the loop's
body.  However, when the timing is just right, some netmgr callbacks for
a given control connection may still be awaiting processing by the same
event loop that executes shutdown_listener() when the latter is run.
Since these netmgr callbacks must be run in order for the reference
count for the relevant controlconnection_t objects to drop to zero, when
the scenario described above happens, shutdown_listener() runs into an
infinite loop due to one of the controlconnection_t objects on the
listener->connections linked list never going away from the head of that
list.

Fix by safely iterating through the listener->connections list and
initiating shutdown for all controlconnection_t objects found.  This
allows any pending netmgr callbacks to be run by the same event loop in
due course, i.e. after shutdown_listener() returns.
2023-12-18 11:07:04 +01:00
Arаm Sаrgsyаn
755b76aa63 Merge branch '4477-tests-statschannel-loadtime-bugfix' into 'main'
Resolve "statschannel test intermittently fails with incorrect zone loadtime"

Closes #4477

See merge request isc-projects/bind9!8569
2023-12-18 09:33:16 +00:00
Aram Sargsyan
4e94ff2541 Fix a statschannel system test zone loadtime issue
The check_loaded() function compares the zone's loadtime value and
an expected loadtime value, which is based on the zone file's mtime
extracted from the filesystem.

For the secondary zones there may be cases, when the zone file isn't
ready yet before the zone transfer is complete and the zone file is
dumped to the disk, so a so zero value mtime is retrieved.

In such cases wait one second and retry until timeout. Also modify
the affected check to allow a possible difference of the same amount
of seconds as the chosen timeout value.
2023-12-18 08:46:31 +00:00
Arаm Sаrgsyаn
ced40c48a4 Merge branch '4493-data-race-in-xfrin_send_request' into 'main'
Resolve "ThreadSanitizer: data race xfrin.c:1555:2 in xfrin_send_request"

Closes #4493

See merge request isc-projects/bind9!8579
2023-12-18 08:44:33 +00:00
Aram Sargsyan
2179224573 Add a CHANGES note for [GL #4493] 2023-12-15 09:56:44 +00:00
Aram Sargsyan
791a046cc7 Use atomic store operations instead of atomic initialize
The atomic_init() function makes sense to use with structure's
members when creating a new instance of a strucutre. In other
places, use atomic store operations instead, in order to avoid
data races.
2023-12-15 09:56:44 +00:00
Petr Špaček
edcabe8030 Merge branch '4467-fix-stats-export-overflow' into 'main'
Avoid overflow during statistics dump

Closes #4467

See merge request isc-projects/bind9!8532
2023-12-14 08:13:46 +00:00
Aydın Mercan
9c4dd863a6 Move atomic statscounter next to the non-atomic definition 2023-12-14 09:11:48 +01:00
Aydın Mercan
bb96142a17 Use a non-atomic counter when passing to stats dumper 2023-12-14 09:11:48 +01:00
Petr Špaček
b57c37d8c5 Add CHANGES and release note for [GL #4467] 2023-12-14 09:11:46 +01:00
Petr Špaček
7b0115e331 Avoid overflow during statistics dump
Related: !1493
Fixes: #4467
2023-12-14 09:11:02 +01:00
Mark Andrews
3389df6d89 Merge branch '4478-redefinition-of-hmac-as-different-kind-of-symbol-on-netbsd' into 'main'
Resolve "Redefinition of 'hmac' as different kind of symbol on NetBSD"

Closes #4478

See merge request isc-projects/bind9!8555
2023-12-13 23:32:41 +00:00
Mark Andrews
648fa635f8 Add CHANGES note for [GL #4478] 2023-12-13 22:27:38 +00:00
Mark Andrews
fd077c2661 NetBSD has added 'hmac' to libc so rename out uses of hmac 2023-12-13 22:27:38 +00:00
Petr Špaček
f7597fa286 Merge branch 'pspacek/update-gitlab-issue-templates' into 'main'
Update Gitlab issue templates

See merge request isc-projects/bind9!8542
2023-12-13 16:30:04 +00:00
Petr Špaček
84795f3005 Add Acknowledgements into Security issue template
Hopefully it will save us one round-trip with the reporter.
2023-12-13 17:11:59 +01:00
Petr Špaček
dd4a5d9668 Fix Gitlab label in Feature request template 2023-12-13 17:09:05 +01:00
Petr Špaček
6ccb07e09a Modernize Gitlab Bug template 2023-12-13 17:09:05 +01:00
Petr Špaček
b77f25446d Add a default Gitlab issue template
It's an attempt to make people use correct Gitlab templates, or use them
at all.
2023-12-13 17:09:05 +01:00
Petr Špaček
b862394bbb Make CVE issues confidential by default
An trivial attempt to avoid accidental disclosures.
2023-12-13 17:09:05 +01:00
Petr Špaček
51218c0cfb Label CVE issue template as internal-use only 2023-12-13 17:09:05 +01:00
Petr Špaček
f72d433520 Add Gitlab template for security issues 2023-12-13 17:09:05 +01:00
Michal Nowak
dc9cf795fe Merge branch 'mnowak/alpine-3.19' into 'main'
Add Alpine Linux 3.19

See merge request isc-projects/bind9!8562
2023-12-12 10:10:50 +00:00
Michal Nowak
1fc56d705e
Add Alpine Linux 3.19 2023-12-12 10:36:03 +01:00
Evan Hunt
f6b9bc7da6 Merge branch 'matthijs-qp-lookup-iterator' into 'main'
Follow-up on !8468, more dns_qp_lookup bug fixes related to the iterator

See merge request isc-projects/bind9!8558
2023-12-11 21:01:46 +00:00
Matthijs Mekking
3c397a5d68 Add CHANGES 2023-12-11 21:01:29 +00:00
Matthijs Mekking
21867f200a Refactor getpred code
Move the code to find the predecessor into one function, as it is shares
quite some similarities: In both cases we first need to find the
immediate predecessor/successor, then we need to find the immediate
predecessor if the iterator is not already pointing at it.
2023-12-11 21:01:29 +00:00
Matthijs Mekking
ab8a0c4b5a and fix yet another dns_qp_lookup() iterator bug
This one is similar to the bug when searching for a key, reaching a
dead-end branch that doesn't match, because the branch offset point
is after the point where the search key differs.

This fixes the case where we are multiple levels deep. In other
words, we had a more-than-one matches *after* the point where the
search key differs.

For example, consider the following qp-trie:

branch: "[e]", "[m]":
 - leaf: "a.b.c.d.e"
 - branch: "moo[g]", "moo[k]", "moo[n]":
   - leaf: "moog"
   - branch: "mook[e]", "mook[o]"
     - leaf: "mooker"
     - leaf: "mooko"
   - leaf: "moon"

If searching for a key "monky", we would reach the branch with
twigs "moo[k]" and "moo[n]". The key matches on the 'k' on offset=4,
and reaches the branch with twigs "mook[e]" and "mook[o]". This time
we cannot find a twig that matches our key at offset=5, there is no
twig for 'y'. The closest name we found was "mooker".

Note that on a branch it can't detect it is on a dead branch because the
key is not encapsulated in a branch node.

In the previous code we considered "mooker" to be the successor of
"monky" and so we needed to the predecessor of "mooker" to find the
predecessor for "monky". However, since the search key alread differed
before entering this branch, this is not enough. We would be left with
"moog" as the predecessor of "monky", while in this example "a.b.c.d.e"
is the actual predecessor.

Instead, we need to go up a level, find the predecessor and check
again if we are on the right branch, and repeat the process until we
are.

Unit tests to cover the scenario are now added.
2023-12-11 21:01:29 +00:00
Matthijs Mekking
276bdcf5cf and fix another dns_qp_lookup() iterator bug
There was yet another edge case in which an iterator could be
positioned at the wrong node after dns_qp_lookup(). When searching for
a key, it's possible to reach a leaf that matches at the given offset,
but because the offset point is *after* the point where the search key
differs from the leaf's contents, we are now at the wrong leaf.

In other words, the bug fixed the previous commit for dead-end branches
must also be applied on matched leaves.

For example, if searching for the key "monpop", we could reach a branch
containing "moop" and "moor". the branch offset point - i.e., the point
after which the branch's leaves differ from each other - is the
fourth character ("p" or "r"). The search key matches the fourth
character "p", and takes that twig to the next node (which can be
a branch for names starting with "moop", or could be a leaf node for
"moop").

The old code failed to detect this condition, and would have
incorrectly left the iterator pointing at some successor, and not
at the predecessor of the "moop".

To find the right predecessor in this case, we need to get to the
previous branch and get the previous from there.

This has been fixed and the unit test now includes several new
scenarios for testing search names that match and unmatch on the
offset but have a different character before the offset.
2023-12-11 21:01:29 +00:00
Michal Nowak
a71c0f5338 Merge branch 'mnowak/replace-danger-python-with-hazard' into 'main'
Replace danger-python with Hazard

See merge request isc-projects/bind9!8548
2023-12-11 17:02:47 +00:00
Tom Krizek
4f70f5bd7c
Handle empty MR description in dangerfile
A merge request might have no description at all (i.e. None, rather than
an empty string). This might happen when the MR is created via an API.
Check a description is present before trying to find a backport string
in it.
2023-12-11 17:22:03 +01:00
Michał Kępień
43126e81e6
Improve determining the lines added by a branch
Since the list of lines added to Git-tracked text files in a given
branch is not part of the Danger DSL [1], it is determined using custom
code in dangerfile.py.  The current implementation of that logic is less
than perfect as it examines the diff between the current tip of the
target branch and the source branch rather than the diff between the
merge base of the two branches and the source branch.  Consider a Git
history like this:

    *   F (target)
    ...
    *   E
    *   D
    *   C
    | * B (source)
    |/
    *   A (merge base)

If danger-python or Hazard are run for commit B, the current logic for
determining the list of added lines in dangerfile.py examines the diff
between commits F and B rather than between commits A and B.  Therefore,
the added_lines() function returns not just the lines added by commit B
on top of commit A, but also the list of lines that were removed between
commits A and F, which leads to confusing results.

Fix by using the triple-dot diff operator in the Git invocation whose
output is used as the source of information for determining the list of
lines added by a given branch.

Since Hazard fetches the target branch itself when it is run, remove the
explicit "git fetch" invocation that fetches the target branch from
GitLab (shortening its local history to a single commit in the process)
before "git diff" is invoked.

[1] https://danger.systems/js/reference.html#GitDSL
2023-12-11 17:22:03 +01:00
Michal Nowak
08ce1bc45f
Replace danger-python with Hazard
Hazard is a minimal danger-python replacement.
2023-12-11 17:22:03 +01:00
Tom Krizek
dc6200ed87 Merge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.19.20' into 'main'
Set up version and release notes for BIND 9.19.20

See merge request isc-projects/bind9!8560
2023-12-08 15:04:58 +00:00
Tom Krizek
9f82448ab5 Set up release notes for BIND 9.19.20 2023-12-08 15:51:48 +01:00
Tom Krizek
2964019558 Update BIND version to 9.19.20-dev 2023-12-08 15:51:48 +01:00
Tom Krizek
18a05caf55
Update BIND version for release v9.19.19 2023-12-08 12:39:04 +01:00
Tom Krizek
8ce8c1c503
Add a CHANGES marker 2023-12-08 12:38:59 +01:00
Tom Krizek
64d5751891 Merge branch 'michal/prepare-documentation-for-bind-9.19.19' into 'v9.19.19-release'
Prepare documentation for BIND 9.19.19

See merge request isc-private/bind9!598
2023-12-08 11:38:30 +00:00
Tom Krizek
874329b3b1
Temporarily allow failure of respdiff-long:tsan job
There was a change in the branch that uncovered preexisting data races
when testing with respdiff under TSAN. This isn't a new issue that
should stop the releases. Allow the check to temporarily fail until the
underlying issue GL #4475 is addressed.
2023-12-07 16:42:43 +01:00