mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
fix bad-cache assert
3346. [security] Bad-cache data could be used before it was initialized, causing an assert. [RT #30025]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
3346. [security] Bad-cache data could be used before it was
|
||||||
|
initialized, causing an assert. [RT #30025]
|
||||||
|
|
||||||
3345. [bug] Addressed race condition when removing the last item
|
3345. [bug] Addressed race condition when removing the last item
|
||||||
or inserting the first item in an ISC_QUEUE.
|
or inserting the first item in an ISC_QUEUE.
|
||||||
[RT #29539]
|
[RT #29539]
|
||||||
|
@@ -8452,6 +8452,7 @@ dns_resolver_addbadcache(dns_resolver_t *resolver, dns_name_t *name,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
bad->type = type;
|
bad->type = type;
|
||||||
bad->hashval = hashval;
|
bad->hashval = hashval;
|
||||||
|
bad->expire = *expire;
|
||||||
isc_buffer_init(&buffer, bad + 1, name->length);
|
isc_buffer_init(&buffer, bad + 1, name->length);
|
||||||
dns_name_init(&bad->name, NULL);
|
dns_name_init(&bad->name, NULL);
|
||||||
dns_name_copy(name, &bad->name, &buffer);
|
dns_name_copy(name, &bad->name, &buffer);
|
||||||
@@ -8463,8 +8464,8 @@ dns_resolver_addbadcache(dns_resolver_t *resolver, dns_name_t *name,
|
|||||||
if (resolver->badcount < resolver->badhash * 2 &&
|
if (resolver->badcount < resolver->badhash * 2 &&
|
||||||
resolver->badhash > DNS_BADCACHE_SIZE)
|
resolver->badhash > DNS_BADCACHE_SIZE)
|
||||||
resizehash(resolver, &now, ISC_FALSE);
|
resizehash(resolver, &now, ISC_FALSE);
|
||||||
}
|
} else
|
||||||
bad->expire = *expire;
|
bad->expire = *expire;
|
||||||
cleanup:
|
cleanup:
|
||||||
UNLOCK(&resolver->lock);
|
UNLOCK(&resolver->lock);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user