mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 18:00:00 -04:00
Disable inactive handles caching when compiled with sanitizers
When isc_nmhandle_t gets deactivated, it could be just put onto array stack to be reused later to safe some initialization time. Unfortunately, this might hide some use-after-free errors. Disable the inactive handles caching when compiled with Address or Thread Sanitizer.
This commit is contained in:
parent
be5be5aa39
commit
92cce1da65
1 changed files with 2 additions and 0 deletions
|
|
@ -1753,9 +1753,11 @@ nmhandle_deactivate(isc_nmsocket_t *sock, isc_nmhandle_t *handle) {
|
|||
|
||||
INSIST(atomic_fetch_sub(&sock->ah, 1) > 0);
|
||||
|
||||
#if !__SANITIZE_ADDRESS && !__SANITIZE_THREAD__
|
||||
if (atomic_load(&sock->active)) {
|
||||
reuse = isc_astack_trypush(sock->inactivehandles, handle);
|
||||
}
|
||||
#endif /* !__SANITIZE_ADDRESS && !__SANITIZE_THREAD__ */
|
||||
if (!reuse) {
|
||||
nmhandle_free(sock, handle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue