mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fix a data race in dns_zone_getxfrintime()
The dns_zone_getxfrintime() function fails to lock the zone before
accessing its 'xfrintime' structure member, which can cause a data
race between soa_query() and the statistics channel. Add the missing
locking/unlocking pair, like it's done in numerous other similar
functions.
(cherry picked from commit ab07803465)
This commit is contained in:
parent
47a77a3b12
commit
407aba8840
2 changed files with 9 additions and 3 deletions
|
|
@ -1555,7 +1555,7 @@ dns_zone_getprimaryaddr(dns_zone_t *zone);
|
|||
*/
|
||||
|
||||
isc_time_t
|
||||
dns_zone_getxfrintime(const dns_zone_t *zone);
|
||||
dns_zone_getxfrintime(dns_zone_t *zone);
|
||||
/*%<
|
||||
* Get the start time of the zone's latest major step before an incoming zone
|
||||
* transfer is initiated. The time is set to the current time before the
|
||||
|
|
|
|||
|
|
@ -18199,10 +18199,16 @@ dns_zone_getprimaryaddr(dns_zone_t *zone) {
|
|||
}
|
||||
|
||||
isc_time_t
|
||||
dns_zone_getxfrintime(const dns_zone_t *zone) {
|
||||
dns_zone_getxfrintime(dns_zone_t *zone) {
|
||||
isc_time_t xfrintime;
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
return (zone->xfrintime);
|
||||
LOCK_ZONE(zone);
|
||||
xfrintime = zone->xfrintime;
|
||||
UNLOCK_ZONE(zone);
|
||||
|
||||
return (xfrintime);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue