2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00
Commit Graph

39719 Commits

Author SHA1 Message Date
Tom Krizek
2633732fb1 Merge branch 'tkrizek/remove-trailing-whitespace' into 'main'
Remove trailing whitespace from all text files

See merge request isc-projects/bind9!8012
2023-06-13 13:31:32 +00:00
Tom Krizek
034a32a4f3 Add utility script to detect trailing whitespace
Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.
2023-06-13 15:06:38 +02:00
Tom Krizek
03e981ed2c Ignore trailing whitespace removal commit in git blame 2023-06-13 15:06:38 +02:00
Tom Krizek
5893debf46 Remove trailing whitespace from all text files
I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'
2023-06-13 15:05:40 +02:00
Arаm Sаrgsyаn
589752fc69 Merge branch '4136-catz-db-update-notify-bug' into 'main'
Fix catz db update callback registration logic error

Closes #4136

See merge request isc-projects/bind9!8025
2023-06-13 13:01:05 +00:00
Aram Sargsyan
23f609ba59 Add a CHANGES note for [GL #4136] 2023-06-13 12:58:13 +00:00
Aram Sargsyan
998765fea5 Fix catz db update callback registration logic error
When a catalog zone is updated using AXFR, the zone database is changed,
so it is required to unregister the update notification callback from
the old database, and register it for the new one.

Currently, here is the order of the steps happening in such scenario:

1. The zone.c:zone_startload() function registers the notify callback
   on the new database using dns_zone_catz_enable_db()
2. The callback, when called, notices that the new 'db' is different
   than 'catz->db', and unregisters the old callback for 'catz->db',
   marks that it's unregistered by setting 'catz->db_registered' to
   false, then it schedules an update if it isn't already scheduled.
3. The offloaded update process, after completing its job, notices that
   'catz->db_registered' is false, and (re)registers the update callback
   for the current database it is working on. There is no harm here even
   if it was registered also on step 1, and we can't skip it, because
   this function can also be called "artificially" during a
   reconfiguration, and in that case the registration step is required
   here.

A problem arises when before step 1 an update process was already
in a running state, operating on the old database, and finishing its
work only after step 2. As described in step 3, dns__catz_update_cb()
notices that 'catz->db_registered' is false and registers the callback
on the current database it is working on, which, at that state, is
already obsolete and unused by the zone. When it detaches the database,
the function which is responsible for its cleanup (e.g. free_rbtdb())
asserts because there is a registered update notify callback there.

To fix the problem, instead of delaying the (re)registration to step 3,
make sure that the new callback is registered and 'catz->db_registered'
is accordingly marked on step 2.
2023-06-13 12:58:13 +00:00
Tom Krizek
b94e500d3d Merge branch '4117-serve-stale-check' into 'main'
Avoid false positive in serve-stale system test check

Closes #4117

See merge request isc-projects/bind9!8026
2023-06-13 12:10:25 +00:00
Tom Krizek
dd7bcd2855 Avoid false positive in serve-stale system test check
The purpose of the check is to verify the server has survived the
previous barrage of queries. This is done by sending a query and
checking we get a NOERROR response back.

Previously, that query could've been affected by a servfail cache - the
server would return a SERVFAIL answer, thus failing the check, despite
being up and running. Use version.bind txt ch query to avoid the
interference of servfail cache.
2023-06-13 10:52:01 +02:00
Michal Nowak
c1879b54c3 Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.15' into 'main'
Set up version and release notes for BIND 9.19.15

See merge request isc-projects/bind9!8021
2023-06-12 15:12:13 +00:00
Michal Nowak
a04301f936 Set up release notes for BIND 9.19.15 2023-06-12 16:12:40 +02:00
Michal Nowak
8f6e77aee9 Update BIND version to 9.19.15-dev 2023-06-12 16:12:27 +02:00
Michal Nowak
fce9689893 Update BIND version for release v9.19.14 2023-06-09 12:17:36 +02:00
Michal Nowak
3b11496941 Add a CHANGES marker 2023-06-09 12:16:22 +02:00
Michal Nowak
b7982536c7 Merge branch 'michal/prepare-documentation-for-bind-9.19.14' into 'security-main'
Prepare documentation for BIND 9.19.14

See merge request isc-private/bind9!530
2023-06-09 10:11:45 +00:00
Michał Kępień
466530c73b Add release note for #4049 2023-06-09 11:53:33 +02:00
Michał Kępień
f933f1856b Reorder release notes 2023-06-09 11:53:33 +02:00
Michał Kępień
76877a83be Tweak and reword release notes 2023-06-09 11:53:33 +02:00
Michał Kępień
1f48e1c998 Prepare release notes for BIND 9.19.14 2023-06-09 11:53:33 +02:00
Michał Kępień
350613af9d Drop "Known Issues" entry for #4006 as it is fixed 2023-06-09 11:53:33 +02:00
Michał Kępień
eb88490e91 Re-add a code comment to the "hooks" system test
Commit 5a84c7a09b removed a useful code
comment from the "hooks" system test.  Add it back to prevent confusion.
2023-06-09 11:53:33 +02:00
Michał Kępień
f251588176 Add a missing word to the release note for #4004 2023-06-09 11:53:33 +02:00
Michal Nowak
f69434dc47 Merge branch '4055-improve-the-overmem-cache-cleaning' into 'security-main'
Improve RBT overmem cache cleaning

See merge request isc-private/bind9!520
2023-06-09 09:50:19 +00:00
Michal Nowak
1afde574e9 Set max-cache-size expectations for low values 2023-06-08 12:11:09 +02:00
Ondřej Surý
616bd7a96e Add CHANGES and release note for [GL #4055] 2023-06-08 12:11:09 +02:00
Ondřej Surý
da0eafcdee 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-08 12:11:09 +02:00
Arаm Sаrgsyаn
282c5605b6 Merge branch '4105-QryDropped-stats-counter-documentation-update' into 'main'
QryDropped stats counter documentation update

Closes #4105

See merge request isc-projects/bind9!8006
2023-06-07 14:00:50 +00:00
Aram Sargsyan
27c30fe8a4 QryDropped stats counter documentation update
Document which dropped queries are calculated by the QryDropped
statistics counter.
2023-06-07 13:06:58 +00:00
Michal Nowak
e15455f848 Merge branch 'mnowak/placeholder-for-issue-4055' into 'main'
Add CHANGES placeholder for [GL #4055]

See merge request isc-projects/bind9!8010
2023-06-07 11:42:58 +00:00
Michal Nowak
0856c08ae9 Add CHANGES placeholder for [GL #4055] 2023-06-07 13:39:12 +02:00
Michal Nowak
490b7bd352 Merge branch 'mnowak/placeholder-for-issue-4089' into 'main'
Add CHANGES placeholder for [GL #4089]

See merge request isc-projects/bind9!8009
2023-06-07 11:18:10 +00:00
Michal Nowak
a2b3c2a386 Add CHANGES placeholder for [GL #4089] 2023-06-07 13:07:51 +02:00
Michal Nowak
fd606a8ea8 Merge branch 'mnowak/placeholder-for-issue-3835' into 'main'
Add CHANGES placeholder for [GL #3835]

See merge request isc-projects/bind9!8008
2023-06-07 09:00:42 +00:00
Michal Nowak
e6ed763bf3 Add CHANGES placeholder for [GL #3835] 2023-06-07 10:47:37 +02:00
Ondřej Surý
5bca79da1a Merge branch '4115-fix-extra-dns_validator-detach' into 'main'
Fix extra detach when dns_validator create_fetch() detects deadlock

Closes #4115

See merge request isc-projects/bind9!8003
2023-06-06 17:34:22 +00:00
Ondřej Surý
1d03cac78a Add CHANGES note for [GL #4115] 2023-06-06 19:04:17 +02:00
Ondřej Surý
696506e164 Fix extra detach when dns_validator create_fetch() detects deadlock
When create_fetch() in the dns_validator unit detects deadlock, it
returns DNS_R_NOVALIDSIG, but it didn't attach to the validator.  The
other condition to returning result != ISC_R_SUCCESS would be error from
dns_resolver_createfetch().  The caller (in two places out of three)
would detect the error condition and always detach from the validator.

Move the dns_validator_detach() on dns_resolver_createfetch() error
condition to create_fetch() function and cleanup the extra detaches in
seek_dnskey() and get_dsset().
2023-06-06 19:04:17 +02:00
Ondřej Surý
fbab2dd45f Merge branch '4038-resize-send-buffers-to-avoid-excessive-memory-allocation' into 'main'
Use appropriately sized send buffers for DNS messages over TCP

Closes #4038

See merge request isc-projects/bind9!8004
2023-06-06 11:41:44 +00:00
Ondřej Surý
dff9a56f07 Merge branch 'ondrej/print-library-versions' into 'main'
Print the libuv, liburcu and OpenSSL versions from configure script

See merge request isc-projects/bind9!7998
2023-06-06 11:40:51 +00:00
Artem Boldariev
8672d54847 Update CHANGES and release note [GL #4038]
Mention that memory usage was reduced by allocating properly sized
send buffers for stream-based transports.
2023-06-06 13:40:42 +02:00
Artem Boldariev
d8a5feb556 Use appropriately sized send buffers for DNS messages over TCP
This commit changes send buffers allocation strategy for stream based
transports. Before that change we would allocate a dynamic buffers
sized at 64Kb even when we do not need that much. That could lead to
high memory usage on server. Now we resize the send buffer to match
the size of the actual data, freeing the memory at the end of the
buffer for being reused later.
2023-06-06 13:40:42 +02:00
Ondřej Surý
920dddb729 Print the libuv, liburcu and OpenSSL versions from configure script
The configure summary now prints versions of the mandatory libraries
found when configuring.
2023-06-06 12:42:02 +02:00
Mark Andrews
8169a0ee31 Merge branch '4116-building-with-with-liburcu-qsbr-fails' into 'main'
Resolve "Building with --with-liburcu=qsbr fails"

Closes #4116

See merge request isc-projects/bind9!8002
2023-06-05 23:46:49 +00:00
Mark Andrews
e6e4ac05b8 Fix typo in synchronize_rcu macro (add h)
synchronize_rcu has not been used until now in BIND9 and there
was a typo in the define (a 'h' was missing).
2023-06-06 08:10:09 +10:00
Mark Andrews
c26d66604b Merge branch '4093-use-rcu-for-view-zonetable' into 'main'
Use RCU for view->zonetable

Closes #4093

See merge request isc-projects/bind9!7990
2023-06-02 00:39:07 +00:00
Mark Andrews
47ed397806 Add CHANGES note for [GL #4093] 2023-06-01 16:51:38 +02:00
Mark Andrews
783c6a9538 Use dns_view_findzone instead of dns_zt_find
This ensures that rcu locking is properly applied for
view->zonetable.
2023-06-01 16:51:38 +02:00
Mark Andrews
8d86fa7135 Extend dns_view_findzone to take an options argument
This is in preparation to allow the few remaining direct
dns_zt_find(view->zonetable, ...) to use it for rcu mediated
access to view->zonetable.
2023-06-01 16:51:38 +02:00
Mark Andrews
ceb3264082 Add dns_view_apply
Add dns_view_apply to allow dns_zt_apply to be called on
view->zonetable with rcu locking applied.
2023-06-01 16:51:38 +02:00
Mark Andrews
e0f41259bd Add dns_view_delzone
dns_view_delzone performs the rcu locking required around accessing
view->zonetable.
2023-06-01 16:51:38 +02:00