From: Aram Sargsyan Date: Wed, 11 Sep 2024 15:58:11 +0000 (+0000) Subject: Fix data race in offloaded dns_message_checksig() X-Git-Tag: v9.21.2~42^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35ef25e5ea442eb0cb3731b1f2a0546394a2e97a;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/dns/message.c b/lib/dns/message.c index 6f1938a3373..6565cbf09d0 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);