Restore locking in resume_dslookup()

Commit 9da902a201 removed locking around
the fctx_decreference() call inside resume_dslookup().  This allows
fctx_unlink() to be called without the bucket lock being held, which
must never happen.  Ensure the bucket lock is held by resume_dslookup()
before it calls fctx_decreference().
This commit is contained in:
Michał Kępień
2019-07-23 11:43:46 +02:00
parent dd358e6a21
commit ca528766d6
+2
View File
@@ -7186,7 +7186,9 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
if (dns_rdataset_isassociated(&nameservers)) {
dns_rdataset_disassociate(&nameservers);
}
LOCK(&res->buckets[fctx->bucketnum].lock);
bucket_empty = fctx_decreference(fctx);
UNLOCK(&res->buckets[fctx->bucketnum].lock);
if (bucket_empty) {
empty_bucket(res);
}