From: Mark Andrews Date: Fri, 22 Nov 2019 00:55:47 +0000 (+1100) Subject: lock disp->mgr before reading disp->mgr->buffers X-Git-Tag: v9.15.7~70^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afc7389ce8fb0fd5a360cb9a48b4db874aa230e2;p=thirdparty%2Fbind9.git lock disp->mgr before reading disp->mgr->buffers --- diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 4a77b7fe457..6cd2fd7fe35 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -1045,9 +1045,11 @@ udp_recv(isc_event_t *ev_in, dns_dispatch_t *disp, dispsocket_t *dispsock) { mgr = disp->mgr; qid = mgr->qid; + LOCK(&disp->mgr->buffer_lock); dispatch_log(disp, LVL(90), "got packet: requests %d, buffers %d, recvs %d", disp->requests, disp->mgr->buffers, disp->recv_pending); + UNLOCK(&disp->mgr->buffer_lock); if (dispsock == NULL && ev->ev_type == ISC_SOCKEVENT_RECVDONE) { /*