]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix data race in offloaded dns_message_checksig()
authorAram Sargsyan <aram@isc.org>
Wed, 11 Sep 2024 15:58:11 +0000 (15:58 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 12 Sep 2024 09:12:35 +0000 (09:12 +0000)
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

index c00d54bffd9d49e31ce73c70082677907ea3e210..7c642553fd35e87b12e1d3726d3e510704031b23 100644 (file)
@@ -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);