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

@@ -19,10 +19,12 @@
  * 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,13 +354,16 @@
         (void) pthread_mutex_unlock(&soft_sessionlist_mutex);
 
         softtoken_initialized = B_FALSE;
         softtoken_pid = 0;
 
-        pkcs11_close_urandom();
-        pkcs11_close_urandom_seed();
-        pkcs11_close_random();
+        /*
+         * 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);
 
         /*