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

7702 Commits

Author SHA1 Message Date
Mark Andrews
b3c1b2a869 exercise dns_rdata_checknames 2020-01-14 15:01:09 +11:00
Mark Andrews
649a34d628 exercise dns_rdata_additionaldata 2020-01-14 03:49:11 +00:00
Mark Andrews
5e74550740 call dns_rdata_towire on valid output from dns_rdata_fromtext and dns_rdata_fromwire 2020-01-14 03:49:11 +00:00
Michał Kępień
ec8334fb74 Properly detect MMDB lookup failures
Only comparing the value of the integer passed as the last argument to
MMDB_lookup_sockaddr() against MMDB_SUCCESS is not enough to ensure that
an MMDB lookup was successful - the 'found_entry' field of the
MMDB_lookup_result_s structure returned by that function also needs to
be true or else the remaining contents of that structure should be
ignored as the lookup failed.  Extend the relevant logical condition in
get_entry_for() to ensure the latter does not return incorrect MMDB
entries for IP addresses which do not belong to any subnet defined in a
given GeoIP2 database.
2020-01-13 14:32:19 +01:00
Mark Andrews
72f0e01f5d Address dns_zt_asyncload races by properly using isc_reference_*. 2020-01-13 11:33:31 +01:00
Mark Andrews
848c1c8b8b remove duplicate #includes 2019-12-23 07:47:36 +11:00
Mark Andrews
7278f2529a revert d10fbdec for lib/dns/gen.c as it is a build platform executable 2019-12-23 07:37:13 +11:00
Mark Andrews
d26e125438 Refactor loop body as copy_non_dnssec_records. 2019-12-20 21:31:23 +11:00
Ondřej Surý
bff83b9480 Add failure handling when iterators don't end with ISC_R_NOMORE 2019-12-20 21:31:23 +11:00
Ondřej Surý
6012479419 Refactor receive_secure_db to make the variables and code flow around the iterator more local 2019-12-20 21:31:23 +11:00
Mark Andrews
9d8f9cc8f2 Call dns_dbiterator_destroy earlier to prevent potential deadlock. 2019-12-20 21:31:23 +11:00
Mark Andrews
62abb6aa82 make resolver->zspill atomic to prevent potential deadlock 2019-12-12 08:26:59 +00:00
Ondřej Surý
cf48e8eb32 Ensure all zone_settimer() calls are done on locked zone 2019-12-11 22:58:59 +00:00
Mark Andrews
13aaeaa06f Note bucket lock requirements and move REQUIRE inside locked section. 2019-12-10 22:16:15 +00:00
Mark Andrews
5589748eca lock access to fctx->nqueries 2019-12-10 22:16:15 +00:00
Mark Andrews
fd52417f71 address deadlock introduced in cd2469d3cdbc211ecf8a82c76c1a0a1c4a545fec 2019-12-10 12:08:57 +00:00
Mark Andrews
c6efc0e50f Add is_leaf and send_to_prune_tree.
Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.
2019-12-09 17:43:54 +00:00
Mark Andrews
176b23b6cd Testing node->down requires the tree lock to be held.
In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.
2019-12-09 17:43:54 +00:00
Matthijs Mekking
4b66c0ebf4 Change some dnssec-policy defaults
Suggested by Tony Finch, these seem to be more reasonable defaults.
2019-12-09 07:25:20 +00:00
Matthijs Mekking
0f9d45a5b8 Default key size 2048
The default size for RSA keys is 2048 bits, for both ZSKs and KSKs.
2019-12-09 07:25:20 +00:00
Ondřej Surý
8120088ec7 Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace 2019-12-06 15:47:39 +01:00
Matthijs Mekking
8c37d3d320 Rename 'dnssec-keys' to 'trust-anchors' 2019-12-05 12:19:17 +01:00
Ondřej Surý
a4ffb64073 Refactor the dns_geoip API to use ISC_THREAD_LOCAL
Previously, the dns_geoip API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables, and
creating the local memory context was moved to named and stored in the
named_g_geoip global context.
2019-12-04 14:17:19 +01:00
Ondřej Surý
4a3d589403 Refactor the dns_dt API to use ISC_THREAD_LOCAL
Previously, the dns_dt API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-03 16:27:30 +01:00
Ondřej Surý
1a66aabd22 Refactor the dns_name API to use ISC_THREAD_LOCAL
Previously, the dns_name API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-03 16:27:24 +01:00
Mark Andrews
cd2469d3cd r/w of rbtdb->current_version requires that rbtdb->lock be held 2019-12-02 23:48:41 +00:00
Mark Andrews
912ce87479 Make fctx->attributes atomic.
FCTX_ATTR_SHUTTINGDOWN needs to be set and tested while holding the node
lock but the rest of the attributes don't as they are task locked. Making
fctx->attributes atomic allows both behaviours without races.
2019-12-03 08:58:53 +11:00
Mark Andrews
9ca6ad6311 Assign fctx->client when fctx is created rather when the join happens.
This prevents races on fctx->client whenever a new fetch joins a existing
fetch (by calling fctx_join) as it is now invariant for the active life of
fctx.
2019-12-02 06:01:46 +00:00
Ondřej Surý
edd97cddc1 Refactor dns_name_dup() usage using the semantic patch 2019-11-29 14:00:37 +01:00
Ondřej Surý
a35b19f80e libdns: dns_name_dup() can't fail, change return type to void 2019-11-29 13:59:40 +01:00
Mark Andrews
637b2c4e51 rdataset_setownercase and rdataset_getownercase need to obtain a node lock 2019-11-28 13:37:56 +01:00
Mark Andrews
8f6aaa7230 add comments 'tree_lock(write) must be held' 2019-11-27 09:58:15 +00:00
Mark Andrews
7cad3b2e91 rbtnode->nsec needs to be read while holding the tree lock 2019-11-27 09:58:15 +00:00
Mark Andrews
f269585de3 provide default yaml indent 2019-11-26 13:52:30 +01:00
Mark Andrews
9936462f31 dns_master_indent and dns_master_indentstr must not be global
The indentation for dumping the master zone was driven by two
global variables dns_master_indent and dns_master_indentstr.  In
threaded mode, this becomes prone to data access races, so this commit
converts the global variables into a local per-context tuple that
consist of count and string.
2019-11-26 13:52:18 +01:00
Ondřej Surý
21eab267df Fix missing adb->{e,i}refcnt locking 2019-11-26 13:07:12 +01:00
Witold Kręcicki
bad5a523c2 lib/dns/adb.c: Use atomics for adb quota values and reference counting 2019-11-26 13:07:12 +01:00
Mark Andrews
26a93d77aa move maxbuffers test to allocate_udp_buffer 2019-11-25 23:39:45 +00:00
Mark Andrews
011af4de71 Lock dispatch manager buffer_lock before accessing buffers;
Only test buffers for UDP dispatches.
2019-11-25 23:39:45 +00:00
Mark Andrews
afc7389ce8 lock disp->mgr before reading disp->mgr->buffers 2019-11-25 23:39:45 +00:00
Mark Andrews
6ce39f64d9 remove DNS_RBT_REFLENGTH as it is no longer needed 2019-11-25 16:21:52 +11:00
Mark Andrews
b8bb1e02ad Split access to wild and dirty from locknum to silence TSAN warnings. 2019-11-25 16:21:52 +11:00
Mark Andrews
3075445ed6 lock dispatch before reporting state 2019-11-22 19:52:14 +00:00
Mark Andrews
444d742a94 change log category of some messages to DNS_LOGCATEGORY_XFER_IN 2019-11-22 13:14:54 +00:00
Witold Kręcicki
58db2d1d18 Fix a bug in trust anchors verification.
We were not reseting the keynode value when iterating over DNSKEYs in
RRSET, so we weren't checking all DNSKEYs against all trust anchors. This
commit fixes the issue by resetting keynode with every loop.
2019-11-21 18:18:56 +01:00
Evan Hunt
7bd3205c61 BIND 9.15.6
-----BEGIN PGP SIGNATURE-----
 
 iEYEABECAAYFAl3SCY8ACgkQw1ppSAjxOtJBiwCgpRCA6Q0+8YXb0ycV2G2hJO6V
 AyUAn2acZBqCFJqOZgCdtyh2banWMbmT
 =43ra
 -----END PGP SIGNATURE-----

Merge tag 'v9_15_6' into merge-v9_15_6
2019-11-20 13:34:25 -08:00
Mark Andrews
7d4d64340e use update_recordsandbytes in rbt_datafixer 2019-11-20 00:17:51 +08:00
Mark Andrews
0cda448248 always obtain write lock when updating version->{records,bytes} 2019-11-20 00:17:51 +08:00
Mark Andrews
fcb6dbcdd7 make header->count atomic 2019-11-19 17:29:20 +11:00
Ondřej Surý
a5189eefa5 lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP.  This messages the quota counting in adb.c.
2019-11-19 02:53:56 +08:00