Skip to content

Commit

Permalink
Bug 1381148 - fix deadlock between nssPKIObject lock and NSSTrustDoma…
Browse files Browse the repository at this point in the history
…in, r=ttaubert

Differential Revision: https://nss-review.dev.mozaws.net/D378

--HG--
extra : rebase_source : 68684add99baa143a707c9fda89f0f6156f5b03c
extra : amend_source : 3b14b163dcc22a3b6117ec3b358301eb51a3df7b
  • Loading branch information
franziskuskiefer committed Jul 26, 2017
1 parent be8e327 commit 4197a07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pki/pki3hack.c
Expand Up @@ -180,16 +180,18 @@ STAN_RemoveModuleFromDefaultTrustDomain(
NSSTrustDomain *td;
int i;
td = STAN_GetDefaultTrustDomain();
NSSRWLock_LockWrite(td->tokensLock);
for (i = 0; i < module->slotCount; i++) {
token = PK11Slot_GetNSSToken(module->slots[i]);
if (token) {
nssToken_NotifyCertsNotVisible(token);
NSSRWLock_LockWrite(td->tokensLock);
nssList_Remove(td->tokenList, token);
NSSRWLock_UnlockWrite(td->tokensLock);
PK11Slot_SetNSSToken(module->slots[i], NULL);
nssToken_Destroy(token);
}
}
NSSRWLock_LockWrite(td->tokensLock);
nssListIterator_Destroy(td->tokens);
td->tokens = nssList_CreateIterator(td->tokenList);
NSSRWLock_UnlockWrite(td->tokensLock);
Expand Down

0 comments on commit 4197a07

Please sign in to comment.