Merge branch 'value-not-updated-atomically' into 'master'

unlink before unlock

See merge request isc-projects/bind9!589
This commit is contained in:
Mark Andrews
2018-08-23 20:49:38 -04:00
2 changed files with 4 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
5017. [bug] lib/isc/pk11.c failed to unlink the session before
releasing the lock which is unsafe. [GL !589]
5016. [bug] Named could assert with overlapping filter-aaaa and
dns64 acls. [GL #445]

View File

@@ -401,6 +401,7 @@ free_session_list(pk11_sessionlist_t *slist) {
LOCK(&sessionlock);
while (!ISC_LIST_EMPTY(*slist)) {
sp = ISC_LIST_HEAD(*slist);
ISC_LIST_UNLINK(*slist, sp, link);
UNLOCK(&sessionlock);
if (sp->session != CK_INVALID_HANDLE) {
rv = pkcs_C_CloseSession(sp->session);
@@ -408,7 +409,6 @@ free_session_list(pk11_sessionlist_t *slist) {
ret = DST_R_CRYPTOFAILURE;
}
LOCK(&sessionlock);
ISC_LIST_UNLINK(*slist, sp, link);
pk11_mem_put(sp, sizeof(*sp));
}
UNLOCK(&sessionlock);