]> git.ipfire.org Git - thirdparty/bind9.git/commit
Hold qid->lock when calling deref_portentry() as
authorMark Andrews <marka@isc.org>
Thu, 22 Oct 2020 05:13:06 +0000 (16:13 +1100)
committerMark Andrews <marka@isc.org>
Fri, 23 Oct 2020 20:14:47 +0000 (07:14 +1100)
commit2a5d2c55aa8a051aac758002238e4a67f89ad881
tree14d8ed10fe388086c87fb438a88b908f7d997dca
parent0a5ab3240095033d3e322a83bd9f75ad28078626
Hold qid->lock when calling deref_portentry() as

socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>

(cherry picked from commit 5c253c416d0bc0cce7606667c6703f44a98e9494)
lib/dns/dispatch.c