]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix a date race in qpcache_addrdataset()
authorAram Sargsyan <aram@isc.org>
Wed, 16 Apr 2025 09:10:47 +0000 (09:10 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 23 Apr 2025 13:02:43 +0000 (13:02 +0000)
commite1a415b412e11bee4c22371a6ffa9ca9ec2c1430
tree7e50dcd2d9944eb97709fa7d6bdf36ea63eabafb
parent58a0e6cc6140740ef0023c5da0a9b002dfc413de
Fix a date race in qpcache_addrdataset()

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.
lib/dns/qpcache.c