]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Fix a date race in qpcache_addrdataset()
authorArаm Sаrgsyаn <aram@isc.org>
Wed, 23 Apr 2025 13:42:10 +0000 (13:42 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Wed, 23 Apr 2025 13:42:10 +0000 (13:42 +0000)
The 'qpnode->nsec' structure member isn't protected by a lock and
there's a data race between the reading and writing parts in the
qpcache_addrdataset() function. Use a node read lock for accessing
'qpnode->nsec' in qpcache_addrdataset(). Add an additional
'qpnode->nsec != DNS_DB_NSEC_HAS_NSEC' check under a write lock
to be sure that no other competing thread changed it in the time
when the read lock is unlocked and a write lock is not acquired
yet.

Closes #5285

Merge branch '5285-data-race-in-qpcache_addrdataset' into 'main'

See merge request isc-projects/bind9!10397


Trivial merge