From 65fced42b96ef2617057a15c6ded3060be99678a Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Wed, 11 Sep 2024 15:58:11 +0000 Subject: [PATCH] Fix data race in offloaded dns_message_checksig() When verifying a message in an offloaded thread there is a race with the worker thread which writes to the same buffer. Clone the message buffer before offloading. (cherry picked from commit 35ef25e5ea442eb0cb3731b1f2a0546394a2e97a) --- lib/dns/message.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/message.c b/lib/dns/message.c index c00d54bffd..7c642553fd 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -3254,6 +3254,7 @@ dns_message_checksig_async(dns_message_t *msg, dns_view_t *view, dns_message_attach(msg, &chsigctx->msg); dns_view_attach(view, &chsigctx->view); + dns_message_clonebuffer(msg); isc_work_enqueue(loop, checksig_run, checksig_cb, chsigctx); return (DNS_R_WAIT);