]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoBump BIND_BASELINE_VERSION for respdiff tests
Michał Kępień [Thu, 22 Oct 2020 07:27:36 +0000 (09:27 +0200)] 
Bump BIND_BASELINE_VERSION for respdiff tests

5 years agoMerge branch 'prep-release' into v9_11_24-release
Tinderbox User [Tue, 13 Oct 2020 11:00:08 +0000 (11:00 +0000)] 
Merge branch 'prep-release' into v9_11_24-release

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.11.24' into 'v9_11_24-release'
Michał Kępień [Tue, 13 Oct 2020 10:33:25 +0000 (10:33 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.11.24' into 'v9_11_24-release'

Prepare release notes for BIND 9.11.24

See merge request isc-private/bind9!218

5 years agoprep 9.11.24
Tinderbox User [Tue, 13 Oct 2020 10:59:30 +0000 (10:59 +0000)] 
prep 9.11.24

5 years agoPrepare release notes for BIND 9.11.24
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Prepare release notes for BIND 9.11.24

5 years agoTweak and reword release notes
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Tue, 13 Oct 2020 10:30:47 +0000 (12:30 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMerge branch '2195-freebsd-dnstap-system-test-failure-v9_11' into 'v9_11'
Diego dos Santos Fronza [Tue, 20 Oct 2020 14:32:48 +0000 (14:32 +0000)] 
Merge branch '2195-freebsd-dnstap-system-test-failure-v9_11' into 'v9_11'

Fix dnstap system test on FreeBSD

See merge request isc-projects/bind9!4276

5 years agoFix dnstap system test on FreeBSD
Diego Fronza [Thu, 1 Oct 2020 17:04:05 +0000 (14:04 -0300)] 
Fix dnstap system test on FreeBSD

This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.

5 years agoMerge branch 'marka-fix-not-enough-categories-v9_11' into 'v9_11'
Mark Andrews [Thu, 15 Oct 2020 01:57:54 +0000 (01:57 +0000)] 
Merge branch 'marka-fix-not-enough-categories-v9_11' into 'v9_11'

Drop the expected minimum number of buckets to 4.

See merge request isc-projects/bind9!4266

5 years agoDrop the expected minimum number of buckets to 4.
Mark Andrews [Fri, 2 Oct 2020 02:27:54 +0000 (12:27 +1000)] 
Drop the expected minimum number of buckets to 4.

The previous value of 5 produced too many false errors.

(cherry picked from commit 0abb49034e3fe7a04a8065602490724b6ff920b7)

5 years agoMerge branch 'marka-rrl-mdig-burst-v9_11' into 'v9_11'
Mark Andrews [Thu, 15 Oct 2020 01:15:48 +0000 (01:15 +0000)] 
Merge branch 'marka-rrl-mdig-burst-v9_11' into 'v9_11'

Try to improve rrl timing

See merge request isc-projects/bind9!4264

5 years agoTry to improve rrl timing
Mark Andrews [Wed, 16 Sep 2020 02:40:52 +0000 (12:40 +1000)] 
Try to improve rrl timing

Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

(cherry picked from commit 92cdc7b6c7eec674fa03e7f87854cd5528c37f48)

5 years agoMerge branch '2204-investigate-pipeline-system-test-failure-2' into 'v9_11'
Mark Andrews [Thu, 8 Oct 2020 05:21:27 +0000 (05:21 +0000)] 
Merge branch '2204-investigate-pipeline-system-test-failure-2' into 'v9_11'

Resolve "Investigate pipeline system test failure"

See merge request isc-projects/bind9!4248

5 years agoRestore the dns_message_reset() call before the dns_dispatch_getnext()
Mark Andrews [Wed, 7 Oct 2020 23:55:35 +0000 (10:55 +1100)] 
Restore the dns_message_reset() call before the dns_dispatch_getnext()

This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.

5 years agoMerge branch 'mnowak/bring_--rpz-log-qtype-qclass_back' into 'v9_11'
Mark Andrews [Wed, 7 Oct 2020 20:10:10 +0000 (20:10 +0000)] 
Merge branch 'mnowak/bring_--rpz-log-qtype-qclass_back' into 'v9_11'

Bring back --rpz-log-qtype-qclass feature-test option

See merge request isc-projects/bind9!4243

5 years agoBring back --rpz-log-qtype-qclass feature-test option
Michal Nowak [Wed, 7 Oct 2020 09:24:16 +0000 (11:24 +0200)] 
Bring back --rpz-log-qtype-qclass feature-test option

It was unintentionally removed during a backport.

5 years agoMerge branch 'wpk/fix-isc-assertions-c-error-v9_11' into 'v9_11'
Michal Nowak [Wed, 7 Oct 2020 09:12:16 +0000 (09:12 +0000)] 
Merge branch 'wpk/fix-isc-assertions-c-error-v9_11' into 'v9_11'

[v9_11] Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

See merge request isc-projects/bind9!4242

5 years agoFix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c
Witold Kręcicki [Wed, 6 May 2020 09:25:30 +0000 (11:25 +0200)] 
Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

(cherry picked from commit f4260dc0c53436b005662b168b2addde91b65033)

5 years agoMerge branch '2183-dns-flag-day-2020-v9_11' into 'v9_11'
Ondřej Surý [Tue, 6 Oct 2020 12:22:09 +0000 (12:22 +0000)] 
Merge branch '2183-dns-flag-day-2020-v9_11' into 'v9_11'

Resolve "DNS Flag Day 2020"

See merge request isc-projects/bind9!4230

5 years agoAdd text describing the changes done in the MR in more detail
Ondřej Surý [Wed, 30 Sep 2020 16:38:32 +0000 (18:38 +0200)] 
Add text describing the changes done in the MR in more detail

(cherry picked from commit 096d41b4e266c003cc3e6234c864f0a7d15145ab)
(cherry picked from commit 469286e8eb24ebd6227e65b18eb4c30e13a58877)

5 years agoAdjust legacy tests for default 1232 EDNS Buffer Size
Ondřej Surý [Mon, 5 Oct 2020 16:17:49 +0000 (18:17 +0200)] 
Adjust legacy tests for default 1232 EDNS Buffer Size

* legacy test was just expecting default server EDNS buffer size to be 4096,
  the test needed the adjustment to reset the buffer sizes back to 4096.

5 years agoAdjust digdelv tests for default 1232 EDNS Buffer Size
Ondřej Surý [Wed, 23 Sep 2020 14:36:44 +0000 (16:36 +0200)] 
Adjust digdelv tests for default 1232 EDNS Buffer Size

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

(cherry picked from commit f1556f8c4126eced7cf71de3dfc007dbd9940c4a)
(cherry picked from commit 6b303721f1ee472dc8ab2d1df03191a98d4e4e5e)

5 years agoChange the default ENDS buffer size to 1232 for DNS Flag Day 2020
Ondřej Surý [Wed, 23 Sep 2020 12:47:26 +0000 (14:47 +0200)] 
Change the default ENDS buffer size to 1232 for DNS Flag Day 2020

The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the minimal
required changes by changing the defaults for `edns-udp-size`,
`max-udp-size` and `nocookie-udp-size` to `1232` (the value picked by
DNS Flag Day 2020).

(cherry picked from commit bb990030d344dafe40a62fe5ed2741de28b8ca66)
(cherry picked from commit df06773f9a73e4a4bb0b5e7f4bd8e40394e64032)

5 years agoMerge branch '2139-rrset-order-fixes-and-cleanups-v9_11' into 'v9_11'
Michał Kępień [Fri, 2 Oct 2020 08:12:59 +0000 (08:12 +0000)] 
Merge branch '2139-rrset-order-fixes-and-cleanups-v9_11' into 'v9_11'

[v9_11] "rrset-order" fixes and cleanups

See merge request isc-projects/bind9!4221

5 years agoAdd CHANGES entry
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add CHANGES entry

(cherry picked from commit 27c815a220a1b18756cc643f3ec1c16635fedda2)

5 years agoRework "rrset-order" documentation
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Rework "rrset-order" documentation

Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.

(cherry picked from commit 2ac04dc9305438f424a3a11c540d505e44db013e)

5 years agoMerge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime-v9_11' into...
Mark Andrews [Thu, 1 Oct 2020 13:23:56 +0000 (13:23 +0000)] 
Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime-v9_11' into 'v9_11'

Resolve "Allow task_test subtests to be selected at runtime."

See merge request isc-projects/bind9!4210

5 years agoAdd the ability select individual tests to rdata_test
Mark Andrews [Fri, 11 Sep 2020 04:17:36 +0000 (14:17 +1000)] 
Add the ability select individual tests to rdata_test

(cherry picked from commit 6293682020472e66a92094b57475a6b13ca1fa77)

5 years agoAdd the ability to print out the list of test names (-l)
Mark Andrews [Tue, 8 Sep 2020 00:38:24 +0000 (10:38 +1000)] 
Add the ability to print out the list of test names (-l)

(cherry picked from commit a9c337471767b75861557c93b4fd7fff66227de0)

5 years agoAdd the ability to select tests to run
Mark Andrews [Wed, 2 Sep 2020 08:22:21 +0000 (18:22 +1000)] 
Add the ability to select tests to run

task_test [-t <test_name>]

(cherry picked from commit 76837484e7d6f9a70c8217f9bd7f5aa1784fe353)

5 years agoMerge branch '2124-fix-assertion-failure-in-dns-message-v9_11' into 'v9_11'
Ondřej Surý [Wed, 30 Sep 2020 12:40:37 +0000 (12:40 +0000)] 
Merge branch '2124-fix-assertion-failure-in-dns-message-v9_11' into 'v9_11'

Resolve "Bind 9.16.6 Assertion failure message.c:4733: REQUIRE(msg->state == (-1)) failed"

See merge request isc-projects/bind9!4200

5 years agoAdd CHANGES and release note for GL #2124
Ondřej Surý [Fri, 25 Sep 2020 10:51:39 +0000 (12:51 +0200)] 
Add CHANGES and release note for GL #2124

5 years agoProperly handling dns_message_t shared references
Diego Fronza [Mon, 21 Sep 2020 20:44:29 +0000 (17:44 -0300)] 
Properly handling dns_message_t shared references

This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a
fetchctx and the dns_message_t object held by the query may be being
used by some external module, e.g. validator, even after the query may
have been destroyed, propery handling of the references to the message
were added in this commit to avoid accessing an already destroyed
object.

Specifically, in resquery_response(), a reference to the message is
attached at the beginning of the function and detached at the end, since
a possible call to fctx_cancelquery() would release the dns_message_t
object, and in the next lines of code a call to add_bad() would require
a valid pointer to the same object.

In valcreate() a new reference is attached to the message object, this
ensures that if the corresponding query object is destroyed before the
validator attempts to access it, no invalid pointer access occurs.

In validated() we have to attach a new reference to the message, since
we destroy the validator object at the beginning of the function, and we
need access to the message in the next lines of the same function.

5 years agoFix invalid dns message state in resolver's logic
Diego Fronza [Mon, 21 Sep 2020 20:32:39 +0000 (17:32 -0300)] 
Fix invalid dns message state in resolver's logic

The assertion failure REQUIRE(msg->state == DNS_SECTION_ANY),
caused by calling dns_message_setclass within function resquery_response()
in resolver.c, was happening due to wrong management of dns message_t
objects used to process responses to the queries issued by the resolver.

Before the fix, a resolver's fetch context (fetchctx_t) would hold
a pointer to the message, this same reference would then be used over all
the attempts to resolve the query, trying next server, etc... for this to work
the message object would have it's state reset between each iteration, marking
it as ready for a new processing.

The problem arose in a scenario with many different forwarders configured,
managing the state of the dns_message_t object was lacking better
synchronization, which have led it to a invalid dns_message_t state in
resquery_response().

Instead of adding unnecessarily complex code to synchronize the object,
the dns_message_t object was moved from fetchctx_t structure to the
query structure, where it better belongs to, since each query will produce
a response, this way whenever a new query is created an associated
dns_messate_t is also created.

This commit deals mainly with moving the dns_message_t object from fetchctx_t
to the query structure.

5 years agoRefactored dns_message_t for using attach/detach semantics
Diego Fronza [Mon, 21 Sep 2020 19:16:15 +0000 (16:16 -0300)] 
Refactored dns_message_t for using attach/detach semantics

This commit will be used as a base for the next code updates in order
to have a better control of dns_message_t objects' lifetime.

5 years agoMerge branch 'michal/disable-openssl-hashing-when-using-native-pkcs11' into 'v9_11'
Michał Kępień [Mon, 28 Sep 2020 07:31:38 +0000 (07:31 +0000)] 
Merge branch 'michal/disable-openssl-hashing-when-using-native-pkcs11' into 'v9_11'

Disable OpenSSL hashing when using native PKCS#11

See merge request isc-projects/bind9!4178

5 years agoDisable OpenSSL hashing when using native PKCS#11
Michał Kępień [Mon, 28 Sep 2020 07:30:00 +0000 (09:30 +0200)] 
Disable OpenSSL hashing when using native PKCS#11

When building with "--enable-native-pkcs11 --with-openssl", OpenSSL
support is automatically disabled in favor of native PKCS#11:

    checking for OpenSSL library... use of native PKCS11 instead

However, adding "--enable-openssl-hash" to the above two switches causes
the build to fail:

    checking for OpenSSL library... use of native PKCS11 instead
    disabled because of native PKCS11
    checking for using OpenSSL for hash functions... configure: error: No OpenSSL for hash functions

In other words, "--with-openssl" and "--enable-openssl-hash" are not
behaving consistently when used together with "--enable-native-pkcs11".

Fix by automatically disabling OpenSSL hashing support when native
PKCS#11 support is enabled.

5 years agoMerge branch '2177-make-native-pkcs11-require-dlopen-support-v9_11' into 'v9_11'
Michał Kępień [Mon, 28 Sep 2020 07:29:08 +0000 (07:29 +0000)] 
Merge branch '2177-make-native-pkcs11-require-dlopen-support-v9_11' into 'v9_11'

[v9_11] Make native PKCS#11 require dlopen() support

See merge request isc-projects/bind9!4190

5 years agoMake native PKCS#11 require dlopen() support
Michał Kępień [Mon, 28 Sep 2020 07:21:59 +0000 (09:21 +0200)] 
Make native PKCS#11 require dlopen() support

PKCS#11 support in BIND requires dlopen() support from the operating
system and thus building with "--enable-native-pkcs11 --without-dlopen"
should not be possible.  Add an Autoconf check which enforces that
constraint.  Adjust the pairwise testing model accordingly.

(cherry picked from commit 187dca9cf7e3b7473352a7bd416abbc5c6f64cd4)

5 years agoMerge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst-v9_11' into 'v9_11'
Mark Andrews [Thu, 24 Sep 2020 03:16:23 +0000 (03:16 +0000)] 
Merge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst-v9_11' into 'v9_11'

Add RFC8906 to list in doc/arm/general.rst

See merge request isc-projects/bind9!4183

5 years agoAdd RFC8906 to list in doc/arm/general.rst
Suzanne Goldlust [Wed, 23 Sep 2020 19:34:42 +0000 (19:34 +0000)] 
Add RFC8906 to list in doc/arm/general.rst

(cherry picked from commit 4c36b6bdf04391bddcd69def47ad96c24b17c8b0)

5 years agoMerge branch '2126-cycles-in-lock-order-graphs-v9-11' into 'v9_11'
Mark Andrews [Wed, 23 Sep 2020 01:05:14 +0000 (01:05 +0000)] 
Merge branch '2126-cycles-in-lock-order-graphs-v9-11' into 'v9_11'

Resolve "Cycles in lock order graphs [v9.11]"

See merge request isc-projects/bind9!4094

5 years agoAddress lock order reversals when shutting down a view.
Mark Andrews [Mon, 7 Sep 2020 03:21:10 +0000 (13:21 +1000)] 
Address lock order reversals when shutting down a view.

Release view->lock before calling dns_resolver_shutdown,
dns_adb_shutdown, and dns_requestmgr_shutdown.

5 years agoMerge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread...
Mark Andrews [Tue, 22 Sep 2020 13:51:06 +0000 (13:51 +0000)] 
Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2-v9_11' into 'v9_11'

Break lock order loop by sending TAT in an event

See merge request isc-projects/bind9!4166

5 years agoBreak lock order loop by sending TAT in an event
Mark Andrews [Tue, 22 Sep 2020 05:22:34 +0000 (15:22 +1000)] 
Break lock order loop by sending TAT in an event

The dotat() function has been changed to send the TAT
query asynchronously, so there's no lock order loop
because we initialize the data first and then we schedule
the TAT send to happen asynchronously.

This breaks following lock-order loops:

zone->lock (dns_zone_setviewcommit) while holding view->lock
(dns_view_setviewcommit)

keytable->lock (dns_keytable_find) while holding zone->lock
(zone_asyncload)

view->lock (dns_view_findzonecut) while holding keytable->lock
(dns_keytable_forall)

(cherry picked from commit 3c4b68af7c0cd8213bcae92faee3bf2a7e9284d1)

5 years agoMerge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread...
Mark Andrews [Tue, 22 Sep 2020 12:52:51 +0000 (12:52 +0000)] 
Merge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock-v9_11' into 'v9_11'

Address lock-order-inversion

See merge request isc-projects/bind9!4164

5 years agoAddress lock-order-inversion
Mark Andrews [Tue, 22 Sep 2020 06:24:06 +0000 (16:24 +1000)] 
Address lock-order-inversion

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_wrlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:52:4
    #2 zone_postload lib/dns/zone.c:5101:2
    #3 receive_secure_db lib/dns/zone.c:16206:11
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 receive_secure_db lib/dns/zone.c:16204:2
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 get_raw_serial lib/dns/zone.c:2518:2
    #2 zone_gotwritehandle lib/dns/zone.c:2559:4
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock

(cherry picked from commit 1090876693470eedf69211d0fe71ba2c88160f45)

5 years agoMerge branch 'mnowak/pairwise-configure-testing-v9_11' into 'v9_11'
Michał Kępień [Tue, 22 Sep 2020 10:08:44 +0000 (10:08 +0000)] 
Merge branch 'mnowak/pairwise-configure-testing-v9_11' into 'v9_11'

[v9_11] Add pairwise testing

See merge request isc-projects/bind9!4162

5 years agoAdd pairwise testing
Michal Nowak [Wed, 1 Jul 2020 08:29:36 +0000 (10:29 +0200)] 
Add pairwise testing

Pairwise testing is a test case generation technique based on the
observation that most faults are caused by interactions of at most two
factors.  For BIND, its configure options can be thought of as such
factors.

Process BIND configure options into a model that is subsequently
processed by the PICT tool in order to find an effective test vector.
That test vector is then used for configuring and building BIND using
various combinations of configure options.

(cherry picked from commit 420986bf187ed2a33321d5af362732184426f439)

5 years agoMerge branch '2166-bind-9-16-7-trap-divide-error-v9_11' into 'v9_11'
Ondřej Surý [Mon, 21 Sep 2020 09:10:59 +0000 (09:10 +0000)] 
Merge branch '2166-bind-9-16-7-trap-divide-error-v9_11' into 'v9_11'

Resolve "bind 9.16.7 trap divide error"

See merge request isc-projects/bind9!4153

5 years agoAdd CHANGES and release note for GL #2166
Ondřej Surý [Thu, 17 Sep 2020 12:47:16 +0000 (14:47 +0200)] 
Add CHANGES and release note for GL #2166

(cherry picked from commit 2869ca1401a45d610354e81e6773d4666001a974)

5 years agoHandle the errors from sysconf() call in isc_meminfo_totalphys()
Ondřej Surý [Thu, 17 Sep 2020 12:37:24 +0000 (14:37 +0200)] 
Handle the errors from sysconf() call in isc_meminfo_totalphys()

isc_meminfo_totalphys() would return invalid memory size when sysconf()
call would fail, because ((size_t)-1 * -1) is very large number.

(cherry picked from commit 79ca724d46918387fba6b2dc484d67390bcbbd56)

5 years agoMerge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put...
Ondřej Surý [Fri, 18 Sep 2020 06:52:41 +0000 (06:52 +0000)] 
Merge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put-v9_11' into 'v9_11'

Exclude isc_mem_isovermem from ThreadSanitizer

See merge request isc-projects/bind9!4144

5 years agoExclude isc_mem_isovermem from ThreadSanitizer
Ondřej Surý [Thu, 17 Sep 2020 12:05:10 +0000 (14:05 +0200)] 
Exclude isc_mem_isovermem from ThreadSanitizer

The .is_overmem member of isc_mem_t structure is intentionally accessed
unlocked as 100% accuracy isn't necessary here.

Without the attribute, following TSAN warning would show up:

    WARNING: ThreadSanitizer: data race
      Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
#0 isc___mem_put lib/isc/mem.c:1119:19
#1 isc__mem_put lib/isc/mem.c:2439:2
#2 dns_rdataslab_fromrdataset lib/dns/rdataslab.c:327:2
#3 addrdataset lib/dns/rbtdb.c:6761:11
#4 dns_db_addrdataset lib/dns/db.c:719:10
#5 cache_name lib/dns/resolver.c:6538:13
#6 cache_message lib/dns/resolver.c:6628:14
#7 resquery_response lib/dns/resolver.c:7883:13
#8 dispatch lib/isc/task.c:1152:7
#9 run lib/isc/task.c:1344:2

      Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: write M3):
#0 isc_mem_isovermem lib/isc/mem.c:1553:15
#1 addrdataset lib/dns/rbtdb.c:6866:25
#2 dns_db_addrdataset lib/dns/db.c:719:10
#3 addoptout lib/dns/ncache.c:281:10
#4 dns_ncache_add lib/dns/ncache.c:101:10
#5 ncache_adderesult lib/dns/resolver.c:6668:12
#6 ncache_message lib/dns/resolver.c:6845:11
#7 rctx_ncache lib/dns/resolver.c:9174:11
#8 resquery_response lib/dns/resolver.c:7894:2
#9 dispatch lib/isc/task.c:1152:7
#10 run lib/isc/task.c:1344:2

      Location is heap block of size 328 at 0x000000000020 allocated by thread T3:
#0 malloc <null>
#1 default_memalloc lib/isc/mem.c:713:8
#2 mem_create lib/isc/mem.c:763:8
#3 isc_mem_create lib/isc/mem.c:2425:2
#4 configure_view bin/named/server.c:4494:4
#5 load_configuration bin/named/server.c:9062:3
#6 run_server bin/named/server.c:9771:2
#7 dispatch lib/isc/task.c:1152:7
#8 run lib/isc/task.c:1344:2

    [...]

    SUMMARY: ThreadSanitizer: data race lib/isc/mem.c:1119:19 in isc___mem_put

(cherry picked from commit 0110d1ab1750ec902ad4947d13c3ac0240a2260b)

5 years agoMerge branch '2131-tsan-data-race-in-accessing-controls-symtab-v9_11' into 'v9_11'
Mark Andrews [Thu, 17 Sep 2020 10:21:53 +0000 (10:21 +0000)] 
Merge branch '2131-tsan-data-race-in-accessing-controls-symtab-v9_11' into 'v9_11'

Lock access to control->symtab to prevent data race

See merge request isc-projects/bind9!4139

5 years agoLock access to control->symtab to prevent data race
Mark Andrews [Tue, 8 Sep 2020 02:11:06 +0000 (12:11 +1000)] 
Lock access to control->symtab to prevent data race

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 isccc_symtab_foreach lib/isccc/symtab.c:277:14
    #1 isccc_cc_cleansymtab lib/isccc/cc.c:954:2
    #2 control_recvmessage bin/named/controlconf.c:477:2
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 isccc_symtab_define lib/isccc/symtab.c:242:2
    #1 isccc_cc_checkdup lib/isccc/cc.c:1026:11
    #2 control_recvmessage bin/named/controlconf.c:478:11
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Location is heap block of size 190352 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 isccc_symtab_create lib/isccc/symtab.c:76:18
    #2 isccc_cc_createsymtab lib/isccc/cc.c:948:10
    #3 named_controls_create bin/named/controlconf.c:1483:11
    #4 named_server_create bin/named/server.c:10057:2
    #5 setup bin/named/main.c:1256:2
    #6 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race lib/isccc/symtab.c:277:14 in isccc_symtab_foreach

(cherry picked from commit 0450acc1b65442a0e904c895cf2875eacf409598)

5 years agoMerge branch '2123-lock-order-inversions-in-main-v9_11' into 'v9_11'
Mark Andrews [Thu, 17 Sep 2020 09:02:33 +0000 (09:02 +0000)] 
Merge branch '2123-lock-order-inversions-in-main-v9_11' into 'v9_11'

Resolve "Lock order inversions in main"

See merge request isc-projects/bind9!4137

5 years agoPause dbiterator ealier to prevent lock-order-inversion
Mark Andrews [Tue, 8 Sep 2020 03:42:07 +0000 (13:42 +1000)] 
Pause dbiterator ealier to prevent lock-order-inversion

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 resume_addnsec3chain lib/dns/zone.c:3776:11
    #6 rss_post lib/dns/zone.c:20659:3
    #7 setnsec3param lib/dns/zone.c:20471:3
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 rss_post lib/dns/zone.c:20658:3
    #2 setnsec3param lib/dns/zone.c:20471:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8666:5
    #2 zone_maintenance lib/dns/zone.c:11063:4
    #3 zone_timer lib/dns/zone.c:14098:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8656:13
    #6 zone_maintenance lib/dns/zone.c:11063:4
    #7 zone_timer lib/dns/zone.c:14098:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

(cherry picked from commit 9e584a45114849637c0ab04e9410ba5fc00b054d)

5 years agoPause the database iterator to release rwlock
Mark Andrews [Tue, 8 Sep 2020 03:16:28 +0000 (13:16 +1000)] 
Pause the database iterator to release rwlock

(cherry picked from commit 2e63de94aa902fd923abfde3461e6a03532afbe5)

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 06:40:51 +0000 (16:40 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000001) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11119:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11089:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8502:3
    #2 zone_maintenance lib/dns/zone.c:11056:4
    #3 zone_timer lib/dns/zone.c:14091:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_current lib/dns/rbtdb.c:9695:3
    #4 dns_dbiterator_current lib/dns/dbiterator.c:101:10
    #5 zone_nsec3chain lib/dns/zone.c:8539:3
    #6 zone_maintenance lib/dns/zone.c:11056:4
    #7 zone_timer lib/dns/zone.c:14091:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit fbed96220486a063aafdd0a6ada8adce972fd48f)

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 06:07:57 +0000 (16:07 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9247:3
    #3 zone_maintenance lib/dns/zone.c:11047:4
    #4 zone_timer lib/dns/zone.c:14090:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9488:13
    #6 zone_maintenance lib/dns/zone.c:11047:4
    #7 zone_timer lib/dns/zone.c:14090:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 dns_db_getsoaserial lib/dns/db.c:780:11
    #6 dump_done lib/dns/zone.c:11428:15
    #7 dump_quantum lib/dns/masterdump.c:1487:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dump_done lib/dns/zone.c:11426:4
    #3 dump_quantum lib/dns/masterdump.c:1487:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit c9dbad97b2f96fcfba3290fe52f6b044af64d780)

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 05:23:13 +0000 (15:23 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11115:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11085:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8274:3
    #2 zone_maintenance lib/dns/zone.c:11052:4
    #3 zone_timer lib/dns/zone.c:14087:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8412:13
    #6 zone_maintenance lib/dns/zone.c:11052:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit 98025e15d0ea05bdac55fb4aa8e342bdf6febe1a)

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 04:18:17 +0000 (14:18 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M3 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 copy_non_dnssec_records lib/dns/zone.c:16031:11
    #6 receive_secure_db lib/dns/zone.c:16163:12
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 receive_secure_db lib/dns/zone.c:16160:16
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M3 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9244:3
    #3 zone_maintenance lib/dns/zone.c:11044:4
    #4 zone_timer lib/dns/zone.c:14087:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9485:13
    #6 zone_maintenance lib/dns/zone.c:11044:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M3 in thread T3:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 zone_get_from_db lib/dns/zone.c:5602:11
    #6 get_raw_serial lib/dns/zone.c:2520:12
    #7 zone_gotwritehandle lib/dns/zone.c:2559:4
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M3 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit e185e37137729c6e377e65d8744c49aef843046f)

5 years agoAddress lock-order-inversion between the keytable and the db locks.
Mark Andrews [Fri, 4 Sep 2020 02:50:42 +0000 (12:50 +1000)] 
Address lock-order-inversion between the keytable and the db locks.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_find lib/dns/keytable.c:522:2
    #3 sync_keyzone lib/dns/zone.c:4560:12
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 dns_rriterator_first lib/dns/rriterator.c:71:15
    #6 sync_keyzone lib/dns/zone.c:4543:16
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_find lib/dns/rbtdb.c:4029:2
    #3 dns_db_find lib/dns/db.c:500:11
    #4 addifmissing lib/dns/zone.c:4481:11
    #5 dns_keytable_forall lib/dns/keytable.c:786:4
    #6 sync_keyzone lib/dns/zone.c:4586:2
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_forall lib/dns/keytable.c:770:2
    #3 sync_keyzone lib/dns/zone.c:4586:2
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

(cherry picked from commit 9e5f83c4993310f9841a4eba90d4a84dba882727)

5 years agoMerge branch 'v9_11_23-release' into 'v9_11'
Michał Kępień [Wed, 16 Sep 2020 21:06:02 +0000 (21:06 +0000)] 
Merge branch 'v9_11_23-release' into 'v9_11'

Merge 9.11.23 release branch

See merge request isc-projects/bind9!4133

5 years agoSet up release notes for BIND 9.11.24
Michał Kępień [Wed, 16 Sep 2020 21:04:54 +0000 (23:04 +0200)] 
Set up release notes for BIND 9.11.24

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Wed, 16 Sep 2020 21:04:54 +0000 (23:04 +0200)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoMerge branch 'prep-release' into v9_11_23-release
Tinderbox User [Mon, 7 Sep 2020 09:08:26 +0000 (09:08 +0000)] 
Merge branch 'prep-release' into v9_11_23-release

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.11.23' into 'v9_11_23-release'
Michał Kępień [Fri, 4 Sep 2020 12:55:37 +0000 (12:55 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.11.23' into 'v9_11_23-release'

Prepare release notes for BIND 9.11.23

See merge request isc-private/bind9!210

5 years agoprep 9.11.23
Tinderbox User [Mon, 7 Sep 2020 09:06:42 +0000 (09:06 +0000)] 
prep 9.11.23

5 years agoPrepare release notes for BIND 9.11.23
Michał Kępień [Fri, 4 Sep 2020 12:48:50 +0000 (14:48 +0200)] 
Prepare release notes for BIND 9.11.23

5 years agoAdd release note for OSS-Fuzz fixes
Michał Kępień [Fri, 4 Sep 2020 12:48:50 +0000 (14:48 +0200)] 
Add release note for OSS-Fuzz fixes

5 years agoAdd release note for GL #2074
Michał Kępień [Fri, 4 Sep 2020 12:48:50 +0000 (14:48 +0200)] 
Add release note for GL #2074

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Fri, 4 Sep 2020 12:48:50 +0000 (14:48 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMiscellaneous formatting and wording tweaks
Michal Nowak [Fri, 4 Sep 2020 12:48:50 +0000 (14:48 +0200)] 
Miscellaneous formatting and wording tweaks

5 years agoMerge branch 'marka-tsan-unit-no-ignore-error-v9_11' into 'v9_11'
Mark Andrews [Wed, 16 Sep 2020 03:56:47 +0000 (03:56 +0000)] 
Merge branch 'marka-tsan-unit-no-ignore-error-v9_11' into 'v9_11'

tsan unit no ignore error v9_11

See merge request isc-projects/bind9!4128

5 years agoremove 'allow_failure: true' from unit tsan tests
Mark Andrews [Wed, 16 Sep 2020 03:29:00 +0000 (13:29 +1000)] 
remove 'allow_failure: true' from unit tsan tests

5 years agoMerge branch 'marka-unit-test-failure-rbt_test.c' into 'v9_11'
Mark Andrews [Tue, 15 Sep 2020 02:42:19 +0000 (02:42 +0000)] 
Merge branch 'marka-unit-test-failure-rbt_test.c' into 'v9_11'

The runtime of rbt_test can exceed 5 minutes when running under TSAN testing.

See merge request isc-projects/bind9!4117

5 years agoThe runtime of rbt_test can exceed 5 minutes when running under TSAN testing.
Mark Andrews [Mon, 14 Sep 2020 02:38:37 +0000 (12:38 +1000)] 
The runtime of rbt_test can exceed 5 minutes when running under TSAN testing.

Limit rbt_insert_and_remove subtest runtime to ~180 seconds which gives a total
runtime of ~270 seconds.

5 years agoMerge branch 'each-copyright-header-v9_11' into 'v9_11'
Evan Hunt [Tue, 15 Sep 2020 00:09:39 +0000 (00:09 +0000)] 
Merge branch 'each-copyright-header-v9_11' into 'v9_11'

copyright header typos

See merge request isc-projects/bind9!4121

5 years agoupdate all copyright headers to eliminate the typo
Evan Hunt [Tue, 15 Sep 2020 00:00:40 +0000 (17:00 -0700)] 
update all copyright headers to eliminate the typo

5 years agofix a typo in copyright headers, and change "http" to "https"
Evan Hunt [Mon, 14 Sep 2020 23:19:37 +0000 (16:19 -0700)] 
fix a typo in copyright headers, and change "http" to "https"

(cherry picked from commit 481a7aae44c95e07628df17e2a222ffa51a698b8)

5 years agoMerge branch '2119-the-runtime-system-tests-interfered-with-each-other-v9_11' into...
Mark Andrews [Thu, 10 Sep 2020 11:05:28 +0000 (11:05 +0000)] 
Merge branch '2119-the-runtime-system-tests-interfered-with-each-other-v9_11' into 'v9_11'

Resolve "The runtime system tests interfered with each other"

See merge request isc-projects/bind9!4111

5 years agoWait for test instance of named to exit before completing subtest.
Mark Andrews [Mon, 31 Aug 2020 03:54:12 +0000 (13:54 +1000)] 
Wait for test instance of named to exit before completing subtest.

(cherry picked from commit dda5b7b0b86ca3250bcc3e6a4e3f931fdd253561)

5 years agoDon't use production address (127.0.0.1) in runtime system test.
Mark Andrews [Mon, 31 Aug 2020 03:51:47 +0000 (13:51 +1000)] 
Don't use production address (127.0.0.1) in runtime system test.

(cherry picked from commit 1f147059386aa3f60206af715abc4fc278b68049)

5 years agoMerge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading...
Mark Andrews [Thu, 10 Sep 2020 09:57:58 +0000 (09:57 +0000)] 
Merge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading-v9_11' into 'v9_11'

Also wait for 'zone_dump: zone example/IN: enter'

See merge request isc-projects/bind9!4109

5 years agoAlso wait for 'zone_dump: zone example/IN: enter'
Mark Andrews [Mon, 31 Aug 2020 11:09:25 +0000 (21:09 +1000)] 
Also wait for 'zone_dump: zone example/IN: enter'

use nextpartpeek as we don't want to reset the starting point

(cherry picked from commit 7b65bea6d2563b3e5dca569d280d10ad63276dc7)

5 years agoMerge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull-v9_11' into...
Mark Andrews [Wed, 9 Sep 2020 22:20:23 +0000 (22:20 +0000)] 
Merge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull-v9_11' into 'v9_11'

Silence REVERSE_INULL warning (CID 306652)

See merge request isc-projects/bind9!4107

5 years agoSilence REVERSE_INULL warning (CID 306652)
Mark Andrews [Wed, 9 Sep 2020 00:40:14 +0000 (10:40 +1000)] 
Silence REVERSE_INULL warning (CID 306652)

(cherry picked from commit 584dbffab1fb855f3b41df32cc258cc5c7969369)

5 years agoMerge branch '2128-coverity-missing-lock-warning-9-11' into 'v9_11'
Mark Andrews [Wed, 9 Sep 2020 21:26:25 +0000 (21:26 +0000)] 
Merge branch '2128-coverity-missing-lock-warning-9-11' into 'v9_11'

Resolve "Coverity missing lock warning 9.11"

See merge request isc-projects/bind9!4095

5 years agoSilence Coverity missing lock warning.
Mark Andrews [Mon, 7 Sep 2020 04:51:06 +0000 (14:51 +1000)] 
Silence Coverity missing lock warning.

Lock access to 'done' during initialisation in manytasks().

5 years agoMerge branch 'marka-use-ns_g_server-recursionquota' into 'v9_11'
Mark Andrews [Wed, 9 Sep 2020 06:17:22 +0000 (06:17 +0000)] 
Merge branch 'marka-use-ns_g_server-recursionquota' into 'v9_11'

Use ns_g_server->recursionquota instead of client->recursionquota

See merge request isc-projects/bind9!4102

5 years agoUse ns_g_server->recursionquota instead of client->recursionquota
Mark Andrews [Wed, 9 Sep 2020 05:49:11 +0000 (15:49 +1000)] 
Use ns_g_server->recursionquota instead of client->recursionquota

as the later will be NULL on ISC_R_QUOTA.

*** CID 306732:  Null pointer dereferences  (FORWARD_NULL)
/bin/named/query.c: 4359 in query_recurse()
4353      static _Atomic(isc_stdtime_t) last = 0;
4354     #else
4355      static isc_stdtime_t last = 0;
4356     #endif
4357      isc_stdtime_t now;
4358      isc_stdtime_get(&now);
   CID 306732:  Null pointer dereferences  (FORWARD_NULL)
   Passing "client" to "log_quota", which dereferences null "client->recursionquota".
4359      log_quota(client, &last, now,
4360        "no more recursive clients (%d/%d/%d): %s",
4361        isc_result_totext(result));
4362      ns_client_killoldestquery(client);
4363      }
4364      if (result == ISC_R_SUCCESS && !client->mortal &&

** CID 306731:  Program hangs  (LOCK)
/lib/dns/resolver.c: 8943 in spillattimer_countdown()

5 years agoMerge branch 'marka-lock-should-be-unlock' into 'v9_11'
Mark Andrews [Wed, 9 Sep 2020 06:01:28 +0000 (06:01 +0000)] 
Merge branch 'marka-lock-should-be-unlock' into 'v9_11'

LOCK should be UNLOCK

See merge request isc-projects/bind9!4101

5 years agoLOCK should be UNLOCK
Mark Andrews [Wed, 9 Sep 2020 05:28:57 +0000 (15:28 +1000)] 
LOCK should be UNLOCK

*** CID 306731:  Program hangs  (LOCK)
/lib/dns/resolver.c: 8943 in spillattimer_countdown()
8937      result = isc_timer_reset(res->spillattimer,
8938       isc_timertype_inactive, NULL,
8939       NULL, true);
8940      RUNTIME_CHECK(result == ISC_R_SUCCESS);
8941      }
8942      count = res->spillat;
   CID 306731:  Program hangs  (LOCK)
   "pthread_mutex_lock" locks "res->spill_lock" while it is locked.
8943      LOCK(&res->spill_lock);
8944      UNLOCK(&res->lock);
8945      if (logit)
8946      isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
8947            DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
8948            "clients-per-query decreased to %u", count);

5 years agoMerge branch '2090-v9_11-dig-tsan-error' into 'v9_11'
Mark Andrews [Wed, 9 Sep 2020 03:38:41 +0000 (03:38 +0000)] 
Merge branch '2090-v9_11-dig-tsan-error' into 'v9_11'

Resolve "v9_11 dig tsan error"

See merge request isc-projects/bind9!3997

5 years agoUpdate 'init_count' atomically to silence tsan errors.
Mark Andrews [Mon, 7 Sep 2020 06:12:31 +0000 (16:12 +1000)] 
Update 'init_count' atomically to silence tsan errors.

5 years agoThe node lock was released too early.
Mark Andrews [Thu, 3 Sep 2020 02:53:53 +0000 (12:53 +1000)] 
The node lock was released too early.

NEGATIVE needs to be call with the node lock held.

WARNING: ThreadSanitizer: data race
  Write of size 2 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 mark_stale_header lib/dns/rbtdb.c:1802:21
    #1 add32 lib/dns/rbtdb.c:6559:5
    #2 addrdataset lib/dns/rbtdb.c:6975:12
    #3 dns_db_addrdataset lib/dns/db.c:783:10
    #4 cache_name lib/dns/resolver.c:5829:13
    #5 cache_message lib/dns/resolver.c:5926:14
    #6 resquery_response lib/dns/resolver.c:8618:12
    #7 dispatch lib/isc/task.c:1157:7
    #8 run lib/isc/task.c:1331:2

  Previous read of size 2 at 0x000000000001 by thread T2:
    #0 cache_findrdataset lib/dns/rbtdb.c:5932:6
    #1 dns_db_findrdataset lib/dns/db.c:739:10
    #2 query_addadditional2 bin/named/query.c:2196:11
    #3 additionaldata_ns lib/dns/./rdata/generic/ns_2.c:198:10
    #4 dns_rdata_additionaldata lib/dns/rdata.c:1246:2
    #5 dns_rdataset_additionaldata lib/dns/rdataset.c:629:12
    #6 query_addrdataset bin/named/query.c:2411:8
    #7 query_addrrset bin/named/query.c:2802:2
    #8 query_addbestns bin/named/query.c:3501:2
    #9 query_find bin/named/query.c:9165:4
    #10 query_resume bin/named/query.c:4164:12
    #11 dispatch lib/isc/task.c:1157:7
    #12 run lib/isc/task.c:1331:2

5 years agoTurn off TSAN for isc_log_wouldlog
Mark Andrews [Mon, 31 Aug 2020 12:41:46 +0000 (22:41 +1000)] 
Turn off TSAN for isc_log_wouldlog