]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
23 months agoRemove the extra memory context with own arena for sending
Ondřej Surý [Tue, 4 Jun 2024 09:21:24 +0000 (11:21 +0200)] 
Remove the extra memory context with own arena for sending

The changes in this MR prevent the memory used for sending the outgoing
TCP requests to spike so much.  That strictly remove the extra need for
own memory context, and thus since we generally prefer simplicity,
remove the extra memory context with own jemalloc arenas just for the
outgoing send buffers.

23 months agoLimit the number of DNS message processed from a single TCP read
Ondřej Surý [Tue, 4 Jun 2024 07:12:45 +0000 (09:12 +0200)] 
Limit the number of DNS message processed from a single TCP read

The single TCP read can create as much as 64k divided by the minimum
size of the DNS message.  This can clog the processing thread and trash
the memory allocator because we need to do as much as ~20k allocations in
a single UV loop tick.

Limit the number of the DNS messages processed in a single UV loop tick
to just single DNS message and limit the number of the outstanding DNS
messages back to 23.  This effectively limits the number of pipelined
DNS messages to that number (this is the limit we already had before).

23 months agoReplace the tcp_buffers memory pool with static per-loop buffer
Ondřej Surý [Tue, 4 Jun 2024 06:38:35 +0000 (08:38 +0200)] 
Replace the tcp_buffers memory pool with static per-loop buffer

As a single thread can process only one TCP send at the time, we don't
really need a memory pool for the TCP buffers, but it's enough to have
a single per-loop (client manager) static buffer that's being used to
assemble the DNS message and then it gets copied into own sending
buffer.

In the future, this should get optimized by exposing the uv_try API
from the network manager, and first try to send the message directly
and allocate the sending buffer only if we need to send the data
asynchronously.

23 months agons_client: reuse TCP send buffers
Aram Sargsyan [Tue, 12 Mar 2024 15:29:51 +0000 (15:29 +0000)] 
ns_client: reuse TCP send buffers

Constantly allocating, reallocating and deallocating 64K TCP send
buffers by 'ns_client' instances takes too much CPU time.

There is an existing mechanism to reuse the ns_clent_t structure
associated with the handle using 'isc_nmhandle_getdata/_setdata'
(see ns_client_request()), but it doesn't work with TCP, because
every time ns_client_request() is called it gets a new handle even
for the same TCP connection, see the comments in
streamdns_on_complete_dnsmessage().

To solve the problem, we introduce an array of available (unused)
TCP buffers stored in ns_clientmgr_t structure so that a 'client'
working via TCP can have a chance to reuse one (if there is one)
instead of allocating a new one every time.

23 months agoThrottle reading from TCP if the sends are not getting through
Ondřej Surý [Thu, 18 Jan 2024 16:24:22 +0000 (17:24 +0100)] 
Throttle reading from TCP if the sends are not getting through

When TCP client would not read the DNS message sent to them, the TCP
sends inside named would accumulate and cause degradation of the
service.  Throttle the reading from the TCP socket when we accumulate
enough DNS data to be sent.  Currently this is limited in a way that a
single largest possible DNS message can fit into the buffer.

23 months agoMerge branch '4473-fix-doh-intermittent-crash' into 'v9.20.0-release'
Nicki Křížek [Mon, 10 Jun 2024 14:45:42 +0000 (14:45 +0000)] 
Merge branch '4473-fix-doh-intermittent-crash' into 'v9.20.0-release'

DoH:  Avoid potential data races in our DoH implementation related to to HTTP/2 session object management and endpoints set object management

See merge request isc-private/bind9!614

23 months agoModify release notes [GL #4473]
Artem Boldariev [Wed, 20 Dec 2023 17:58:49 +0000 (19:58 +0200)] 
Modify release notes [GL #4473]

Mention that an intermittent BIND process termination in DoH code has
been fixed.

23 months agoModify CHANGES [GL #4473]
Artem Boldariev [Wed, 20 Dec 2023 17:54:31 +0000 (19:54 +0200)] 
Modify CHANGES [GL #4473]

Mention that an intermittent BIND process termination in DoH code has
been fixed.

23 months agoKeep the endpoints set reference within an HTTP/2 socket
Artem Boldariev [Wed, 13 Mar 2024 16:04:46 +0000 (18:04 +0200)] 
Keep the endpoints set reference within an HTTP/2 socket

This commit ensures that an HTTP endpoints set reference is stored in
a socket object associated with an HTTP/2 stream instead of
referencing the global set stored inside a listener.

This helps to prevent an issue like follows:

1. BIND is configured to serve DoH clients;
2. A client is connected and one or more HTTP/2 stream is
created. Internal pointers are now pointing to the data on the
associated HTTP endpoints set;
3. BIND is reconfigured - the new endpoints set object is created and
promoted to all listeners;
4. The old pointers to the HTTP endpoints set data are now invalid.

Instead referencing a global object that is updated on
re-configurations we now store a local reference which prevents the
endpoints set objects to go out of scope prematurely.

23 months agoDoH: avoid potential use after free for HTTP/2 session objects
Artem Boldariev [Fri, 8 Dec 2023 12:26:46 +0000 (14:26 +0200)] 
DoH: avoid potential use after free for HTTP/2 session objects

It was reported that HTTP/2 session might get closed or even deleted
before all async. processing has been completed.

This commit addresses that: now we are avoiding using the object when
we do not need it or specifically check if the pointers used are not
'NULL' and by ensuring that there is at least one reference to the
session object while we are doing incoming data processing.

This commit makes the code more resilient to such issues in the
future.

23 months agoMerge branch 'nicki/add-placeholder-for-4661' into 'main'
Nicki Křížek [Mon, 10 Jun 2024 14:16:46 +0000 (14:16 +0000)] 
Merge branch 'nicki/add-placeholder-for-4661' into 'main'

Add a CHANGES placeholder for [GL #4661]

See merge request isc-projects/bind9!9097

23 months agoAdd a CHANGES placeholder for [GL #4661]
Nicki Křížek [Mon, 10 Jun 2024 12:09:12 +0000 (14:09 +0200)] 
Add a CHANGES placeholder for [GL #4661]

23 months agoMerge branch '4728-allow-transfer-none' into 'main'
Evan Hunt [Wed, 5 Jun 2024 21:50:47 +0000 (21:50 +0000)] 
Merge branch '4728-allow-transfer-none' into 'main'

change allow-transfer default to "none"

Closes #4728

See merge request isc-projects/bind9!9046

23 months agoCHANGES and relnotes for [GL #4728]
Evan Hunt [Thu, 16 May 2024 22:52:27 +0000 (15:52 -0700)] 
CHANGES and relnotes for [GL #4728]

23 months agochange allow-transfer default to "none"
Evan Hunt [Thu, 16 May 2024 22:23:22 +0000 (15:23 -0700)] 
change allow-transfer default to "none"

Changed the default value for 'allow-transfer' to 'none'; zone
transfers now require explicit authorization.

Updated all system tests to specify an allow-transfer ACL when needed.

Revised the ARM to specify that the default is 'none'.

23 months agoMerge branch 'ondrej/use-rcu-stack-for-qpcache-deadnodes' into 'main'
Ondřej Surý [Wed, 5 Jun 2024 17:40:30 +0000 (17:40 +0000)] 
Merge branch 'ondrej/use-rcu-stack-for-qpcache-deadnodes' into 'main'

Use RCU wait-free stack for qpcache deadnodes

See merge request isc-projects/bind9!8907

23 months agoUse isc_queue to implement wait-free deadnodes queue
Ondřej Surý [Mon, 25 Mar 2024 11:17:42 +0000 (12:17 +0100)] 
Use isc_queue to implement wait-free deadnodes queue

Replace the ISC_LIST based deadnodes implementation with isc_queue which
is wait-free and we don't have to acquire neither the tree nor node lock
to append nodes to the queue and the cleaning process can also
copy (splice) the list into a local copy without acquiring the list.

Currently, there's little benefit to this as we need to hold those
locks anyway, but in the future as we move to RCU based implementation,
this will be ready.

To align the cleaning with our event loop based model, remove the
hardcoded count for the node locks and use the number of the event loops
instead.  This way, each event loop can have its own cleaning as part of
the process.  Use uniform random numbers to spread the nodes evenly
between the buckets (instead of hashing the domain name).

23 months agoAdd isc_queue implementation on top of cds_wfcq
Ondřej Surý [Mon, 25 Mar 2024 11:17:42 +0000 (12:17 +0100)] 
Add isc_queue implementation on top of cds_wfcq

Add an isc_queue implementation that hides the gory details of cds_wfcq
into more neat API.  The same caveats as with cds_wfcq.

TODO: Add documentation to the API.

23 months agoMerge branch '4736-isc_r_hostdown-was-not-being-handled-by-resolver-c' into 'main'
Mark Andrews [Tue, 4 Jun 2024 07:35:36 +0000 (07:35 +0000)] 
Merge branch '4736-isc_r_hostdown-was-not-being-handled-by-resolver-c' into 'main'

Resolve "ISC_R_HOSTDOWN was not being handled by resolver.c"

Closes #4736

See merge request isc-projects/bind9!9055

23 months agoAdd CHANGES note for [GL #4736]
Mark Andrews [Tue, 21 May 2024 01:52:38 +0000 (11:52 +1000)] 
Add CHANGES note for [GL #4736]

23 months agoUpdate resquery_senddone handling of ISC_R_TIMEDOUT
Mark Andrews [Mon, 27 May 2024 05:17:06 +0000 (15:17 +1000)] 
Update resquery_senddone handling of ISC_R_TIMEDOUT

Treat timed out as an address specific error.

23 months agoUpdate resquery_senddone handling of ISC_R_CONNECTIONRESET
Mark Andrews [Mon, 27 May 2024 02:46:46 +0000 (12:46 +1000)] 
Update resquery_senddone handling of ISC_R_CONNECTIONRESET

Treat connection reset as an address specific error.

23 months agoHandle ISC_R_HOSTDOWN and ISC_R_NETDOWN in resolver.c
Mark Andrews [Tue, 21 May 2024 01:48:25 +0000 (11:48 +1000)] 
Handle ISC_R_HOSTDOWN and ISC_R_NETDOWN in resolver.c

These error codes should be treated like other unreachable error
codes.

23 months agoMerge branch '4706-4707-add-more-label-checks-to-dangerfile.py' into 'main'
Michał Kępień [Mon, 3 Jun 2024 11:10:55 +0000 (11:10 +0000)] 
Merge branch '4706-4707-add-more-label-checks-to-dangerfile.py' into 'main'

Add more label checks to dangerfile.py

Closes #4706 and #4707

See merge request isc-projects/bind9!9040

23 months agoFail for merge requests with "Affects v9.x" labels
Michał Kępień [Mon, 3 Jun 2024 11:07:21 +0000 (13:07 +0200)] 
Fail for merge requests with "Affects v9.x" labels

Setting "Affects v9.x" labels on a merge request duplicates information
already present on the GitLab issue associated with that merge request.
For trivial merge requests that are not associated with any GitLab
issue, setting the "Affects v9.x" label(s) is considered unnecessary.
Trigger a failure for every merge request marked with at least one
"Affects v9.x" label.

23 months agoWarn about auto-generated merge request titles
Michał Kępień [Mon, 3 Jun 2024 11:07:21 +0000 (13:07 +0200)] 
Warn about auto-generated merge request titles

Merge request titles auto-generated by GitLab are often a source of
confusion regarding the actual contents of a given merge request.  Warn
for merge requests containing titles that look like auto-generated ones.

23 months agoFail for branches using old-style version suffixes
Michał Kępień [Mon, 3 Jun 2024 11:07:21 +0000 (13:07 +0200)] 
Fail for branches using old-style version suffixes

Using "-v9_x" and "-v9.x" version suffixes for branch names is now
deprecated since some automation logic does not handle these.  Fail for
any merge request using such old-style version suffixes.

23 months agoFail for backports with "Affects v9.x" labels set
Michał Kępień [Mon, 3 Jun 2024 11:07:21 +0000 (13:07 +0200)] 
Fail for backports with "Affects v9.x" labels set

Backports are not expected to have any "Affects v9.x" labels set since
those are only meant to be set for merge requests that should have
backports created for them.

23 months agoMerge branch '3472-ipv4-only-mode-not-respected-for-zone-transfers' into 'main'
Mark Andrews [Mon, 3 Jun 2024 09:59:44 +0000 (09:59 +0000)] 
Merge branch '3472-ipv4-only-mode-not-respected-for-zone-transfers' into 'main'

Resolve "IPv4-only mode not respected for zone transfers"

Closes #3472

See merge request isc-projects/bind9!8522

23 months agoAdd CHANGES note for [GL #6288]
Mark Andrews [Wed, 29 Nov 2023 01:51:15 +0000 (12:51 +1100)] 
Add CHANGES note for [GL #6288]

23 months agoDon't do DS checks over disabled address families
Mark Andrews [Thu, 30 Nov 2023 05:46:50 +0000 (16:46 +1100)] 
Don't do DS checks over disabled address families

23 months agoDon't forward UPDATE messages over disabled address families
Mark Andrews [Thu, 30 Nov 2023 05:31:33 +0000 (16:31 +1100)] 
Don't forward UPDATE messages over disabled address families

23 months agoDon't send NOTIFY over disabled address families
Mark Andrews [Thu, 30 Nov 2023 00:18:41 +0000 (11:18 +1100)] 
Don't send NOTIFY over disabled address families

23 months agoCheck that no primaries is logged with -4 or -6
Mark Andrews [Wed, 29 Nov 2023 03:29:05 +0000 (14:29 +1100)] 
Check that no primaries is logged with -4 or -6

When in -4 mode check that "IPv6 disabled and no IPv4 primaries"
is logged and when in -6 mode check that "IPv4 disabled and no IPv6
primaries" is logged.

23 months agoReport non-effective primaries
Mark Andrews [Wed, 29 Nov 2023 01:35:20 +0000 (12:35 +1100)] 
Report non-effective primaries

When named is started with -4 or -6 and the primaries for a zone
do not have an IPv4 or IPv6 address respectively issue a log message.

23 months agoZone transfers should honour -4 and -6 options
Mark Andrews [Tue, 28 Nov 2023 06:26:41 +0000 (17:26 +1100)] 
Zone transfers should honour -4 and -6 options

Check if the address family has been disabled when transferring
zones.

23 months agoAdd helper function isc_sockaddr_disabled
Mark Andrews [Tue, 13 Feb 2024 00:42:44 +0000 (11:42 +1100)] 
Add helper function isc_sockaddr_disabled

23 months agoMerge branch '4708-uv-tcp-close-reset-issue' into 'main'
Matthijs Mekking [Mon, 3 Jun 2024 08:15:35 +0000 (08:15 +0000)] 
Merge branch '4708-uv-tcp-close-reset-issue' into 'main'

Deal with uv_tcp_close_reset more gracefully

Closes #4708

See merge request isc-projects/bind9!9022

23 months agoAdd CHANGES entry for [GL #4708]
Matthijs Mekking [Wed, 8 May 2024 07:51:31 +0000 (09:51 +0200)] 
Add CHANGES entry for [GL #4708]

23 months agoCall reset_shutdown if uv_tcp_close_reset failed
Matthijs Mekking [Wed, 8 May 2024 07:48:08 +0000 (09:48 +0200)] 
Call reset_shutdown if uv_tcp_close_reset failed

If uv_tcp_close_reset() returns an error code, this means the
reset_shutdown callback has not been issued, so do it now.

23 months agoDo not runtime check uv_tcp_close_reset
Matthijs Mekking [Wed, 8 May 2024 07:27:53 +0000 (09:27 +0200)] 
Do not runtime check uv_tcp_close_reset

When we reset a TCP connection by sending a RST packet, do not bother
requiring the result is a success code.

23 months agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Mon, 3 Jun 2024 07:46:04 +0000 (07:46 +0000)] 
Merge branch 'marka-placeholder' into 'main'

add placeholder

See merge request isc-projects/bind9!9083

23 months agoadd placeholder
Mark Andrews [Mon, 3 Jun 2024 07:18:24 +0000 (17:18 +1000)] 
add placeholder

23 months agoMerge branch '2744-warning-checkhints-unable-to-get-root-ns-rrset-from-cache-not...
Mark Andrews [Fri, 31 May 2024 06:16:24 +0000 (06:16 +0000)] 
Merge branch '2744-warning-checkhints-unable-to-get-root-ns-rrset-from-cache-not-found' into 'main'

Resolve "warning: checkhints: unable to get root NS rrset from cache: not found"

Closes #2744

See merge request isc-projects/bind9!8745

23 months agoAdd CHANGES entry for [GL #2744]
Mark Andrews [Fri, 16 Feb 2024 00:53:23 +0000 (11:53 +1100)] 
Add CHANGES entry for [GL #2744]

23 months agoPass a memory context in to dns_cache_create
Mark Andrews [Wed, 27 Mar 2024 00:32:25 +0000 (11:32 +1100)] 
Pass a memory context in to dns_cache_create

23 months agoUse a new memory context when flushing the cache
Mark Andrews [Fri, 16 Feb 2024 00:40:26 +0000 (11:40 +1100)] 
Use a new memory context when flushing the cache

When the cache's memory context was in over memory state when the
cache was flushed it resulted in LRU cleaning removing newly entered
data in the new cache straight away until the old cache had been
destroyed enough to take it out of over memory state.  When flushing
the cache create a new memory context for the new db to prevent this.

23 months agoMerge branch '4750-set-loop-on-incoming-transfer' into 'main'
Ondřej Surý [Wed, 29 May 2024 06:31:28 +0000 (06:31 +0000)] 
Merge branch '4750-set-loop-on-incoming-transfer' into 'main'

Create the new database for AXFR from the dns_zone API

Closes #4750

See merge request isc-projects/bind9!9073

23 months agoCreate the new database for AXFR from the dns_zone API
Ondřej Surý [Tue, 28 May 2024 14:13:31 +0000 (16:13 +0200)] 
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.

23 months agoMerge branch 'stepan/hypothesis' into 'main'
Petr Špaček [Tue, 28 May 2024 13:17:32 +0000 (13:17 +0000)] 
Merge branch 'stepan/hypothesis' into 'main'

Expand the wildcard system test with wider use of hypothesis

See merge request isc-projects/bind9!8461

23 months agoAdd a helper for uncompressed length of dnspython's dns.name.Name
Štěpán Balážik [Tue, 14 May 2024 14:26:44 +0000 (16:26 +0200)] 
Add a helper for uncompressed length of dnspython's dns.name.Name

This is useful for generating using hypothesis but also for other
cases.

23 months agoMove hypothesis strategies to isctest for later reuse
Štěpán Balážik [Tue, 23 Apr 2024 14:45:45 +0000 (16:45 +0200)] 
Move hypothesis strategies to isctest for later reuse

`isctest.hypothesis` seems to be a nice place to have these.

23 months agoDisable deadlines for hypothesis tests when running in CI
Štěpán Balážik [Tue, 23 Apr 2024 13:48:18 +0000 (15:48 +0200)] 
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.

23 months agoTest nested wildcard special case in the respective system test
Štěpán Balážik [Mon, 29 Jan 2024 17:56:32 +0000 (18:56 +0100)] 
Test nested wildcard special case in the respective system test

See final remark of RFC 4592 2.2.1. for details.

23 months agoExpand the wildcard system test with wider use of hypothesis
Štěpán Balážik [Thu, 2 Nov 2023 15:03:54 +0000 (16:03 +0100)] 
Expand the wildcard system test with wider use of hypothesis

The queries are now generated more generally (i. e. they have
multiple labels, etc.).

23 months agoAdd hypothesis strategies for generating DNS names and company
Štěpán Balážik [Thu, 2 Nov 2023 15:00:46 +0000 (16:00 +0100)] 
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.

23 months agoExtend isctest package with more utility functions
Štěpán Balážik [Thu, 21 Dec 2023 19:25:20 +0000 (20:25 +0100)] 
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`.

23 months agoSilent pylint's line-too-long warning as it's handled better by black
Štěpán Balážik [Thu, 2 Nov 2023 15:29:46 +0000 (16:29 +0100)] 
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.

23 months agoMerge branch 'nicki/use-bind-team-gitlab-tokens' into 'main'
Nicki Křížek [Mon, 27 May 2024 11:13:34 +0000 (11:13 +0000)] 
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

23 months agoUse BIND_TEAM_WRITE_TOKEN for autobackport bot
Nicki Křížek [Fri, 24 May 2024 13:51:40 +0000 (15:51 +0200)] 
Use BIND_TEAM_WRITE_TOKEN for autobackport bot

This is done to unify the token usage across our repositories to
simplify token maintenance.

23 months agoUse BIND_TEAM_API_TOKEN for danger bot
Nicki Křížek [Fri, 24 May 2024 13:50:31 +0000 (15:50 +0200)] 
Use BIND_TEAM_API_TOKEN for danger bot

This is done to unify the token usage across our repositories to
simplify token maintenance.

23 months agoMerge branch 'ondrej/cleanup-dns_db' into 'main'
Ondřej Surý [Sat, 25 May 2024 09:48:34 +0000 (09:48 +0000)] 
Merge branch 'ondrej/cleanup-dns_db' into 'main'

Cleanup the dns_cache unit

See merge request isc-projects/bind9!9064

23 months agofixup! Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'
Aram Sargsyan [Fri, 24 May 2024 15:42:41 +0000 (15:42 +0000)] 
fixup! Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'

23 months agoCleanup the dns_cache unit
Ondřej Surý [Fri, 24 May 2024 09:35:40 +0000 (11:35 +0200)] 
Cleanup the dns_cache unit

Remove duplicate code and use ISC_REFCOUNT_{DECL,IMPL} macros.

23 months agoMerge branch 'mnowak/cross-version-config-tests-drop-allow_failure-true' into 'main'
Michal Nowak [Fri, 24 May 2024 11:44:39 +0000 (11:44 +0000)] 
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

23 months agoWorkaround temporary cross-version-config-tests limitation
Michal Nowak [Thu, 16 May 2024 10:36:34 +0000 (12:36 +0200)] 
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.

23 months agoFix oversight in cross-version-config test
Nicki Křížek [Fri, 24 May 2024 09:00:09 +0000 (11:00 +0200)] 
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.

23 months agoRevert "Allow failure of cross-version-config test"
Michal Nowak [Thu, 16 May 2024 10:29:49 +0000 (12:29 +0200)] 
Revert "Allow failure of cross-version-config test"

This reverts commit b99cdfab9d012bce63dff8463eae87772034138a.

23 months agoMerge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'
Ondřej Surý [Fri, 24 May 2024 08:29:54 +0000 (08:29 +0000)] 
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

23 months agoRefactor the common buffer manipulation in rdataslab.c in macros
Ondřej Surý [Thu, 29 Feb 2024 21:26:29 +0000 (22:26 +0100)] 
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.

23 months agoMerge branch 'mnowak/alpine-3.20' into 'main'
Michal Nowak [Thu, 23 May 2024 11:19:26 +0000 (11:19 +0000)] 
Merge branch 'mnowak/alpine-3.20' into 'main'

Add Alpine Linux 3.20

See merge request isc-projects/bind9!9059

23 months agoAdd Alpine Linux 3.20
Michal Nowak [Thu, 23 May 2024 08:58:25 +0000 (10:58 +0200)] 
Add Alpine Linux 3.20

23 months agoMerge branch 'mnowak/short-stress-tests-should-keep-artifacts' into 'main'
Michal Nowak [Wed, 22 May 2024 10:55:18 +0000 (10:55 +0000)] 
Merge branch 'mnowak/short-stress-tests-should-keep-artifacts' into 'main'

Short stress tests should keep artifacts

See merge request isc-projects/bind9!9056

23 months agoShort stress tests should keep artifacts
Michal Nowak [Thu, 16 May 2024 14:44:38 +0000 (16:44 +0200)] 
Short stress tests should keep artifacts

23 months agoMerge branch 'aydin/fix-trace' into 'main'
Aydın Mercan [Mon, 20 May 2024 11:45:22 +0000 (11:45 +0000)] 
Merge branch 'aydin/fix-trace' into 'main'

Fix typing mistakes in trace macros

See merge request isc-projects/bind9!9050

23 months agoreinsert accidentally removed + in db trace
Aydın Mercan [Fri, 17 May 2024 13:52:42 +0000 (16:52 +0300)] 
reinsert accidentally removed + in db trace

It only affects development when using `DNS_DB_TRACE`.

23 months agofix typing mistakes in trace macros
Aydın Mercan [Fri, 17 May 2024 13:45:10 +0000 (16:45 +0300)] 
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.

23 months agoMerge branch '4730-clang-format-header-file-changes' into 'main'
Evan Hunt [Fri, 17 May 2024 23:18:47 +0000 (23:18 +0000)] 
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

23 months agoIgnore reformat sources with up-to-date clang-format-18
Mark Andrews [Fri, 17 May 2024 03:32:10 +0000 (13:32 +1000)] 
Ignore reformat sources with up-to-date clang-format-18

23 months agoClang-format header file changes
Mark Andrews [Fri, 17 May 2024 02:29:59 +0000 (12:29 +1000)] 
Clang-format header file changes

23 months agoMerge branch 'aram/mr8937-changes-placeholder' into 'main'
Arаm Sаrgsyаn [Fri, 17 May 2024 10:48:23 +0000 (10:48 +0000)] 
Merge branch 'aram/mr8937-changes-placeholder' into 'main'

Add a CHANGES placeholder for [GL !8937]

See merge request isc-projects/bind9!9049

23 months agoAdd a CHANGES placeholder for [GL !8937]
Aram Sargsyan [Fri, 17 May 2024 10:20:48 +0000 (10:20 +0000)] 
Add a CHANGES placeholder for [GL !8937]

23 months agoMerge branch '4726-increase-formerr-coverage-in-message-parsing' into 'main'
Mark Andrews [Fri, 17 May 2024 05:16:48 +0000 (05:16 +0000)] 
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

23 months agoadd test cases for several FORMERR code paths:
Mark Andrews [Mon, 29 Jan 2024 18:21:37 +0000 (10:21 -0800)] 
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

23 months agoMerge branch '4683-qpzone-tsan-fix' into 'main'
Evan Hunt [Fri, 17 May 2024 00:33:48 +0000 (00:33 +0000)] 
Merge branch '4683-qpzone-tsan-fix' into 'main'

replace qpzone node attributes with atomics

Closes #4683

See merge request isc-projects/bind9!9033

23 months agoreplace qpzone node attriutes with atomics
Evan Hunt [Tue, 14 May 2024 19:36:58 +0000 (12:36 -0700)] 
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.

23 months agoMerge branch 'matthijs-qp-set-iterator' into 'main'
Matthijs Mekking [Thu, 16 May 2024 09:50:08 +0000 (09:50 +0000)] 
Merge branch 'matthijs-qp-set-iterator' into 'main'

Rewrite fix_iterator()

See merge request isc-projects/bind9!9038

23 months agoTwo more qp test cases
Matthijs Mekking [Wed, 15 May 2024 10:25:34 +0000 (12:25 +0200)] 
Two more qp test cases

Add two more cases that should select different predecessors from
different twigs.

23 months agoRewrite qp fix_iterator()
Matthijs Mekking [Wed, 15 May 2024 09:35:31 +0000 (11:35 +0200)] 
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().

23 months agoGet anyleaf when qp lookup is on a dead end branch
Matthijs Mekking [Wed, 15 May 2024 08:59:07 +0000 (10:59 +0200)] 
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.

23 months agoMerge tag 'v9.19.24'
Michal Nowak [Thu, 16 May 2024 09:37:12 +0000 (11:37 +0200)] 
Merge tag 'v9.19.24'

23 months agoMerge branch '4517-dnssec-verify-reports-errors-in-nsec3-chain' into 'main'
Mark Andrews [Thu, 16 May 2024 01:52:55 +0000 (01:52 +0000)] 
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

23 months agoAdd CHANGES note for [GL #4517]
Mark Andrews [Tue, 9 Jan 2024 01:28:28 +0000 (12:28 +1100)] 
Add CHANGES note for [GL #4517]

23 months agoDon't sign non-apex DNSKEY records
Mark Andrews [Tue, 9 Jan 2024 04:20:09 +0000 (15:20 +1100)] 
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.

23 months agoRemove invalid DNSKEY RRset from zone
Mark Andrews [Tue, 9 Jan 2024 03:58:37 +0000 (14:58 +1100)] 
Remove invalid DNSKEY RRset from zone

23 months agoAdd regression test data for [GL #4517]
Mark Andrews [Tue, 9 Jan 2024 01:22:21 +0000 (12:22 +1100)] 
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.

23 months agoFail if there are non apex DNSKEYs
Mark Andrews [Tue, 9 Jan 2024 06:01:07 +0000 (17:01 +1100)] 
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.

23 months agoProperly build the NSEC/NSEC3 type bit map
Mark Andrews [Tue, 9 Jan 2024 01:12:33 +0000 (12:12 +1100)] 
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.

23 months agoProperly update 'maxtype'
Mark Andrews [Tue, 9 Jan 2024 01:09:03 +0000 (12:09 +1100)] 
Properly update 'maxtype'

'maxtype' should be checked to see if it should be updated whenever
a type is added to the type map.

2 years agoMerge branch 'ondrej/isc_httpd-reference-counting' into 'main'
Ondřej Surý [Wed, 15 May 2024 12:32:15 +0000 (12:32 +0000)] 
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