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 committed by Ondřej Surý
parent 2dd5b2b90e
commit 1a5f560387
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41

View file

@ -5662,6 +5662,7 @@ validated(isc_task_t *task, isc_event_t *event) {
bucketnum = fctx->bucketnum;
LOCK(&res->buckets[bucketnum].lock);
fctx->vresult = vevent->result;
ISC_LIST_UNLINK(fctx->validators, vevent->validator, link);
fctx->validator = NULL;
UNLOCK(&res->buckets[bucketnum].lock);