2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00
Commit Graph

43024 Commits

Author SHA1 Message Date
Mark Andrews
2225f96251 Check delv +yaml negative response output
(cherry picked from commit 9c04640def)
2025-01-22 23:58:49 +00:00
Mark Andrews
69a15deffa Terminate yaml string after negative comment
(cherry picked from commit 89afc11389)
2025-01-22 23:58:49 +00:00
Ondřej Surý
55b7cc9596 [9.20] chg: dev: Shutdown the fetch context after canceling the last fetch
Shutdown the fetch context immediately after the last fetch has been canceled from
that particular fetch context.

Backport of MR !9958

Merge branch 'backport-ondrej/shutdown-the-fetch-context-early-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9977
2025-01-22 14:05:12 +00:00
Ondřej Surý
ea301cf062 Shutdown the fetch context after canceling the last fetch
Currently, the fetch context will continue running even when the last
fetch (response) has been removed from the context, so named can process
and cache the answer.  This can lead to a situation where the number of
outgoing recursing clients exceeds the the configured number for
recursive-clients.

Be more stringent about the recursive-clients limit and shutdown the
fetch context immediately after the last fetch has been canceled from
that particular fetch context.

(cherry picked from commit 9f945c8b67)
2025-01-22 15:02:38 +01:00
Ondřej Surý
0ab22458f5 [9.20] fix: usr: Apply the memory limit only to ADB database items
Resolver under heavy-load could exhaust the memory available for storing
the information in the Address Database (ADB) effectively evicting already
stored information in the ADB.  The memory used to retrieve and provide
information from the ADB is now not a subject of the same memory limits
that are applied for storing the information in the Address Database.

Closes #5127

Backport of MR !9954

Merge branch 'backport-5127-change-ADB-memory-split-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9975
2025-01-22 14:01:52 +00:00
Ondřej Surý
819e809be5 Remove memory limit on ADB finds and fetches
Address Database (ADB) shares the memory for the short lived ADB
objects (finds, fetches, addrinfo) and the long lived ADB
objects (names, entries, namehooks).  This could lead to a situation
where the resolver-heavy load would force evict ADB objects from the
database to point where ADB is completely empty, leading to even more
resolver-heavy load.

Make the short lived ADB objects use the other memory context that we
already created for the hashmaps.  This makes the ADB overmem condition
to not be triggered by the ongoing resolver fetches.

(cherry picked from commit 05faff6d53)
2025-01-22 15:01:33 +01:00
Ondřej Surý
60b81239de [9.20] fix: usr: Avoid unnecessary locking in the zone/cache database
Prevent lock contention among many worker threads referring to the same database node at the same time. This would improve zone and cache database performance for the heavily contended database nodes.

Backport of !9963

Closes #5130

Merge branch '5130-reduce-lock-contention-in-decrement-reference-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9964
2025-01-22 13:30:28 +00:00
JINMEI Tatuya
da0453b1d5 Optimize database decref by avoiding locking with refs > 1
Previously, this function always acquires a node write lock if it
might need node cleanup in case the reference decrements to 0.  In
fact, the lock is unnecessary if the reference is larger than 1 and it
can be optimized as an "easy" case. This optimization could even be
"necessary". In some extreme cases, many worker threads could repeat
acquring and releasing the reference on the same node, resulting in
severe lock contention for nothing (as the ref wouldn't decrement to 0
in most cases). This change would prevent noticeable performance
drop like query timeout for such cases.

Co-authored-by: JINMEI Tatuya <jtatuya@infoblox.com>
Co-authored-by: Ondřej Surý <ondrej@isc.org>

(cherry picked from commit 7f4471594d)
2025-01-22 14:29:30 +01:00
Colin Vidal
ba48aee4c9 [9.20] new: nil: ignore TAGS files
Backport of MR !9956

Merge branch 'backport-colin/ignoreTAGS-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9973
2025-01-22 11:59:50 +00:00
Colin Vidal
6eed964dd9 ignore TAGS files
TAGS file are generated from `make tags` using etags. Other index tags
are already ignored (GTAGS, GPATH, etc.). Also ignoring `TAGS`.

(cherry picked from commit 2164ea8abd)
2025-01-22 11:23:28 +00:00
Andoni Duarte
ac651c4250 chg: doc: Set up version for BIND 9.20.6
Merge branch 'andoni/set-up-version-for-bind-9.20.6' into 'bind-9.20'

See merge request isc-projects/bind9!9969
2025-01-22 08:40:51 +00:00
Andoni Duarte Pintado
d343349b83 Update BIND version to 9.20.6-dev 2025-01-21 17:52:22 +01:00
Nicki Křížek
5464a5d46a Update BIND version for release v9.20.5 2025-01-20 14:15:57 +01:00
Nicki Křížek
34332de83f new: doc: Prepare documentation for BIND 9.20.5
Merge branch 'andoni/prepare-documentation-for-bind-9.20.5' into 'v9.20.5-release'

See merge request isc-private/bind9!773
2025-01-20 13:14:59 +00:00
Petr Špaček
ae8518b2ae Reword release note for #5108 2025-01-20 14:07:34 +01:00
Michał Kępień
b4f661e4c2 Add release note for GL #5099 2025-01-18 05:58:35 +01:00
Andoni Duarte Pintado
9144d0d198 Tweak and reword release notes 2025-01-18 05:58:35 +01:00
Andoni Duarte Pintado
38536ad107 Fix broken option reference in the ARM 2025-01-18 05:58:35 +01:00
Andoni Duarte Pintado
e9ef3c3ce7 Prepare release notes for BIND 9.20.5 2025-01-18 05:58:35 +01:00
Andoni Duarte Pintado
0ce9b034f5 Generate changelog for BIND 9.20.5 2025-01-18 05:58:35 +01:00
Andoni Duarte
51900adf29 [9.20] [CVE-2024-12705] sec: usr: DNS-over-HTTP(s) flooding fixes
Fix DNS-over-HTTP(S) implementation issues that arise under heavy
query load. Optimize resource usage for :iscman:`named` instances
that accept queries over DNS-over-HTTP(S).

Previously, :iscman:`named` would process all incoming HTTP/2 data
at once, which could overwhelm the server, especially when dealing
with clients that send requests but don't wait for responses. That
has been fixed. Now, :iscman:`named` handles HTTP/2 data in smaller
chunks and throttles reading until the remote side reads the
response data. It also throttles clients that send too many requests
at once.

Additionally, :iscman:`named` now carefully processes data sent by
some clients, which can be considered "flooding." It logs these
clients and drops connections from them.
:gl:`#4795`

In some cases, :iscman:`named` could leave DNS-over-HTTP(S)
connections in the `CLOSE_WAIT` state indefinitely. That also has
been fixed. ISC would like to thank JF Billaud for thoroughly
investigating the issue and verifying the fix.
:gl:`#5083`

See https://gitlab.isc.org/isc-projects/bind9/-/issues/4795

Closes https://gitlab.isc.org/isc-projects/bind9/-/issues/5083

Backport of !732.

Merge branch 'artem-improve-doh-resource-usage-9.20' into 'v9.20.5-release'

See merge request isc-private/bind9!766
2025-01-15 15:40:42 +00:00
Artem Boldariev
50a062e5ce DoH: reduce excessive bad request logging
We started using isc_nm_bad_request() more actively throughout
codebase. In the case of HTTP/2 it can lead to a large count of
useless "Bad Request" messages in the BIND log, as often we attempt to
send such request over effectively finished HTTP/2 sessions.

This commit fixes that.

(cherry picked from commit 937b5f8349)
2025-01-15 16:07:13 +01:00
Artem Boldariev
c53541bfc5 Do not stop timer in isc_nm_read_stop() in manual timer mode
A call to isc_nm_read_stop() would always stop reading timer even in
manual timer control mode which was added with StreamDNS in mind. That
looks like an omission that happened due to how timers are controlled
in StreamDNS where we always stop the timer before pausing reading
anyway (see streamdns_on_complete_dnsmessage()). That would not work
well for HTTP, though, where we might want pause reading without
stopping the timer in the case we want to split incoming data into
multiple chunks to be processed independently.

I suppose that it happened due to NM refactoring in the middle of
StreamDNS development (at the time isc_nm_cancelread() and
isc_nm_pauseread() were removed), as the StreamDNS code seems to be
written as if timers are not stoping during a call to
isc_nm_read_stop().

(cherry picked from commit 4ae4e255cf)
2025-01-15 16:05:56 +01:00
Artem Boldariev
36e9720d24 DoH: introduce manual read timer control
This commit introduces manual read timer control as used by StreamDNS
and its underlying transports. Before that, DoH code would rely on the
timer control provided by TCP, which would reset the timer any time
some data arrived. Now, the timer is restarted only when a full DNS
message is processed in line with other DNS transports.

That change is required because we should not stop the timer when
reading from the network is paused due to throttling. We need a way to
drop timed-out clients, particularly those who refuse to read the data
we send.

(cherry picked from commit 609a41517b)
2025-01-15 16:05:47 +01:00
Artem Boldariev
4907248d14 DoH: floodding clients detection
This commit adds logic to make code better protected against clients
that send valid HTTP/2 data that is useless from a DNS server
perspective.

Firstly, it adds logic that protects against clients who send too
little useful (=DNS) data. We achieve that by adding a check that
eventually detects such clients with a nonfavorable useful to
processed data ratio after the initial grace period. The grace period
is limited to processing 128 KiB of data, which should be enough for
sending the largest possible DNS message in a GET request and then
some. This is the main safety belt that would detect even flooding
clients that initially behave well in order to fool the checks server.

Secondly, in addition to the above, we introduce additional checks to
detect outright misbehaving clients earlier:

The code will treat clients that open too many streams (50) without
sending any data for processing as flooding ones; The clients that
managed to send 1.5 KiB of data without opening a single stream or
submitting at least some DNS data will be treated as flooding ones.
Of course, the behaviour described above is nothing else but
heuristical checks, so they can never be perfect. At the same time,
they should be reasonable enough not to drop any valid clients,
realatively easy to implement, and have negligible computational
overhead.

(cherry picked from commit 3425e4b1d0)
2025-01-15 16:05:33 +01:00
Artem Boldariev
5eec1f5368 DoH: process data chunk by chunk instead of all at once
Initially, our DNS-over-HTTP(S) implementation would try to process as
much incoming data from the network as possible. However, that might
be undesirable as we might create too many streams (each effectively
backed by a ns_client_t object). That is too forgiving as it might
overwhelm the server and trash its memory allocator, causing high CPU
and memory usage.

Instead of doing that, we resort to processing incoming data using a
chunk-by-chunk processing strategy. That is, we split data into small
chunks (currently 256 bytes) and process each of them
asynchronously. However, we can process more than one chunk at
once (up to 4 currently), given that the number of HTTP/2 streams has
not increased while processing a chunk.

That alone is not enough, though. In addition to the above, we should
limit the number of active streams: these streams for which we have
received a request and started processing it (the ones for which a
read callback was called), as it is perfectly fine to have more opened
streams than active ones. In the case we have reached or surpassed the
limit of active streams, we stop reading AND processing the data from
the remote peer. The number of active streams is effectively decreased
only when responses associated with the active streams are sent to the
remote peer.

Overall, this strategy is very similar to the one used for other
stream-based DNS transports like TCP and TLS.

(cherry picked from commit 9846f395ad)
2025-01-15 16:05:13 +01:00
Andoni Duarte
4d3d17c344 [9.20] [CVE-2024-11187] sec: usr: Limit the additional processing for large RDATA sets
When answering queries, don't add data to the additional section if the answer has more than 13 names in the RDATA. This limits the number of lookups into the database(s) during a single client query, reducing query processing load.

Backport of MR !750

See isc-projects/bind9#5034

Merge branch '5034-security-limit-additional-9.20' into 'v9.20.5-release'

See merge request isc-private/bind9!758
2025-01-15 13:08:50 +00:00
Ondřej Surý
1b531c17a5 Limit the additional processing for large RDATA sets
When answering queries, don't add data to the additional section if
the answer has more than 13 names in the RDATA.  This limits the
number of lookups into the database(s) during a single client query,
reducing query processing load.

Also, don't append any additional data to type=ANY queries. The
answer to ANY is already big enough.

(cherry picked from commit a1982cf1bb)
2025-01-15 13:57:27 +01:00
Ondřej Surý
e7d4e27337 Isolate using the -T noaa flag only for part of the resolver test
Instead of running the whole resolver/ns4 server with -T noaa flag,
use it only for the part where it is actually needed.  The -T noaa
could interfere with other parts of the test because the answers don't
have the authoritative-answer bit set, and we could have false
positives (or false negatives) in the test because the authoritative
server doesn't follow the DNS protocol for all the tests in the resolver
system test.

(cherry picked from commit e51d4d3b88)
2025-01-15 13:57:16 +01:00
Nicki Křížek
993cb76148 chg: usr: Revert "Fix NSEC3 closest encloser lookup for names with empty non-terminals"
Revert the fix for #4950 for 9.20.

This reverts MR !9438.

History: A performance improvement for NSEC3 closest encloser lookups (#4460) was introduced (in MR !9436) and backported to 9.20 (MR !9438) and to 9.18 in (MR !9439). It was released in 9.18.30 (and 9.20.2 and 9.21.1).

There was a bug in the code (#4950), so we reverted the change in !9611, !9613 and !9614 (not released).

Then a new attempt was merged in main (MR !9610) and backported to 9.20 (MR !9631) and 9.18 (MR !9632). The latter should not have been backported and was reverted in !9689. 

We now also revert the fix for 9.20

Related #5108

Merge branch 'revert-4950-bind-logs-expected-covering-nsec3-got-an-exact-match-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9947
2025-01-14 08:35:53 +00:00
Matthijs Mekking
8c9d31edaf Revert "Test that the correct NSEC3 closest encloser is returned"
This reverts commit fd2f1bdf02.
2025-01-13 11:42:26 +01:00
Matthijs Mekking
5798ed1fa6 Revert "Use a binary search to find the NSEC3 closest encloser"
This reverts commit 14bb1f8aa0.
2025-01-13 11:40:19 +01:00
Michał Kępień
698f1091bf [9.20] fix: nil: Fix default IANA root zone mirror configuration
Closes #5115

Backport of MR !9934

Merge branch 'backport-5115-fix-default-iana-root-zone-mirror-configuration-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9944
2025-01-09 12:00:26 +00:00
Michał Kępień
1e9eab2b5d Fix default IANA root zone mirror configuration
Commit 4555a31934 renamed the top-level
"primaries" block in bin/named/config.c to "remote-servers".  This
configuration block lists the primary servers used for an IANA root zone
mirror when no primary servers are explicitly specified for it in the
configuration.  However, the relevant part of the named_zone_configure()
function only looks for a top-level "primaries" block and not for any of
its synonyms.  As a result, configuring an IANA root zone mirror with
just:

    zone "." {
        type mirror;
    };

now results in a cryptic fatal error on startup:

    loading configuration: not found
    exiting (due to fatal error)

Fix by using the correct top-level block name in named_zone_configure().

(cherry picked from commit 010d2eb436)
2025-01-09 12:25:33 +01:00
Arаm Sаrgsyаn
cc0cbbe697 [9.20] fix: usr: Fix response policy zones and catalog zones with an $INCLUDE statement defined
Response policy zones (RPZ) and catalog zones were not working correctly if they had an $INCLUDE statement defined. This has been fixed.

Closes #5111

Backport of MR !9930

Merge branch 'backport-5111-includes-disable-rpz-and-catz-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9941
2025-01-08 15:21:52 +00:00
Aram Sargsyan
c9ecf79e89 Fix a typo in dns/master.h
The ISC_R_SEENINCLUDE definition does not exist, the correct one
is DNS_R_SEENINCLUDE.

(cherry picked from commit d75bdabe51)
2025-01-08 15:21:28 +00:00
Aram Sargsyan
1c6a97055d Don't disable RPZ and CATZ for zones with an $INCLUDE statement
The code in zone_startload() disables RPZ and CATZ for a zone if
dns_master_loadfile() returns anything other than ISC_R_SUCCESS,
which makes sense, but it's an error because zone_startload() can
also return DNS_R_SEENINCLUDE upon success when the zone had an
$INCLUDE statement.

(cherry picked from commit 3d7a9fba3b)
2025-01-08 15:21:28 +00:00
Nicki Křížek
2d89dae589 [9.20] new: ci: Add shotgun perf test of DoH GET to CI
Add performance tests of DoH using the GET protocol to nightly pipelines.

Backport of MR !9926

Merge branch 'backport-nicki/ci-shotgun-doh-get-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9939
2025-01-08 14:12:54 +00:00
Nicki Křížek
ee76d3f2c2 Add shotgun perf test of DoH GET to CI
(cherry picked from commit 32c5f24713)
2025-01-08 13:46:49 +00:00
Ondřej Surý
fa7443d3fd [9.20] fix: dev: Use CMM_{STORE,LOAD}_SHARED to store/load glue in gluelist
ThreadSanitizer has trouble understanding that gluelist->glue is
constant after it is assigned to the slabheader with cmpxchg.  Help
ThreadSanitizer to understand the code by using CMM_STORE_SHARED and
CMM_LOAD_SHARED on gluelist->glue.

Backport of MR !9929

Merge branch 'backport-ondrej/hint-tsan-in-addglue-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9936
2025-01-06 19:13:37 +00:00
Ondřej Surý
9fbfc8a8b5 Use CMM_{STORE,LOAD}_SHARED to store/load glue in gluelist
ThreadSanitizer has trouble understanding that gluelist->glue is
constant after it is assigned to the slabheader with cmpxchg.  Help
ThreadSanitizer to understand the code by using CMM_STORE_SHARED and
CMM_LOAD_SHARED on gluelist->glue.

The ThreadSanitizer report:

    WARNING: ThreadSanitizer: data race
      Read of size 8 at 0x000000000001 by thread T0001:
	#0 addglue lib/dns/qpzone.c:5304 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#1 dns_db_addglue lib/dns/db.c:1119 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#2 query_additional lib/ns/query.c:2230 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#3 query_addrrset lib/ns/query.c:2324
	#4 query_prepare_delegation_response lib/ns/query.c:8595 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#5 query_delegation lib/ns/query.c:8780 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#6 query_notfound lib/ns/query.c:8552 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#7 query_gotanswer lib/ns/query.c:7553 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#8 query_lookup lib/ns/query.c:6020 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#9 ns__query_start lib/ns/query.c:5690 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#10 query_setup lib/ns/query.c:5239 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#11 ns_query_start lib/ns/query.c:11979 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#12 ns_client_request_continue lib/ns/client.c:2466 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#13 ns_client_request lib/ns/client.c:2142 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#14 isc___nm_readcb netmgr/netmgr.c:1859 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#15 isc__nm_readcb netmgr/netmgr.c:1874
	#16 isc__nm_udp_read_cb netmgr/udp.c:589 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#17 uv__udp_recvmmsg src/unix/udp.c:202 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#18 uv__udp_recvmsg src/unix/udp.c:245 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#19 uv__udp_io src/unix/udp.c:142
	#20 uv__io_poll src/unix/linux.c:1564 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#21 uv_run src/unix/core.c:458 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#22 loop_thread lib/isc/loop.c:328 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#23 thread_body lib/isc/thread.c:85 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#24 thread_run lib/isc/thread.c:100

      Previous write of size 8 at 0x000000000001 by thread T0002:
	#0 create_gluelist lib/dns/qpzone.c:5253 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#1 addglue lib/dns/qpzone.c:5281
	#2 dns_db_addglue lib/dns/db.c:1119 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#3 query_additional lib/ns/query.c:2230 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#4 query_addrrset lib/ns/query.c:2324
	#5 query_prepare_delegation_response lib/ns/query.c:8595 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#6 query_delegation lib/ns/query.c:8780 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#7 query_notfound lib/ns/query.c:8552 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#8 query_gotanswer lib/ns/query.c:7553 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#9 query_lookup lib/ns/query.c:6020 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#10 ns__query_start lib/ns/query.c:5690 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#11 query_setup lib/ns/query.c:5239 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#12 ns_query_start lib/ns/query.c:11979 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#13 ns_client_request_continue lib/ns/client.c:2466 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#14 ns_client_request lib/ns/client.c:2142 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#15 isc___nm_readcb netmgr/netmgr.c:1859 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#16 isc__nm_readcb netmgr/netmgr.c:1874
	#17 isc__nm_udp_read_cb netmgr/udp.c:589 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#18 uv__udp_recvmmsg src/unix/udp.c:202 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#19 uv__udp_recvmsg src/unix/udp.c:245 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#20 uv__udp_io src/unix/udp.c:142
	#21 uv__io_poll src/unix/linux.c:1564 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#22 uv_run src/unix/core.c:458 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#23 loop_thread lib/isc/loop.c:328 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#24 thread_body lib/isc/thread.c:85 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#25 thread_run lib/isc/thread.c:100

      Location is heap block of size 88 at 0x000000000024 allocated by thread T0002:
	#0 malloc <null> (BuildId: c08afb1c60772d9b4e4d4be38d0c0434c5b41990)
	#1 mallocx lib/isc/jemalloc_shim.h:41 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#2 mem_get lib/isc/mem.c:303
	#3 isc__mem_get lib/isc/mem.c:654
	#4 new_gluelist lib/dns/qpzone.c:5012 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#5 create_gluelist lib/dns/qpzone.c:5241
	#6 addglue lib/dns/qpzone.c:5281
	#7 dns_db_addglue lib/dns/db.c:1119 (BuildId: 62aa74b0423f77cc56d705f02c2412b4762577cb)
	#8 query_additional lib/ns/query.c:2230 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#9 query_addrrset lib/ns/query.c:2324
	#10 query_prepare_delegation_response lib/ns/query.c:8595 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#11 query_delegation lib/ns/query.c:8780 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#12 query_notfound lib/ns/query.c:8552 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#13 query_gotanswer lib/ns/query.c:7553 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#14 query_lookup lib/ns/query.c:6020 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#15 ns__query_start lib/ns/query.c:5690 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#16 query_setup lib/ns/query.c:5239 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#17 ns_query_start lib/ns/query.c:11979 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#18 ns_client_request_continue lib/ns/client.c:2466 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#19 ns_client_request lib/ns/client.c:2142 (BuildId: 9cc0711aeddfa6164f4f6fd94b0187f7bfa13ff2)
	#20 isc___nm_readcb netmgr/netmgr.c:1859 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#21 isc__nm_readcb netmgr/netmgr.c:1874
	#22 isc__nm_udp_read_cb netmgr/udp.c:589 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#23 uv__udp_recvmmsg src/unix/udp.c:202 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#24 uv__udp_recvmsg src/unix/udp.c:245 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#25 uv__udp_io src/unix/udp.c:142
	#26 uv__io_poll src/unix/linux.c:1564 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#27 uv_run src/unix/core.c:458 (BuildId: 355edf0d38120d6761c51ee8cab2c162dff57b0a)
	#28 loop_thread lib/isc/loop.c:328 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#29 thread_body lib/isc/thread.c:85 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#30 thread_run lib/isc/thread.c:100

      Thread T0001 'isc-loop-0002' (running) created by main thread at:
	#0 pthread_create <null> (BuildId: c08afb1c60772d9b4e4d4be38d0c0434c5b41990)
	#1 isc_thread_create lib/isc/thread.c:139 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#2 isc_loopmgr_run lib/isc/loop.c:508 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#3 main bin/named/main.c:1532 (BuildId: d03d7837520674921fd1fe7c353cb790cab69b3b)

      Thread T0002 'isc-loop-0003' (running) created by main thread at:
	#0 pthread_create <null> (BuildId: c08afb1c60772d9b4e4d4be38d0c0434c5b41990)
	#1 isc_thread_create lib/isc/thread.c:139 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#2 isc_loopmgr_run lib/isc/loop.c:508 (BuildId: de1ebc9b2642ead6bbd0f4553c7144c016b01ffc)
	#3 main bin/named/main.c:1532 (BuildId: d03d7837520674921fd1fe7c353cb790cab69b3b)

    SUMMARY: ThreadSanitizer: data race lib/dns/qpzone.c:5304 in addglue

(cherry picked from commit f7316b44b9)
2025-01-06 19:13:29 +00:00
Ondřej Surý
eb3c66304f [9.20] fix: usr: Resolve the spurious drops in performance due GLUE cache
For performance reasons, the returned GLUE records are cached on the first use.  The current implementation could randomly cause a performance drop and increased memory use.  This has been fixed.

Closes #5064

Backport of MR !9831

Merge branch 'backport-5064-rewrite-glue-cache-in-qpzone-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9918
2025-01-06 19:13:04 +00:00
Ondřej Surý
547f376f21 Rewrite the GLUE cache in QP zone database
This is a second attempt to rewrite the GLUE cache to not use per
database version hash table.  Instead of keeping a hash table indexed by
the node, use a directly linked list of GLUE records for each
slabheader.  This was attempted before, but there was a data race caused
by the fact that the thread cleaning the GLUE records could be slower
than accessing the slab headers again and reinitializing the wait-free
stack.

The improved design builds on the previous design, but adds a new
dns_gluelist structure that has a pointer to the database version.

If a dns_gluelist belonging to a different (old) version is detected, it
is just detached from the slabheader and left for the closeversion() to
clean it up later.

(cherry picked from commit 29bde687b5)
2025-01-06 14:00:47 +01:00
Ondřej Surý
ad952ffee6 Revert "Fix the glue table in the QP and RBT zone databases"
This reverts commit 46cfebac58.

(cherry picked from commit 759d59801b)
2025-01-06 14:00:43 +01:00
Michal Nowak
f85a7f9be9 [9.20] fix: test: Fix "checking startup notify rate limit" fails on OL 8 FIPS
Adjust number of zones down to 23 to match those present when testing in FIPS mode.

Closes #5097

Backport of MR !9919

Merge branch 'backport-5097-checking-startup-notify-rate-limit-fails-on-ol-8-fips-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9935
2025-01-02 16:08:36 +00:00
Mark Andrews
40af61428e Adjust number of zones to those in FIPS mode
(cherry picked from commit 17804f5154)
2025-01-02 15:35:39 +00:00
Artem Boldariev
b14148ac89 [9.20] chg: dev: Add TLS SNI extension to all outgoing TLS connections
Backport of !9923.

Merge branch 'artem-outgoing-tls-sni-support-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9933
2024-12-26 17:13:03 +00:00
Artem Boldariev
50876e52f1 BIND - enable TLS SNI support for outgoing TLS connections
This commit ensures that BIND enables TLS SNI support for outgoing DoT
connections (when possible) in order to improve compatibility with
other DNS server software.

(cherry picked from commit 740292d3ec)
2024-12-26 18:31:31 +02:00
Artem Boldariev
01076f9396 Dig - enable TLS SNI support
This commit ensures that dig enables TLS SNI support for outgoing
connections in order to improve compatibility with other DNS server
software.

(cherry picked from commit e04fb30ee6)
2024-12-26 18:31:20 +02:00
Artem Boldariev
4f8ade0e1e TLS SNI - add low level support for SNI to the networking code
This commit adds support for setting SNI hostnames in outgoing
connections over TLS.

Most of the changes are related to either adapting the code to accept
and extra argument in *connect() functions and a couple of changes to
the TLS Stream to actually make use of the new SNI hostname
information.

(cherry picked from commit 6691a1530d)
2024-12-26 18:31:03 +02:00