]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Fix data race in glue cache RCU pointer publication
authorOndřej Surý <ondrej@isc.org>
Thu, 19 Mar 2026 18:04:09 +0000 (19:04 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 19 Mar 2026 18:04:09 +0000 (19:04 +0100)
The liburcu rcu_cmpxchg_pointer() uses relaxed ordering on the CAS
failure path. When two threads race to publish a new pointer and one
loses the CAS, the returned pointer has no acquire semantics - reading
fields through it is a data race on weakly-ordered architectures.

Override rcu_cmpxchg_pointer() and rcu_xchg_pointer() to use
acquire/release ordering via standard __atomic builtins, which also
makes the operations natively visible to ThreadSanitizer.

Closes #5182

Merge branch '5182-fix-false-tsan-report-in-addglue' into 'main'

See merge request isc-projects/bind9!11719


Trivial merge