mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-01 13:01:40 -05:00
Disable inactive uvreqs caching when compiled with sanitizers
When isc__nm_uvreq_t gets deactivated, it could be just put onto array
stack to be reused later to save some initialization time.
Unfortunately, this might hide some use-after-free errors.
Disable the inactive uvreqs caching when compiled with Address or
Thread Sanitizer.
(cherry picked from commit be339b3c83)
This commit is contained in:
parent
dad941a288
commit
408b79ba24
1 changed files with 4 additions and 0 deletions
|
|
@ -2515,10 +2515,14 @@ isc___nm_uvreq_put(isc__nm_uvreq_t **req0, isc_nmsocket_t *sock FLARG) {
|
|||
handle = req->handle;
|
||||
req->handle = NULL;
|
||||
|
||||
#if !__SANITIZE_ADDRESS__ && !__SANITIZE_THREAD__
|
||||
if (!isc__nmsocket_active(sock) ||
|
||||
!isc_astack_trypush(sock->inactivereqs, req)) {
|
||||
isc_mem_put(sock->mgr->mctx, req, sizeof(*req));
|
||||
}
|
||||
#else /* !__SANITIZE_ADDRESS__ && !__SANITIZE_THREAD__ */
|
||||
isc_mem_put(sock->mgr->mctx, req, sizeof(*req));
|
||||
#endif /* !__SANITIZE_ADDRESS__ && !__SANITIZE_THREAD__ */
|
||||
|
||||
if (handle != NULL) {
|
||||
isc__nmhandle_detach(&handle FLARG_PASS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue