Print this page
1667 pkcs11 may deadlock when multi-threaded consumers fork

*** 19,28 **** --- 19,30 ---- * CDDL HEADER END */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. */ #include <strings.h> #include <errno.h> #include <cryptoutil.h>
*** 352,364 **** (void) pthread_mutex_unlock(&soft_sessionlist_mutex); softtoken_initialized = B_FALSE; softtoken_pid = 0; ! pkcs11_close_urandom(); ! pkcs11_close_urandom_seed(); ! pkcs11_close_random(); /* Destroy the session list lock here */ (void) pthread_mutex_destroy(&soft_sessionlist_mutex); /* --- 354,369 ---- (void) pthread_mutex_unlock(&soft_sessionlist_mutex); softtoken_initialized = B_FALSE; softtoken_pid = 0; ! /* ! * There used to be calls to cleanup libcryptoutil here. Given that ! * libcryptoutil can be linked and invoked independently of PKCS#11, ! * cleaning up libcryptoutil here makes no sense. Decoupling these ! * two also prevent deadlocks and other artificial dependencies. ! */ /* Destroy the session list lock here */ (void) pthread_mutex_destroy(&soft_sessionlist_mutex); /*