Commit Graph
11507 Commits
Author SHA1 Message Date
Mark Andrews ff88e33cff Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.

(cherry picked from commit 29f1c1e677)
2021-05-18 16:46:07 +10:00
Mark Andrews baa40e47cd Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.

(cherry picked from commit 683ad6e4bd)
2021-05-18 15:48:32 +10:00
Matthijs Mekking 2c81206984 Sync dns results
Add missing DNS results from 9.16. We only care about
DNS_R_NSEC3ITERRANGE but better to sync and use the same numbers than
use a different number for this result code than what is used in 9.16.
2021-04-30 09:58:44 +02:00
Mark AndrewsandMatthijs Mekking 1647bc7dc4 Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure
(cherry picked from commit af02bbcdd6)
2021-04-30 09:36:45 +02:00
Mark Andrews e4e4ff0e10 Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).

(cherry picked from commit 8510ccaa54)
2021-04-30 11:31:05 +10:00
Mark Andrews 6e729ce890 Warn if there is excessive NSEC3 iterations
(cherry picked from commit c9f5f8a059)
2021-04-30 10:49:00 +10:00
Mark Andrews 91a7f94a66 Reduce nsec3 max iterations to 150
(manually picked from commit 29126500d2)
2021-04-30 10:49:00 +10:00
Tinderbox UserandMichał Kępień ab7ca7759c prep 9.11.30 2021-04-29 11:56:03 +02:00
Mark AndrewsandMichał Kępień d7011a55d3 Unload a zone if a transfer breaks its SOA record
If a zone transfer results in a zone not having any NS records, named
stops serving it because such a zone is broken.  Do the same if an
incoming zone transfer results in a zone lacking an SOA record at the
apex or containing more than one SOA record.
2021-04-29 11:56:03 +02:00
Mark AndrewsandMichał Kępień 0313ede6e1 Address inconsistencies in checking added RRsets
loading_addrdataset() rejects SOA RRsets which are not at top of zone.
addrdataset() should similarly reject such RRsets.
2021-04-29 11:56:03 +02:00
Mark AndrewsandMichał Kępień 4eff09c6b1 Check SOA owner names in zone transfers
An IXFR containing SOA records with owner names different than the
transferred zone's origin can result in named serving a version of that
zone without an SOA record at the apex.  This causes a RUNTIME_CHECK
assertion failure the next time such a zone is refreshed.  Fix by
immediately rejecting a zone transfer (either an incremental or
non-incremental one) upon detecting an SOA record not placed at the apex
of the transferred zone.
2021-04-29 11:56:03 +02:00
Michał Kępień 870701c336 Fix handling undefined GSS_SPNEGO_MECHANISM macro
BIND 9 attempts to look up GSSAPI OIDs for the Kerberos 5 and SPNEGO
mechanisms in the relevant header files provided by the Kerberos/GSSAPI
library used.  Due to the differences between various Kerberos/GSSAPI
implementations, if any of the expected preprocessor macros
(GSS_KRB5_MECHANISM, GSS_SPNEGO_MECHANISM) is not defined in the header
files provided by the library used, the code in lib/dns/gssapictx.c
defines its own version of each missing macro, so that BIND 9 can
attempt to use the relevant security mechanisms anyway.

Commit 7f08c756aa, which contains a
partial backport of the changes introduced in commit
978c7b2e89, left a block of code in the
lib/dns/include/dst/gssapi.h header which defines the
GSS_SPNEGO_MECHANISM preprocessor macro to NULL if it is not defined by
any header file provided by the Kerberos/GSSAPI library used.  This
causes the gss_add_oid_set_member() call in the mech_oid_set_create()
helper function to always return an error.  This in turn causes the
dst_gssapi_acquirecred() function to also always return an error, which
ultimately prevents any named instance whose configuration includes the
"tkey-gssapi-credential" option from starting.

Remove the offending conditional definition of the GSS_SPNEGO_MECHANISM
preprocessor macro from lib/dns/include/dst/gssapi.h, so that a proper
GSSAPI OID is assigned to that macro in lib/dns/gssapictx.c when the
Kerberos/GSSAPI library used does not define it.

(cherry picked from commit 648ef3a2b4)
2021-04-16 14:54:31 +02:00
Mark Andrews 25ba866b62 Make calling generic rdata methods consistent
add matching macros to pass arguments from called methods
to generic methods.  This will reduce the amount of work
required when extending methods.

Also cleanup unnecessary UNUSED declarations.

(cherry picked from commit a88d3963e2)
2021-04-13 01:53:26 +00:00
Michał Kępień dc1ed88776 Free resources when gss_accept_sec_context() fails
Even if a call to gss_accept_sec_context() fails, it might still cause a
GSS-API response token to be allocated and left for the caller to
release.  Make sure the token is released before an early return from
dst_gssapi_acceptctx().

(cherry picked from commit d954e152d9)
2021-04-08 11:04:21 +02:00
Diego Fronza e2e6fd4fa0 Resolve TSAN data race in zone_maintenance
Fix race between zone_maintenance and dns_zone_notifyreceive functions,
zone_maintenance was attempting to read a zone flag calling
DNS_ZONE_FLAG(zone, flag) while dns_zone_notifyreceive was updating
a flag in the same zone calling DNS_ZONE_SETFLAG(zone, ...).

The code reading the flag in zone_maintenance was not protected by the
zone's lock, to avoid a race the zone's lock is now being acquired
before an attempt to read the zone flag is made.
2021-04-07 10:48:12 -03:00
Ondřej SurýandOndřej Surý 224ce9e0c0 Move the dummy shims to single ifndef GSSAPI block
Previously, every function had it's own #ifdef GSSAPI #else #endif block
that defined shim function in case GSSAPI was not being used.  Now the
dummy shim functions have be split out into a single #else #endif block
at the end of the file.

This makes the gssapictx.c similar to 9.17.x code, making the backports
and reviews easier.
2021-04-01 10:39:48 +02:00
Mark AndrewsandOndřej Surý 57de8df75b Add Heimdal compatibility support
The Heimdal Kerberos library handles the OID sets in a different manner.
Unify the handling of the OID sets between MIT and Heimdal
implementations by dynamically creating the OID sets instead of using
static predefined set.  This is how upstream recommends to handle the
OID sets.
2021-04-01 10:39:48 +02:00
Mark AndrewsandOndřej Surý 7f08c756aa Remove custom ISC SPNEGO implementation
The custom ISC SPNEGO mechanism implementation is no longer needed on
the basis that all major Kerberos 5/GSSAPI (mit-krb5, heimdal and
Windows) implementations support SPNEGO mechanism since 2006.

This commit removes the custom ISC SPNEGO implementation, and removes
the option from both autoconf and win32 Configure script.  Unknown
options are being ignored, so this doesn't require any special handling.
2021-04-01 10:39:48 +02:00
Tinderbox User c06787e095 prep 9.11.29 2021-03-09 12:49:04 +00:00
Mark Andrews dc88bd641d Address unchecked returns leading to NULL pointer dereferences
on out of memory conditions.
2021-02-25 11:44:28 +11:00
Michal Nowak b9ef330fbe Initialize checknames field in dns_view_create()
The 'checknames' field wasn't initialized in dns_view_create(), but it
should otherwise AddressSanitizer identifies the following runtime error
in query_test.c.

    runtime error: load of value 190, which is not a valid value for type '_Bool'

(cherry picked from commit 0c6fa16477)
2021-02-23 16:48:10 +01:00
Mark Andrews 0ee76590d6 Correctly detect when get_direction failed
(cherry picked from commit 009358d77d)
2021-02-19 11:40:05 +11:00
Mark Andrews 4af7a5f1b1 Test a LOC record with an invalid direction field
(cherry picked from commit 07902d9f9d)
2021-02-19 11:40:04 +11:00
Tinderbox UserandMichał Kępień 43ef3488bf prep 9.11.28 2021-02-17 22:46:14 +01:00
Ondřej SurýandMichał Kępień abed9404d1 Fix off-by-one bug in ISC SPNEGO implementation
The ISC SPNEGO implementation is based on mod_auth_kerb code.  When
CVE-2006-5989 was disclosed, the relevant fix was not applied to the
BIND 9 codebase, making the latter vulnerable to the aforementioned flaw
when "tkey-gssapi-keytab" or "tkey-gssapi-credential" is set in
named.conf.

The original description of CVE-2006-5989 was:

    Off-by-one error in the der_get_oid function in mod_auth_kerb 5.0
    allows remote attackers to cause a denial of service (crash) via a
    crafted Kerberos message that triggers a heap-based buffer overflow
    in the component array.

Later research revealed that this flaw also theoretically enables remote
code execution, though achieving the latter in real-world conditions is
currently deemed very difficult.

This vulnerability was responsibly reported as ZDI-CAN-12302 ("ISC BIND
TKEY Query Heap-based Buffer Overflow Remote Code Execution
Vulnerability") by Trend Micro Zero Day Initiative.
2021-02-17 22:46:14 +01:00
Tinderbox UserandMichał Kępień 177d66e39f prep 9.11.27 2021-01-21 09:38:24 +01:00
Michal Nowak 187fd98bca update for 2021 2021-01-06 16:55:54 +01:00
Mark Andrews 25150c15e7 Inactive incorrectly incremented
It is possible to have two threads destroying an rbtdb at the same
time when detachnode() executes and removes the last reference to
a node between exiting being set to true for the node and testing
if the references are zero in maybe_free_rbtdb().  Move NODE_UNLOCK()
to after checking if references is zero to prevent detachnode()
changing the reference count too early.

(cherry picked from commit 859d2fdad6)
2021-01-06 19:18:54 +11:00
Mark Andrews f63b2d8fbd update link order of libbind9 2020-12-21 01:10:00 +00:00
Tinderbox UserandMichał Kępień 363a2c3e5e prep 9.11.26 2020-12-16 22:32:08 +01:00
Mark Andrews 042e1e3a44 Lock check of DNS_ZONEFLG_EXITING flag
WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_zone_refresh lib/dns/zone.c:10447
    #1 dns_zone_notifyreceive2 lib/dns/zone.c:13646
    #2 dns_zone_notifyreceive2 lib/dns/zone.c:13497
    #3 ns_notify_start bin/named/notify.c:150
    #4 client_request bin/named/client.c:3137
    #5 dispatch lib/isc/task.c:1157
    #6 run lib/isc/task.c:1331
    #7 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 dns_zone_refresh lib/dns/zone.c:10466
    #1 zone_maintenance lib/dns/zone.c:10236
    #2 zone_timer lib/dns/zone.c:13136
    #3 dispatch lib/isc/task.c:1157
    #4 run lib/isc/task.c:1331
    #5 <null> <null>
2020-12-10 06:31:20 +00:00
Mark Andrews 7982767d4a Ignore TSAN errors with getcounter and setcounter
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 getcounter lib/isc/stats.c:289:15
    #1 isc_stats_update_if_greater lib/isc/stats.c:464:24
    #2 client_accept bin/named/client.c:3599:2
    #3 client_start bin/named/client.c:833:4
    #4 dispatch lib/isc/task.c:1157:7
    #5 run lib/isc/task.c:1331:2

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 setcounter lib/isc/stats.c:313:27
    #1 isc_stats_update_if_greater lib/isc/stats.c:466:3
    #2 client_accept bin/named/client.c:3599:2
    #3 client_start bin/named/client.c:833:4
    #4 dispatch lib/isc/task.c:1157:7
    #5 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Ondřej SurýandMark Andrews 761cedc2b4 Don't use rwlocks for reference counting
WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 memset <null>
    #1 mem_put lib/isc/mem.c:819
    #2 isc___mem_free lib/isc/mem.c:1662
    #3 isc__mem_free lib/isc/mem.c:3078
    #4 isc___mem_putanddetach lib/isc/mem.c:1221
    #5 isc__mem_putanddetach lib/isc/mem.c:3033
    #6 destroyring lib/dns/tsig.c:494
    #7 dns_tsigkeyring_dumpanddetach lib/dns/tsig.c:665
    #8 destroy lib/dns/view.c:392
    #9 dns_view_weakdetach lib/dns/view.c:704
    #10 zone_free lib/dns/zone.c:1152
    #11 zone_shutdown lib/dns/zone.c:13123
    #12 dispatch lib/isc/task.c:1157
    #13 run lib/isc/task.c:1331
    #14 <null> <null>

    Previous atomic read of size 8 at 0x000000000001 by thread T2:
    #0 __tsan_atomic64_load <null>
    #1 isc_rwlock_unlock lib/isc/rwlock.c:612
    #2 dns_tsigkeyring_dumpanddetach lib/dns/tsig.c:632
    #3 destroy lib/dns/view.c:392
    #4 dns_view_weakdetach lib/dns/view.c:704
    #5 zone_free lib/dns/zone.c:1149
    #6 zone_shutdown lib/dns/zone.c:13123
    #7 dispatch lib/isc/task.c:1157
    #8 run lib/isc/task.c:1331
    #9 <null> <null>
2020-12-10 06:31:19 +00:00
Mark Andrews d85196cdca Ignore TSAN errors accessing init_count and header->count
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 subtractrdataset lib/dns/rbtdb.c:7065:21
    #1 dns_db_subtractrdataset lib/dns/db.c:807:10
    #2 diff_apply lib/dns/diff.c:377:14
    #3 dns_diff_apply lib/dns/diff.c:458:10
    #4 do_one_tuple lib/dns/zone.c:4103:11
    #5 update_one_rr lib/dns/zone.c:4132:10
    #6 keyfetch_done lib/dns/zone.c:9835:4
    #7 dispatch lib/isc/task.c:1157:7
    #8 run lib/isc/task.c:1331:2

    Previous write of size 4 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 addrdataset lib/dns/rbtdb.c:6869:21
    #1 dns_db_addrdataset lib/dns/db.c:783:10
    #2 addoptout lib/dns/ncache.c:264:10
    #3 dns_ncache_add lib/dns/ncache.c:101:10
    #4 ncache_adderesult lib/dns/resolver.c:5989:12
    #5 ncache_message lib/dns/resolver.c:6165:11
    #6 resquery_response lib/dns/resolver.c:8691:12
    #7 dispatch lib/isc/task.c:1157:7
    #8 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews fdb893ede1 Address data race in dns_stats_detach over references
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_stats_detach lib/dns/stats.c:115:19
    #1 destroy lib/dns/view.c:527:3
    #2 dns_view_weakdetach lib/dns/view.c:704:3
    #3 zone_free lib/dns/zone.c:1149:3
    #4 zone_shutdown lib/dns/zone.c:13123:3
    #5 dispatch lib/isc/task.c:1157:7
    #6 run lib/isc/task.c:1331:2

    Previous read of size 4 at 0x000000000001 by thread T2:
    #0 dns_stats_detach lib/dns/stats.c:118:13
    #1 destroy lib/dns/view.c:527:3
    #2 dns_view_weakdetach lib/dns/view.c:704:3
    #3 zone_free lib/dns/zone.c:1152:3
    #4 zone_shutdown lib/dns/zone.c:13123:3
    #5 dispatch lib/isc/task.c:1157:7
    #6 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews e989ba66f0 Lock access to acache stats when not using atomics
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_acache_getentry lib/dns/acache.c:1549:2
    #1 rdataset_getadditional lib/dns/rbtdb.c:9912:11
    #2 dns_rdataset_getadditional lib/dns/rdataset.c:711:11
    #3 query_addadditional2 bin/named/query.c:1991:11
    #4 additionaldata_ns lib/dns/./rdata/generic/ns_2.c:198:10
    #5 dns_rdata_additionaldata lib/dns/rdata.c:1246:2
    #6 dns_rdataset_additionaldata lib/dns/rdataset.c:629:12
    #7 query_addrdataset bin/named/query.c:2435:8
    #8 query_addrrset bin/named/query.c:2826:2
    #9 query_addbestns bin/named/query.c:3525:2
    #10 query_find bin/named/query.c:9204:4
    #11 query_resume bin/named/query.c:4188:12
    #12 dispatch lib/isc/task.c:1157:7
    #13 run lib/isc/task.c:1331:2

    Previous write of size 4 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 dns_acache_countquerymiss lib/dns/acache.c:1201:2
    #1 rdataset_getadditional lib/dns/rbtdb.c:9896:4
    #2 dns_rdataset_getadditional lib/dns/rdataset.c:711:11
    #3 query_addadditional2 bin/named/query.c:1991:11
    #4 additionaldata_ns lib/dns/./rdata/generic/ns_2.c:198:10
    #5 dns_rdata_additionaldata lib/dns/rdata.c:1246:2
    #6 dns_rdataset_additionaldata lib/dns/rdataset.c:629:12
    #7 query_addrdataset bin/named/query.c:2435:8
    #8 query_addrrset bin/named/query.c:2826:2
    #9 query_find bin/named/query.c:9176:4
    #10 query_resume bin/named/query.c:4188:12
    #11 dispatch lib/isc/task.c:1157:7
2020-12-10 06:31:19 +00:00
Mark Andrews d4a59f232e Ignore TSAN warnings in state_key_init - deliberate
WARNING: ThreadSanitizer: data race
    Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
    #0 state_key_init lib/dns/geoip2.c:150:5
    #1 get_entry_for lib/dns/geoip2.c:241:11
    #2 dns_geoip_match lib/dns/geoip2.c:410:10
    #3 dns_aclelement_match2 lib/dns/acl.c:493:11
    #4 dns_acl_match2 lib/dns/acl.c:298:7
    #5 allowed bin/named/client.c:1869:11
    #6 ns_client_isself bin/named/client.c:1934:7
    #7 notify_isself lib/dns/zone.c:11055:11
    #8 notify_send lib/dns/zone.c:11374:7
    #9 notify_find_address lib/dns/zone.c:11178:2
    #10 zone_notify lib/dns/zone.c:11616:3
    #11 zone_maintenance lib/dns/zone.c:10291:4
    #12 zone_timer lib/dns/zone.c:13136:2
    #13 dispatch lib/isc/task.c:1157:7
    #14 run lib/isc/task.c:1331:2

    Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: write M3):
    #0 state_key_init lib/dns/geoip2.c:134:7
    #1 get_entry_for lib/dns/geoip2.c:241:11
    #2 dns_geoip_match lib/dns/geoip2.c:410:10
    #3 dns_aclelement_match2 lib/dns/acl.c:493:11
    #4 dns_acl_match2 lib/dns/acl.c:298:7
    #5 allowed bin/named/client.c:1869:11
    #6 ns_client_isself bin/named/client.c:1934:7
    #7 notify_isself lib/dns/zone.c:11055:11
    #8 notify_send lib/dns/zone.c:11374:7
    #9 notify_find_address lib/dns/zone.c:11178:2
    #10 zone_notify lib/dns/zone.c:11616:3
    #11 zone_maintenance lib/dns/zone.c:10291:4
    #12 zone_timer lib/dns/zone.c:13136:2
    #13 dispatch lib/isc/task.c:1157:7
    #14 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews 5f6ab3512e Silence TSAN warning on spins in isc_rwlock_lock
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1:
    #0 isc_rwlock_lock lib/isc/rwlock.c:720:2
    #1 findnodeintree lib/dns/rbtdb.c:3060:2
    #2 findnsec3node lib/dns/rbtdb.c:3164:10
    #3 dns_db_findnsec3node lib/dns/db.c:528:10
    #4 diff_apply lib/dns/diff.c:318:5
    #5 dns_diff_applysilently lib/dns/diff.c:463:10
    #6 signname bin/dnssec/./dnssec-signzone.c:1118:11
    #7 sign bin/dnssec/./dnssec-signzone.c:1599:2
    #8 dispatch lib/isc/task.c:1157:7
    #9 run lib/isc/task.c:1331:2

    Previous read of size 4 at 0x000000000001 by thread T2:
    #0 isc_rwlock_lock lib/isc/rwlock.c:704:25
    #1 addrdataset lib/dns/rbtdb.c:6853:2
    #2 dns_db_addrdataset lib/dns/db.c:783:10
    #3 diff_apply lib/dns/diff.c:370:14
    #4 dns_diff_applysilently lib/dns/diff.c:463:10
    #5 signname bin/dnssec/./dnssec-signzone.c:1118:11
    #6 sign bin/dnssec/./dnssec-signzone.c:1599:2
    #7 dispatch lib/isc/task.c:1157:7
    #8 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews a241c69920 Lock read of refs when atomics are not available.
WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 zone_iattach lib/dns/zone.c:5412:2
    #1 soa_query lib/dns/zone.c:12725:2
    #2 dispatch lib/isc/task.c:1157:7
    #3 run lib/isc/task.c:1331:2

    Previous write of size 4 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 dns_zone_detach lib/dns/zone.c:5346:2
    #1 ns_server_refreshcommand bin/named/./server.c:9880:3
    #2 ns_control_docommand bin/named/control.c:247:12
    #3 control_recvmessage bin/named/controlconf.c:469:13
    #4 dispatch lib/isc/task.c:1157:7
    #5 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews 1caef804d5 Ignore thread sanitizer warnings in stats counters
set ISC_NO_SANITIZE_THREAD for incrementcounter and decrementcounter

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 decrementcounter lib/isc/stats.c:258:26
    #1 isc_stats_decrement lib/isc/stats.c:350:2
    #2 dec_stats lib/isc/unix/socket.c:934:3
    #3 socketclose lib/isc/unix/socket.c:2270:3
    #4 destroy lib/isc/unix/socket.c:2323:3
    #5 isc__socket_detach lib/isc/unix/socket.c:3275:3
    #6 isc_socket_detach lib/isc/unix/./../socket_api.c:128:3
    #7 exit_check bin/named/client.c:593:4
    #8 ns_client_next bin/named/client.c:947:8
    #9 client_request bin/named/client.c
    #10 dispatch lib/isc/task.c:1157:7
    #11 run lib/isc/task.c:1331:2

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 incrementcounter lib/isc/stats.c:239:26
    #1 isc_stats_increment lib/isc/stats.c:340:2
    #2 inc_stats lib/isc/unix/socket.c:923:3
    #3 internal_accept lib/isc/unix/socket.c:3741:4
    #4 dispatch lib/isc/task.c:1157:7
    #5 run lib/isc/task.c:1331:2
2020-12-10 06:31:19 +00:00
Mark Andrews 0e5a076cc1 Prevent inlining of code with thread sanitiser disabled 2020-12-10 06:31:19 +00:00
Mark Andrews f3c402baed Only lock access to epoll_ctl when using watcher thread 2020-12-10 02:34:36 +00:00
Mark Andrews 7466b505b3 check result 2020-12-10 02:34:36 +00:00
Mark Andrews 136804b1a0 #ifdef protect key_mutex 2020-12-10 02:34:36 +00:00
Petr MensikandMark Andrews 839350f5f6 Pass task_test also with threads disabled
Condition cv is declared only when threads are used. Use it only in that
case. Test compiles and passes without thread support also.
2020-12-01 23:06:19 +00:00
Mark Andrews d09991e4e9 Adjust default value of "max-recursion-queries"
Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.

(cherry picked from commit ab0bf49203)
2020-12-01 22:13:05 +00:00
Mark Andrews 0e7a4169bd Fix misplaced declaration
(cherry picked from commit 49b9219bb3)
2020-12-01 23:19:46 +11:00
Michał Kępień dfdd3a8a2f Make DocBook sources namespaced again
Every DocBook source document can be namespaced (DocBook 5) or
non-namespaced (DocBook 4).  The set of XSL stylesheets used for
producing an output document can also be namespaced or non-namespaced.
Namespaced source documents should be used with namespaced stylesheets
and non-namespaced source documents should be used with non-namespaced
stylesheets.  However, both stylesheet flavors contain processing rules
which allow them to be used interchangeably for any type of source
document.

Unfortunately, these processing rules became broken in version 1.79.1 of
the stylesheets, which means that non-namespaced source documents can no
longer be correctly transformed into man pages using namespaced
stylesheets and vice versa.  This problem was fixed upstream [1], but no
released version of the XSL stylesheets contains that fix yet.

Back in 2016, this problem was reported as RT #43831 and allegedly fixed
in commit 1b8ce3b330.  However, that fix
only helped for the non-namespaced version of the stylesheets - while
also breaking man page generation for the namespaced flavor.

Since using namespaced DocBook sources is the current best practice
(DocBook 5), make BIND DocBook sources namespaced again.  When using
version 1.79.1 or 1.79.2 of the XSL stylesheets, care must be taken to
ensure namespaced stylesheets are used for generating BIND
documentation.

[1] https://github.com/docbook/xslt10-stylesheets/issues/109
2020-11-30 09:33:32 +01:00
Mark Andrews 28f1cbb007 Add comment about cookie sizes
(cherry picked from commit 304df53991)
2020-11-27 10:20:40 +11:00
Mark Andrews cdf73095ab Tighten DNS COOKIE response handling
Fallback to TCP when we have already seen a DNS COOKIE response
from the given address and don't have one in this UDP response. This
could be a server that has turned off DNS COOKIE support, a
misconfigured anycast server with partial DNS COOKIE support, or a
spoofed response. Falling back to TCP is the correct behaviour in
all 3 cases.

(cherry picked from commit 0e3b1f5a25)
2020-11-27 09:28:09 +11:00