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.
This commit is contained in:
Ondřej Surý 2026-03-19 03:42:08 +01:00
parent ea408e3c3d
commit a2bd833909

View file

@ -5626,7 +5626,6 @@ validated(void *arg) {
addrinfo = valarg->addrinfo;
message = val->message;
fctx->vresult = val->result;
FCTXTRACE("received validation completion event");
@ -5634,6 +5633,8 @@ validated(void *arg) {
LOCK(&fctx->lock);
fctx->vresult = val->result;
ISC_LIST_UNLINK(fctx->validators, val, link);
if (SHUTTINGDOWN(fctx)) {