Fix data race on fctx->vresult in validated()

Move the write to fctx->vresult after LOCK(&fctx->lock).  The field was
being set before acquiring the lock, but dns_resolver_logfetch() reads
it under the same lock from another thread.

(cherry picked from commit a2bd833909)
This commit is contained in:
Ondřej Surý 2026-03-19 03:42:08 +01:00
parent 31cbfc9fb3
commit 993002cebf

View file

@ -5335,9 +5335,9 @@ validated(void *arg) {
addrinfo = valarg->addrinfo;
message = val->message;
fctx->vresult = val->result;
LOCK(&fctx->lock);
fctx->vresult = val->result;
ISC_LIST_UNLINK(fctx->validators, val, link);
fctx->validator = NULL;
UNLOCK(&fctx->lock);