Commit Graph
28867 Commits
Author SHA1 Message Date
Mark Andrews d9a2cccc97 Lock on msg == SELECT_POKE_CLOSE as it triggers a tsan error
WARNING: ThreadSanitizer: data race (pid=1941)
  Write of size 4 at 0x7ba40000f050 by main thread (mutexes: write M1100, write M75):
    #0 socket_create /builds/isc-projects/bind9/1126G:3009:29 (libisc.so.1105+0x60822)
    #1 isc__socket_create /builds/isc-projects/bind9/lib/isc/unix/socket.c:3043:10 (libisc.so.1105+0x60583)
    #2 isc_socket_create /builds/isc-projects/bind9/lib/isc/unix/./../socket_api.c:105:11 (libisc.so.1105+0x6a4a0)
    #3 open_socket /builds/isc-projects/bind9/lib/dns/dispatch.c:1708:12 (libdns.so.1110+0x7491c)
    #4 get_udpsocket /builds/isc-projects/bind9/lib/dns/dispatch.c:2904:13 (libdns.so.1110+0x745ec)
    #5 dispatch_createudp /builds/isc-projects/bind9/lib/dns/dispatch.c:2994:12 (libdns.so.1110+0x6e159)
    #6 dns_dispatch_getudp_dup /builds/isc-projects/bind9/lib/dns/dispatch.c:2823:11 (libdns.so.1110+0x6d8f2)
    #7 dns_dispatch_getudp /builds/isc-projects/bind9/lib/dns/dispatch.c:2849:10 (libdns.so.1110+0x6e99e)
    #8 make_dispatchset /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:81:11 (dispatch_test+0x4ba8fc)
    #9 dispatchset_create /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:115:11 (dispatch_test+0x4b9f99)
    #10 <null> <null> (libcmocka.so.0+0x50d8)
    #11 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

  Previous write of size 4 at 0x7ba40000f050 by thread T14:
    #0 wakeup_socket /builds/isc-projects/bind9/lib/isc/unix/socket.c:1126:24 (libisc.so.1105+0x70181)
    #1 process_ctlfd /builds/isc-projects/bind9/lib/isc/unix/socket.c:4252:3 (libisc.so.1105+0x6c048)
    #2 process_fds /builds/isc-projects/bind9/lib/isc/unix/socket.c:4156:10 (libisc.so.1105+0x6bcb4)
    #3 watcher /builds/isc-projects/bind9/lib/isc/unix/socket.c:4395:10 (libisc.so.1105+0x64188)

  Location is heap block of size 16385 at 0x7ba40000f000 allocated by main thread:
    #0 malloc <null> (dispatch_test+0x42b7c4)
    #1 internal_memalloc /builds/isc-projects/bind9/lib/isc/mem.c:887:8 (libisc.so.1105+0x37e38)
    #2 mem_get /builds/isc-projects/bind9/lib/isc/mem.c:792:8 (libisc.so.1105+0x32c2c)
    #3 isc___mem_get /builds/isc-projects/bind9/lib/isc/mem.c:1310:9 (libisc.so.1105+0x325d7)
    #4 isc__mem_get /builds/isc-projects/bind9/lib/isc/mem.c:3012:11 (libisc.so.1105+0x34f80)
    #5 isc__socketmgr_create2 /builds/isc-projects/bind9/lib/isc/unix/socket.c:4697:21 (libisc.so.1105+0x6374f)
    #6 isc__socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/socket.c:4651:10 (libisc.so.1105+0x635f2)
    #7 isc_socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/./../socket_api.c:74:11 (libisc.so.1105+0x6a2c7)
    #8 create_managers /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:120:2 (dispatch_test+0x4bb28a)
    #9 dns_test_begin /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:192:3 (dispatch_test+0x4bb182)
    #10 _setup /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:53:11 (dispatch_test+0x4b9ff8)
    #11 <null> <null> (libcmocka.so.0+0x51e2)
    #12 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

  Mutex M1100 (0x7b5000000230) created at:
    #0 pthread_mutex_init <null> (dispatch_test+0x42e60d)
    #1 isc__mutex_init /builds/isc-projects/bind9/lib/isc/pthreads/mutex.c:287:8 (libisc.so.1105+0x72317)
    #2 dns_dispatchmgr_create /builds/isc-projects/bind9/lib/dns/dispatch.c:1778:11 (libdns.so.1110+0x6a055)
    #3 make_dispatchset /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:75:11 (dispatch_test+0x4ba883)
    #4 dispatchset_create /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:115:11 (dispatch_test+0x4b9f99)
    #5 <null> <null> (libcmocka.so.0+0x50d8)
    #6 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

  Mutex M75 (0x7bb800000320) created at:
    #0 pthread_mutex_init <null> (dispatch_test+0x42e60d)
    #1 isc__mutex_init /builds/isc-projects/bind9/lib/isc/pthreads/mutex.c:287:8 (libisc.so.1105+0x72317)
    #2 isc__socketmgr_create2 /builds/isc-projects/bind9/lib/isc/unix/socket.c:4728:12 (libisc.so.1105+0x63914)
    #3 isc__socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/socket.c:4651:10 (libisc.so.1105+0x635f2)
    #4 isc_socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/./../socket_api.c:74:11 (libisc.so.1105+0x6a2c7)
    #5 create_managers /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:120:2 (dispatch_test+0x4bb28a)
    #6 dns_test_begin /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:192:3 (dispatch_test+0x4bb182)
    #7 _setup /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:53:11 (dispatch_test+0x4b9ff8)
    #8 <null> <null> (libcmocka.so.0+0x51e2)
    #9 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

  Thread T14 'isc-socket' (tid=1969, running) created by main thread at:
    #0 pthread_create <null> (dispatch_test+0x42d08b)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1105+0x72488)
    #2 isc__socketmgr_create2 /builds/isc-projects/bind9/lib/isc/unix/socket.c:4787:6 (libisc.so.1105+0x63cc6)
    #3 isc__socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/socket.c:4651:10 (libisc.so.1105+0x635f2)
    #4 isc_socketmgr_create /builds/isc-projects/bind9/lib/isc/unix/./../socket_api.c:74:11 (libisc.so.1105+0x6a2c7)
    #5 create_managers /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:120:2 (dispatch_test+0x4bb28a)
    #6 dns_test_begin /builds/isc-projects/bind9/lib/dns/tests/dnstest.c:192:3 (dispatch_test+0x4bb182)
    #7 _setup /builds/isc-projects/bind9/lib/dns/tests/dispatch_test.c:53:11 (dispatch_test+0x4b9ff8)
    #8 <null> <null> (libcmocka.so.0+0x51e2)
    #9 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

SUMMARY: ThreadSanitizer: data race /builds/isc-projects/bind9/lib/isc/unix/socket.c:3009:29 in socket_create
2020-09-02 03:07:03 +00:00
Mark Andrews 54e35ae174 Destroy the mutex 2020-09-02 03:07:03 +00:00
Mark Andrews 338aea8447 Lock 'responses' before reading it
WARNING: ThreadSanitizer: data race
  Read of size 4 at 0x000000000001 by main thread:
    #0 dispatch_getnext lib/dns/tests/dispatch_test.c:327
    #1 <null> <null>
    #2 __libc_start_main ../csu/libc-start.c:308

  Previous write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 response lib/dns/tests/dispatch_test.c:234
    #1 dispatch lib/isc/task.c:1157
    #2 run lib/isc/task.c:1331
    #3 <null> <null>

  Location is global 'responses' of size 4 at 0x000000000001

  Mutex M1 (0x000000000009) created at:
    #0 pthread_mutex_init <null>
    #1 isc__mutex_init lib/isc/pthreads/mutex.c:287
    #2 dispatch_getnext lib/dns/tests/dispatch_test.c:273
    #3 <null> <null>
    #4 __libc_start_main ../csu/libc-start.c:308

  Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:60
    #2 isc__taskmgr_create lib/isc/task.c:1468
    #3 isc_taskmgr_create lib/isc/task.c:2109
    #4 create_managers lib/dns/tests/dnstest.c:118
    #5 dns_test_begin lib/dns/tests/dnstest.c:192
    #6 _setup lib/dns/tests/dispatch_test.c:53
    #7 <null> <null>
    #8 __libc_start_main ../csu/libc-start.c:308

SUMMARY: ThreadSanitizer: data race lib/dns/tests/dispatch_test.c:327 in dispatch_getnext
2020-09-02 03:07:03 +00:00
Mark Andrews d8de7340ab Merge branch '2081-data-race-in-zonemgr_test-v9_11' into 'v9_11'
Resolve "data race in zonemgr_test"

See merge request isc-projects/bind9!4057
2020-09-02 02:30:52 +00:00
Mark Andrews 5c73320075 Add CHANGES note
(cherry picked from commit ca1b0f1539)
2020-09-02 11:47:58 +10:00
Mark Andrews a7da8f84ca isc_ratelimiter needs to hold a reference to its task
to prevent the task subsystem shutting down before the
ratelimiter is freed.

(cherry picked from commit b8e4b6d303)
2020-09-02 11:47:37 +10:00
Mark Andrews 1446e11985 Merge branch '2085-9-11-socket_test-tsan-errors' into 'v9_11'
Resolve "9.11 socket_test tsan errors"

See merge request isc-projects/bind9!3993
2020-09-02 01:01:30 +00:00
Mark Andrews 310004d8ac Add locking to socket_test to silence tsan reports.
There where data races accessing completion.
2020-09-02 00:25:56 +00:00
Mark Andrews 28185bdcf3 Merge branch '2049-cleanup-sock-v9_11' into 'v9_11'
remove unused variable sock

See merge request isc-projects/bind9!4053
2020-09-01 23:36:22 +00:00
Mark Andrews c9f7d7c05f remove unused variable sock
(cherry picked from commit b1c424ddf3)
2020-09-02 09:00:22 +10:00
Mark Andrews 8f28b38979 Merge branch '2086-v9_11-timer_test-tsan-errors' into 'v9_11'
Resolve "v9_11 timer_test tsan errors"

See merge request isc-projects/bind9!3994
2020-09-01 22:51:53 +00:00
Mark Andrews 8094b821b3 Lock access to 'eventcnt' in timer_test.
There was a data race accessing 'eventcnt'.
2020-09-01 22:15:23 +00:00
Mark Andrews 41b23de45a Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering-v9_11' into 'v9_11'
Use memory_order_acq_rel in isc_refcount_decrement.

See merge request isc-projects/bind9!4049
2020-09-01 13:40:07 +00:00
Mark Andrews 30013c3794 Use memory_order_acq_rel in isc_refcount_decrement.
While

if (isc_refcount_decrement() == 1) {	// memory_order_release
	isc_refcount_destroy();		// memory_order_acquire
	...
}

is theoretically the most efficent in practice, using
memory_order_acq_rel produces the same code on x86_64 and doesn't
trigger tsan data races (which use a idealistic model) if
isc_refcount_destroy() is not called immediately.  In fact
isc_refcount_destroy() could be removed if we didn't want
to check for the count being 0 when isc_refcount_destroy() is
called.

https://stackoverflow.com/questions/49112732/memory-order-in-shared-pointer-destructor
(cherry picked from commit 6278899a38)
2020-09-01 22:31:52 +10:00
Ondřej Surý 2e47802198 Merge branch '2037-deferred-system-test-v9_11' into 'v9_11'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used [TEST] [v9.11]

See merge request isc-projects/bind9!4041
2020-08-31 10:38:39 +00:00
Ondřej SurýandOndřej Surý a40151fe76 Add PoC system test for pk11_numbits() assertion
(cherry picked from commit a69433ba40)
2020-08-31 11:49:36 +02:00
Ondřej Surý 78ceb907fc Merge branch '2028-deferred-system-test-v9_11' into 'v9_11'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries [TEST] [v9.11]

See merge request isc-projects/bind9!4036
2020-08-31 07:30:05 +00:00
Mark AndrewsandOndřej Surý 78d0355f30 check that a malformed truncated response to a TSIG query is handled
(cherry picked from commit 8bbf3eb5f3)
2020-08-31 08:35:10 +02:00
Mark Andrews 76b1c600d3 Merge branch '2097-manual-page-tools-need-updating-v9_11' into 'v9_11'
[v9_11] Fix generated documentation

See merge request isc-projects/bind9!4026
2020-08-27 01:12:03 +00:00
Michal NowakandMark Andrews 88bab74ce9 Fix generated documentation
Regenerated documentation.
2020-08-26 22:17:26 +00:00
Ondřej Surý c910d13f2e Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields-v9_11' into 'v9_11'
Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

See merge request isc-projects/bind9!4025
2020-08-26 20:31:27 +00:00
Mark AndrewsandOndřej Surý e95fdfba09 Add CHANGES note
(cherry picked from commit d9594cffab)
2020-08-26 17:26:56 +02:00
Mark AndrewsandOndřej Surý f2335d1faa Refactor totext_loc
(cherry picked from commit 2ca4d35037)
2020-08-26 17:26:56 +02:00
Mark AndrewsandOndřej Surý 19b95a5f37 Correctly encode LOC records with non integer negative altitudes.
(cherry picked from commit 337cc878fa)
2020-08-26 17:26:56 +02:00
Mark AndrewsandOndřej Surý 8a499c1fc6 Check LOC's altitude field is properly parsed and encoded.
(cherry picked from commit 888dfd78c7)
2020-08-26 17:26:56 +02:00
Mark AndrewsandOndřej Surý b2d67a28ac Tighten LOC parsing to reject period and/or m as a value.
(cherry picked from commit 9225c67835)
2020-08-26 17:26:56 +02:00
Mark AndrewsandOndřej Surý 2a6d6a7896 Synchronize {to,from}text_loc formatting with 9.16 2020-08-26 17:26:41 +02:00
Michał Kępień 90eb693b7c Merge branch 'michal/set-up-release-notes-for-bind-9.11.23' into 'v9_11'
Set up release notes for BIND 9.11.23

See merge request isc-projects/bind9!4021
2020-08-26 13:50:03 +00:00
Michał Kępień 9f355db252 Set up release notes for BIND 9.11.23 2020-08-26 15:46:02 +02:00
Michal Nowak 821ca188f4 Merge branch 'mnowak/tumbleweed-fix-krb5-config-location-v9_11' into 'v9_11'
[v9_11] Tumbleweed changed location of krb5-config

See merge request isc-projects/bind9!4019
2020-08-26 09:08:04 +00:00
Michal Nowak 6dac1faca4 Tumbleweed changed location of krb5-config
krb5-config is now in /usr/bin/ and we should detect it automatically.

(cherry picked from commit 6095811461)
(cherry picked from commit 9a305e0d47)
2020-08-26 11:02:52 +02:00
Ondřej Surý 0954b2e0ee Merge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour-v9_11' into 'v9_11'
Cast the original rcode to (dns_ttl_t) when setting extended rcode

See merge request isc-projects/bind9!4015
2020-08-25 19:01:12 +00:00
Mark AndrewsandOndřej Surý b114651445 Cast the original rcode to (dns_ttl_t) when setting extended rcode
Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in

(cherry picked from commit a347641782)
2020-08-25 16:41:08 +02:00
Michal Nowak 19d4f62b03 Merge branch '2053-test-disable-buffer-useinline-in-gitlab-ci-v9_11' into 'v9_11'
[v9_11] Resolve "Test --disable-buffer-useinline in GitLab CI"

See merge request isc-projects/bind9!4013
2020-08-25 14:28:26 +00:00
Michal Nowak 2e2c3720da Build CentOS 8 with --enable-buffer-useinline
(cherry picked from commit f34df4ef90)
2020-08-25 16:14:00 +02:00
Michal Nowak 966eb72f5b Fix warnings in when build with --enable-buffer-useinline
sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness

(cherry picked from commit dd425254a7)
2020-08-25 16:13:54 +02:00
Michal Nowak 9ba15f21f0 Merge branch 'mnowak/update_BIND_BASELINE_VERSION_to_v9_11_22' into 'v9_11'
Update BIND_BASELINE_VERSION to v9_11_22

See merge request isc-projects/bind9!4001
2020-08-21 09:37:11 +00:00
Michal Nowak a28d3aba3a Update BIND_BASELINE_VERSION to v9_11_22 2020-08-21 11:29:58 +02:00
Evan Hunt 15d57a425e Merge tag 'v9_11_22' into v9_11
BIND 9.11.22
2020-08-20 12:10:47 -07:00
Ondřej Surý 2c6693c73f Merge branch 'marka-fuzz-consolidated-v9_16-v9_11' into 'v9_11'
Consolidated fuzz fixes (v9.11)

See merge request isc-projects/bind9!3979
2020-08-18 10:31:07 +00:00
Mark AndrewsandOndřej Surý 4236972de4 A6: return FORMERR in fromwire if bits are non zero.
oss_fuzz: Issue 24864: bind9:dns_rdata_fromwire_text_fuzzer: Overwrites-const-input in dns_rdata_fromwire_text_fuzzer

(cherry picked from commit 8452404bd7)
(cherry picked from commit d8a57d32b1)
2020-08-18 11:36:06 +02:00
Mark AndrewsandOndřej Surý 80bc4fc1ea RRSIG: reject records with empty SIG section
(cherry picked from commit f6d7b8c20d)
(cherry picked from commit 6b1675a62c)
2020-08-18 11:33:32 +02:00
Michal Nowak 3a057967c5 Merge branch 'mnowak/add-missing-only-schedules-v9_11' into 'v9_11'
[v9_11] Add missing 'only:schedules' to tarball-create job

See merge request isc-projects/bind9!3977
2020-08-18 09:28:52 +00:00
Michal Nowak b3c80fafe0 Add missing 'only:schedules' to tarball-create job
Missing 'only:schedules' prevents schedule jobs to run.
Regressed in 2b5007ef1a.
2020-08-18 11:21:32 +02:00
Michal Nowak 365575b5cb Merge branch 'mnowak/gcovr-v9_11' into 'v9_11'
[v9_11] Report coverage with gcovr

See merge request isc-projects/bind9!3974
2020-08-17 15:30:34 +00:00
Michal Nowak 5a6e2bc26e Report coverage with gcovr 2020-08-17 17:09:16 +02:00
Michal Nowak 0b1025912b Merge branch 'mnowak/broaden-abi-check-scope-v9_11' into 'v9_11'
[v9_11] Broaden scope of abi-check

See merge request isc-projects/bind9!3972
2020-08-17 13:17:37 +00:00
Michal Nowak f9cb545cce Broaden scope of abi-check
For abi-check we should use as broad 'configure' options as possible.

(cherry picked from commit 8e43f5e860)
2020-08-17 15:15:04 +02:00
Mark Andrews a0d1680ae0 Merge branch 'marka-fuzz-fixes-v9_11' into 'v9_11'
Marka fuzz fixes v9 11

See merge request isc-projects/bind9!3958
2020-08-13 15:11:46 +00:00
Mark Andrews a0ec8cfc93 Add CHANGES note
(cherry picked from commit 80d69ba04c)
2020-08-14 00:30:09 +10:00