From 1a5f560387003a5c017eb063a21424a38377f754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 19 Mar 2026 03:42:08 +0100 Subject: [PATCH] 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 a2bd8339095c99b4f0faea0f1bc39128c048c3aa) --- lib/dns/resolver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 1bacec6470..b436119613 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -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);