]> 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:08:35 +0000 (09:08 +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.

lib/dns/message.c

index 6f1938a3373fd9030317fcb3a67f7d38cf498489..6565cbf09d01adf22509a0fd87466101f6a9a132 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);