]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix non-atomic read-modify-write on entry->srtt in adjustsrtt()
authorOndřej Surý <ondrej@isc.org>
Thu, 19 Mar 2026 03:17:45 +0000 (04:17 +0100)
committerOndřej Surý (GitLab job 7061058) <ondrej@isc.org>
Fri, 20 Mar 2026 01:06:56 +0000 (01:06 +0000)
commitfb8a9e73ccd51e503f5446f188db36f6b2e3cd2f
treea6c00baea7aec8c6525b2c375b54422bd6006c59
parentbe7b811fffcae12c75390fb5e482f383f3e84c2e
Fix non-atomic read-modify-write on entry->srtt in adjustsrtt()

The SRTT update loaded the old value, computed a new one, and stored it
back as separate operations.  Two concurrent callers could each read the
same old value and one update would be silently lost.

Use a CAS loop for the read-modify-write on entry->srtt.  For the aging
path, also CAS on entry->lastage to prevent multiple threads from aging
the same entry in the same second.

(cherry picked from commit 4d15494b943eeb246115d9de891a3e5da3a56df5)
lib/dns/adb.c