]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not update find.result_v4 and find.result_v6
authorMark Andrews <marka@isc.org>
Tue, 18 Jun 2024 06:22:31 +0000 (16:22 +1000)
committerMark Andrews <marka@isc.org>
Wed, 31 Jul 2024 05:52:18 +0000 (05:52 +0000)
These values are supposed to be static for the life of the find and
clean_finds_at_name was updating them resulting in TSAN error
reports.

    WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
      #0 clean_finds_at_name lib/dns/adb.c:1537
      #1 fetch_callback lib/dns/adb.c:4009
      #2 task_run lib/isc/task.c:815
      #3 isc_task_run lib/isc/task.c:896
      #4 isc__nm_async_task netmgr/netmgr.c:848
      #5 process_netievent netmgr/netmgr.c:920
      #6 process_queue netmgr/netmgr.c:1013
      #7 process_all_queues netmgr/netmgr.c:767
      #8 async_cb netmgr/netmgr.c:796
      #9 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163
      #10 isc__trampoline_run lib/isc/trampoline.c:189

    Previous read of size 4 at 0x000000000001 by thread T2:
      #0 findname lib/dns/resolver.c:3749
      #1 fctx_getaddresses lib/dns/resolver.c:3993
      #2 fctx_try lib/dns/resolver.c:4390
      #3 rctx_nextserver lib/dns/resolver.c:10356
      #4 rctx_done lib/dns/resolver.c:10503
      #5 resquery_response lib/dns/resolver.c:8511
      #6 udp_recv lib/dns/dispatch.c:638
      #7 isc__nm_async_readcb netmgr/netmgr.c:2885
      #8 isc__nm_readcb netmgr/netmgr.c:2858
      #9 udp_recv_cb netmgr/udp.c:650
      #10 isc__nm_udp_read_cb netmgr/udp.c:1057
      #11 uv__udp_recvmsg /usr/src/libuv-v1.44.1/src/unix/udp.c:303
      #12 isc__trampoline_run lib/isc/trampoline.c:189

(cherry picked from commit 53a5f50e9d12a333e58ddcfeb0d283e0bfa9c985)

lib/dns/adb.c

index 72390f2571ce91b009919e086b1ed36d8dfd540c..7c40568e13c9d60379cde3513aa3290c6e9ca6c1 100644 (file)
@@ -1563,8 +1563,6 @@ clean_finds_at_name(dns_adbname_t *name, isc_eventtype_t evtype,
                        ev = &find->event;
                        task = ev->ev_sender;
                        ev->ev_sender = find;
-                       find->result_v4 = find_err_map[name->fetch_err];
-                       find->result_v6 = find_err_map[name->fetch6_err];
                        ev->ev_type = evtype;
                        ev->ev_destroy = event_free;
                        ev->ev_destroy_arg = find;
@@ -3369,8 +3367,6 @@ cleanup:
                ev->ev_type = DNS_EVENT_ADBCANCELED;
                ev->ev_destroy = event_free;
                ev->ev_destroy_arg = find;
-               find->result_v4 = ISC_R_CANCELED;
-               find->result_v6 = ISC_R_CANCELED;
 
                DP(DEF_LEVEL, "sending event %p to task %p for find %p", ev,
                   task, find);