]> git.ipfire.org Git - thirdparty/bind9.git/commit
Don't release the tree read lock in dereference_iter_node()
authorOndřej Surý <ondrej@isc.org>
Thu, 3 Nov 2022 12:28:33 +0000 (13:28 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 3 Nov 2022 14:07:44 +0000 (14:07 +0000)
commit96e7bf76e71f1d85b57874037d447a2649daa7c0
treefe2ee6336116c77e74196c00a8a4d343df64b871
parentcfe42dfb68afb0a660f0e957af71037efad5aa9e
Don't release the tree read lock in dereference_iter_node()

Previously, the tree read lock could be upgraded to a write lock in
decrement_reference() and then downgraded back to read lock in
dereference_iter_node().  When the use of isc_rwlock_downgrade() was
removed, the downgrade was changed to a simple unlock+lock. This allows
some delete operations to sneak in and delete nodes that the iterator
expects to be in place.

Expand decrement_reference() so the caller can indicate whether the
tree read lock should be upgraded, and disallow the upgrade when
calling from dereference_iter_node(), so there will be no need to
release the lock afterward.
lib/dns/rbtdb.c