]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add rcu_barrier() to isc__log_shutdown()
authorOndřej Surý <ondrej@isc.org>
Thu, 24 Jul 2025 09:02:15 +0000 (11:02 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 4 Aug 2025 09:29:54 +0000 (11:29 +0200)
There is a data race when QP is reclaiming chunks on the call_rcu
threads and it tries to log the number of reclaimed chunks while the
server is shuttingdown.  Workaround this by adding rcu_barrier() before
shuttingdown the global log context.

lib/isc/log.c

index d46054f4344932f453ec59b35e24a6bc34c40f07..512e72470427859cb134a6654ba70ba83d9fc98e 100644 (file)
@@ -1573,6 +1573,14 @@ isc__log_initialize(void) {
 
 void
 isc__log_shutdown(void) {
+       /*
+        * There is a data race when the QP database reclaims chunks on the
+        * call_rcu threads and tries to log the number of reclaimed chunks
+        * while the server is shutting down.  Work around this by adding
+        * an rcu_barrier() before shutting down the global logging context.
+        */
+       rcu_barrier();
+
        REQUIRE(VALID_CONTEXT(isc__lctx));
 
        isc_mem_t *mctx = isc__lctx->mctx;