From 993002cebf2d8150c212f6a6d9274aeecade9594 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index d114180401..ca0c62cbbe 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -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);